PIXNET Logo登入

新聞吐槽課

跳到主文

新奇外電新聞,怪圖,吐槽,大量的貓咪。

部落格全站分類:電玩動漫

  • 相簿
  • 部落格
  • 留言
  • 名片
  • 4月 29 週日 200716:40
  • [整理]安裝PHPBB MOD教程(2)

1
如何得知要安裝的外掛是否需要輸入 SQL 語法來完成安裝?
在安裝說明文件中,檢視是否有以下文字
#
#-----[ SQL ]-------------------------------------------------
#
有的話就表示除了修改完檔案後還要再輸入 SQL 語法來完成安裝
那要如何輸入 SQL 語法?
這我以 Forum Logo Selector MOD 這個外掛來做範例
根據install_tw.txt文件說明
#
#-----[ 增加 SQL ]------------------------------------------
#
# 請記得修改成你的資料表名稱
INSERT INTO `phpbb_config` VALUES ('logo_image_path', 'images/logo');
INSERT INTO `phpbb_config` VALUES ('logo_image', 'subSilver.gif');
INSERT INTO `phpbb_config` VALUES ('logo_image_w', '200');
INSERT INTO `phpbb_config` VALUES ('logo_image_h', '91');
這就表示我們要輸入四行語法來完成安裝
什麼是"請記得修改成你的資料表名稱"?
還記得你當時在安裝phpBB2時的畫面嗎?
根據圖中紅框的資料來修改語法中的"phpbb_"
如果你當時有再進行修改不是取phpbb_的話 例如你是取phpbb22_
那麼語法要改成
INSERT INTO `phpbb22_config` VALUES ('logo_image_path', 'images/logo');
INSERT INTO `phpbb22_config` VALUES ('logo_image', 'subSilver.gif');
INSERT INTO `phpbb22_config` VALUES ('logo_image_w', '200');
INSERT INTO `phpbb22_config` VALUES ('logo_image_h', '91');
接下來就是連到phpMyAdmin網頁來進行輸入語法的動作
自機架設的話,其網址為
http://localhost/phpMyAdmin/index.php
localhost請自行換成你的網址
如果你是租用空間的話,phpMyAdmin網址請自行去詢問你所承租的主機商
不論是自機還是租用的,連到phpMyAdmin後會出現一個小畫面要你輸入phpMyAdmin的帳號及密碼
輸入完後會進入以下畫面
為何我進入後是英文介面?
請在右邊 Language 下拉式選單中選擇Chinese traditional(zh-tw)
接下來請在左邊的(資料庫...)下拉式選單中選擇你phpBB2所使用的資料庫名稱
我忘記我當時安裝的資料庫名稱了,該怎麼辦?
這時請開啟你phpBB2資料夾下的config.php
內容裡的紅字就是你資料庫的名稱
$dbname = 'dante_Rebellion';
之後按下上方的 SQL 連結
然後在空白處複製貼上說明文件中的語法,再按下"執行"
然後就會出現以下的結果畫面
這就表示你已成功輸入該外掛的語法,可以離開phpMyAdmin頁面了
有些外掛例如Birthday、Gender、Custom mass PM等都是需要輸入 SQL 語法的
但為何我沒在說明文件中看到 SQL 語法?

有些外掛作者會考慮到有些使用者對於phpMyAdmin不大熟悉
所以他們會在外掛包理附加一個"執行檔"
通常檔案名稱是db_update.php、install.php等
像是Advanced Links Mod 1.2.2就是links_install.php
Birthday則是birthday_db_update.php
此外也有升級用的"執行檔"
例如EasySite 1.3.0裡的db_update_111-130.php是給已安裝EasySite 1.1.1.的人升級到1.3.0用的
將執行檔上傳到phpBB2目錄下
然後以管理員的身份登入後,在網址輸入(以birthday做範例)
http://(你的網址)/(你的phpBB2資料夾名稱)/birthday_db_update.php
例:http://MyHome/phpBB2/birthday_db_update.php
按下 Enter 按鈕就會看到以下畫面就是成功了!
之後安全性上的考量,在執行完後請記得刪除"執行檔"
  • 如何確定外掛的語法有正確執行?

如果你是使用作者提供的執行檔來輸入語法
這裡以Cash Mod 2.2.1做範例
那麼在執行畫面後可看到是否有成功輸入語法
圖中的綠色英文"Successfull"
就表示已成功輸入 SQL 語法到資料庫
但如果是以下畫面
顯示紅色英文"Error"
就表示語法輸入錯誤,你可能已輸入過這些語法
  • 如何檢查語法是否已輸入到資料庫?

  • 這時請進入phpMyAdmin網頁後,再進入你論壇使用的資料庫
    然後根據作者提供的sql_221.txt文件來檢查是否有輸入語法
    #
    #-----[ SQL ]------------------------------------------
    #
    # If you don't know how to execute sql queries, then copy
    # sql_install.php into your phpbb directory and run it.
    # (assuming you use mysql or mssql)
    #
    # If you don't use mysql or mssql, you'll have to edit these queries accordingly
    #
    # If you have a different table prefix then change this command accordingly.
    # I have used the default table prefix!
    #
    INSERT INTO phpbb_config (config_name, config_value) VALUES ('cash_disable',0);
    INSERT INTO phpbb_config (config_name, config_value) VALUES ('cash_display_after_posts',1);
    INSERT INTO phpbb_config (config_name, config_value) VALUES ('cash_post_message','You earned %s for that post');
    INSERT INTO phpbb_config (config_name, config_value) VALUES ('cash_disable_spam_num',10);
    INSERT INTO phpbb_config (config_name, config_value) VALUES ('cash_disable_spam_time',24);
    INSERT INTO phpbb_config (config_name, config_value) VALUES ('cash_disable_spam_message','You have exceeded the alloted amount of posts and will not earn anything for your post');
    INSERT INTO phpbb_config (config_name, config_value) VALUES ('cash_installed','yes');
    INSERT INTO phpbb_config (config_name, config_value) VALUES ('cash_version','2.2.1');
    INSERT INTO phpbb_config (config_name, config_value) VALUES ('cash_adminbig','0');
    INSERT INTO phpbb_config (config_name, config_value) VALUES ('cash_adminnavbar','1');
    INSERT INTO phpbb_config (config_name, config_value) VALUES ('points_name','Points');
    這部份是在phpbb_config資料表內輸入新記錄
    所以按下phpbb_config左邊的瀏覽圖示
    直接跳到最後一頁後(越新加入的語法越後面)
    這時對照內容是否與文件中相符合
    #
    #-----[ SQL ]------------------------------------------
    #
    # If you have a different table prefix then change this command accordingly.
    # I have used the default table prefix!
    #
    CREATE TABLE phpbb_cash (
    cash_id smallint(6) NOT NULL auto_increment,
    cash_order smallint(6) NOT NULL default '0',
    cash_settings smallint(4) NOT NULL default '3313',
    cash_dbfield varchar(64) NOT NULL default '',
    cash_name varchar(64) NOT NULL default 'GP',
    cash_default int(11) NOT NULL default '0',
    cash_decimals tinyint(2) NOT NULL default '0',
    cash_imageurl varchar(255) NOT NULL default '',
    cash_exchange int(11) NOT NULL default '1',
    cash_perpost int(11) NOT NULL default '25',
    cash_postbonus int(11) NOT NULL default '2',
    cash_perreply int(11) NOT NULL default '25',
    cash_maxearn int(11) NOT NULL default '75',
    cash_perpm int(11) NOT NULL default '0',
    cash_perchar int(11) NOT NULL default '20',
    cash_allowance tinyint(1) NOT NULL default '0',
    cash_allowanceamount int(11) NOT NULL default '0',
    cash_allowancetime tinyint(2) NOT NULL default '2',
    cash_allowancenext int(11) NOT NULL default '0',
    cash_forumlist varchar(255) NOT NULL default '',
    PRIMARY KEY (cash_id)
    );
    #
    #-----[ SQL ]------------------------------------------
    #
    # If you have a different table prefix then change this command accordingly.
    # I have used the default table prefix!
    #
    CREATE TABLE phpbb_cash_events (
    event_name varchar(32) NOT NULL default '',
    event_data varchar(255) NOT NULL default '',
    PRIMARY KEY (event_name)
    );
    #
    #-----[ SQL ]------------------------------------------
    #
    # If you have a different table prefix then change this command accordingly.
    # I have used the default table prefix!
    #
    CREATE TABLE phpbb_cash_exchange (
    ex_cash_id1 int(11) NOT NULL default '0',
    ex_cash_id2 int(11) NOT NULL default '0',
    ex_cash_enabled int(1) NOT NULL default '0',
    PRIMARY KEY (ex_cash_id1,ex_cash_id2)
    );
    #
    #-----[ SQL ]------------------------------------------
    #
    # If you have a different table prefix then change this command accordingly.
    # I have used the default table prefix!
    #
    CREATE TABLE phpbb_cash_groups (
    group_id mediumint(6) NOT NULL default '0',
    group_type tinyint(2) NOT NULL default '0',
    cash_id smallint(6) NOT NULL default '0',
    cash_perpost int(11) NOT NULL default '0',
    cash_postbonus int(11) NOT NULL default '0',
    cash_perreply int(11) NOT NULL default '0',
    cash_perchar int(11) NOT NULL default '0',
    cash_maxearn int(11) NOT NULL default '0',
    cash_perpm int(11) NOT NULL default '0',
    cash_allowance tinyint(1) NOT NULL default '0',
    cash_allowanceamount int(11) NOT NULL default '0',
    cash_allowancetime tinyint(2) NOT NULL default '2',
    cash_allowancenext int(11) NOT NULL default '0',
    PRIMARY KEY (group_id,group_type,cash_id)
    );
    #
    #-----[ SQL ]------------------------------------------
    #
    # If you have a different table prefix then change this command accordingly.
    # I have used the default table prefix!
    #
    CREATE TABLE phpbb_cash_log (
    log_id int(11) NOT NULL auto_increment,
    log_time int(11) NOT NULL default '0',
    log_type smallint(6) NOT NULL default '0',
    log_action varchar(255) NOT NULL default '',
    log_text varchar(255) NOT NULL default '',
    PRIMARY KEY (log_id)
    );
    這部份是直接新增資料表
    所以在主畫面就可檢查是否相符合
  • 是先輸入語法還是先安裝外掛?

  • 這我個人是建議先輸入語法再安裝外掛後上傳檔案,就是輸入完語法後再上傳檔案(這期間強烈建議暫時關閉論壇,避免發生不可預測的問題)
  • 同樣的語法再執行一次會不會出問題?

  • 有些語法再執行一次不會對資料庫造成影響,但有的語法卻有可能造成影響
    如果不小心再度執行,然後論壇有出現異狀,建議先刪除該語法所輸入的記錄或資料表再重新輸入看看
  • 如果語法的資料庫格式不同輸入會不會有影響?

  • 這一定會出問題而無法輸入語法,就算能成功輸入,也難保不會對外掛的功能產生影響>
    (繼續閱讀...)
    文章標籤

    shintaro 發表在 痞客邦 留言(0) 人氣(7,327)

    • 個人分類:程式相關
    ▲top
    • 4月 29 週日 200716:19
    • [整理]安裝PHPBB MOD教程(1)

    MOD是什麼?
    MOD是縮寫、全文為Modification 意義有修改、改造、修正、修飾等字義
    一般我們翻譯為"外掛" 不過也有的外文網站是叫"Hack" 
    "MOD"與"Hack"兩者雖名不同 但其代表意義是相同的。
    (繼續閱讀...)
    文章標籤

    shintaro 發表在 痞客邦 留言(0) 人氣(2,222)

    • 個人分類:程式相關
    ▲top
    1

    關於 shintaro

    在其他地方找到我

    搜尋部落格文章 SEARCH

    最新迴響

    • [22/04/05] 訪客 於文章「《灼眼的夏娜》作者和《死亡筆記本》「L」...」留言:
      回饋您這方面資訊,我是從 PTT搜尋引擎的排名,看...
    • [21/08/02] 欣旅程,欣生活 於文章「圖噗集合#1...」留言:
      好有趣...
    • [19/06/29] 訪客 於文章「人聲的錄音和降噪技巧...」留言:
      整篇文章觀念都有問題...
    • [17/09/12] Bruce Wang 於文章「人聲的錄音和降噪技巧...」留言:
      您好,最近因為小寶寶剛出生但又想在家做線上教學所以在找價位約...
    • [17/06/12] 雲子 於文章「純愛與萌、エロゲ的蛻變 同級生2把我變成...」留言:
      據wiki資料筱原泉美的形象是參考機動警察的"泉野明"而來,...
    • [17/01/10] 哈哈 於文章「Happy New Year...」留言:
      http://www.mediafire.com/file/...
    • [15/10/10] ANNIE 於文章「【怒】麥可傑克森驗屍報告!?人都死了還在...」留言:
      虛偽的壞蛋? PO出尼既人先係吧^^...
    • [15/04/23] K 於文章「人聲的錄音和降噪技巧...」留言:
      想請問一下~ 混音出來後卻覺得人聲跟音樂很不協調(就是有一...
    • [15/02/07] 阿銀 於文章「Happy New Year...」發表了一則私密留言
    • [15/01/04] dandelion 於文章「人聲的錄音和降噪技巧...」留言:
      可是電容式會不會比較容易收到除了人聲外的其他微小雜音?? ...

    近期文章

    • Happy New Year
    • 圖噗集合#1
    • 說點聰明的話
    • 打我啊笨蛋
    • 人聲的錄音和降噪技巧
    • 如何為口說評論寫稿
    • Youtube 頻道成立: Shintaro Learns to Review
    • 【Zero Punctuation】零標點符號評論遊戲『模擬城市 Simcity』 (中文字幕)
    • 【Glass Reflection】加拿大人評論動畫『魔法少女小圓』
    • 【Glass Reflection】加拿大人評論動畫『Steins;Gate』(命運石之門)

    文章分類

    toggle 義工事業 (4)
    • 歌詞倉庫&插畫備份 (69)
    • 聲優・STAFF (9)
    • 動漫新聞 (202)
    • TVG新聞 (124)
    • 公告事項 (14)
    • 綜合圖片 (136)
    • 綜合新聞 (224)
    • 貓貓狗狗 (40)
    • 英文影片翻譯 (10)
    • 未分類文章 (1)

    訂閱本部落格

    參觀人氣

    • 本日人氣:
    • 累積人氣:

    交換連結【有圖版】