發現links_install.php執行時如果出現\r
You are not Authorised to do this
就直接察看links_install.php李 sql的語法
然後直接到phpmyadmin去執行sql語法
但 小女子 不太懂程式~
所以想問一下大家 以下 哪些才算是sql語法呢??
謝謝
代碼: 選擇全部
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
//
$sql = array(
"CREATE TABLE ".$table_prefix."link_categories (
cat_id mediumint(8) unsigned NOT NULL auto_increment,
cat_title varchar(100) NOT NULL default '',
cat_order mediumint(8) unsigned NOT NULL default '0',
PRIMARY KEY (cat_id),
KEY cat_order (cat_order))",
"CREATE TABLE ".$table_prefix."links (
link_id mediumint(8) unsigned NOT NULL auto_increment,
link_title varchar(100) NOT NULL default '',
link_desc varchar(255) default NULL,
link_category mediumint(8) unsigned NOT NULL default '0',
link_url varchar(100) NOT NULL default '',
link_logo_src varchar(120) default NULL,
link_joined int(11) NOT NULL default '0',
link_active tinyint(1) NOT NULL default '0',
link_hits int(10) unsigned NOT NULL default '0',
user_id mediumint(8) NOT NULL default '0',
user_ip varchar(8) NOT NULL default '',
last_user_ip varchar(8) NOT NULL default '',
PRIMARY KEY (link_id))",
"INSERT INTO ".$table_prefix."link_categories VALUES (1, 'Arts', 1)",
"INSERT INTO ".$table_prefix."link_categories VALUES (2, 'Business', 2)",
"INSERT INTO ".$table_prefix."link_categories VALUES (3, 'Children and Teens', 3)",
"INSERT INTO ".$table_prefix."link_categories VALUES (4, 'Computers', 4)",
"INSERT INTO ".$table_prefix."link_categories VALUES (5, 'Games', 5)",
"INSERT INTO ".$table_prefix."link_categories VALUES (6, 'Health', 6)",
"INSERT INTO ".$table_prefix."link_categories VALUES (7, 'Home', 7)",
"INSERT INTO ".$table_prefix."link_categories VALUES (8, 'News', 8)",
"INSERT INTO ".$table_prefix."links VALUES (1, 'phpBB Official Website', 'Official phpBB Website', 4, 'http://www.phpbb.com/', 'images/links/phpBB_88a.gif', ".time().", 1, 0, 2, '', '')",
"INSERT INTO ".$table_prefix."links VALUES (2, 'phpbb-tw.net', 'Unofficial phpBB Chinese Support Centre', 4, 'http://phpbb-tw.net', 'images/links/phpbb-tw_logo88a.gif', ".time().", 1, 0, 2, '', '')",
"INSERT INTO ".$table_prefix."links VALUES (3, 'phpbb2.de', 'Your Source for phpBB2 Stuff', 4, 'http://www.phpbb2.de', 'images/links/phpbb2_de_logo.gif', ".time().", 1, 0, 2, '', '')",
"INSERT INTO ".$table_prefix."links VALUES (4, 'Forumimages.com', 'Forumimages.com', 4, 'http://www.forumimages.com', 'images/links/forum_images_banner_88x31.gif', ".time().", 1, 0, 2, '', '')",
"CREATE TABLE ".$table_prefix."link_config (
config_name varchar(255) NOT NULL default '',
config_value varchar(255) NOT NULL default ''
)",
"INSERT INTO ".$table_prefix."link_config (config_name, config_value) VALUES ('site_logo', 'http://".$board_config['server_name'].$board_config['script_path']."images/links/web_logo88a.gif')",
"INSERT INTO ".$table_prefix."link_config (config_name, config_value) VALUES ('site_url', 'http://".$board_config['server_name'].$board_config['script_path']."')",
"INSERT INTO ".$table_prefix."link_config (config_name, config_value) VALUES ('width', '88')",
"INSERT INTO ".$table_prefix."link_config (config_name, config_value) VALUES ('height', '31')",
"INSERT INTO ".$table_prefix."link_config (config_name, config_value) VALUES ('linkspp', '10')",
"INSERT INTO ".$table_prefix."link_config (config_name, config_value) VALUES ('display_interval', '6000')",
"INSERT INTO ".$table_prefix."link_config (config_name, config_value) VALUES ('display_logo_num', '10')",
"INSERT INTO ".$table_prefix."link_config (config_name, config_value) VALUES ('display_links_logo', '1')",
"INSERT INTO ".$table_prefix."link_config (config_name, config_value) VALUES ('email_notify', '1')",
"INSERT INTO ".$table_prefix."link_config (config_name, config_value) VALUES ('pm_notify ', '0')",
"INSERT INTO ".$table_prefix."link_config (config_name, config_value) VALUES ('lock_submit_site', '0')",
"INSERT INTO ".$table_prefix."link_config (config_name, config_value) VALUES ('allow_no_logo', '0')"
);
if ($userdata['user_level']!=ADMIN)
message_die(GENERAL_ERROR, "You are not Authorised to do this");
$n = 0;
$message = "<b>This list is a result of the SQL queries needed for the Advanced Links MOD</b><br/><br/>";
while($sql[$n])
{
$message .= ($mods[$n-1] != $mods[$n]) ? '<p><b><font size=3>'.$mods[$n].'</font></b><br/>' : '';
if(!$result = $db->sql_query($sql[$n]))
{
$message .= '<b><font color=#FF0000>[Error or Already added]</font></b> line: '.($n+1).' , '.$sql[$n].'<br />';
}
else
{
$message .='<b><font color=#0000fF>[Added/Updated]</font></b> line: '.($n+1).' , '.$sql[$n].'<br />';
}
$n++;
}
message_die(GENERAL_MESSAGE, $message);
?>


:: 