1 頁 (共 1 頁)

[問題] 安裝簡易子版面1.0的問題 ...

發表於 : 2005-04-19 21:21
acc_kang_ta
參考網址:http://phpbb-tw.net/phpbb/viewtopic.php ... A%A9%AD%B1
安裝完後出現這個訊息 ...
Fatal error: Call to a member function on a non-object in c:\appserv\www
x2\includes\functions.php on line 246



我的論壇網址:http://rx2clan.twbbs.org/rx2/portal.php
我的functions.php(是在裝了下面這段才出現上面的問題...)

代碼: 選擇全部

//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','&nbsp;','$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 ) \r
         { 
            $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
這個論壇網址是測試網址 ... 目前只裝了ep

發表於 : 2005-04-20 17:41
p181c
我的安裝後也是出現這個訊息........

發表於 : 2005-04-20 17:45
acc_kang_ta
你也是唷 :oops: ... 阿你也是用iCGstation這個風格嗎 :?:

發表於 : 2005-04-20 18:23
p181c
我適用預設的風格.然後自己修改.我的論壇 http://yung821.why3s.us/

發表於 : 2005-04-20 19:39
acc_kang_ta
你怎麼把論壇最下方的"正體中文語系由 phpbb-tw 維護製作"拿掉了 ... 那是版權耶 :oops:

發表於 : 2005-04-20 19:51
p181c
我安裝成功了.但是在版面中的最下面有一行版面路徑.原本是下拉式選單.結果變成直式的而且還不能點選.請問要如何修改呢.

前往: 選擇一個版面 ☆ ☆ LSTC 管理區 ☆ ☆ LSTC終極藍圖團隊 站務特區 → ● ↓申請註冊,贊助論壇↓ ● ★ ↓天堂網路遊戲 ↓★ → 【 天堂之買賣交易 】  → 太陽神伺服器  → 愛神伺服器  → 勝利女神伺服器

要怎樣才能在改回下拉式的選單呢.我的風格是預設的風格.

發表於 : 2005-04-20 21:31
p181c
請問我要設定子面板的面板長度.請問要修改哪一個檔案呢.

發表於 : 2005-04-21 18:03
acc_kang_ta
p181c 寫:我的安裝後也是出現這個訊息........
那你的iCGstation風格有修改成功嗎 :oops:

發表於 : 2005-04-22 00:07
p181c
安裝完後出現這個訊息 ...
Fatal error: Call to a member function on a non-object in c:\appserv\www
x2\includes\functions.php on line 246

我找到安裝錯誤的問題是在這裡.你修改看看.

打開 \includes\functions.php

找到=================
function make_jumpbox($action, $match_forum_id = 0)
{
global $template, $userdata, $lang, $db, $nav_links, $phpEx, $SID;

// $is_auth = auth(AUTH_VIEW, AUTH_LIST_ALL, $userdata);

$sql = "SELECT c.cat_id, c.cat_title, c.cat_order
FROM " . CATEGORIES_TABLE . " c, " . FORUMS_TABLE . " f
WHERE f.cat_id = c.cat_id
GROUP BY c.cat_id, c.cat_title, c.cat_order
ORDER BY c.cat_order";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, "Couldn't obtain category list.", "", __LINE__, __FILE__, $sql);
}

$category_rows = array();
while ( $row = $db->sql_fetchrow($result) )
{
$category_rows[] = $row;
}

if ( $total_categories = count($category_rows) )
{
$sql = "SELECT *
FROM " . FORUMS_TABLE . "
ORDER BY cat_id, forum_order";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain forums information', '', __LINE__, __FILE__, $sql);
}

$boxstring = '<select name="' . POST_FORUM_URL . '" onchange="if(this.options[this.selectedIndex].value != -1){ forms[\'jumpbox\'].submit() }"><option value="-1">' . $lang['Select_forum'] . '</option>';

$forum_rows = array();
while ( $row = $db->sql_fetchrow($result) )
{
$forum_rows[] = $row;
}

if ( $total_forums = count($forum_rows) )
{
for($i = 0; $i < $total_categories; $i++)
{
$boxstring_forums = '';
for($j = 0; $j < $total_forums; $j++)
{
if ( $forum_rows[$j]['cat_id'] == $category_rows[$i]['cat_id'] && $forum_rows[$j]['auth_view'] <= AUTH_REG )
{

// if ( $forum_rows[$j]['cat_id'] == $category_rows[$i]['cat_id'] && $is_auth[$forum_rows[$j]['forum_id']]['auth_view'] )
// {
$selected = ( $forum_rows[$j]['forum_id'] == $match_forum_id ) ? 'selected="selected"' : '';
$boxstring_forums .= '<option value="' . $forum_rows[$j]['forum_id'] . '"' . $selected . '>' . $forum_rows[$j]['forum_name'] . '</option>';

//
// Add an array to $nav_links for the Mozilla navigation bar.
// 'chapter' and 'forum' can create multiple items, therefore we are using a nested array.
//
$nav_links['chapter forum'][$forum_rows[$j]['forum_id']] = array (
'url' => append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=" . $forum_rows[$j]['forum_id']),
'title' => $forum_rows[$j]['forum_name']
);

}
}

if ( $boxstring_forums != '' )
{
$boxstring .= '<option value="-1">&nbsp;</option>';
$boxstring .= '<option value="-1">' . $category_rows[$i]['cat_title'] . '</option>';
$boxstring .= '<option value="-1">----------------</option>';
$boxstring .= $boxstring_forums;
}
}
}

$boxstring .= '</select>';
}
else
{
$boxstring .= '<select name="' . POST_FORUM_URL . '" onchange="if(this.options[this.selectedIndex].value != -1){ forms[\'jumpbox\'].submit() }"></select>';
}

// Let the jumpbox work again in sites having additional session id checks.
// if ( !empty($SID) )
// {
$boxstring .= '<input type="hidden" name="sid" value="' . $userdata['session_id'] . '" />';
// }

$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'],

'S_JUMPBOX_SELECT' => $boxstring,
'S_JUMPBOX_ACTION' => append_sid($action))
);
$template->assign_var_from_handle('JUMPBOX', 'jumpbox');

return;
}

取代為==========

//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','&nbsp;','$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

找到======================================
?>
前面加上==================================
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;
}

發表於 : 2005-04-28 10:43
acc_kang_ta
感謝大大提供ICG改法...@_@"問題已解決正常運動^^"

發表於 : 2005-07-31 08:55
dexf1
挖把PHPBB-TW拿掉還改成自己的網站ㄝ...

發表於 : 2005-07-31 08:59
Kill
那種人就不需要理他了 :evil:

發表於 : 2005-07-31 11:29
吉川拓也
p181c 寫:我適用預設的風格.然後自己修改.我的論壇 http://yung821.why3s.us/
哇 ! 好利害喔 !
整個論壇都是你自己的團隊製作的唷 :-o
那以後要請你多幫忙了唷 :-P