Location: PHPKode > projects > Phpbb-Auction > update_db.php
<head>
<body>

<?php

define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);

echo '<table width="100%" cellspacing="1" cellpadding="2" border="0" class="forumline">';
echo '<tr><th>Updating the database</th></tr><tr><td><span class="genmed"><ul type="circle">';


$sql = array();
$sql[] = "INSERT INTO `" . $table_prefix . "auction_config` VALUES ('auction_block_display_last_bids', '1')";
$sql[] = "INSERT INTO `" . $table_prefix . "auction_config` VALUES ('auction_config_last_bids_number', '5')";
$sql[] = "INSERT INTO `" . $table_prefix . "auction_config` VALUES ('auction_block_display_newest_offers', '1')";
$sql[] = "INSERT INTO `" . $table_prefix . "auction_config` VALUES ('auction_config_newest_offers_number', '10')";
$sql[] = "INSERT INTO `" . $table_prefix . "auction_config` VALUES ('auction_paymentsystem_activate_debit', '0')";
$sql[] = "INSERT INTO `" . $table_prefix . "auction_config` VALUES ('auction_offer_cost_final_percent', '0')";

$sql[] = "INSERT INTO `" . $table_prefix . "auction_config` VALUES ('auction_pseudo_cron', '0')";
$sql[] = "INSERT INTO `" . $table_prefix . "auction_config` VALUES ('auction_pseudo_cron_frequence', 'm')";
$sql[] = "INSERT INTO `" . $table_prefix . "auction_config` VALUES ('auction_pseudo_cron_last', '1103460607')";
$sql[] = "INSERT INTO `" . $table_prefix . "auction_config` VALUES ('auction_room_pagination', '1000')";


$sql[] = "CREATE TABLE `" . $table_prefix . "auction_store` (
  `pk_auction_store_id` mediumint(8) NOT NULL auto_increment,
  `fk_user_id` mediumint(8) NOT NULL default '0',
  `store_name` varchar(255) NOT NULL default '',
  `store_description` text NOT NULL,
  `store_header` text NOT NULL,
  `show_block_drop_down` tinyint(1) NOT NULL default '1',
  `show_block_rooms` tinyint(1) NOT NULL default '1',
  `show_block_search` tinyint(1) NOT NULL default '1',
  `show_block_statistics` tinyint(1) NOT NULL default '1',
  `show_block_myauction` tinyint(1) NOT NULL default '1',
  `show_block_specials` tinyint(1) NOT NULL default '1',
  `show_block_priceinfo` tinyint(1) NOT NULL default '1',
  `show_block_calendar` tinyint(1) NOT NULL default '1',
  `show_block_closetoend` tinyint(1) NOT NULL default '1',
  `show_block_ticker` tinyint(1) NOT NULL default '1',
  PRIMARY KEY  (`pk_auction_store_id`)
) TYPE=MyISAM AUTO_INCREMENT=2";

$sql[] = "CREATE TABLE `" . $table_prefix . "auction_bid_increase` (
  `PK_bid_increase` mediumint(8) unsigned NOT NULL auto_increment,
  `bid_increase` decimal(15,2) NOT NULL default '0.00',
  PRIMARY KEY  (`PK_bid_increase`)
) TYPE=MyISAM AUTO_INCREMENT=60";
$sql[] = "INSERT INTO `" . $table_prefix . "auction_bid_increase` VALUES (49, '0.10')";
$sql[] = "INSERT INTO `" . $table_prefix . "auction_bid_increase` VALUES (50, '0.20')";
$sql[] = "INSERT INTO `" . $table_prefix . "auction_bid_increase` VALUES (51, '0.50')";
$sql[] = "INSERT INTO `" . $table_prefix . "auction_bid_increase` VALUES (52, '1.00')";
$sql[] = "INSERT INTO `" . $table_prefix . "auction_bid_increase` VALUES (53, '2.00')";
$sql[] = "INSERT INTO `" . $table_prefix . "auction_bid_increase` VALUES (54, '5.00')";
$sql[] = "INSERT INTO `" . $table_prefix . "auction_bid_increase` VALUES (55, '10.00')";
$sql[] = "INSERT INTO `" . $table_prefix . "auction_bid_increase` VALUES (56, '20.00')";
$sql[] = "INSERT INTO `" . $table_prefix . "auction_bid_increase` VALUES (57, '30.00')";
$sql[] = "INSERT INTO `" . $table_prefix . "auction_bid_increase` VALUES (58, '50.00')";
$sql[] = "INSERT INTO `" . $table_prefix . "auction_bid_increase` VALUES (59, '100.00')";


$sql[] = "CREATE TABLE  `" . $table_prefix . "auction_account` (
`pk_auction_account_id` MEDIUMINT( 8 ) NOT NULL AUTO_INCREMENT ,
`fk_auction_account_creditor_id` MEDIUMINT( 8 ) NOT NULL ,
`fk_auction_account_debitor_id` MEDIUMINT( 8 ) NOT NULL ,
`auction_account_auction_amount` DECIMAL( 15, 2 ) NOT NULL ,
`auction_account_amount_date` INT( 11 ) NOT NULL ,
`auction_account_notified` MEDIUMINT( 8 ) NOT NULL ,
`auction_account_amount_paid` DECIMAL( 15, 2 ) NOT NULL ,
`auction_account_amount_paid_by` MEDIUMINT( 8 ) NOT NULL ,
`fk_auction_offer_id` MEDIUMINT( 8 ) NOT NULL ,
`auction_account_action` VARCHAR( 25 ) NOT NULL ,
PRIMARY KEY ( `pk_auction_account_id` )
)";

$sql[] = "ALTER TABLE `" . $table_prefix . "auction_offer` ADD `auction_offer_percentage_charged` TINYINT( 1 ) DEFAULT '0' NOT NULL";
$sql[] = "ALTER TABLE `" . $table_prefix . "auction_offer` ADD `auction_offer_sellers_location` varchar(100) NOT NULL default '' ";
$sql[] = "ALTER TABLE `" . $table_prefix . "auction_offer` ADD `auction_offer_bid_increase` decimal(15,2) NOT NULL default '0.00' ";
$sql[] = "ALTER TABLE `" . $table_prefix . "auction_offer` ADD `auction_offer_accepted_payments` varchar(100) NOT NULL default '' ";

$sql[] = "UPDATE `" . $table_prefix . "auction_config` SET auction_version= '1.3m' WHERE auction_version='1.2 m' ";


for( $i = 0; $i < count($sql); $i++ )
{
	if( !$result = $db->sql_query ($sql[$i]) )
	{
		$error = $db->sql_error();

		echo '<li>' . $sql[$i] . '<br /> +++ <font color="#FF0000"><b>Error:</b></font> ' . $error['message'] . '</li><br />';
	}
	else
	{
		echo '<li>' . $sql[$i] . '<br /> +++ <font color="#00AA00"><b>Successfull</b></font></li><br />';
	}
}


echo '</ul></span></td></tr><tr><td class="catBottom" height="28">&nbsp;</td></tr>';
echo '<tr><th>End</th></tr><tr><td><span class="genmed">Installation is now finished. Please be sure to delete this file now.<br />If you have run into any errors, please visit the <a href="http://www.phpbb-auction.com" target="_new">www.phpbb-auction.com</a> and ask someone for help.</span></td></tr></table>';

?>

</body>
</head>
Return current item: Phpbb-Auction