<?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright © 2002 - 2008 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Guestbook Infusion 4.06
| Author: Sebastian Schüssler (slaughter)
| Download:
| http://basti2web.de
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
require_once "../../../maincore.php";
// Check: iAUTH and $aid
if (!defined("iAUTH") || $_GET['aid'] != iAUTH) redirect("index.php");
// Includes
require_once INFUSIONS."guest_book/infusion_db.php";
require_once INFUSIONS."guest_book/includes/functions.php";
// Check: Admin Rights
if (!GB_ADMIN) redirect("index.php");
// Header
switch(UCC_PHPF_VER) {
case 6:
require_once BASEDIR."subheader.php";
require_once ADMIN."navigation.php";
break;
case 7:
require_once THEMES."templates/header.php";
break;
default:
redirect(INFUSIONS."guest_book/admin/error.php?id=3");
}
// Language Files
if (file_exists(INFUSIONS."guest_book/locale/".$settings['locale'].".php")) {
include INFUSIONS."guest_book/locale/".$settings['locale'].".php";
} else {
include INFUSIONS."guest_book/locale/English.php";
}
// MySQL database functions || edited by slaughter
function dbquery_gb_update($query) {
$result = @mysql_query($query);
if (!$result) {
//echo mysql_error();
return false;
} else {
return $result;
}
}
opentable($locale['gb_300'].": v4.04 => v4.05");
//-----------
$mysql[] = "CREATE TABLE ".DB_PREFIX."guestbook_captcha (
captcha_datestamp INT(10) UNSIGNED NOT NULL DEFAULT '0',
captcha_ip varchar(50) NOT NULL,
captcha_encode VARCHAR(32) NOT NULL DEFAULT '',
captcha_string VARCHAR(15) NOT NULL DEFAULT ''
) TYPE=MyISAM;";
$mysql[] = "ALTER TABLE ".DB_PREFIX."guestbook_entry ADD gb_comment TEXT NOT NULL";
$mysql[] = "ALTER TABLE ".DB_PREFIX."guestbook_entry ADD gb_comment_user VARCHAR(50) NOT NULL DEFAULT ''";
$mysql[] = "ALTER TABLE ".DB_PREFIX."guestbook_settings ADD gb_email_required SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0'";
$mysql[] = "ALTER TABLE ".DB_PREFIX."guestbook_settings ADD gb_show_bbcode SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0'";
$mysql[] = "ALTER TABLE ".DB_PREFIX."guestbook_settings ADD gb_show_color SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0'";
$mysql[] = "UPDATE ".DB_PREFIX."guestbook_settings SET gb_email_required = '1'";
$mysql[] = "UPDATE ".DB_PREFIX."guestbook_settings SET gb_show_bbcode = '1'";
$mysql[] = "UPDATE ".DB_PREFIX."guestbook_settings SET gb_show_color = '1'";
$mysql[] = "UPDATE ".DB_PREFIX."guestbook_settings SET gb_version = '4.05'";
$mysql[] = "UPDATE ".DB_PREFIX."infusions SET inf_version='4.05' WHERE inf_folder='guest_book'";
//-----------
$errors = 0;
foreach($mysql as $query) {
if(dbquery_gb_update($query)) {
$res = "<b>".$locale['gb_301']."</b>";
} else {
$errors++;
$res = "<b>".$locale['gb_302'].":</b> ";
$res .= mysql_error();
}
echo "<br /><code>".htmlentities($query)."</code>";
echo "<br />".$res."<br />";
}
if($errors) {
echo "<p><b>".$locale['gb_303'].": ".$errors."</b></p>";
} else {
echo "<p><b>".$locale['gb_304']."</b></p>";
}
echo "<br /><a href='".INFUSIONS."guest_book/admin/gb_admin.php".$aidlink."'>".$locale['gb_305']."</a><br /><br />";
closetable();
// Footer
switch(UCC_PHPF_VER) {
case 6:
require_once BASEDIR."side_right.php";
require_once BASEDIR."footer.php";
break;
case 7:
require_once THEMES."templates/footer.php";
break;
default:
redirect(INFUSIONS."guest_book/admin/error.php?id=3");
}
?>