簡易子版面V1.0
http://phpbb-tw.net/phpbb/viewtopic.php ... A%A9%AD%B1
代碼: 選擇全部
打?#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 )
{
$sub_list.= implode(' ', $forum_sub[$forum_data[$cat_id][$j][forum_id]]);
$sub_list.=sub_search($forum_sub2[$forum_data[$cat_id][$j][forum_id]],$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= implode(' ', $forum_sub[$id]);
$list.=sub_search($forum_sub2[$id],$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;
}
---------------------------------------------------------
function make_jumpbox($action, $match_forum_id = 0)
的整個到底到哪裡
目前是用最新版本的PHPBB 2.0.1.6架的
沒裝任何外掛
網址
http://nicecountry.dyndns.tv/phpbb/index.php
請裝過的大大教一下小弟~謝謝