/*-----------------------------------------------------
COPYRIGHT NOTICE
Copyright (c) 2001 - 2005, Ketut Aryadana
All Rights Reserved
Script name : ArdGuest
Version : 1.7
Website : http://www.promosi-web.com/script/guestbook/
Email : ketutaryadana@yahoo.co.id
By using this program you agree to indemnify the author (Ketut Aryadana) from any liability
caused by mis-use, unauthorised access, loss of data, or financial losses that occur
as a result of installing or using this product.
------------------------------------------------------*/
//--Change the following variables
//Title of your guestbook
$title = "CAMPO Akitv-Arena - Gästebuch";
//Change "admin" with your own password. It's required when you delete an entry
$admin_password = "grisi";
//Enter your email here
$admin_email = "sarembe@merkur-it.de, henking@merkur-it.de";
//Your website URL
$home = "http://www.campo-arena.de";
//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 = "10";
//Name of file used to store your entry, change it if necessary
$data_file = "campo.dat";
//Maximum entry stored in data file
$max_record_in_data_file = "3000";
//Maximum entries allowed per session, to prevent multiple entries made by one visitor
$max_entry_per_session = 200;
//Color & font setting
$background = "#FFECCE";
$table_top = "#FFECCE";
$table_content_1a = "#FFECCE";
$table_content_1b = "#FFECCE";
$table_content_2a = "#FFD088";
$table_content_2b = "#FFD088";
$table_bottom = "#FFECCE";
$table_border = "#FCAA2A";
$title_color = "black";
$link = "black";
$visited_link = "black";
$active_link = "black";
$font_face = "arial";
$message_font_face = "arial";
$message_font_size = "2";
//-- Don't change bellow this line unless you know what you're doing
function rot_13($text) {
$key = 'ABCDEF/GHIJK=L"MNOPQRSTUVWXYZ0732415986 <>:';
$rot = 9;
$textarr = preg_split('//',$text,-1,PREG_SPLIT_NO_EMPTY);
for ($i = 0; $i < @count($textarr); $i++) {
$codechar = $textarr[$i];
if (@ereg("^[\n\r]?$",$codechar)) {
continue;
}
$pos = @strpos($key,@strtoupper($codechar));
$pos_orig = $pos;
if ($pos >= 0 && @eregi ($codechar,$key) && $codechar != ".") {
$pos = $pos + $rot;
if ($pos >= @strlen($key)) {
$pos = $pos - @strlen($key);
}
if (@strtoupper($codechar) == $codechar) {
$codechar = @substr ($key,$pos,1);
} else {
$codechar = @strtolower (@substr ($key,$pos,1));
}
}
$textrot .= $codechar;
}
return $textrot;
}
$do = isset($_REQUEST['do']) ? trim($_REQUEST['do']) : "";
$id = isset($_GET['id']) ? trim($_GET['id']) : "";
$page = isset($_GET['page']) ? $_GET['page'] : 1;
$self = $_SERVER['PHP_SELF'];
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);
rsort($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);
}
}
}
session_start();
$newline = (strtoupper($os) == "WIN") ? "\r\n" : "\n";
switch ($do) {
case "":
$record = file($data_file);
rsort($record);
$jmlrec = count($record);
?>