/*-----------------------------------------------------
COPYRIGHT NOTICE
Copyright (c) 2004 - Ketut Aryadana
All Rights Reserved
Script name : ArdGuest Standard
Version : 1.6
WebSite : http://www.promosi-web.com/script/guestbook
Email : aryasmail@yahoo.com.au
File name : ardguest.php
------------------------------------------------------*/
//--Change the following variables
//Title of your guestbook
$title = "Memories of Mark Garvey";
//Change "admin" with your own password. It's required when you delete an entry
$admin_password = "jeannelovesdolphins";
//Enter your email here
$admin_email = "ben@bengarvey.com";
//Your website URL
$home = "http://www.markgarvey.net";
//Send you an email when someone add your guestbook, YES or NO
$notify = "YES";
//Your Operating System
//For Windows/NT user : WIN
//For Linux/Unix user : UNIX
$os = "UNIX";
//Maximum entry per page when you view your guestbook
$max_entry_per_page = "1";
//Name of file used to store your entry, change it if necessary
$data_file = "ardgb.dat";
//Maximum entry stored in data file
$max_record_in_data_file = "500000";
//Color & font setting
$background = "#FFFFFF";
$table_top = "#EEEEEE";
$table_content_1a = "#EDEEE8";
$table_content_1b = "#E4E4E4";
$table_content_2a = "#FFF8F0";
$table_content_2b = "#FFEFDF";
$table_bottom = "#EEEEEE";
$table_border = "#000000";
$title_color = "#222222";
$link = "blue";
$visited_link = "blue";
$active_link = "red";
$font_face = "Copperplate Gothic Light";
$message_font_face = "Copperplate Gothic Light";
$message_font_size = "2";
$title_list = "";
//-- Don't change bellow 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 = intval($HTTP_GET_VARS["id"]);
if (isset($HTTP_GET_VARS["page"])) $page = intval($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($do)) $do = "";
else if (preg_match("/\W/",$do)) $do = "";
if (!isset($page) or $page == 0) $page="index";
if (!file_exists($data_file)) {
echo "Error !! Can't find data file : $data_file.
";
exit;
} else {
if ($max_record_in_data_file <> 0) {
$f = file($data_file);
sort($f);
$j = count($f);
if ($j > $max_record_in_data_file) {
$rf = fopen($data_file,"w");
if (strtoupper($os)=="UNIX") {
if (flock($rf,LOCK_EX)) {
for ($i=0; $i<$max_record_in_data_file; $i++) {
fwrite($rf,$f[$i]);
}
flock($rf,LOCK_UN);
}
} else {
for ($i=0; $i<$max_record_in_data_file; $i++) {
fwrite($rf,$f[$i]);
}
}
fclose($rf);
}
}
}
switch ($do) {
case "":
$record = file($data_file);
sort($record);
$jmlrec = count($record);
$PHP_SELF = "ardguest.php";
?>