[問題]請問有關子版面在viewforum.php裡顯示版面管理員的問題....

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

版主: 版主管理群

主題已鎖定
PandaTwo
星球普通子民
星球普通子民
文章: 10
註冊時間: 2005-12-06 22:15

[問題]請問有關子版面在viewforum.php裡顯示版面管理員的問題....

文章 PandaTwo »

問題外掛:Attached forum子版面1.0.6
參考連結:http://phpbb-tw.net/phpbb/viewtopic.php?t=38688
使用版本:phpBB 2.0.21
網站位置:http://www.mascoteventclub.ez2.us/ForTest/
狀況描述:

請問一下....
在index.php中,會在各個版面的版名以及說明下面顯示版面管理員的清單(若是有的話)
會顯示
版面管理員:xxx,yyy
等資訊....

圖檔
這邊顯示的一樣....

可是當進入子版面後

圖檔
其中版面管理員就無法顯現出來....

察看了一下程式碼的部分....
templates\subSilver\index_body.tpl中有段程式寫到
<!-- BEGIN forumrow -->
<tr>
<td class="row1" align="center" valign="middle" height="50"><img src="{catrow.forumrow.FORUM_FOLDER_IMG}" width="46" height="25" alt="{catrow.forumrow.L_FORUM_FOLDER_ALT}" title="{catrow.forumrow.L_FORUM_FOLDER_ALT}" /></td>
<td class="row1" width="100%" height="50"><span class="forumlink"> <a href="{catrow.forumrow.U_VIEWFORUM}" class="forumlink">{catrow.forumrow.FORUM_NAME}</a><br />
</span> <span class="genmed">{catrow.forumrow.FORUM_DESC}<br />
</span><span class="gensmall">{catrow.forumrow.L_MODERATOR} {catrow.forumrow.MODERATORS}</span>
<!-- BEGIN switch_attached_forums -->
<!-- BEGIN br -->
<br />
<!-- END br -->
<span class="genmed">{catrow.forumrow.switch_attached_forums.L_ATTACHED_FORUMS}:
<!-- BEGIN attached_forums -->
<a class="nav" href="{catrow.forumrow.switch_attached_forums.attached_forums.U_VIEWFORUM}"><img alt="{catrow.forumrow.switch_attached_forums.attached_forums.L_FORUM_IMAGE}" border="0" src="{catrow.forumrow.switch_attached_forums.attached_forums.FORUM_IMAGE}" title="{catrow.forumrow.switch_attached_forums.attached_forums.L_FORUM_IMAGE}" />{catrow.forumrow.switch_attached_forums.attached_forums.FORUM_NAME}</a>
<!-- END attached_forums -->
<span class="genmed">
<!-- END switch_attached_forums -->
</td>
<td class="row2" align="center" valign="middle" height="50"><span class="gensmall">{catrow.forumrow.TOPICS}</span></td>
<td class="row2" align="center" valign="middle" height="50"><span class="gensmall">{catrow.forumrow.POSTS}</span></td>
<td class="row2" align="center" valign="middle" height="50" nowrap="nowrap"> <span class="gensmall">{catrow.forumrow.LAST_POST}</span></td>
</tr>
<!-- END forumrow -->
以及在index.php中有
else
{
$last_post = $lang['No_Posts'];
}


if ( count($forum_moderators[$forum_id]) > 0 )
{
$l_moderators = ( count($forum_moderators[$forum_id]) == 1 ) ? $lang['Moderator'] : $lang['Moderators'];
$moderator_list = implode(', ', $forum_moderators[$forum_id]);
}
else
{
// Modified by Attached Forums MOD

$l_moderators = '';
$moderator_list = '';
// END Modified by Attached Forums MOD
}



以及



$template->assign_block_vars('catrow.forumrow', array(
'ROW_COLOR' => '#' . $row_color,
'ROW_CLASS' => $row_class,
'FORUM_FOLDER_IMG' => $folder_image,
'FORUM_NAME' => $forum_data[$j]['forum_name'],
'FORUM_DESC' => $forum_data[$j]['forum_desc'],
'POSTS' => $forum_data[$j]['forum_posts'],
'TOPICS' => $forum_data[$j]['forum_topics'],
'LAST_POST' => $last_post,
'MODERATORS' => $moderator_list,

'L_MODERATOR' => $l_moderators,

'L_FORUM_FOLDER_ALT' => $folder_alt,

'U_VIEWFORUM' => append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id"))

紅色部分應該就是有關顯示版面管理員的相關程式碼....

因此我去尋找了templates\subSilver\viewforum_body.tpl中相對應的部分...
<!-- BEGIN switch_attached_present -->
<tr>
<td class="row1" align="center" valign="middle" height="38"><img src="{switch_attached_list.switch_attached_present.FORUM_FOLDER_IMG}" width="46" height="25" alt="{switch_attached_list.switch_attached_present.L_FORUM_FOLDER_ALT}" title="{switch_attached_list.switch_attached_present.L_FORUM_FOLDER_ALT}" /></td>
<td class="row1" width="75%"><span class="forumlink"><a class="forumlink" href="{switch_attached_list.switch_attached_present.U_VIEWFORUM}">{switch_attached_list.switch_attached_present.FORUM_NAME}</a></span><br /><span class="genmed">{switch_attached_list.switch_attached_present.FORUM_DESC}<br />
</span> <span class="gensmall">{switch_attached_list.switch_attached_present.L_MODERATOR} {switch_attached_list.switch_attached_present.MODERATORS}</span></td>
<td class="row2" align="center" valign="middle"><span class="gensmall">{switch_attached_list.switch_attached_present.TOPICS}</span></td>
<td class="row2" align="center" valign="middle"><span class="gensmall">{switch_attached_list.switch_attached_present.POSTS}</span></td>
<td class="row2" align="center" nowrap="nowrap" valign="middle"><span class="gensmall">{switch_attached_list.switch_attached_present.LAST_POST_ID}</span></td>

</tr>
<!-- END switch_attached_present -->
發覺他原始並無紅色部分的字樣...
應該就是在程式碼中並無寫出要秀出版面管理員的名單,因此我參照index_body.tpl的寫法將紅色部分加了進去....

並繼續參照index.php來修改viewforum.php,找到在藍色的程式碼....
else
{
$last_post = $lang['No_Posts'];
}
並在其後加上了
if ( count($forum_moderators[$forum_id]) > 0 )
{
$l_moderators = ( count($forum_moderators[$forum_id]) == 1 ) ? $lang['Moderator'] : $lang['Moderators'];
$moderator_list = implode(', ', $forum_moderators[$forum_id]);
}
else
{
// Modified by Attached Forums MOD

$l_moderators = '';
$moderator_list = '';
// END Modified by Attached Forums MOD
}
以及在後面加上紅色部分的宣告
$template->assign_block_vars ('switch_attached_list.switch_attached_present',
array
(
'FORUM_FOLDER_IMG' => $folder_image,
'L_FORUM_FOLDER_ALT' => $folder_alt,
'FORUM_NAME' => $attach_forum_name,
'U_VIEWFORUM' => $attach_forum_link,
'FORUM_DESC' => $attach_forum_desc,
'TOPICS' => $attach_forum_topics,
'POSTS' => $attach_forum_posts,
'LAST_POST_ID' => $last_post,
'MODERATORS' => $moderator_list,

'L_MODERATOR' => $l_moderators,
可是結果在執行時,就會出現此行是錯誤的
$moderator_list = implode(', ', $forum_moderators[$forum_id]);
可是若是把此行先行註解起來...
執行時不會有錯誤訊息...
但我想要的結果也不會出來...

該行註解起來的話....
在子版面的版面管理員這幾個字樣會出現,但後面不會接著出現人員清單...
而且,在index.php中若是並無版面管理員,則版面管理員的字樣也就不會出現
但我這樣修改後,若是該子版面並無任何管理員,其版面管理員的字樣還是一樣會出現

請問,這部分應該要怎樣修改呢?
感覺好像是有在變數MODERATORS以及L_MODERATOR在viewforum.php中被重複宣告與使用了....
可是不知道該怎麼改.....
頭像
心靈捕手
默默耕耘的老師
默默耕耘的老師
文章: 8547
註冊時間: 2004-04-30 01:54
來自: Taiwan

文章 心靈捕手 »

建議您:
參考此文, 修改看看.
http://www.phpbb.com/phpBB/viewtopic.ph ... 11#1702711
施比受有福,祝福您好運! ^_^
歡迎光臨★★心靈捕手★★ :: 討論區
https://wang5555.dnsfor.me/phpBB3/
PandaTwo
星球普通子民
星球普通子民
文章: 10
註冊時間: 2005-12-06 22:15

文章 PandaTwo »

心靈捕手 寫:建議您:
參考此文, 修改看看.
http://www.phpbb.com/phpBB/viewtopic.ph ... 11#1702711
謝謝....
順利完成了....

原來除了自己依樣畫葫蘆增加的部分外...
還要再另外加一段程式碼...

謝謝....^_^
主題已鎖定

回到「外掛問題討論」