參考連結: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中有段程式寫到
以及在index.php中有<!-- 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 -->
紅色部分應該就是有關顯示版面管理員的相關程式碼....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中被重複宣告與使用了....
可是不知道該怎麼改.....

