/* ----------------------------------------------------------------------------- */
/* */
/* Copyright (C) 2005, Script by RP-Draw WebDesign, Delfzijl, Netherlands */
/* http://www.rp-draw.nl/scripts/index.html - info@rp-draw.nl */
/* Version 2.1.01 - 28-03-2005 */
/* */
/* */
/* GPL LICENCE */
/* This file is part of Flat-Guest guestbook. */
/* */
/* Flat-Guest guestbook is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License, or */
/* (at your option) any later version. */
/* */
/* Flat-Guest guestbook is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
/* along with Flat-Guest guestbook; if not, write to the Free Software */
/* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/* */
/* ----------------------------------------------------------------------------- */
error_reporting('E_ALL & ~E_NOTICE');
//Script file version
$version = "2.1.01";
//Script file version date
$versiondate = "28-03-2005";
// Ttitle of the web page
$title = "Leamington Kinsmen Guestbook";
//####Change "12345" with your own password. It's required when you delete an entry
$admin_password = "complex";
//####Change "en" to your language
$language = "en";
// dk = Danish, by Robert van Rees ** partial translation Need help.
// nl = Dutch, by Robert van Rees
// en = English by Gary Cleghorn
// fr = French, by Loïc Reynaud
// de = German, by Robert van Rees
// hu = Hungarian, by Timea Vrasko
// no = Norwegian, by Vegard Søbstad Alsli
// pt = Portuguese, by Mirele Sotelo Gonçalves
// es = Spanish, by Manuel
// se = swedish, by Roffe Johnzon
//####Change to your website adres.
//####When people click the back button on the main page the wil be taken here...
$website = "http://www.leamingtonkin.com/MEMBERS.htm";
//Maximum entry per page when you view your guestbook
$max_entry_per_page = "10";
//--only 2000 characters allowed for comment
$maxchar = 255;
//Name of file used to store your entry
//Be sure that your server can write in this file by CHMOD it to 777
$data_file = "data.dat";
//Maximum entry stored in data file
$max_record_in_data_file = "200";
//Color & font setting
$background = "#FFFFFF"; // Page color
$table_top = "#000080"; // Color of the first row
$font_top_color = "#FFFFFF"; // Font Color of the text on the first row
$table_content_1a = "#C3DCF9"; // Background color of odd messages
$table_content_2a = "#66A6EE"; // Background color of even messages
$table_bottom = "#000080"; // Color of the last row
$table_width = "95%"; // Width of the message table
$font_bottom_color = "#FFFFFF"; // Font Color of the text on the last row
$table_border = "#000000"; // Bordercolor of the main message table
$link = "#FFFFFF"; // Color of some of the links (see style sheet)
$visited_link = "#FFFFFF";
$active_link = "#CC0000";
$font_face = "verdana"; // Fontface of some of the text (zee style sheet)
$linecolor = "#FE7302"; // Color of line above messages
$message_font_face = "arial"; // Fontface of messages (also see style sheet)
$message_font_size = "2"; // Fontsize of messages (also see style sheet)
$message_font_color = "#000000"; // Fontcolor of messages (also see style sheet)
$conf = array(); // Don't edit this line!
/* language-file selection */
$conf['lang'] = $language;
$lang = array();
$langfile = "language/".$language."-lang.php";
// Check if language file exists.
if (!file_exists($langfile)) {
echo "";
echo "ERROR ! The Script can not find the language file $langfile. Please check and change the language value: \"$language\" in the config area of fggbook.php. ";
exit;
} else {
include $langfile;
}
// +++ Start of Script +++ DO NOT EDIT BELOW THIS LINE ++++++++++++++++++++++++++++++++++++++++++
if (!empty($_GET)) {
if (isset($_GET["do"])) $do = $_GET["do"];
if (isset($_GET["id"])) $id = $_GET["id"];
if (isset($_GET["page"])) $page = $_GET["page"];
} else if (!empty($HTTP_GET_VARS)) {
if (isset($HTTP_GET_VARS["do"])) $do = $HTTP_GET_VARS["do"];
if (isset($HTTP_GET_VARS["id"])) $id = trim($HTTP_GET_VARS["id"]);
if (isset($HTTP_GET_VARS["page"])) $page = trim($HTTP_GET_VARS["page"]);
}
if (isset($_POST["do"])) $do = $_POST["do"];
else if (isset($HTTP_POST_VARS["do"])) $do = $HTTP_POST_VARS["do"];
if (!isset($PHP_SELF)) {
if (isset($_SERVER["PHP_SELF"])) $PHP_SELF = $_SERVER["PHP_SELF"];
else if (isset($HTTP_SERVER_VARS["PHP_SELF"])) $PHP_SELF = $HTTP_SERVER_VARS["PHP_SELF"];
}
if (!isset($DOC_ROOT)) {
if (isset($_SERVER['DOCUMENT_ROOT'])) $DOC_ROOT = $_SERVER['DOCUMENT_ROOT'];
else if (isset($HTTP_SERVER_VARS['DOCUMENT_ROOT'])) $DOC_ROOT = $HTTP_SERVER_VARS['DOCUMENT_ROOT'];
}
// reverse strrchr() - PHP v4.0b3 and above
function reverse_strrchr($haystack, $needle)
{
$pos = strrpos($haystack, $needle);
if($pos === false) {
return $haystack;
}
return substr($haystack, 0, $pos + 1);
}
$data1 = $DOC_ROOT;
$data2 = reverse_strrchr($PHP_SELF, '/');
$data_path = "$data1$data2$data_file";
if (!isset($do)) $do = "";
else if (preg_match("/\W/",$do)) $do = "";
if (!isset($page) or $page == 0) $page=1;
// Check if date file exists.
if (!file_exists($data_path)) {
echo "".$lang[$conf['lang']]['error']." ".$lang[$conf['lang']]['no-datafile']." path : $data_path ";
exit;
} else {
if ($max_record_in_data_file <> 0) {
$f = file($data_path);
rsort($f);
$j = count($f);
if ($j > $max_record_in_data_file) {
$rf = fopen($data_path,"w");
for ($i=0; $i<$max_record_in_data_file; $i++) {
fwrite($rf,$f[$i]);
}
fclose($rf);
}
}
}
switch ($do) {
case "":
$record = file($data_path);
rsort($record);
$jmlrec = count($record);
?>
Monday 05th of January 2009 09:25:53 PM
$jml_page = intval($jmlrec/$max_entry_per_page);
$sisa = $jmlrec%$max_entry_per_page;
if ($sisa > 0) $jml_page++;
$no = $page*$max_entry_per_page-$max_entry_per_page;
if ($jmlrec == 0) echo "