
有不好需要加強的地方,歡迎多指教
範例圖片
http://myweb.hinet.net/home4/iqstar/forum_sub.jpg
範例網站
http://bbs.2233.idv.tw
在phpbb2.0.4,2.0.11,2.0.12 測試過皆無問題
原本的安裝說明,所使用的圖檔是連到我的網頁空間
造成我的網頁流量增加不少,所以我改掉連結了,之前裝的人請見諒
請自行下載,放在自己的網頁空間上
外掛中所使用的圖檔下載網址
http://myweb.hinet.net/home4/iqstar/topnew.gif
http://myweb.hinet.net/home4/iqstar/ico ... t_lock.gif
代碼: 選擇全部
/*=====================================================
Mod Title: 簡易子版面\r
Author : ETERNAL<iqstar@ms24.hinet.net>
Mod Version: 1.0
Mod Date: 2005/2/21
Demo Site : http://bbs.2233.idv.tw/
Files To Edit: 11
===================================================== */
---------------------------------------------------------
?#91;入sql語法
ALTER TABLE `phpbb_forums` ADD `forum_sub` SMALLINT( 5 ) UNSIGNED DEFAULT '0' NOT NULL ;
ALTER TABLE `phpbb_forums` ADD `sort_sub` SMALLINT( 5 ) UNSIGNED DEFAULT '0' NOT NULL ;
---------------------------------------------------------
=============打?#125; index.php============
找到===================
$forum_data = array();
後面?#91;上===============
$forum_sub = array();
$forum_sub2 = array();
找到===================
$forum_data[] = $row;
後面?#91;上===============
if($row[forum_sub]>0)
{
if ( $row['forum_status'] == FORUM_LOCKED )
{
$forum_sub[$row['forum_sub']][$row['forum_id']] = '<a href='.append_sid('viewforum.'.$phpEx.'?' . POST_FORUM_URL .'='.$row['forum_id']).'>'. $row['forum_name'] . ' </a><img src="images/icon_minipost_lock.gif" alt="'.$lang['Forum_locked'].'" border="0">';
}else
{
$forum_sub[$row['forum_sub']][$row['forum_id']]='<a href='.append_sid('viewforum.'.$phpEx.'?' . POST_FORUM_URL .'='.$row['forum_id']).'>'. $row['forum_name'] . ' </a>';
}
$forum_sub2[$row['forum_sub']][]=$row[forum_id];
}
找到==============
if ( $is_auth_ary[$forum_id]['auth_view'] )
取代為============
if ( $is_auth_ary[$forum_id]['auth_view'] && $forum_data[$j]['forum_sub'] ==0)
找到==============
$folder_image = ( $unread_topics ) ? $images['forum_new'] : $images['forum'];
$folder_alt = ( $unread_topics ) ? $lang['New_posts'] : $lang['No_new_posts'];
}
後面?#91;上===========
//forum_sub start
for($k=0;$k<count($forum_sub2[$forum_id]);$k++)
{
$unread_topics = false;
$forum_id2=$forum_sub2[$forum_id][$k];
if ( $userdata['session_logged_in'] )
{
if ( !empty($new_topic_data[$forum_id2]) )
{
$forum_last_post_time = 0;
while( list($check_topic_id, $check_post_time) = @each($new_topic_data[$forum_id2]) )
{
if ( empty($tracking_topics[$check_topic_id]) )
{
$unread_topics = true;
$forum_last_post_time = max($check_post_time, $forum_last_post_time);
}
else
{
if ( $tracking_topics[$check_topic_id] < $check_post_time )
{
$unread_topics = true;
$forum_last_post_time = max($check_post_time, $forum_last_post_time);
}
if($new_topic_data[$forum_id2][0])
{
$unread_topics = true;
}
}
}
if ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f_all']) )
{
if ( $HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f_all'] > $forum_last_post_time )
{
$unread_topics = false;
}
}
}
}
if($is_auth_ary[$forum_id2]['auth_view'])
{
if($unread_topics)
{
$forum_sub[$forum_id][$forum_id2] = $forum_sub[$forum_id][$forum_id2].'<img src="images/topnew.gif" alt='.$lang['New_posts'].' border="0">';
}
}else
{
unset($forum_sub[$forum_id][$forum_id2]);
}
}
//forum_sub end
找到===============
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
{
$l_moderators = ' ';
$moderator_list = ' ';
}
後面?#91;上===============
//forum_sub start
if ( count($forum_sub[$forum_id]) > 0 )
{
$forum_sub_list = implode(', ', $forum_sub[$forum_id]);
}
else
{
$forum_sub_list = '';
}
if(!empty($forum_sub_list))
{
$forum_sub_list="子版面 : ".$forum_sub_list;
}
//forum_sub end
找到===============
'FORUM_DESC' => $forum_data[$j]['forum_desc'],
後面?#91;上==============
'FORUM_NAME_SUB' => $forum_sub_list,
---------------------------------------------------------
打?#125; \includes\functions.php
找到=================
function make_jumpbox($action, $match_forum_id = 0)
{
....................
....................
....................
}
將整個 function make_jumpbox($action , $match_forum_id = 0) 取代為==========
//forum_sub start
function make_jumpbox($action,$match_forum_id=0)
{
global $template, $userdata, $lang, $db, $nav_links, $phpEx, $SID,$is_auth;
$sql="select cat_id,cat_title from ".CATEGORIES_TABLE." order by cat_order ";
if( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, "Couldn't get list of Categories/Forums", "", __LINE__, __FILE__, $sql);
}
$cat_data = array();
while( $row = $db->sql_fetchrow($result) )
{
$cat_data[] = $row;
}
$db->sql_freeresult($result);
$sql = "SELECT cat_id,forum_id,forum_name,sort_sub,forum_sub,auth_view from ".FORUMS_TABLE." ORDER BY cat_id,forum_order";
if( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, "Couldn't get list of Categories/Forums", "", __LINE__, __FILE__, $sql);
}
$forum_data = array();
$forum_sub = array();
$forum_sub2 = array();
while( $row = $db->sql_fetchrow($result) )
{
$s="";
if($row['auth_view'] <= AUTH_REG)
{
if($row[forum_sub]==0)
{
$forum_data[$row['cat_id']][] = $row;
}
else
{
if ($row[forum_id] == $match_forum_id)
{
$s = " selected=\"selected\"";
}
$forum_sub[$row['forum_sub']][] = "add_select('".$row[forum_id]."','".$row[forum_name]."','$s',".($row[sort_sub]+1).");";
$forum_sub2[$row['forum_sub']][]=$row[forum_id];
}
}
}
$db->sql_freeresult($result);
$sub_list="add_select('-1','".$lang['Select_forum']."','$s',0);";
for( $i=0;$i<count($cat_data);$i++)
{
$s = "";
$cat_id=$cat_data[$i][cat_id];
$sub_list .="add_select('-1',' ','$s',0);";
$sub_list .="add_select('-1','".$cat_data[$i][cat_title]."','$s',0);";
for($j=0;$j<count($forum_data[$cat_id]);$j++)
{
$s = "";
if ($forum_data[$cat_id][$j][forum_id] == $match_forum_id)
{
$s = " selected=\"selected\"";
}
$sub_list .= "add_select('".$forum_data[$cat_id][$j][forum_id]."','".$forum_data[$cat_id][$j][forum_name]."','$s',".($forum_data[$cat_id][$j][sort_sub]+1).");";
if ( count($forum_sub[$forum_data[$cat_id][$j][forum_id]]) > 0 )
{
for($jj=0;$jj<count($forum_sub[$forum_data[$cat_id][$j][forum_id]]);$jj++)
{
$sub_list.= $forum_sub[$forum_data[$cat_id][$j][forum_id]][$jj];
$sub_list.=sub_search($forum_sub2[$forum_data[$cat_id][$j][forum_id]][$jj],$forum_sub,$forum_sub2);
}
}
}
}
$template->set_filenames(array(
'jumpbox' => 'jumpbox.tpl')
);
$template->assign_vars(array(
'L_GO' => $lang['Go'],
'L_JUMP_TO' => $lang['Jump_to'],
'L_SELECT_FORUM' => $lang['Select_forum'],
'JUMP_NAME'=>POST_FORUM_URL,
'S_JUMPBOX_SELECT' => $sub_list,
'S_JUMPBOX_ACTION' => append_sid($action))
);
$template->assign_var_from_handle('JUMPBOX', 'jumpbox');
return;
}
function sub_search($id,$forum_sub,$forum_sub2)
{
if ( count($forum_sub[$id]) > 0 )
{
$list="";
for($jj=0;$jj<count($forum_sub[$id]);$jj++)
{
$list.= $forum_sub[$id][$jj];
$list.=sub_search($forum_sub2[$id][$jj],$forum_sub,$forum_sub2);
}
}
return $list;
}
//forum_sub end
找到======================================
?>
前面?#91;上==================================
function forum_path($forum_row,$forum_id)
{
global $db,$phpEx;
if($forum_row['forum_sub'] > 0)
{
$forum_path="-><a href=".append_sid("viewforum.$phpEx?" . POST_FORUM_URL ."=$forum_id").">".$forum_row['forum_name']."</a>";
$sql="select forum_id,forum_name,forum_sub from ".FORUMS_TABLE." where forum_id=".$forum_row['forum_sub'];
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query forums information', '', __LINE__, __FILE__, $sql);
}
while($row = $db->sql_fetchrow($result))
{
$forum_path="-><a href=".append_sid("viewforum.$phpEx?" . POST_FORUM_URL ."=".$row[forum_id]).">".$row['forum_name']."</a>".$forum_path;
if($row['forum_sub']==0)
{
break;
}
$sql="select forum_id,forum_name,forum_sub from ".FORUMS_TABLE." where forum_id=".$row['forum_sub'];
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query forums information', '', __LINE__, __FILE__, $sql);
}
}
}else
{
$forum_path="-><a href=".append_sid("viewforum.$phpEx?" . POST_FORUM_URL ."=$forum_id").">".$forum_row['forum_name']."</a>";
}
$db->sql_freeresult($result);
unset($row);
unset($forum_row);
return $forum_path;
}
---------------------------------------------------------
打?#125;viewforum.php
找到===============================
make_jumpbox('viewforum.'.$phpEx);
後面?#91;上===========================
//forum_sub start
$forum_path=forum_path($forum_row,$forum_id);
//forum_sub end
找到===============================
'U_VIEW_FORUM' => append_sid("viewforum.$phpEx?" . POST_FORUM_URL ."=$forum_id"),
取代為=============================
'FORUM_PATH' => $forum_path,
找到===============================
//
// End header
//
後面?#91;上===========================
//forum_sub start
$cat_id=$forum_row[cat_id];
$sql = "SELECT f.*, p.post_time, p.post_username, u.username, u.user_id,substring(pt.topic_title,1,18) as topic_title
FROM ((( " . FORUMS_TABLE . " f
LEFT JOIN " . POSTS_TABLE . " p ON p.post_id = f.forum_last_post_id )
LEFT JOIN " . USERS_TABLE . " u ON u.user_id = p.poster_id )
LEFT JOIN " . TOPICS_TABLE . " pt ON pt.topic_id = p.topic_id )
where f.forum_sub =$forum_id or f.sort_sub = ".($forum_row[sort_sub]+2)."
ORDER BY f.cat_id, f.forum_order";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query forums information', '', __LINE__, __FILE__, $sql);
}
$temp_forum_id="";
$forum_data = array();
$forum_sub = array();
while( $row = $db->sql_fetchrow($result) )
{
if($row['sort_sub']==$forum_row['sort_sub']+1)
{
$forum_data[] = $row;
$temp_forum_id.=",".$row[forum_id];
}elseif($row['sort_sub']==$forum_row['sort_sub']+2)
{
if ( $row['forum_status'] == FORUM_LOCKED )
{
$forum_sub[$row['forum_sub']][$row['forum_id']] = '<a href='.append_sid('viewforum.'.$phpEx.'?' . POST_FORUM_URL .'='.$row['forum_id']).'>'. str_replace("<","",$row['forum_name']) . ' </a><img src="http://myweb.hinet.net/home4/iqstar/phpbb/phpbb/icon_minipost_lock.gif" alt="'.$lang['Forum_locked'].'" border="0">';
}else
{
$forum_sub[$row['forum_sub']][$row['forum_id']]='<a href='.append_sid('viewforum.'.$phpEx.'?' . POST_FORUM_URL .'='.$row['forum_id']).'>'. str_replace("<","",$row['forum_name']) . ' </a>';
}
}
}
$db->sql_freeresult($result);
$forum_moderators = array();
if(!empty($temp_forum_id))
{
//
// Find which forums are visible for this user
//
$is_auth_ary = array();
$is_auth_ary = auth(AUTH_VIEW, AUTH_LIST_ALL, $userdata, $forum_data);
$temp_forum_id=substr($temp_forum_id,1,strlen($temp_forum_id));
$sql = "SELECT aa.forum_id, u.user_id, u.username
FROM " . AUTH_ACCESS_TABLE . " aa, " . USER_GROUP_TABLE . " ug, " . GROUPS_TABLE . " g, " . USERS_TABLE . " u
WHERE aa.forum_id in ($temp_forum_id) and aa.auth_mod = " . TRUE . "
AND g.group_single_user = 1
AND ug.group_id = aa.group_id
AND g.group_id = aa.group_id
AND u.user_id = ug.user_id
GROUP BY u.user_id, u.username, aa.forum_id
ORDER BY aa.forum_id, u.user_id";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query forum moderator information', '', __LINE__, __FILE__, $sql);
}
while( $row = $db->sql_fetchrow($result) )
{
$forum_moderators[$row['forum_id']][] = '<option>'. $row['username'] . '</option>';
}
$db->sql_freeresult($result);
if ( $userdata['session_logged_in'] )
{
$sql = "SELECT t.forum_id, t.topic_id, p.post_time
FROM " . TOPICS_TABLE . " t, " . POSTS_TABLE . " p
WHERE p.post_id = t.topic_last_post_id and t.forum_id in ($temp_forum_id)
AND p.post_time > " . $userdata['user_lastvisit'] . "
AND t.topic_moved_id = 0";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query new topic information', '', __LINE__, __FILE__, $sql);
}
$new_topic_data = array();
while( $topic_data = $db->sql_fetchrow($result) )
{
$new_topic_data[$topic_data['forum_id']][$topic_data['topic_id']] = $topic_data['post_time'];
}
$db->sql_freeresult($result);
}
for($j = 0; $j < count($forum_data); $j++)
{
$forum_sub_id = $forum_data[$j]['forum_id'];
if ( $is_auth_ary[$forum_sub_id]['auth_view'] )
{
$template->assign_block_vars('sub_forum',array(
'L_FORUM' => $lang['Forum'],
'L_TOPICS' => $lang['Topics'],
'L_POSTS' => $lang['Posts'],
'L_LASTPOST' => $lang['Last_Post'],
'L_MODERATOR' => $lang['Moderators'])
);
break;
}
}
for($j = 0; $j < count($forum_data); $j++)
{
$forum_sub_id = $forum_data[$j]['forum_id'];//display forum_sub start
if ( $is_auth_ary[$forum_sub_id]['auth_view'] )
{
if ( $forum_data[$j]['forum_status'] == FORUM_LOCKED )
{
$folder_image = $images['forum_locked'];
$folder_alt = $lang['Forum_locked'];
}
else
{
$unread_topics = false;
if ( $userdata['session_logged_in'] )
{
if ( !empty($new_topic_data[$forum_sub_id]) )
{
$forum_last_post_time = 0;
while( list($check_topic_id, $check_post_time) = @each($new_topic_data[$forum_sub_id]) )
{
if ( empty($tracking_topics[$check_topic_id]) )
{
$unread_topics = true;
$forum_last_post_time = max($check_post_time, $forum_last_post_time);
}
else
{
if ( $tracking_topics[$check_topic_id] < $check_post_time )
{
$unread_topics = true;
$forum_last_post_time = max($check_post_time, $forum_last_post_time);
}
}
}
if ( !empty($tracking_forums[$forum_sub_id]) )
{
if ( $tracking_forums[$forum_sub_id] > $forum_last_post_time )
{
$unread_topics = false;
}
}
if ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f_all']) )
{
if ( $HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f_all'] > $forum_last_post_time )
{
$unread_topics = false;
}
}
}
}
$folder_image = ( $unread_topics ) ? $images['forum_new'] : $images['forum'];
$folder_alt = ( $unread_topics ) ? $lang['New_posts'] : $lang['No_new_posts'];
}
$posts = $forum_data[$j]['forum_posts'];
$topics = $forum_data[$j]['forum_topics'];
if ( $forum_data[$j]['forum_last_post_id'] )
{
$last_post_time = create_date($board_config['default_dateformat'], $forum_data[$j]['post_time'], $board_config['board_timezone']);
$last_post = '<table width="100%" align="center"><tr><td align="right"><span class="genmed"><a href="' . append_sid("viewtopic.$phpEx?" . POST_POST_URL . '=' . $forum_data[$j]['forum_last_post_id']) . '#' . $forum_data[$j]['forum_last_post_id'] . '"> '.$forum_data[$j]['topic_title'].' </a>'.'<br />'.$last_post_time . '<br />'.'by ';
$last_post .= ( $forum_data[$j]['user_id'] == ANONYMOUS ) ? ( ($forum_data[$j]['post_username'] != '' ) ? $forum_data[$j]['post_username'] . ' ' : $lang['Guest'] . ' ' ) : '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . '=' . $forum_data[$j]['user_id']) . '">' . $forum_data[$j]['username'] . '</a> </span></td>';
$last_post .= '<td align="right" valign="middle"><img src="' . $images['icon_latest_reply'] . '" border="0" /></td></tr></table>';
}
else
{
$last_post = $lang['No_Posts'];
}
if ( count($forum_moderators[$forum_sub_id]) > 0 )
{
$l_moderators = ( count($forum_moderators[$forum_sub_id]) == 1 ) ? $lang['Moderator'] : $lang['Moderators'];
$moderator_list = implode(', ', $forum_moderators[$forum_sub_id]);
}
else
{
$l_moderators = ' ';
$moderator_list = ' ';
}
if ( count($forum_sub[$forum_sub_id]) > 0 )
{
$forum_sub_list = implode(', ', $forum_sub[$forum_sub_id]);
}
else
{
$forum_sub_list = '';
}
if(!empty($forum_sub_list))
{
$forum_sub_list="子版面 : ".$forum_sub_list;
}
$row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
$row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
$template->assign_block_vars('sub_forum.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'],
'FORUM_NAME_SUB' => $forum_sub_list,
'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_sub_id"))
);
}//display forum_sub end
}
}
//forum_sub end
---------------------------------------------------------
打?#125; viewtopic.php
找到==================================
$sql = "SELECT t.topic_id, t.topic_title, t.topic_status, t.topic_replies, t.topic_time, t.topic_type, t.topic_vote, t.topic_last_post_id, f.forum_name, f.forum_status, f.forum_id, f.auth_view, f.auth_read, f.auth_post, f.auth_reply, f.auth_edit, f.auth_delete, f.auth_sticky, f.auth_announce, f.auth_pollcreate, f.auth_vote, f.auth_attachments " . $count_sql . "
在, f.auth_attachments後面?#91;上==================================
,f.forum_sub
找到==================================
$forum_id = intval($forum_topic_data['forum_id']);
後面?#91;上==================================
//forum_sub start
$forum_path=forum_path($forum_topic_data,$forum_id);
//forum_sub end
找到==================================
'FORUM_ID' => $forum_id,
後面?#91;上==================================
'FORUM_PATH' => $forum_path,
---------------------------------------------------------
打?#125;admin/admin_forums.php
找到========================================
return($catlist);
}
後面?#91;上=====================================
//forum_sub start
function get_sub_list($id)
{
global $db;
$sql="select cat_id,cat_title from ".CATEGORIES_TABLE." order by cat_order ";
if( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, "Couldn't get list of Categories/Forums", "", __LINE__, __FILE__, $sql);
}
$cat_data = array();
while( $row = $db->sql_fetchrow($result) )
{
$cat_data[] = $row;
}
$db->sql_freeresult($result);
$sql = "SELECT cat_id,forum_id,forum_name,sort_sub,forum_sub,main_sub from ".FORUMS_TABLE." ORDER BY cat_id,forum_order";
if( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, "Couldn't get list of Categories/Forums", "", __LINE__, __FILE__, $sql);
}
$forum_data = array();
$forum_sub = array();
$forum_sub2 = array();
while( $row = $db->sql_fetchrow($result) )
{
$s="";
if($row[forum_sub]==0)
{
$forum_data[$row['cat_id']][] = $row;
}
else
{
if ($row[forum_id] == $id)
{
$s = " selected=\"selected\"";
}
$forum_sub[$row['forum_sub']][] = "add_select('".$row[cat_id].",".$row[forum_id].",".$row[sort_sub].",".$row[main_sub]."','".$row[forum_name]."','$s',".($row[sort_sub]+1).");";
$forum_sub2[$row['forum_sub']][]=$row[forum_id];
}
}
$db->sql_freeresult($result);
$sub_list="";
for( $i=0;$i<count($cat_data);$i++)
{
$s = "";
$cat_id=$cat_data[$i][cat_id];
$sub_list .="add_select('".$cat_id.",0,0,0','".$cat_data[$i][cat_title]."','$s',0);";
for($j=0;$j<count($forum_data[$cat_id]);$j++)
{
$s = "";
if ($forum_data[$cat_id][$j][forum_id] == $id)
{
$s = " selected=\"selected\"";
}
$sub_list .= "add_select('".$forum_data[$cat_id][$j][cat_id].",".$forum_data[$cat_id][$j][forum_id].",".$forum_data[$cat_id][$j][sort_sub].",".$forum_data[$cat_id][$j][forum_id]."','".$forum_data[$cat_id][$j][forum_name]."','$s',".($forum_data[$cat_id][$j][sort_sub]+1).");";
if ( count($forum_sub[$forum_data[$cat_id][$j][forum_id]]) > 0 )
{
for($jj=0;$jj<count($forum_sub[$forum_data[$cat_id][$j][forum_id]]);$jj++)
{
$sub_list.= $forum_sub[$forum_data[$cat_id][$j][forum_id]][$jj];
$sub_list.=sub_search($forum_sub2[$forum_data[$cat_id][$j][forum_id]][$jj],$forum_sub,$forum_sub2);
}
}
}
}
return $sub_list;
}
//forum_sub end
找到======================
$catlist = get_list('category', $cat_id, TRUE);
取代為======================
$catlist = get_sub_list($row['forum_id']);
找到======================
while( list($field, $value) = each($forum_auth_ary) )
{
$field_sql .= ", $field";
$value_sql .= ", $value";
}
後面?#91;上==================
//forum_sub start
$forum_set=$HTTP_POST_VARS[POST_CAT_URL];
if(empty($forum_set))
{
message_die(GENERAL_ERROR, "?#93;定錯誤");
}
else
{
$temp=split(",",$forum_set);
$c=intval($temp[0]);
$forum_sub=intval($temp[1]);
if($forum_sub >0 && intval($HTTP_POST_VARS[POST_FORUM_URL])!= $forum_sub)
{
$sort_sub=intval($temp[2])+1;
}else
{
$sort_sub=intval($temp[2]);
}
}
//forum_sub end
找到======================
$sql = "INSERT INTO " . FORUMS_TABLE . " (forum_id, forum_name, cat_id, forum_desc, forum_order, forum_status, prune_enable" . $field_sql . ")
VALUES ('" . $next_id . "', '" . str_replace("\'", "''", $HTTP_POST_VARS['forumname']) . "', " . intval($HTTP_POST_VARS[POST_CAT_URL]) . ", '" . str_replace("\'", "''", $HTTP_POST_VARS['forumdesc']) . "', $next_order, " . intval($HTTP_POST_VARS['forumstatus']) . ", " . intval($HTTP_POST_VARS['prune_enable']) . $value_sql . ")";
取代為=====================
$sql = "INSERT INTO " . FORUMS_TABLE . " (forum_id, forum_name, cat_id, forum_desc, forum_order, forum_status,forum_sub,sort_sub, prune_enable" . $field_sql . ")
VALUES ('" . $next_id . "', '" . str_replace("\'", "''", $HTTP_POST_VARS['forumname']) . "', " . $c . ", '" . str_replace("\'", "''", $HTTP_POST_VARS['forumdesc']) . "', $next_order, " . intval($HTTP_POST_VARS['forumstatus']) . ", " .$forum_sub.",".$sort_sub.",". intval($HTTP_POST_VARS['prune_enable']) . $value_sql . ")";
找到========================
$sql = "UPDATE " . FORUMS_TABLE . "
SET forum_name = '" . str_replace("\'", "''", $HTTP_POST_VARS['forumname']) . "', cat_id = " . intval($HTTP_POST_VARS[POST_CAT_URL]) . ", forum_desc = '" . str_replace("\'", "''", $HTTP_POST_VARS['forumdesc']) . "', forum_status = " . intval($HTTP_POST_VARS['forumstatus']) . ", prune_enable = " . intval($HTTP_POST_VARS['prune_enable']) . "
WHERE forum_id = " . intval($HTTP_POST_VARS[POST_FORUM_URL]);
取代為======================
//forum_sub start
$forum_set=$HTTP_POST_VARS[POST_CAT_URL];
if(empty($forum_set))
{
message_die(GENERAL_ERROR, "?#93;定錯誤");
}
else
{
$sql = "select count(forum_sub) as id from " . FORUMS_TABLE . " WHERE forum_sub = " . intval($HTTP_POST_VARS[POST_FORUM_URL]);
if( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, "?#93;定錯誤");
}
$get_sub_Id = $db->sql_fetchrow($result);
if($get_sub_Id[id]>0)
{
message_die(GENERAL_ERROR, "此版面有其他子版面相連,無法?#93;定成子版面");
}
$temp=split(",",$forum_set);
$c=intval($temp[0]);
$forum_sub=intval($temp[1]);
if(intval($HTTP_POST_VARS[POST_FORUM_URL])== $forum_sub)
{
$sort_sub=intval($temp[2]);
$sql = "UPDATE " . FORUMS_TABLE . "
SET forum_name = '" . str_replace("\'", "''", $HTTP_POST_VARS['forumname']) . "', forum_desc = '" . str_replace("\'", "''", $HTTP_POST_VARS['forumdesc']) . "', forum_status = " . intval($HTTP_POST_VARS['forumstatus']) . ", prune_enable = " . intval($HTTP_POST_VARS['prune_enable']) . "
WHERE forum_id = " . intval($HTTP_POST_VARS[POST_FORUM_URL]);
}else
{
if(intval($temp[1])>0)
{
$sort_sub=intval($temp[2])+1;
}else
{
$sort_sub=intval($temp[2]);
}
$sql = "UPDATE " . FORUMS_TABLE . "
SET forum_name = '" . str_replace("\'", "''", $HTTP_POST_VARS['forumname']) . "', cat_id = " . $c . ", forum_desc = '" . str_replace("\'", "''", $HTTP_POST_VARS['forumdesc']) . "', forum_status = " . intval($HTTP_POST_VARS['forumstatus']) . ", prune_enable = " . intval($HTTP_POST_VARS['prune_enable']) . "
,forum_sub=".$forum_sub.",sort_sub=".$sort_sub."
WHERE forum_id = " . intval($HTTP_POST_VARS[POST_FORUM_URL]);
}
}
if( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, "Couldn't update forum information", "", __LINE__, __FILE__, $sql);
}
//forum_sub end
找到====================
if ($forum_rows[$j]['cat_id'] == $cat_id)
{
後面?#91;上================
if($forum_rows[$j]['forum_sub']>0)
{
$forum_sub="<br>子版面";
}
找到====================
'U_FORUM_MOVE_DOWN' => append_sid("admin_forums.$phpEx?mode=forum_order&move=15&" . POST_FORUM_URL . "=$forum_id"),
後面?#91;上=================
'FORUM_SUB' =>$forum_sub,
---------------------------------------------------------
打?#125; posting.php
找到=================
$forum_name = $post_info['forum_name'];
後面?#91;上===============
$forum_path=forum_path($post_info,$forum_id);
找到=================
'L_POST_A' => $page_title,
'L_POST_SUBJECT' => $lang['Post_subject'],
後面?#91;上===============
'FORUM_PATH' => $forum_path,
---------------------------------------------------------
打?#125; \templates\subSilver\index_body.tpl
找到==================================
{catrow.forumrow.FORUM_DESC}
取代為================================
{catrow.forumrow.FORUM_DESC}<br>{catrow.forumrow.FORUM_NAME_SUB}
---------------------------------------------------------
打?#125; \templates\subSilver\jumpbox.tpl
找到====================================
<form method="get" name="jumpbox" action="{S_JUMPBOX_ACTION}" onSubmit="if(document.jumpbox.f.value == -1){return false;}"><table cellspacing="0" cellpadding="0" border="0">
前面?#91;上=================================
<script language="JavaScript">
function add_select(val,na,s,sort)
{
var temp="";
if(sort>0)
{
na="→ "+na
}
for(var i=0;i<sort;i++)
{
temp+=" ";
}
document.write('<option value="'+val+'" '+s+'>'+temp+na+'</option>');
}
</script>
找到======================================
{S_JUMPBOX_SELECT}
取代為=====================================
<script language="JavaScript">{S_JUMPBOX_SELECT}</script>
---------------------------------------------------------
打?#125; viewforum_body.tpl
找到=======================================
\n -> <a class="nav" href="{U_VIEW_FORUM}">{FORUM_NAME}</a>
取代為=====================================
{FORUM_PATH}
找到=======================================
<table border="0" cellpadding="4" cellspacing="1" width="100%" class="forumline">
<tr>
<th colspan="2" align="center" height="25" class="thCornerL" nowrap="nowrap"> {L_TOPICS} </th>
<th width="50" align="center" class="thTop" nowrap="nowrap"> {L_REPLIES} </th>
<th width="100" align="center" class="thTop" nowrap="nowrap"> {L_AUTHOR} </th>
<th width="50" align="center" class="thTop" nowrap="nowrap"> {L_VIEWS} </th>
<th width="190" align="center" class="thCornerR" nowrap="nowrap"> {L_LASTPOST} </th>
</tr>
前面?#91;上=====================================
<!-- BEGIN sub_forum -->
<table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline">
<tr>
<th colspan="2" class="thCornerL" height="25" nowrap="nowrap"> {L_FORUM} </th>
<th width="50" class="thTop" nowrap="nowrap"> {L_TOPICS} </th>
<th width="50" class="thTop" nowrap="nowrap"> {L_POSTS} </th>
<th class="thCornerR" nowrap="nowrap"> {L_LASTPOST} </th>
</tr>
<!-- BEGIN forumrow -->
<tr>
<td class="row1" align="center" valign="middle" height="50"><img src="{sub_forum.forumrow.FORUM_FOLDER_IMG}" width="46" height="25" alt="{sub_forum.forumrow.L_FORUM_FOLDER_ALT}" title="{sub_forum.forumrow.L_FORUM_FOLDER_ALT}" /></td>
<td class="row1" width="70%" height="50"><span class="forumlink"> <a href="{sub_forum.forumrow.U_VIEWFORUM}" class="forumlink">{sub_forum.forumrow.FORUM_NAME}</a><br />
</span> <span class="genmed">{sub_forum.forumrow.FORUM_DESC}<br />
</span><span class="gensmall">{sub_forum.forumrow.L_MODERATOR} {sub_forum.forumrow.MODERATORS}</span></td>
<td class="row2" align="center" valign="middle" height="50"><span class="gensmall">{sub_forum.forumrow.TOPICS}</span></td>
<td class="row2" align="center" valign="middle" height="50"><span class="gensmall">{sub_forum.forumrow.POSTS}</span></td>
<td class="row2" align="center" valign="middle" height="50" nowrap="nowrap"> <span class="gensmall">{sub_forum.forumrow.LAST_POST}</span></td>
</tr>
<!-- END forumrow -->
</table>
<!-- END sub_forum -->
---------------------------------------------------------
打?#125; \templates\subSilver\viewtopic_body.tpl
找到=================
-> <a class="nav" href="{U_VIEW_FORUM}">{FORUM_NAME}</a>
取代為===============
{FORUM_PATH}
---------------------------------------------------------
打?#125; \templates\subSilver\posting_body.tpl
找到=================
-> <a href="{U_VIEW_FORUM}" class="nav">{FORUM_NAME}</a>
取代為===============
{FORUM_PATH}
---------------------------------------------------------
打?#125; \templates\subSilver\admin\forum_admin_body.tpl
找到==============
{L_MOVE_DOWN}</a>
後面?#91;上===========
{catrow.forumrow.FORUM_SUB}
---------------------------------------------------------
打?#125; \templates\subSilver\admin\forum_edit_body.tpl
找到==================
<p>{L_FORUM_EXPLAIN}</p>
後面?#91;上===============
<script language="JavaScript">
function add_select(val,na,s,sort)
{
\n var temp="";
if(sort>0)
{
na="→ "+na
}
for(var i=0;i<sort;i++)
{
temp+=" ";
}
document.write('<option value="'+val+'" '+s+'>'+temp+na+'</option>');
}
</script>
找到=====================
{S_CAT_LIST}
取代為===================
<script language="JavaScript">{S_CAT_LIST}</script>
#####################################################################
若您安裝過的外掛,有更改過admin/admin_forums.php的內容
在admin/admin_forums.php的修改過程中\r
有兩個步驟請注意
代碼: 選擇全部
$sql = "INSERT INTO " . FORUMS_TABLE . " (forum_id, forum_name, cat_id, forum_desc, forum_order, forum_status, prune_enable" . $field_sql . ")
VALUES ('" . $next_id . "', '" . str_replace("\'", "''", $HTTP_POST_VARS['forumname']) . "', " . intval($HTTP_POST_VARS[POST_CAT_URL]) . ", '" . str_replace("\'", "''", $HTTP_POST_VARS['forumdesc']) . "', $next_order, " . intval($HTTP_POST_VARS['forumstatus']) . ", " . intval($HTTP_POST_VARS['prune_enable']) . $value_sql . ")";
代碼: 選擇全部
$sql = "UPDATE " . FORUMS_TABLE . "
SET forum_name = '" . str_replace("\'", "''", $HTTP_POST_VARS['forumname']) . "', cat_id = " . intval($HTTP_POST_VARS[POST_CAT_URL]) . ", forum_desc = '" . str_replace("\'", "''", $HTTP_POST_VARS['forumdesc']) . "', forum_status = " . intval($HTTP_POST_VARS['forumstatus']) . ", prune_enable = " . intval($HTTP_POST_VARS['prune_enable']) . "
WHERE forum_id = " . intval($HTTP_POST_VARS[POST_FORUM_URL]);
找到==================================
代碼: 選擇全部
$sql = "INSERT INTO " . FORUMS_TABLE . " (forum_id, forum_name, cat_id, forum_desc, forum_order, forum_status, prune_enable" . $field_sql . ")
VALUES ('" . $next_id . "', '" . str_replace("\'", "''", $HTTP_POST_VARS['forumname']) . "', " . intval($HTTP_POST_VARS[POST_CAT_URL]) . ", '" . str_replace("\'", "''", $HTTP_POST_VARS['forumdesc']) . "', $next_order, " . intval($HTTP_POST_VARS['forumstatus']) . ", " . intval($HTTP_POST_VARS['prune_enable']) . $value_sql . ")";
代碼: 選擇全部
, prune_enable
代碼: 選擇全部
,forum_sub,sort_sub
代碼: 選擇全部
.",". intval($HTTP_POST_VARS['prune_enable'])
代碼: 選擇全部
. ", " .$forum_sub.",".$sort_sub.","
找到==================================
代碼: 選擇全部
$sql = "UPDATE " . FORUMS_TABLE . "
SET forum_name = '" . str_replace("\'", "''", $HTTP_POST_VARS['forumname']) . "', cat_id = " . intval($HTTP_POST_VARS[POST_CAT_URL]) . ", forum_desc = '" . str_replace("\'", "''", $HTTP_POST_VARS['forumdesc']) . "', forum_status = " . intval($HTTP_POST_VARS['forumstatus']) . ", prune_enable = " . intval($HTTP_POST_VARS['prune_enable']) . "
WHERE forum_id = " . intval($HTTP_POST_VARS[POST_FORUM_URL]);
代碼: 選擇全部
//forum_sub start
$forum_set=$HTTP_POST_VARS[POST_CAT_URL];
if(empty($forum_set))
{
message_die(GENERAL_ERROR, "?#93;定錯誤");
}
else
{
$sql = "select count(forum_sub) as id from " . FORUMS_TABLE . " WHERE forum_sub = " . intval($HTTP_POST_VARS[POST_FORUM_URL]);
if( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, "?#93;定錯誤");
}
$get_sub_Id = $db->sql_fetchrow($result);
if($get_sub_Id[id]>0)
{
message_die(GENERAL_ERROR, "此版面有其他子版面相連,無法?#93;定成子版面");
}
$temp=split(",",$forum_set);
$c=intval($temp[0]);
$forum_sub=intval($temp[1]);
if(intval($HTTP_POST_VARS[POST_FORUM_URL])== $forum_sub)
{
$sort_sub=intval($temp[2]);
代碼: 選擇全部
}else
{
if(intval($temp[1])>0)
{
$sort_sub=intval($temp[2])+1;
}else
{
$sort_sub=intval($temp[2]);
}
代碼: 選擇全部
intval($HTTP_POST_VARS[POST_CAT_URL])
代碼: 選擇全部
$c
代碼: 選擇全部
, prune_enable = " . intval($HTTP_POST_VARS['prune_enable']) . "
代碼: 選擇全部
,forum_sub=".$forum_sub.",sort_sub=".$sort_sub."
代碼: 選擇全部
}
}
if( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, "Couldn't update forum information", "", __LINE__, __FILE__, $sql);
}
//forum_sub end