Ich hab hier mal die Dadei die die Tables installieren sollte, vielleich erkennt ja jemand von Euch den Fehler:
Code: Alles auswählen
<?php
/***************************************************************************
rate_topics_table.php
-------------------
begin : Sat Feb 23, 2002
copyright : (C) 2002 Nivisec.com
email : nivisec@hotmail.com
$Id: rate_topics_table.php,v 1.2.2 2002/02/28 18:15:10 nivisec Exp $
***************************************************************************/
/***************************************************************************
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
***************************************************************************/
define('IN_PHPBB', true);
$phpbb_root_path = "./";
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
print '<b>Rate Results Table</b> <br>';
print '<a href="rate_topics_table.php?m=2&t=1">Create the table</a><br>';
print '<a href="rate_topics_table.php?m=3&t=1">Update the table - must do this after creation!</a><br>';
print '<a href="rate_topics_table.php?m=4&t=1">Update the table #2 - must do this after creation!</a><br>';
print '<a href="rate_topics_table.php?m=1&t=1">Delete the table</a>';
print '<br /><br /><b>Rate Config Table</b> <br>';
print '<a href="rate_topics_table.php?m=2&t=2">Create the table</a><br>';
print '<a href="rate_topics_table.php?m=3&t=2">Create the table defaults - must do this after creation!</a><br>';
print '<a href="rate_topics_table.php?m=4&t=2">Create the table defaults part 2- must do this after creation!</a><br>';
print '<a href="rate_topics_table.php?m=5&t=2">Create the table defaults part 3- must do this after creation!</a><br>';
print '<a href="rate_topics_table.php?m=1&t=2">Delete the table</a>';
print '<br /><br /><b>Rate Forum Field</b> <br>';
print '<a href="rate_topics_table.php?m=2&t=3">Create the field</a><br>';
print '<a href="rate_topics_table.php?m=1&t=3">Delete the field</a>';
if ($t == 1)
{
if ($m == 1)
{ //delete mode
$sql = "DROP
TABLE " . $table_prefix . "rate_results";
if (!$db->sql_query($sql))
{
print '<hr>Unable to delete the table, either it does not exist or you do not have security access to do it.';
print '<br />You can try to run the sql command manually with phpmyadmin or another utitily.';
print '<br />SQL COMMAND: ' . $sql;
}
else
{
print '<hr>Deleted table.';
}
}
if ($m == 2)
{ //create mode
$sql = "CREATE TABLE " . $table_prefix . "rate_results (
`user_id` MEDIUMINT UNSIGNED NOT NULL,
`topic_id` MEDIUMINT UNSIGNED NOT NULL,
`rating` MEDIUMINT UNSIGNED NOT NULL,
PRIMARY KEY (`user_id`, `topic_id`)
)";
if (!$db->sql_query($sql))
{
print '<hr>Unable to create the table, either it already exists or you do not have security access to do it.';
print '<br />You can try to run the sql command manually with phpmyadmin or another utitily.';
print '<br />SQL COMMAND: ' . $sql;
}
else
{
print '<hr>Created table.';
}
}
if ($m == 3)
{ //update mode
$sql = "ALTER
TABLE " . $table_prefix . "rate_results
ADD `rater_ip` CHAR(8) NOT NULL";
if (!$db->sql_query($sql))
{
print '<hr>Unable to update the table, either entry already exists or you do not have security access to do it.';
print '<br />You can try to run the sql command manually with phpmyadmin or another utitily.';
print '<br />SQL COMMAND: ' . $sql;
}
else
{
print '<hr>Updated table.';
}
}
if ($m == 4)
{ //update #2 mode
$sql = "ALTER
TABLE " . $table_prefix . "rate_results
ADD `rate_time` INT UNSIGNED NOT NULL default " . time();
if (!$db->sql_query($sql))
{
print '<hr>Unable to update the table, either entry already exists or you do not have security access to do it.';
print '<br />You can try to run the sql command manually with phpmyadmin or another utitily.';
print '<br />SQL COMMAND: ' . $sql;
}
else
{
print '<hr>Updated table.';
}
}
}
if ($t == 2)
{
if ($m == 1)
{ //delete mode
$sql = "DROP
TABLE " . $table_prefix . "rate_config";
if (!$db->sql_query($sql))
{
print '<hr>Unable to delete the table, either it does not exist or you do not have security access to do it.';
print '<br />You can try to run the sql command manually with phpmyadmin or another utitily.';
print '<br />SQL COMMAND: ' . $sql;
}
else
{
print '<hr>Deleted table.';
}
}
if ($m == 2)
{ //create mode
$sql = "CREATE
TABLE " . $table_prefix . "rate_config (
config_name varchar(255) NOT NULL default '',
config_value varchar(255) NOT NULL default '',
PRIMARY KEY (config_name)
) TYPE=MyISAM";
if (!$db->sql_query($sql))
{
print '<hr>Unable to create the table, either it already exists or you do not have security access to do it.';
print '<br />You can try to run the sql command manually with phpmyadmin or another utitily.';
print '<br />SQL COMMAND: ' . $sql;
}
else
{
print '<hr>Created table.';
}
}
if ($m == 3)
{ //Default mode
$sql = "INSERT
INTO " . $table_prefix . "rate_config (`config_name`, `config_value`)
VALUES ('allow_disable', '0')";
if (!$db->sql_query($sql))
{
print '<hr>Unable to create the defaults, either they already exist or you do not have security access to do it.';
print '<br />You can try to run the sql commands manually with phpmyadmin or another utitily.';
print '<br />SQL COMMAND: ' . $sql;
}
else
{
print '<hr>Created default.';
}
$sql = "INSERT
INTO " . $table_prefix . "rate_config (`config_name`, `config_value`)
VALUES ('allow_ext_rating', '0')";
if (!$db->sql_query($sql))
{
print '<hr>Unable to create the defaults, either they already exist or you do not have security access to do it.';
print '<br />You can try to run the sql commands manually with phpmyadmin or another utitily.';
print '<br />SQL COMMAND: ' . $sql;
}
else
{
print '<hr>Created default.';
}
$sql = "INSERT
INTO " . $table_prefix . "rate_config (`config_name`, `config_value`)
VALUES ('max_rating', '5')";
if (!$db->sql_query($sql))
{
print '<hr>Unable to create the defaults, either they already exist or you do not have security access to do it.';
print '<br />You can try to run the sql commands manually with phpmyadmin or another utitily.';
print '<br />SQL COMMAND: ' . $sql;
}
else
{
print '<hr>Created default.';
}
$sql = "INSERT
INTO " . $table_prefix . "rate_config (`config_name`, `config_value`)
VALUES ('allow_rerate', '0')";
if (!$db->sql_query($sql))
{
print '<hr>Unable to create the defaults, either they already exist or you do not have security access to do it.';
print '<br />You can try to run the sql commands manually with phpmyadmin or another utitily.';
print '<br />SQL COMMAND: ' . $sql;
}
else
{
print '<hr>Created default.';
}
}
if ($m == 4)
{ //Default part 2 mode
$sql = "INSERT
INTO " . $table_prefix . "rate_config (`config_name`, `config_value`)
VALUES ('anon_rate_id', '16777215')";
if (!$db->sql_query($sql))
{
print '<hr>Unable to create the defaults, either they already exist or you do not have security access to do it.';
print '<br />You can try to run the sql commands manually with phpmyadmin or another utitily.';
print '<br />SQL COMMAND: ' . $sql;
}
else
{
print '<hr>Created default.';
}
$sql = "INSERT
INTO " . $table_prefix . "rate_config (`config_name`, `config_value`)
VALUES ('check_anon_ip', '0')";
if (!$db->sql_query($sql))
{
print '<hr>Unable to create the defaults, either they already exist or you do not have security access to do it.';
print '<br />You can try to run the sql commands manually with phpmyadmin or another utitily.';
print '<br />SQL COMMAND: ' . $sql;
}
else
{
print '<hr>Created default.';
}
$sql = "INSERT
INTO " . $table_prefix . "rate_config (`config_name`, `config_value`)
VALUES ('main_page_number', '10')";
if (!$db->sql_query($sql))
{
print '<hr>Unable to create the defaults, either they already exist or you do not have security access to do it.';
print '<br />You can try to run the sql commands manually with phpmyadmin or another utitily.';
print '<br />SQL COMMAND: ' . $sql;
}
else
{
print '<hr>Created default.';
}
$sql = "INSERT
INTO " . $table_prefix . "rate_config (`config_name`, `config_value`)
VALUES ('big_page_number', '30')";
if (!$db->sql_query($sql))
{
print '<hr>Unable to create the defaults, either they already exist or you do not have security access to do it.';
print '<br />You can try to run the sql commands manually with phpmyadmin or another utitily.';
print '<br />SQL COMMAND: ' . $sql;
}
else
{
print '<hr>Created default.';
}
}
if ($m == 5)
{ //Default part 3 mode
$sql = "INSERT
INTO " . $table_prefix . "rate_config (`config_name`, `config_value`)
VALUES ('min_rates_number', '1')";
if (!$db->sql_query($sql))
{
print '<hr>Unable to create the defaults, either they already exist or you do not have security access to do it.';
print '<br />You can try to run the sql commands manually with phpmyadmin or another utitily.';
print '<br />SQL COMMAND: ' . $sql;
}
else
{
print '<hr>Created default.';
}
}
}
if ($t == 3)
{
if ($m == 1)
{ //delete mode
$sql = "ALTER
TABLE " . FORUMS_TABLE . "
DROP `auth_rate`";
if (!$db->sql_query($sql))
{
print '<hr>Unable to delete the table, either it does not exist or you do not have security access to do it.';
print '<br />You can try to run the sql command manually with phpmyadmin or another utitily.';
print '<br />SQL COMMAND: ' . $sql;
}
else
{
print '<hr>Deleted field.';
}
}
if ($m == 2)
{ //create mode
$sql = "ALTER
TABLE " . FORUMS_TABLE . "
ADD `auth_rate` TINYINT(2) NOT NULL default -1";
if (!$db->sql_query($sql))
{
print '<hr>Unable to create the table, either it already exists or you do not have security access to do it.';
print '<br />You can try to run the sql command manually with phpmyadmin or another utitily.';
print '<br />SQL COMMAND: ' . $sql;
}
else
{
print '<hr>Created field.';
}
}
}
?>
THANXXXX