[討論]關於自行製作外掛。

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

版主: 版主管理群

主題已鎖定
我是傾聽我心唷
星球普通子民
星球普通子民
文章: 8
註冊時間: 2005-03-03 23:51

[討論]關於自行製作外掛。

文章 我是傾聽我心唷 »

hello~各位

最近想要自行製作外掛,大概有點類似竹貓之前的 瘋狂大冒險。

但是不需要這麼複雜。

大概只是類似查詢的網頁這樣。

整個版面的樣式 是希望如下

代碼: 選擇全部

表頭 匯入over_header.tpl 方便使用者回討論區

中間就是我設計的程式

表尾 匯入overall_footer.tpl 做個版權的宣告。
自己初步嘗試過

總是一值出現\r

代碼: 選擇全部

Warning: Cannot modify header information - headers already sent by (output started at /home/www/data/domodata.php:2) in /home/www/data/includes/sessions.php on line 308

Warning: Cannot modify header information - headers already sent by (output started at /home/www/data/domodata.php:2) in /home/www/data/includes/sessions.php on line 309

Warning: Cannot modify header information - headers already sent by (output started at /home/www/data/domodata.php:2) in /home/www/data/includes/page_header.php on line 661

Warning: Cannot modify header information - headers already sent by (output started at /home/www/data/domodata.php:2) in /home/www/data/includes/page_header.php on line 667

Warning: Cannot modify header information - headers already sent by (output started at /home/www/data/domodata.php:2) in /home/www/data/includes/page_header.php on line 668
目前初步的index.php檔案如下 只是先嘗試呼叫而已\r

代碼: 選擇全部

<link rel="stylesheet" type="text/css" href="../templates/fisubsilversh/fisubsilversh.css" />                                                                                  
<?php
define('IN_PHPBB', true);
$phpbb_root_path = '../';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);


include_once($phpbb_root_path . 'includes/functions_announces.'. $phpEx);

if (file_exists($phpbb_root_path . 'language/lang_' . $board_config['default_lan                                                                                                    g'] . "/lang_main_link.$phpEx"))
                {
                        include_once($phpbb_root_path . 'language/lang_' . $boar                                                                                                    d_config['default_lang'] . "/lang_main_link.$phpEx");
                }
                elseif (file_exists($phpbb_root_path . "language/lang_english/la                                                                                                    ng_main_link.$phpEx"))
                {
                        include_once($phpbb_root_path . "language/lang_english/l                                                                                                    ang_main_link.$phpEx");
                }
                else
                {
                        message_die(GENERAL_ERROR, "Unable to find a suitable la                                                                                                    nguage file for Advanced Links Mod", '');
                }

message_die(GENERAL_MESSAGE, $lang['No_forums']);
不知道我哪裡沒有注意到的?? 謝謝各位的指導~*
最後由 我是傾聽我心唷 於 2005-03-08 23:09 編輯,總共編輯了 2 次。
頭像
johnkk
星球公民
星球公民
文章: 234
註冊時間: 2003-02-21 19:15
來自: 來自蝸牛鎮
聯繫:

文章 johnkk »

你在自行寫phpbb的外掛的前段 要加上這段\r

代碼: 選擇全部

// Start session management
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
// End session management
這是判斷使用者之用...在進入每頁都要判斷一次
對Red Hat Linux還是一位新手..
但決不會因為難而放棄的
越是難搞越有興趣~^.^~

歡迎參觀我的網站
http://www.snailtown.idv.tw/
圖檔

●架設主機作業系統:Linux
●網站連結: http://www.snailtown.idv.tw/
●您的上網方式:ADSL
●您安裝的程式:Apache + php + MySql
●您的 phpBB2 版本:2.015
我是傾聽我心唷
星球普通子民
星球普通子民
文章: 8
註冊時間: 2005-03-03 23:51

文章 我是傾聽我心唷 »

問題還是一樣........頁面最上端會有

代碼: 選擇全部

Warning: Cannot modify header information - headers already sent by (output started at /home/www/data/domodata/index.php:2) in /home/www/data/includes/sessions.php on line 188

Warning: Cannot modify header information - headers already sent by (output started at /home/www/data/domodata/index.php:2) in /home/www/data/includes/sessions.php on line 189

Warning: Cannot modify header information - headers already sent by (output started at /home/www/data/domodata/index.php:2) in /home/www/data/includes/page_header.php on line 661

Warning: Cannot modify header information - headers already sent by (output started at /home/www/data/domodata/index.php:2) in /home/www/data/includes/page_header.php on line 667

Warning: Cannot modify header information - headers already sent by (output started at /home/www/data/domodata/index.php:2) in /home/www/data/includes/page_header.php on line 668
messagebox
竹貓忠實會員
竹貓忠實會員
文章: 981
註冊時間: 2003-02-24 23:34

文章 messagebox »

代碼: 選擇全部

<link rel="stylesheet" type="text/css" href="../templates/fisubsilversh/fisubsilversh.css" />                               
[color=red]↑這行是標準輸出(所以這行後面,無法送出檔頭header)
因為common.php會引用sessions.php(這檔案會送出setcookie之類的檔頭)
page_header.php也會送出部份檔頭\r
在PHP裡面使用print.echo等函式所做的輸出也是算標準輸出,必須在檔頭送完後在在輸出\r
[/color]
<?php 
define('IN_PHPBB', true); 
$phpbb_root_path = '../'; 
include($phpbb_root_path . 'extension.inc'); 
include($phpbb_root_path . 'common.'.$phpEx); 


include_once($phpbb_root_path . 'includes/functions_announces.'. $phpEx); 

if (file_exists($phpbb_root_path . 'language/lang_' . $board_config['default_lan                                                                                                    g'] . "/lang_main_link.$phpEx")) 
                { 
                        include_once($phpbb_root_path . 'language/lang_' . $boar                                                                                                    d_config['default_lang'] . "/lang_main_link.$phpEx"); 
                } 
                elseif (file_exists($phpbb_root_path . "language/lang_english/la                                                                                                    ng_main_link.$phpEx")) 
                { 
                        include_once($phpbb_root_path . "language/lang_english/l                                                                                                    ang_main_link.$phpEx"); 
                } 
                else 
                { 
                        message_die(GENERAL_ERROR, "Unable to find a suitable la                                                                                                    nguage file for Advanced Links Mod", ''); 
                } 

message_die(GENERAL_MESSAGE, $lang['No_forums']); 
我是傾聽我心唷
星球普通子民
星球普通子民
文章: 8
註冊時間: 2005-03-03 23:51

文章 我是傾聽我心唷 »

soga...........原來問題是這樣子的。

但是現在有一個問題是為何 檔案裡面我必須包含\r

代碼: 選擇全部

message_die(GENERAL_MESSAGE, $lang['No_forums']); 
才會有 標題與版權宣告??

如果只是想單純的include 標題 與 版權宣告,都會出現如下的錯誤。

代碼: 選擇全部

Parse error: parse error in /home/www/data/templates/fisubsilversh/overall_header.tpl on line 1


{ADMIN_LINK}
{S_TIMEZONE}
{TRANSLATION_INFO}
Powered by phpBB2 Plus {PLUS_VERSION} based on phpBB {PHPBB_VERSION} &copy; 2001, 2002 phpBB Group :: FI Theme :: {L_CREDITS} 

{BANNER_7_IMG} 
{BANNER_8_IMG} 
 {BANNER_9_IMG} 
{BANNER_10_IMG} 
 {BANNER_11_IMG} 
{BANNER_12_IMG} 
 
我想我大概對PHPBB 的設計不是很了解??

不知道個位有沒有簡單的方法可以提供一下呢??

阿.......講這麼多都忘記打廣告~ 呵呵^^y

飛天歷險-非官方網站

目前的測試頁在這裡
PS:不要從測試頁去做任何動作唷~
kansyu
星球普通子民
星球普通子民
文章: 4
註冊時間: 2002-11-04 13:26

文章 kansyu »

HELLO~
最近有了重大的突破= =+
終於可以大致上的顯示出我所要的樣式。不過有個問題
為何 表尾overall_foolter.tpl 所顯示出來的文字 關於變數的部分都無法顯示??

例如竹貓的版權宣告變成{TRANSLATION_INFO}

不知道要如何解決??

我目前的index檔案內容為\r

代碼: 選擇全部

<?php
define('IN_PHPBB', true);
include("./extension.inc");
include("./common.php");
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
include("./includes/page_header.php");
include("./templates/fisubsilversh/over.tpl");
?>
至於中間的地圖部分是修改over.tpl 利用iframe去讀取那地圖。不知道這樣說各位了不了解我的意思??

測試網址
神川小羽
調皮の小羽
調皮の小羽
文章: 1461
註冊時間: 2004-05-01 05:55
來自: 謎樣之筱語
聯繫:

文章 神川小羽 »

應該是因為你沒有引入下面的....
再加入這一行

代碼: 選擇全部

include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
-.-
我是傾聽我心唷
星球普通子民
星球普通子民
文章: 8
註冊時間: 2005-03-03 23:51

文章 我是傾聽我心唷 »

終於可以了耶~^^Y

謝謝各位唷~*^^*
我是傾聽我心唷
星球普通子民
星球普通子民
文章: 8
註冊時間: 2005-03-03 23:51

文章 我是傾聽我心唷 »

另外一個問題,關於cookie的部分
請問要怎麼去增加呢??
我再下達

代碼: 選擇全部

setcookie("domo_select",$Act);
的時候都會出現\r

代碼: 選擇全部

Warning: Cannot modify header information - headers already sent by (output started at /home/www/swdphpbb/cache/tpl_fisubsilversh.overall_header.php:5) in /home/www/swdphpbb/domo_index.php on line 13
這樣的錯誤

請問各位大大是怎麼另外加上cookie的呢?^^Y

現在的測試頁在這裡唷~*
主題已鎖定

回到「外掛問題討論」