Location: PHPKode > projects > Esvon Personals > esvon-personals/upgrades/v2_6_to_v3/upgrade280-290.php
<?php

// File to upgrade Esvon Classifieds from 2.8.x to 2.9
// After use this, you can delete it

//*********************************************

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("ALTER TABLE ".TBL_EDITOR." CHANGE pwd pwd varchar(32) NOT NULL");

mysql_query("UPDATE ".TBL_EDITOR." SET pwd=MD5('adm')");
 
mysql_query("ALTER TABLE ".TBL_AD." ADD hw_visibility varchar(20) NOT NULL");

mysql_query("ALTER TABLE ".TBL_PAY_LOG." ADD txn_id varchar(255) NOT NULL");

mysql_query("CREATE TABLE ".TBL_RESERV_FLD." (
  name varchar(80) NOT NULL default '',
  tbl char(1) NOT NULL default '',
  PRIMARY KEY  (name,tbl)
)");

mysql_query("CREATE TABLE ".TBL_PAY_PEND." (
  id int(11) unsigned NOT NULL auto_increment,
  order_id mediumint(8) unsigned NOT NULL default '0',
  details varchar(255) NOT NULL default '',
  amount decimal(6,2) NOT NULL default '0.00',
  odate datetime NOT NULL default '0000-00-00 00:00:00',
  userid mediumint(8) unsigned NOT NULL default '0',
  ttype varchar(255) NOT NULL default '',
  PRIMARY KEY  (id),
  KEY (order_id)
)");

mysql_query("INSERT INTO ".TBL_RESERV_FLD." VALUES 
('accessdate', 'U'),
('approved', 'A'),
('catid', 'A'),
('date', 'A'),
('disabled', 'U'),
('email', 'U'),
('en_exp_modify', 'U'),
('exp_date', 'A'),
('exp_date', 'U'),
('free_ad_used', 'U'),
('hits', 'A'),
('hw_ads_max', 'U'),
('hw_pay_plan', 'A'),
('hw_pay_plan', 'U'),
('hw_remind', 'A'),
('hw_visibility', 'A'),
('hw_weight', 'A'),
('id', 'U'),
('images', 'A'),
('images', 'U'),
('lastlogin', 'U'),
('lastlogin_ip', 'U'),
('last_pg', 'U'),
('link_id', 'A'),
('num_votes', 'A'),
('hw_feat', 'A'),
('pwd', 'U'),
('rating', 'A'),
('regdate', 'U'),
('txn_id', 'A'),
('txn_id', 'U'),
('updated', 'A'),
('userid', 'A'),
('username', 'U')");

mysql_query("UPDATE ".TBL_MODULES." SET admin_capable=0 where dir='Favorites'");

// just drop all favorites

mysql_query("DROP TABLE ".hwModTable('Favorites','folder'));

$tbl = hwModTable('Favorites','link');

mysql_query("DROP TABLE ".$tbl);
mysql_query("CREATE TABLE ".$tbl." (
   user_id mediumint(8) unsigned DEFAULT '0' NOT NULL,
   link_id mediumint(8) unsigned DEFAULT '0' NOT NULL,
   PRIMARY KEY (user_id, link_id))");

echo 'Esvon Classifieds Tables Updated, Ok.. ('.basename(__FILE__).')';

?>
Return current item: Esvon Personals