############################################ # + xGB [x-devGuestBook] v 1.2 # # + by Robert Klikics & Alexander Weiss # # + visit: http://x-dev.de for more stuff # # + License: GPL # # + You may not remove the Copyrights # ############################################ # + Filename: xGB_admin.php [admin] # ############################################ require("./config/gb_settings.php"); require("./config/gb_head.inc"); //pw check: if($act == "login" && $pass != $password) die("sorry, $pass is a bad password"); if($act=="login") { if($pass == $password) { echo "
edit and/or delete entries in the guestbook file
\n:: back to the guestbook ::\n";
include("./config/gb_foot.inc");
exit;
}
elseif($act == "xchange")
{
if($pass != $password) die("sorry, $pass is a bad password");
include("./data/gb_data.dat");
$datei = fopen("./data/gb_data.dat", "w");
$count = "0";
if($datei)
{
fputs($datei, " \n");
while($newname[$count] != "")
{
if($keep[$count] == "yes")
{
fputs($datei, "\$name[] = \"$newname[$count]\";\n");
fputs($datei, "\$email[] = \"$newemail[$count]\";\n");
fputs($datei, "\$pageurl[] = \"$pageurl[$count]\";\n");
fputs($datei, "\$pagename[] = \"$pagename[$count]\";\n");
//$newtext[$count] = ereg_replace("
", "!newline!", $newtext[$count]);
//$newtext[$count] = htmlentities($newtext[$count]);
//$newtext[$count] = ereg_replace("!newline!", "
", $newtext[$count]);
fputs($datei, "\$text[] = \"$newtext[$count]\";\n");
fputs($datei, "\$datum[] = \"$datum[$count]\";\n");
$count++;
}
else
{
$count++;
continue;
}
}
}
echo "
changes made successfully.
\n"; echo ":: back ::\n"; include("./config/gb_foot.inc"); exit; } elseif($act == "badwords") { if($pass != $password) die("sorry, $pass is a bad password"); include("./data/gb_badwords.dat"); echo "
\n"; echo "
"; echo "back to the guestbook\n"; include("./config/gb_foot.inc"); exit; } elseif($act == "b_write") { if($pass != $password) die("sorry, $pass is a bad password"); $datei = fopen("./data/gb_badwords.dat", "w"); if($datei) { $count = "0"; fputs($datei, "bad word(s) have been added
\n"; echo "back\n"; include("./config/gb_foot.inc"); exit; } else { echo "
\n"; } //footer einfügen: include("./config/gb_foot.inc"); echo ":: xGB admin ::"; echo "