'.Keep(str_replace(\"\\n\",\"
\",rawurldecode(PSS('$1'))))"); // [%== ... ==%] comment visible only to editor Markup('blockcommentvisitor','Captcha: This is for preventing automated spam submissions.
Math Question *:   \$captcha_1 + \$captcha_2 =
Please solve this simple math problem and enter the result. E.g. for 1+3, enter 4.
"); $GuestbookCaptchaHTML = $GuestbookCaptchaHTMLFmt; $GuestbookCaptchaHTML = str_replace("\$captcha_1", $captcha_1."", $GuestbookCaptchaHTML); $GuestbookCaptchaHTML = str_replace("\$captcha_2", $captcha_2."", $GuestbookCaptchaHTML); } else $GuestbookCaptchaHTML = ""; SDV($HandleActions['guestbook'],'HandleGuestbook'); if (!$pagename) $pagename = $_REQUEST['pagename']; if (!$pagename && preg_match('!^'.preg_quote($_SERVER['SCRIPT_NAME'],'!').'/?([^?]*)!', $_SERVER['REQUEST_URI'],$match)) $pagename = urldecode($match[1]); if (preg_match('/[\\x80-\\xbf]/',$pagename)) $pagename=utf8_decode($pagename); $pagename = preg_replace('![^[:alnum:]\\x80-\\xff]+$!','',$pagename); $name = FmtPageName('$FullName',$pagename); if (empty($_GET['guestbook_from'])) $defaultGuestbookAbout = ""; else $defaultGuestbookAbout = "Page \"".$_GET['guestbook_from']."\""; SDV($GuestbookTextBoxMaxlength, 255); SDV($GuestbookTextAreaMaxlength, 1000); if ($GuestbookValidation) SDV($GuestbookValidateFormJavascript, " "); else SDV($GuestbookValidateFormJavascript, ""); SDV($GuestbookTagFmt, "
". $GuestbookCaptchaHTML. "
Name: (Please include your affiliation.)
Contact: (Hidden from public.)
(optional. The contact information you provide won't be displayed in this guestbook. Only if you want to leave a way for me to get back to you, type in your email-id or web-site address.)
About:
Message:
(Number of characters remaining: ".$GuestbookTextAreaMaxlength.". Please do not include any URL in the message body.)
   
         (Please press the OK button only ONCE.)
 


"); // ================================================================= function HandleGuestbook($pagename){ global $GuestbookCaptcha, $TimeFmt, $Now, $_POST, $_SESSION, $GuestbookTextBoxMaxlength, $GuestbookTextAreaMaxlength; // Test captcha if ( ($GuestbookCaptcha && $_POST['captcha']."" != $_SESSION['guestbook_captcha']."") || strlen($_POST["name"])>$GuestbookTextBoxMaxlength || strlen($_POST["contact"])>$GuestbookTextBoxMaxlength || strlen($_POST["about"])>$GuestbookTextBoxMaxlength || strlen($_POST["message"])>$GuestbookTextAreaMaxlength ) Redirect($pagename); else { $default = "----"; $rcpage = ReadPage($pagename,""); $pos = strpos($rcpage['text'],"(:\$Guestbook:)"); if ($pos === FALSE) return; $len = strlen("(:\$Guestbook:)"); $before = substr($rcpage['text'],0,$pos+$len); $after = substr($rcpage['text'],$pos+$len); $rcpage['text'] = $before. "\n\n%color=#777777%Posted on ''".strftime($TimeFmt,$Now). "'' by (:rawdecode:)".rawurlencode(strip_tags(htmlspecialchars(StripCSlashes($_POST["name"]))))."(:rawdecodeend:)%%[[<<]]". (($_POST["contact"])?"[%== %color=#666688%(:rawdecode:)".rawurlencode(strip_tags(htmlspecialchars(StripCSlashes($_POST["contact"]))))."(:rawdecodeend:)%%[[<<]] ==%]":""). (($_POST["about"])?"%color=#887766%About: (:rawdecode:)".rawurlencode(strip_tags(htmlspecialchars(StripCSlashes($_POST["about"]))))."(:rawdecodeend:)%%[[<<]]":""). "(:rawdecode:)".str_replace('%20',' ',rawurlencode(strip_tags(htmlspecialchars(StripCSlashes($_POST['message'])))))."(:rawdecodeend:)". "\n\n----".$homepage. "". $HTTP_GET_VARS["homepage"]. $after; WritePage($pagename,$rcpage); Redirect($pagename); } } Markup('{$Guestbook}', '>{$var}','/\\(:\\$Guestbook:\\)/',Keep($GuestbookValidateFormJavascript.$GuestbookTagFmt)); ?>