<?php
// File to upgrade Esvon Classifieds from 2.7.x to 2.8
// After use this, you can delete it
// Note: admin password is reset to "adm" because of new
// non-plaintext password storage
//*********************************************
define('DB_UPGRADE', 1);
if(!defined('SITE_PATH')){
if(!file_exists('./inc/application.php')) die("File Not Found: application.php");
require_once './inc/application.php';
}
mysql_query("CREATE TABLE ".TBL_PREFIX."expense (
id int(11) unsigned NOT NULL auto_increment,
cdate date DEFAULT '0000-00-00' NOT NULL,
amount decimal(6,2) DEFAULT '0.00' NOT NULL,
descr varchar(255) NOT NULL,
PRIMARY KEY (id)
)");
mysql_query("CREATE TABLE ".TBL_PREFIX."session(
session_id char(32) NOT NULL,
expires int NOT NULL,
data text NOT NULL,
PRIMARY KEY (session_id),
INDEX (expires)
)");
mysql_query("CREATE TABLE ".TBL_PREFIX."admin_login (
id smallint(5) unsigned NOT NULL auto_increment,
ip varchar(255) NOT NULL,
ldate datetime NOT NULL,
login_used varchar(50) NOT NULL,
status char(1) NOT NULL,
PRIMARY KEY (id)
)");
mysql_query("CREATE TABLE ".TBL_PREFIX."price_plan_category (
cid smallint(5) unsigned DEFAULT '0' NOT NULL,
ppid varchar(10) NOT NULL,
PRIMARY KEY (cid, ppid)
)");
mysql_query("UPDATE ".TBL_EDITOR." SET pwd=PASSWORD('adm')");
mysql_query("ALTER TABLE ".TBL_EDITOR." ADD options BLOB not null");
mysql_query("ALTER TABLE ".TBL_PAY_PLAN." ADD realm char(1) NOT NULL");
echo 'Esvon Classifieds Tables Updated, Ok.. ('.basename(__FILE__).')';
?>