ja war eins dabei und hab ich auch ausgeführt... sieht im einzelnen so aus:
<?php
/***************************************************************************
* vault_db_update.php
* -------------------
*
*
***************************************************************************/
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
//
// End session management
//
if( $userdata['user_level'] != ADMIN )
{
message_die(GENERAL_MESSAGE, 'You are not authorised to access this page');
}
$page_title = 'Installation of the mod Vault';
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
echo '<table width="100%" cellspacing="1" cellpadding="2" border="0" class="forumline">';
echo '<tr><th>Installation of the mod Vault</th></tr><tr><td><span class="genmed"><ul type="circle">';
$sql = array();
$sql[] = "INSERT INTO " . $table_prefix . "config (config_name, config_value) VALUES ('vault_enable', '1')";
$sql[] = "INSERT INTO " . $table_prefix . "config (config_name, config_value) VALUES ('vault_name', 'Vault')";
$sql[] = "INSERT INTO " . $table_prefix . "config (config_name, config_value) VALUES ('stock_use', '1')";
$sql[] = "INSERT INTO " . $table_prefix . "config (config_name, config_value) VALUES ('stock_time', '86400')";
$sql[] = "INSERT INTO " . $table_prefix . "config (config_name, config_value) VALUES ('stock_last_change', '0')";
$sql[] = "INSERT INTO " . $table_prefix . "config (config_name, config_value) VALUES ('vault_display_profile' , '1')";
$sql[] = "INSERT INTO " . $table_prefix . "config (config_name, config_value) VALUES ('vault_display_topics' , '0')";
$sql[] = "CREATE TABLE " . $table_prefix . "vault_blacklist (
user_id int(8) NOT NULL default '0',
user_due int(8) NOT NULL default '0',
PRIMARY KEY (user_id)
) TYPE=MyISAM";
$sql[] = "CREATE TABLE " . $table_prefix . "vault_exchange (
stock_id int(8) NOT NULL default '0',
stock_name varchar(40) NOT NULL default '',
stock_desc varchar(255) NOT NULL default '',
stock_price int(8) NOT NULL default '0',
stock_previous_price int(8) NOT NULL default '0',
stock_best_price int(8) NOT NULL default '0',
stock_worst_price int(8) NOT NULL default '0',
PRIMARY KEY (stock_id)
) TYPE=MyISAM";
$sql[] = "INSERT INTO " . $table_prefix . "vault_exchange (stock_id, stock_name, stock_desc, stock_price, stock_previous_price, stock_best_price, stock_worst_price) VALUES (1, 'Vault_action_name_1', 'Vault_action_desc_1', 100, 100, 100, 100)";
$sql[] = "INSERT INTO " . $table_prefix . "vault_exchange (stock_id, stock_name, stock_desc, stock_price, stock_previous_price, stock_best_price, stock_worst_price) VALUES (2, 'Vault_action_name_2', 'Vault_action_desc_2', 200, 200, 200, 200)";
$sql[] = "INSERT INTO " . $table_prefix . "vault_exchange (stock_id, stock_name, stock_desc, stock_price, stock_previous_price, stock_best_price, stock_worst_price) VALUES (3, 'Vault_action_name_3', 'Vault_action_desc_3', 300, 300, 300, 300)";
$sql[] = "CREATE TABLE " . $table_prefix . "vault_exchange_users (
stock_id mediumint(8) NOT NULL default '0',
user_id mediumint(8) NOT NULL default '0',
stock_amount mediumint(8) NOT NULL default '0',
KEY stock_id (stock_id),
KEY user_id (user_id)
) TYPE=MyISAM";
$sql[] = "CREATE TABLE " . $table_prefix . "vault_general (
config_name varchar(255) NOT NULL default '',
config_value int(15) NOT NULL default '0',
PRIMARY KEY (config_name)
) TYPE=MyISAM";
$sql[] = "INSERT INTO " . $table_prefix . "vault_general (config_name, config_value) VALUES ('vault_loan_enable', 1)";
$sql[] = "INSERT INTO " . $table_prefix . "vault_general (config_name, config_value) VALUES ('interests_rate', 4)";
$sql[] = "INSERT INTO " . $table_prefix . "vault_general (config_name, config_value) VALUES ('interests_time', 86400)";
$sql[] = "INSERT INTO " . $table_prefix . "vault_general (config_name, config_value) VALUES ('loan_interests', 15)";
$sql[] = "INSERT INTO " . $table_prefix . "vault_general (config_name, config_value) VALUES ('loan_interests_time', 864000)";
$sql[] = "INSERT INTO " . $table_prefix . "vault_general (config_name, config_value) VALUES ('loan_max_sum', 5000)";
$sql[] = "INSERT INTO " . $table_prefix . "vault_general (config_name, config_value) VALUES ('loan_requirements', 0)";
$sql[] = "INSERT INTO " . $table_prefix . "vault_general (config_name, config_value) VALUES ('stock_max_change', 10)";
$sql[] = "INSERT INTO " . $table_prefix . "vault_general (config_name, config_value) VALUES ('stock_min_change', 0)";
$sql[] = "INSERT INTO " . $table_prefix . "vault_general (config_name, config_value) VALUES ('base_amount', 10)";
$sql[] = "INSERT INTO " . $table_prefix . "vault_general (config_name, config_value) VALUES ('num_items', 20)";
$sql[] = "CREATE TABLE " . $table_prefix . "vault_users (
owner_id int(8) NOT NULL default '0',
account_id int(8) NOT NULL default '0',
account_sum int(8) NOT NULL default '0',
account_time int(11) NOT NULL default '0',
loan_sum int(8) NOT NULL default '0',
loan_time int(11) NOT NULL default '0',
account_protect tinyint(1) NOT NULL default '0',
loan_protect tinyint(1) NOT NULL default '0',
newsletter tinyint(1) NOT NULL default '0',
PRIMARY KEY (owner_id)
) TYPE=MyISAM";
for( $i = 0; $i < count($sql); $i++ )
{
if( !$result = $db->sql_query ($sql[$i]) )
{
$error = $db->sql_error();
echo '[*]' . $sql[$i] . '
+++ <font color="#FF0000">[b]Error:[/b]</font> ' . $error['message'] . '
';
}
else
{
echo '[*]' . $sql[$i] . '
+++ <font color="#00AA00">[b]Successfull[/b]</font>
';
}
}
echo '[/list]</span></td></tr><tr><td class="catBottom" height="28"></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.</span></td></tr></table>';
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
?>
Alles anzeigen