Kedvencek közé -
   
Legyen ez a kezdőlapom!  
 
$msgError: $msgNameRequired.\"); if ( !isset($message) or empty($message) ) die(\"$msgError: $msgMessageRequired.\"); if ( !isset($visualcode) or empty($visualcode) ) die(\"$msgError: $msgVisualcodeRequired.\"); # Email checking. First we check whether the email field is # not empty, if so, it does not matter if email is not # required, we check for a correct email address and if it is # not, we show an error message. if ( !empty($email) ) { if ( !checkEmail($email) ) { die(\"$msgError: $msgEmailIncorrect\"); } } # Else if email field is empty and it is required, then we # let the user know that. else if ($gbRequireEmail) { die(\"$msgError: $msgEmailRequired\"); } # Url checking. # Valid url addresses could be: # http://www.hewop.com/~yapgb # www.hewop.com/~yapgb (the script will add \"http://\" at the start) # If url field is not empty and it is not equal to just \"http://\" if ( !empty($url) and ($url != \"http://\") ) { # If url is not correct if ( !checkUrl($url) ) { # Add \"http://\" string to the start of the url, if it becomes a # valid url address, add the string definitely. if ( checkUrl(\"http://\" . $url) ) $url = \"http://\" . $url; # If the url address is not correct, show the appropiate message. else die(\"$msgError: $msgUrlIncorrect\"); } } # If the url field is empty and it is required in config.php, let the # user know. else if ($gbRequireUrl) { die(\"$msgError: $msgUrlRequired\"); } # Format fields. These functions (cleanXxx) need revision. $name = cleanField($name); $email = cleanField($email); $url = cleanField($url); $message = cleanMessage($message); $newEntry = $name.\"|\".$date.\"|\".$email.\"|\".$url.\"|\".$message.\"|[end]\"; # Store new entry $fp = fopen($gbFile, \"a\"); fwrite($fp, $newEntry.\"\n\"); fclose($fp); # If notify of new post enabled. if ($gbNewPostNotify) { newPostNotify($name, $email, $url, $message); } # Redirect to main page. header(\"Location: $gbIndex\"); exit(); # Following code, until die($pageContent), is never executed, # it could be used to show a \"sign succesful\" message, just # delete the two lines above (header and exit functions). $pageContent = \" \n \n $msgSignSuccessful
$msgGoToBook. \"; die($pageContent); } # View entries else { # Read entries file into an array. $text = file($gbFile); # How many entries we have. $lines = count($text); # First entry to show, according to page number. $limitValue = $lines - $page * $gbLimit; # The message template $entryTemplate = readTemplate(\"temp_message.html\"); # Execute number of entries per page times. for ($i = $limitValue + $gbLimit - 1; ($i >= $limitValue) && ($i >= 0); $i--) { list($name, $date, $email, $url, $message) = explode(\"|\", $text[$i]); # Censoring functions. $name = swapBadWords($name); $email = swapBadWords($email); $url = swapBadWords($url); $message = swapBadWords($message); # Cutting long words to avoid bad behaviour. # NOTE: These function needs some retouch. $name = cutLongWords($name); $message = cutLongWords($message); # If BBCode is enabled. if ($gbEnableBBCode) $message = swapBBCode($message); # If smilies are enabled. if ($gbEnableSmilies) $message = swapSmilies($message); $entries .= $entryTemplate; # If hide email option is on. if ($gbHideEmail) $email = hideEmail($email); # Swap entry GB_TAGS $entries = swapEntryTags($entries, $i, $name, $date, $email, $url, $message); } # Load main page template. $bodyContent = readTemplate(\"temp_body.html\"); # Swap global GB_TAGS $bodyContent = swapGlobalTags($bodyContent); # Put entries into main page. $bodyContent = str_replace(\"\", $entries, $bodyContent); # Pagination $bodyContent = swapPaginTags($bodyContent, $lines, $page); # Show main page echo $bodyContent; } ?>
x