", $data); # Convert greater than return $data; } # End of function - Reverse HTML Special Characters /* * * Function: Word Break * */ function wordbreak($text, $wordsize) { if (strlen($text) <= $wordsize) { return $text; } # No breaking necessary, return original text. $text = str_replace("\n", "", $text); # Strip linefeeds $done = "false"; $newtext = ""; $start = 0; # Initialize starting position $segment = substr($text, $start, $wordsize +1); # Initialize first segment while ($done == "false") { # Parse text $lastspace = strrpos($segment, " "); $lastbreak = strrpos($segment, "\r"); if ($lastspace == "" AND $lastbreak == "") { # Break segment $newtext .= substr($text, $start, $wordsize) . " "; $start = $start + $wordsize; } else { # Move start to last space or break $last = max($lastspace, $lastbreak); $newtext .= substr($segment, 0, $last +1); $start = $start + $last +1; } # End If - Break segment $segment = substr($text, $start, $wordsize +1); if (strlen($segment) <= $wordsize) { # Final segment is smaller than word size. $newtext .= $segment; $done = "true"; } # End If - Final segment is smaller than word size. } # End While - Parse text $newtext = str_replace("\r", "\r\n", $newtext); # Replace linefeeds return $newtext; } # End of function - Word Break /* * * Function: Update Guestbook Configuration File * */ function update_gbconfiguration() { global $perpage, $ipcheck, $addquestion1, $displayadd1, $addquestion2, $displayadd2, $addquestion3, $displayadd3, $displayuin, $displayemail, $foundoptions, $bodycolor, $bordercolor, $tablecolor, $barcolor, $textcolor, $bartextcolor, $linkcolor, $vlinkcolor, $alinkcolor, $hovercolor, $homepage_title, $homepage_url, $guestbookname, $guestbookbannerurl, $signguestbookurl1, $signguestbookurl2, $backgroundimageurl, $webmaster_email, $notifications, $notification_email, $welcome_msg, $thankyou_msg, $adminurl, $adminpass, $cookieexpiration, $datapath, $bannedwords, $headertag, $data_version, $time_hour_offset; if (!isset ($addquestion1)) { $addquestion1 = ""; } $addquestion1 = cook($addquestion1); if (!isset ($addquestion2)) { $addquestion2 = ""; } $addquestion2 = cook($addquestion2); if (!isset ($addquestion3)) { $addquestion3 = ""; } $addquestion3 = cook($addquestion3); if (!isset ($homepage_title)) { $homepage_title = ""; } $homepage_title = cook($homepage_title); if (!isset ($guestbookname)) { $guestbookname = ""; } $guestbookname = cook($guestbookname); if (!isset ($welcome_msg)) { $welcome_msg = ""; } $welcome_msg = cook($welcome_msg); if (!isset ($thankyou_msg)) { $thankyou_msg = ""; } $thankyou_msg = cook($thankyou_msg); $howfound = chop(recordformat($foundoptions)); $linebreak = chr(13) . "\n"; # Linebreak & line feed characters. $headertag_converted = str_replace("|", "|", $headertag); # Convert pipes to HTML elements. $headertag_converted = str_replace($linebreak, "|", $headertag_converted); # Convert linebreaks to pipes. $welcome_msg_converted = str_replace("|", "|", $welcome_msg); # Convert pipes to HTML elements. $welcome_msg_converted = str_replace($linebreak, "|", $welcome_msg_converted); # Convert linebreaks to pipes. $thankyou_msg_converted = str_replace("|", "|", $thankyou_msg); # Convert pipes to HTML elements. $thankyou_msg_converted = str_replace($linebreak, "|", $thankyou_msg_converted); # Convert linebreaks to pipes. $filename = $datapath . 'gbconfiguration.dat'; $contents = "$data_version $perpage $ipcheck $addquestion1 $displayadd1 $addquestion2 $displayadd2 $addquestion3 $displayadd3 $displayuin $displayemail $bodycolor $bordercolor $tablecolor $barcolor $textcolor $bartextcolor $linkcolor $vlinkcolor $alinkcolor $hovercolor $homepage_title $homepage_url $guestbookname $guestbookbannerurl $signguestbookurl1 $signguestbookurl2 $backgroundimageurl $webmaster_email $notifications $notification_email $welcome_msg_converted $thankyou_msg_converted $adminurl $adminpass $cookieexpiration $howfound $bannedwords $headertag_converted $time_hour_offset "; if ($fp = fopen($filename, 'w')) { # File opened for writing $lock = flock($fp, LOCK_EX); if ($lock) { # Lock achived fwrite($fp, $contents); flock($fp, LOCK_UN); } # End If - Lock achived fclose($fp); } else { print "ERROR: Guestbook Configuration file couldn't be opened for writing.

\n\nFilename: $filename

\n\n"; } # End If - File opened for writing } # End of function - Update Guestbook Configuration File /* * * Function: Load Guestbook Configuration File * */ function load_gbconfiguration() { global $perpage, $ipcheck, $addquestion1, $displayadd1, $addquestion2, $displayadd2, $addquestion3, $displayadd3, $displayuin, $displayemail, $foundoptions, $bodycolor, $bordercolor, $tablecolor, $barcolor, $textcolor, $bartextcolor, $linkcolor, $vlinkcolor, $alinkcolor, $hovercolor, $homepage_title, $homepage_url, $guestbookname, $guestbookbannerurl, $signguestbookurl1, $signguestbookurl2, $backgroundimageurl, $webmaster_email, $notifications, $notification_email, $welcome_msg, $thankyou_msg, $adminurl, $adminpass, $cookieexpiration, $datapath, $bannedwords, $headertag, $data_version, $time_hour_offset; $versionupdate120 = false; $filename = "data/gbconfiguration.dat"; if ($fp = fopen($filename, 'r')) { # File opened for reading $lock = flock($fp, LOCK_SH); if ($lock) { # Lock achived $data_version = chop(fgets($fp, 5000)); if ($data_version != "v1.20") { $versionupdate120 = true; $perpage = $data_version; } else { $perpage = chop(fgets($fp, 5000)); } $ipcheck = chop(fgets($fp, 5000)); $addquestion1 = chop(fgets($fp, 5000)); $displayadd1 = chop(fgets($fp, 5000)); $addquestion2 = chop(fgets($fp, 5000)); $displayadd2 = chop(fgets($fp, 5000)); $addquestion3 = chop(fgets($fp, 5000)); $displayadd3 = chop(fgets($fp, 5000)); $displayuin = chop(fgets($fp, 5000)); $displayemail = chop(fgets($fp, 5000)); $bodycolor = chop(fgets($fp, 5000)); $bordercolor = chop(fgets($fp, 5000)); $tablecolor = chop(fgets($fp, 5000)); $barcolor = chop(fgets($fp, 5000)); $textcolor = chop(fgets($fp, 5000)); $bartextcolor = chop(fgets($fp, 5000)); $linkcolor = chop(fgets($fp, 5000)); $vlinkcolor = chop(fgets($fp, 5000)); $alinkcolor = chop(fgets($fp, 5000)); $hovercolor = chop(fgets($fp, 5000)); $homepage_title = chop(fgets($fp, 5000)); $homepage_url = chop(fgets($fp, 5000)); $guestbookname = chop(fgets($fp, 5000)); $guestbookbannerurl = chop(fgets($fp, 5000)); $signguestbookurl1 = chop(fgets($fp, 5000)); $signguestbookurl2 = chop(fgets($fp, 5000)); $backgroundimageurl = chop(fgets($fp, 5000)); $webmaster_email = chop(fgets($fp, 5000)); $notifications = chop(fgets($fp, 5000)); $notification_email = chop(fgets($fp, 5000)); $welcome_msg = chop(fgets($fp, 5000)); $thankyou_msg = chop(fgets($fp, 5000)); $adminurl = chop(fgets($fp, 5000)); $adminpass = chop(fgets($fp, 5000)); $cookieexpiration = chop(fgets($fp, 5000)); $howfound = chop(fgets($fp, 5000)); $bannedwords = chop(fgets($fp, 5000)); $headertag = chop(fgets($fp, 5000)); if ($versionupdate120) { $time_hour_offset = "0"; $data_version = "v1.20"; } else { $time_hour_offset = chop(fgets($fp, 5000)); } $lock = flock($fp, LOCK_UN); } # End If - Lock achived fclose($fp); $foundoptions = explode("|", $howfound); $linebreak = chr(13) . "\n"; # Linebreak & line feed characters. $headertag = str_replace("|", $linebreak, $headertag); # Convert pipes to linebreaks. $headertag = str_replace("|", "|", $headertag); # Convert HTML elements to pipes. $welcome_msg = str_replace("|", "
", $welcome_msg); # Convert pipes to linebreaks. $welcome_msg = str_replace("|", "|", $welcome_msg); # Convert HTML elements to pipes. $thankyou_msg = str_replace("|", "
", $thankyou_msg); # Convert pipes to linebreaks. $thankyou_msg = str_replace("|", "|", $thankyou_msg); # Convert HTML elements to pipes. if ($versionupdate120) { update_gbconfiguration(); } } # End If - File opened for reading } # End of function - Load Guestbook Configuration File /* * * Function: Load Language Configuration File * */ function load_language($filename) { if ($fp = fopen($filename, 'r')) { # File opened for reading $lock = flock($fp, LOCK_SH); if ($lock) { # Lock achived $lang = file($filename); $lock = flock($fp, LOCK_UN); } # End If - Lock achived fclose($fp); } # End If - File opened for reading $number_lines = sizeof($lang); for ($i = 0; $i < $number_lines; $i++) { # Initialize text $lang[$i] = trim($lang[$i]); # Trim string (removes CR from end of line). } # End For Loop - Initialize text return $lang; } # End of function - Load Language Configuration File /* * * Function: Display Header * */ function displayheader($title) { global $bodycolor, $backgroundimageurl, $bordercolor, $tablecolor, $barcolor, $textcolor, $bartextcolor, $linkcolor, $vlinkcolor, $alinkcolor, $hovercolor, $homepage_title, $homepage_url, $webmaster_email, $displaythankyou, $signguestbookurl1, $signguestbookurl2, $headertag, $guestbookbannerurl, $homepage_url; ?>  Coco Loco - Vendégkönyv
Coco Loco
monkey Csípótekerőstrópusikarneválzene Látogatóink: Látogatóink/visitors
rainbowline
\n"; } if ($displaythankyou == "true") { displaythankyou(); } } # End of function - Display Header /* * * Function: Display Footer * */ function displayfooter() { ?>



Vissza

", $linebreak, $record_comments); # Convert
to linebreaks. $from = $webmaster_email; if ($record_email != "") { $from = "$record_name <$record_email>"; } # Use guest's e-mail of available $message = "New Addition to $guestbooknamestripped $linebreak $linebreak"; $message .= "Name: $record_name $linebreak"; if ($record_email != "") { $message .= "E-mail: $record_email $linebreak"; } if ($record_website != "") { $message .= "Website: $record_website $linebreak"; } if ($record_url != "") { $message .= "URL: $record_url $linebreak"; } if ($record_icq != "") { $message .= "UIN: $record_icq $linebreak"; } if ($record_found != "") { $message .= "Found: $record_found $linebreak"; } if ($record_location != "") { $message .= "Location: $record_location $linebreak"; } $message .= "$linebreak"; if ($record_answer1 != "") { $message .= "$record_question1 $record_answer1 $linebreak $linebreak"; } if ($record_answer2 != "") { $message .= "$record_question2 $record_answer2 $linebreak $linebreak"; } if ($record_answer3 != "") { $message .= "$record_question3 $record_answer3 $linebreak $linebreak"; } if ($record_comments != "") { $message .= "Comment: $record_comments $linebreak $linebreak"; } $message .= " Record #: $recordnumber Date: $record_date IP Address: $record_ipaddress Remote Host: $record_remotehost To edit, delete or add a comment to this post, click on the following URL: $adminurl?action=uidsearch&uid=$record_uid&page=0 "; # Send e-mail mail("$notification_email", "New Addition to $guestbooknamestripped", $message, "From: $from"); } # End If - Send notification e-mail(s) } # End of function - E-mail Notification /* * * Function: Sign Guestbook * */ function signguestbook() { global $guestbookname, $addquestion1, $displayadd1, $addquestion2, $displayadd2, $addquestion3, $displayadd3, $displayuin, $displayemail, $foundoptions, $bordercolor, $tablecolor, $barcolor, $textcolor, $bartextcolor, $homepage_title, $homepage_url, $webmaster_email, $welcome_msg, $browser, $lang; $halflength = "45"; if ($browser == "MSIE") { $halflength = "49"; } # Adjust input box length for IE $fulllength = "92"; if ($browser == "MSIE") { $fulllength = "100"; } # Adjust input box length for IE $new_name = ""; $record_name = ""; $new_date = ""; $record_date = ""; $new_email = ""; $record_email = ""; $new_url = ""; $record_url = ""; $new_website = ""; $record_website = ""; $new_icq = ""; $record_icq = ""; $new_found = ""; $record_found = ""; $new_location = ""; $record_location = ""; $new_comments = ""; $record_comments = ""; $new_ipaddress = ""; $record_ipaddress = ""; $new_remotehost = ""; $record_remotehost = ""; $new_question1 = $addquestion1; $new_question2 = $addquestion2; $new_question3 = $addquestion3; $new_answer1 = ""; $record_answer1 = ""; $new_answer2 = ""; $record_answer2 = ""; $new_answer3 = ""; $record_answer3 = ""; $new_adminmsg = ""; $record_adminmsg = ""; displayheader("$guestbookname"); ?>



: .
CAPTCHA Image
Írd be a képen látható kódot:    Új kód

0) { # - Check for double post $last_record = loadrecord($totalrecords); $last_data = explode("|", $last_record); if ($data[0] == $last_data[0] AND $data[8] == $last_data[8]) { errormsg($lang[23], $lang[27]); } } # End If - Check for double post /* Check Captcha code */ if ($securimage->check($captcha_code) == false) { errormsg($lang[23], $lang[46]); } displayheader("$guestbookname"); ?>



", $linebreak, $record_comments); # Convert
to linebreaks. $record_adminmsg = str_replace("
", $linebreak, $record_adminmsg); # Convert
to linebreaks. ?>


\n"; } # End of function - Display Record /* * * Function: Display Page * */ function displaypage($page) { global $perpage, $totalrecords; /* Calculate range of records on this page. */ if ($totalrecords == 0) { $totalpages = 0; } else { $totalpages = intval(($totalrecords -1) / $perpage) + 1; } # Calculate how many pages there are. $end = $totalrecords - (($totalpages - $page) * $perpage); $start = $end - ($perpage -1); if ($start < 1) { $start = 1; } $records = loadrange($start, $end); $recordindex = sizeof($records); for ($i = $end; $i >= $start; $i--) { displayrecord($i, $records[$recordindex], $page); $recordindex--; } } # End of function - Display Page /* * * Function: Opening Screen * */ function openingscreen($page) { global $perpage, $bordercolor, $tablecolor, $barcolor, $textcolor, $bartextcolor, $guestbookname, $homepage_title, $guestbookbannerurl, $signguestbookurl1, $signguestbookurl2, $homepage_url, $webmaster_email, $totalrecords, $confirm, $lang; if ($totalrecords == 0) { $totalpages = 0; } else { $totalpages = intval(($totalrecords -1) / $perpage) + 1; } # Calculate how many pages there are. if ($page == "" OR $page > $totalpages) { $page = $totalpages; } $currentpage = $page; displayheader("$guestbookname"); /* if ($homepage_title != "" AND $homepage_url != "" AND $homepage_url !="http://" ) { # Display a link back to homepage ?>

<? echo $signguestbookurl1 ?>
<? echo $signguestbookurl1 ?>
 -

1) { ?>
:


1) { ?>
:

<? echo $signguestbookurl1 ?>
<? echo $signguestbookurl1 ?>
 -

0) { # Do IP check if (checkiplog($new_ipaddress) == "fail") { errormsg($lang[23], "$ipcheck $lang[40]
$lang[28]"); } } # End If - Do IP check if ($totalrecords > 0) { # - Check for double post $last_record = loadrecord($totalrecords); $last_data = explode("|", $last_record); if ($new_name == $last_data[0] AND $new_comments == $last_data[8]) { errormsg($lang[23], "$lang[27] $lang[28]"); } } # End If - Check for double post $recordnumber = addrecord($new_name, $new_date, $new_email, $new_url, $new_website, $new_icq, $new_found, $new_location, $new_comments, $new_ipaddress, $new_remotehost, $new_question1, $new_question2, $new_question3, $new_answer1, $new_answer2, $new_answer3, $new_adminmsg); notification($recordnumber, $thisrecord); $displaythankyou = "true"; $action = ""; $page = ""; } if ($action == "sign") { signguestbook(); } openingscreen($page); # No action, display Opening Screen by default. ?>