[問題] 簡易子版面V1.0安裝發生了問題...

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

版主: 版主管理群

主題已鎖定
masakasu
星球普通子民
星球普通子民
文章: 18
註冊時間: 2004-11-08 23:06

[問題] 簡易子版面V1.0安裝發生了問題...

文章 masakasu »

感謝心靈捕手大大的提醒...我修改一下

參考連結:http://phpbb-tw.net/phpbb/viewtopic.php?t=33019
PHP版本:phpBB2.10.11
論壇位置:http://mba.nccu.edu.tw/~yylee/ (安裝失敗後我就把MOD拿下來了)
安裝前已安裝的MOD有attach mod & board msg xl
安裝完了之後出現下列錯誤訊息\r

代碼: 選擇全部

Fatal error: Call to a member function on a non-object in /home/yylee/public_html/includes/functions.php on line 224
由於小弟我對語言不熟特地上來請教大家到底發生什麼問題了呢??
functions.php 224行左右的程式語言

代碼: 選擇全部

{
	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;
	}
第224行就是以if ( !($result = $db->sql_query($sql)) )開頭那段
請大家救救我....
最後由 masakasu 於 2005-03-10 13:52 編輯,總共編輯了 1 次。
頭像
心靈捕手
默默耕耘的老師
默默耕耘的老師
文章: 8547
註冊時間: 2004-04-30 01:54
來自: Taiwan

Re: [問題] 簡易子版面V1.0安裝發生了問題...

文章 心靈捕手 »

masakasu 寫:參考連結:http://phpbb-tw.net/phpbb/viewtopic.php?t=33019
安裝前已安裝的MOD有attach mod & board msg xl
安裝完了之後出現下列錯誤訊息\r

代碼: 選擇全部

Fatal error: Call to a member function on a non-object in /home/yylee/public_html/includes/functions.php on line 224
由於小弟我對語言不熟特地上來請教大家到底發生什麼問題了呢??
\n以下是functions.php 224行左右的圖片
圖檔

請大家救救我....
建議您再多補充下列訊息:
  • 您的 phpbb 版本?
  • 您的論壇位址?
  • 請貼出該檔案( functions.php) 該行( 224 行) 上下 10 行程式碼( 勿用" 圖片" 顯示).
如此一來, 可能更有助於解答您的問題. :-)
施比受有福,祝福您好運! ^_^
歡迎光臨★★心靈捕手★★ :: 討論區
https://wang5555.dnsfor.me/phpBB3/
masakasu
星球普通子民
星球普通子民
文章: 18
註冊時間: 2004-11-08 23:06

文章 masakasu »

經過心靈捕手的提醒補上了一些其他的訊息\r
自推一下~~
請各位先進幫我看看是不是哪裡出錯了,謝謝
頭像
心靈捕手
默默耕耘的老師
默默耕耘的老師
文章: 8547
註冊時間: 2004-04-30 01:54
來自: Taiwan

文章 心靈捕手 »

masakasu 寫:經過心靈捕手的提醒補上了一些其他的訊息\r
自推一下~~
請各位先進幫我看看是不是哪裡出錯了,謝謝
我猜想是您在安裝該外掛時候出了差錯\r
以下是該外掛該檔案的修正部份說明
資料來源:
http://phpbb-tw.net/phpbb/viewtopic.php?t=33019

代碼: 選擇全部

打開 \includes\functions.php 

找到================= 
[color=red][b]function make_jumpbox($action, $match_forum_id = 0) 
{ 
.................... 
.................... 
.................... 
}[/b][/color] 

將整個 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','&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 
如果您按此作修正的話(將紅字部分全部取代),
那麼應該就不會再出現上頭的錯誤訊息了. :-)
施比受有福,祝福您好運! ^_^
歡迎光臨★★心靈捕手★★ :: 討論區
https://wang5555.dnsfor.me/phpBB3/
主題已鎖定

回到「外掛問題討論」