[問題] 安裝生日mod一問

phpBB 2 MOD Support
無論是官方或非官方認證之外掛,安裝與使用問題討論。
(發表文章請按照公告格式發表,違者砍文)

版主: 版主管理群

主題已鎖定
gogopen
星球公民
星球公民
文章: 49
註冊時間: 2004-08-21 12:32

[問題] 安裝生日mod一問

文章 gogopen »

我想問問,點解我裝生日mod有以下問題。
當我想執行db update時,http://www.yourWebSite.xxx/phpbbRootDir ... update.php
會出現以下message: ' You are not Authorised to do this',我已經用admin身份登入,究竟問題在那裏?
mcdondon
星球普通子民
星球普通子民
文章: 20
註冊時間: 2004-12-04 17:27
來自: HK
聯繫:

文章 mcdondon »

你可以自己直接去phpadmin那裡加!
gogopen
星球公民
星球公民
文章: 49
註冊時間: 2004-08-21 12:32

文章 gogopen »

mcdondon 寫:你可以自己直接去phpadmin那裡加!
想問問是怎樣加的,請指教!
mcdondon
星球普通子民
星球普通子民
文章: 20
註冊時間: 2004-12-04 17:27
來自: HK
聯繫:

文章 mcdondon »

執行 SQL 語法於資料庫, 再打你要加的SQL statement
gogopen
星球公民
星球公民
文章: 49
註冊時間: 2004-08-21 12:32

[問題] 如何手動加入?

文章 gogopen »

mcdondon 寫:執行 SQL 語法於資料庫, 再打你要加的SQL statement
請問下列的birthday mod是如何手動加入?

代碼: 選擇全部

<?php
#########################################################
## SQL commands to phpBB2
## Author: Niels Chr. R鷣\r
## Nickname: Niels Chr. Denmark
## Email: ncr@db9.dk
##
## Ver 1.0.7
##
## phpBB2 database update script for mods
## this file is intended to use with phpBB2, when installing mods
## after so you may delete this file, but only admin can use so it really doesen't matter
## The script will look what prefix you are using, and use the existing DB defined by congig.php
## The execution of this script's included SQL is harmless, so you can run it as meny times you like
## note, though that the users last visit, will be set back to his/her last login, 
## but that is a minor cosmetic isue, that will correct it self next time the use  logs in
##
## the following example are from my mods, and you can add some self, for other mods if you like
## you will after execution get a list over those commands that are run with succes and those with warnings !
## delete the sample lines if you are using it only for other mods
##
#########################################################

define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
include($phpbb_root_path . 'includes/functions_selects.'.$phpEx);
define('SITE_HISTORY_TABLE', $table_prefix.'site_history');

###################################################################################################
##
## put the SQL commands below here, the SQL commands listed below are only exampels, substitude them with the one you need ##
##
###################################################################################################
$sql=array(
'ALTER TABLE phpbb_users ADD user_birthday INT DEFAULT "999999" not null  ',
'ALTER TABLE phpbb_users ADD user_next_birthday_greeting INT DEFAULT "0" not null ',
'INSERT INTO phpbb_config (config_name, config_value) VALUES ("birthday_required", "0")',
'INSERT INTO phpbb_config (config_name, config_value) VALUES ("birthday_greeting", "1")',
'INSERT INTO phpbb_config (config_name, config_value) VALUES ("max_user_age", "100")',
'INSERT INTO phpbb_config (config_name, config_value) VALUES ("min_user_age", "5")',
'INSERT INTO phpbb_config (config_name, config_value) VALUES ("birthday_check_day", "7")'
);

$mods = array ( 
'Birthday PART 1 Mod','Birthday PART 1 Mod','Birthday PART 2 Mod','Birthday PART 2 Mod','Birthday PART 2 Mod','Birthday PART 2 Mod','Birthday PART 2 Mod',
);

############################################### Do not change anything below this line #######################################

//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
//
// End session management
//

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 additional mods in the pre-moded pack</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>[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); 
?>
mcdondon
星球普通子民
星球普通子民
文章: 20
註冊時間: 2004-12-04 17:27
來自: HK
聯繫:

文章 mcdondon »

代碼: 選擇全部

'ALTER TABLE phpbb_users ADD user_birthday INT DEFAULT "999999" not null  ', 
'ALTER TABLE phpbb_users ADD user_next_birthday_greeting INT DEFAULT "0" not null ', 
'INSERT INTO phpbb_config (config_name, config_value) VALUES ("birthday_required", "0")', 
'INSERT INTO phpbb_config (config_name, config_value) VALUES ("birthday_greeting", "1")', 
'INSERT INTO phpbb_config (config_name, config_value) VALUES ("max_user_age", "100")', 
'INSERT INTO phpbb_config (config_name, config_value) VALUES ("min_user_age", "5")', 
'INSERT INTO phpbb_config (config_name, config_value) VALUES ("birthday_check_day", "7")' 
主題已鎖定

回到「外掛問題討論」