0) { $start=($page*10)-9;$end=$start+9; } else { $page=1;$start=1;$end=10; } $filesize=filesize($settings['logfile']); $fp = @fopen($settings['logfile'],"rb") or problem("Can't open the log file ($settings[logfile]) for reading! CHMOD this file to 666 (rw-rw-rw)!"); $content=@fread($fp,$filesize); fclose($fp); $content = trim(chop($content)); $lines = explode($settings['newline'],$content); if ($filesize == 0) {$total=0;} else { $total = count($lines); if ($end > $total) {$end=$total;} $pages = ceil($total/10); echo "

Displaying page $page of $pages. Pages: "; for ($i=1; $i<=$pages; $i++) { if($i == $page) {echo "$i\n";} else {echo "$i\n";} } } echo "

"; if ($filesize == 0) { echo ""; } else {printEntries($lines,$start,$end);} echo "
No entries yet!
"; if ($filesize != 0) { echo "

Pages: "; for ($i=1; $i<=$pages; $i++) { if($i == $page) {echo "$i\n";} else {echo "$i\n";} } } printCopyHTML(); printDownHTML(); exit(); // >>> START FUNCTIONS <<< // function check_secnum($secnumber,$checksum) { global $settings; if ($secnumber == $checksum) { unset($_SESSION['checked']); return true; } else { return false; } } // END check_secnum function print_secimg($name,$from,$email,$url,$comments,$isprivate,$message=0) { $_SESSION['checked']="P"; ?>

Anti-SPAM check

 

Please type in the security number

";} elseif ($message == 2) {echo "

Wrong security number. Please try again

";} ?>

 

This is a security check that prevents automated signups of this guestbook (SPAM). Please enter the security number displayed below into the input field and click the continue button.

 

Security number:
Please type in the security number displayed above:

 

 

 

$v) { $text = preg_replace("/$k/i",$v,$text); } return $text; } // END filter_bad_words function showPrivate($pass,$num) { global $settings; if ($pass != $settings[apass]) {problem("Wrong password! Only the guestbook owner may read this post!","1");} $delimiter="\t"; $lines = file($settings['logfile']); list($name,$from,$email,$url,$comment,$added,$isprivate)=explode($delimiter,$lines[$num]); echo ""; echo "
Submitted by Comments:
$name
From: $from
Website: "; if (strlen($url)>0) { echo "$url"; } echo"
E-mail: "; if (strlen($email)>0) { echo "$email"; } echo "
$comment
Added: $added      \"Delete

Back to Guestbook

"; printCopyHTML(); printDownHTML(); exit(); } // END showPrivate function confirmViewPrivate($num) { ?>

 

 

This is a private post for the owner of this questbook.

Please enter your administration password:

| Back

 

 

",$text); $text = preg_replace("/\:\(/","\"\"",$text); $text = preg_replace("/\:D/","\"\"",$text); $text = preg_replace("/\;\)/","\"\"",$text); $text = preg_replace("/\:o/","\"\"",$text); $text = preg_replace("/\:p/i","\"\"",$text); $text = preg_replace("/\:cool\:/i","\"\"",$text); $text = preg_replace("/\:rolleyes\:/i","\"\"",$text); $text = preg_replace("/\:mad\:/i","\"\"",$text); $text = preg_replace("/\:eek\:/i","\"\"",$text); $text = preg_replace("/\:clap\:/i","\"\"",$text); $text = preg_replace("/\:bonk\:/i","\"\"",$text); $text = preg_replace("/\:chased\:/i","\"\"",$text); $text = preg_replace("/\:crazy\:/i","\"\"",$text); $text = preg_replace("/\:cry\:/i","\"\"",$text); $text = preg_replace("/\:curse\:/i","\"\"",$text); $text = preg_replace("/\:err\:/i","\"\"",$text); $text = preg_replace("/\:livid\:/i","\"\"",$text); $text = preg_replace("/\:rotflol\:/i","\"\"",$text); $text = preg_replace("/\:love\:/i","\"\"",$text); $text = preg_replace("/\:nerd\:/i","\"\"",$text); $text = preg_replace("/\:nono\:/i","\"\"",$text); $text = preg_replace("/\:smash\:/i","\"\"",$text); $text = preg_replace("/\:thumbsup\:/i","\"\"",$text); $text = preg_replace("/\:toast\:/i","\"\"",$text); $text = preg_replace("/\:welcome\:/i","\"\"",$text); $text = preg_replace("/\:ylsuper\:/i","\"\"",$text); return "$text"; } // END processsmileys function doDelete($pass,$num) { global $settings; if ($pass != $settings[apass]) {problem("Wrong password! The entry hasn't been deleted.","1");} $filesize=filesize($settings['logfile']); $fp = @fopen($settings['logfile'],"rb") or problem("Can't open the log file ($settings[logfile]) for reading! CHMOD this file to 666 (rw-rw-rw)!"); $content=@fread($fp,$filesize); fclose($fp); $content = trim(chop($content)); $lines = explode($settings['newline'],$content); unset($lines[$num]); $fp = fopen($settings['logfile'],"wb") or problem("Couldn't open links file ($settings[logfile]) for writing! Please CHMOD all $settings[logfile] to 666 (rw-rw-rw)!"); foreach ($lines as $thisline) { $thisline .= $settings['newline']; fputs($fp,$thisline); } fclose($fp); ?>

 

 

Selected entry was successfully removed!

Click here to continue

 

 

 

 

 

 

Please enter your administration password:

Are you sure you want to delete this entry? This action cannot be undone!

| NO, I changed my mind

 

 

'','url' => ''); $char = array('.','@'); $repl = array(".","@"); $v['email']=htmlspecialchars("$_REQUEST[email]"); if (strlen($v['email']) > 0 && !(preg_match("/([\w\-]+\@[\w\-]+\.[\w\-]+)/",$v['email']))) {problem("Please enter a valid e-mail address!","1");} $v['email']=str_replace($char,$repl,$v['email']); $v['url']=htmlspecialchars("$_REQUEST[url]"); if ($v['url'] == "http://" || $v['url'] == "https://") {$v['url'] = "";} elseif (strlen($v['url']) > 0 && !(preg_match("/(http(s)?:\/\/+[\w\-]+\.[\w\-]+)/i",$v['url']))) {problem("The site URL is not valid, make sure you start it with http:// or https://!","1");} return $v; } // END check_mail_url function addEntry($name,$from,$email,$url,$comments,$isprivate="0") { global $settings; /* This part will help prevent multiple submissions */ if ($settings['one_per_session'] && $_SESSION['add']) { problem("You may only submit this guestbook once per session!"); } $delimiter="\t"; $added=date ("F j, Y"); $comments_nosmileys=$comments; $comments = str_replace("\r\n","
",$comments); $comments = str_replace("\n","
",$comments); $comments = str_replace("\r","
",$comments); $comments = wordwrap($comments,$settings['max_word'],'
',1); if ($settings['smileys'] == 1 && $_REQUEST['nosmileys'] != "Y") {$comments = processsmileys($comments);} if ($settings['filter']) { $comments = filter_bad_words($comments); $name = filter_bad_words($name); $from = filter_bad_words($from); } $addline = "$name$delimiter$from$delimiter$email$delimiter$url$delimiter$comments$delimiter$added$delimiter$isprivate$settings[newline]"; $fp = @fopen($settings['logfile'],"rb") or problem("Can't open the log file ($settings[logfile]) for reading! CHMOD this file to 666 (rw-rw-rw)!"); $links = @fread($fp,filesize($settings['logfile'])); fclose($fp); $addline .= $links; $fp = fopen($settings['logfile'],"wb") or problem("Couldn't open links file ($settings[logfile]) for writing! Please CHMOD all $settings[logfile] to 666 (rw-rw-rw)!"); fputs($fp,$addline); fclose($fp); if ($settings['notify'] == 1) { $char = array('.','@'); $repl = array(".","@"); $email=str_replace($repl,$char,$email); $message = "Hello! Someone has just signed your guestbook! Name: $name From: $from E-mail: $email Website: $url Message (without smileys): $comments_nosmileys Visit the below URL to view your guestbook: $settings[gbook_url] End of message "; mail("$settings[admin_email]","Someone has just signed your guestbook",$message); } /* Register this session variable */ $_SESSION['add']=1; ?>

 

 

Your message was successfully added!

Click here to continue

 

 

 

 

Sign guestbook

Required fields are bold.

Your name:
Where are you from?
Your e-mail:
Your website:

Comments:
Insert smileys (Opens a new window)
Disable smileys"; } ?>

Make this post private

Submitted by Comments: $name
From: $from
Website: "; if (strlen($url)>0) { echo "$url"; } echo"
E-mail: "; if (strlen($email)>0) { echo "$email"; } echo " "; if (empty($isprivate)) {echo "$comment";} else { echo "

 

Private post. Click to view.

"; } echo "
Added: $added      \"Delete "; } } // END printEntries function problem($myproblem,$backlink="1") { $html = "

 

 

Error

$myproblem

 

"; if ($backlink) { $html .= "

Back to the previous page

\n"; } $html .= "

 

 

"; echo "$html\n"; printCopyHTML(); printDownHTML(); exit(); } // END problem function printNoCache() { header("Expires: Mon, 26 Jul 2000 05:00:00 GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); } // END printNoCache function printTopHTML() { global $settings; echo " $settings[gbook_title] "; include_once "header.txt"; echo "

$settings[gbook_title]

Back to $settings[website_title] | View guestbook | Sign guestbook

"; } // END printTopHTML function printDownHTML() { global $settings; echo "
"; include_once "footer.txt"; echo " "; } // END printDownHTML function printCopyHTML() { global $settings; echo "

Powered by PHP guestbook $settings[verzija] from PHPJunkyard - Free PHP scripts

"; } // END printCopyHTML function gbook_input($in,$error=0) { $in = trim($in); if (strlen($in)) { $in = htmlspecialchars($in); } elseif ($error) { problem($error); } return stripslashes($in); } // END gbook_input() function gbook_isNumber($in,$error=0) { $in = trim($in); if (preg_match("/\D/",$in) || $in=="") { if ($error) { problem($error); } else { return '0'; } } return $in; } // END gbook_isNumber() ?>