Location: PHPKode > projects > Esvon Personals > esvon-personals/upgrades/v3_to_v4/upgrade301-302.php
<?php

// File to upgrade Esvon Classifieds from 3.0.1 to 3.0.777
// 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_SETTINGS." 
ADD options blob NOT NULL");

mysql_query("ALTER TABLE ".TBL_SETTINGS." 
ADD login varchar(20) BINARY NOT NULL,
ADD pwd varchar(32) NOT NULL");

$db->query("UPDATE ".TBL_SETTINGS." SET login = 'adm',pwd = MD5('adm')");

mysql_query("CREATE TABLE ".TBL_EXTRA_OPT." (
   id smallint(5) unsigned NOT NULL auto_increment,
   type varchar(10) NOT NULL,
   val varchar(10) NOT NULL,
   descr varchar(255) NOT NULL,
   price decimal(6,2) NOT NULL,
   active tinyint(1) DEFAULT '0' NOT NULL,
   PRIMARY KEY (id),
   UNIQUE (type,val)
)");

mysql_query("INSERT INTO ".TBL_EXTRA_OPT." VALUES (1, 'FEAT', '', 'No featuring', '0.00', '1'),
(2, 'FEAT', '1', 'Feature my ad', '30.00', '1'),
(3, 'VIS', '', 'No extra visibility for my ad', '0.00', '1'),
(4, 'VIS', 'B', 'Bold my ad', '4.00', '1'),
(5, 'VIS', 'BR', 'Bold and Red my ad', '8.00', '1'),
(6, 'WEIGHT', '', 'No priority', '0.00', '1'),
(7, 'WEIGHT', '1', 'Bronze Level Priority', '6.00', '1'),
(8, 'WEIGHT', '2', 'Silver Level Priority', '10.00', '1'),
(9, 'WEIGHT', '3', 'Gold Level Priority', '15.00', '1'),
(10, 'WEIGHT', '4', 'Platinum Level Priority', '25.00', '1'),
(11, 'COLOR', '', 'No extra highlight for my ad', '0.00', '1'),
(12, 'COLOR', 'FFFF00', 'Yellow highlight', '15.00', '1')");

mysql_query("ALTER TABLE ".TBL_AD." CHANGE hw_visibility hw_vis varchar(20) NOT NULL");

mysql_query("INSERT INTO ".TBL_RESERV_FLD." VALUES ('hw_vis', 'A')");

mysql_query("CREATE TABLE ".TBL_PP_USER." (
   fee_id varchar(10) NOT NULL,
   sub_id varchar(10) NOT NULL,
   PRIMARY KEY (fee_id, sub_id)
)");

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


?>
Return current item: Esvon Personals