2012-08-13 80 views
0

已經有5天了,仍然不知道問題出在哪裏!所以我在這裏發佈錯誤和整個代碼。希望有人能幫助!我會非常感激。致命錯誤:調用一個非對象的成員函數Show_LastRec_Pack()

Fatal error: Call to a member function Show_LastRec_Pack() on a non-object in packgames.php on line 69 

這裏的 「packgames.php」:

<? 
/** 
* Block Last Rec Pack 
**/ 
define ('PACK_GAMES_TO_SHOW', 3); 

require_once ('recmod/constants.php'); 

$query = "SELECT r.*, pp.topic_id, p.Nick, b.*, p.Rating 
      FROM " . TABLE_RECGAMES . " r, " . $this->db->obj['sql_tbl_prefix'] . "attachments a, " . $this->db->obj['sql_tbl_prefix'] . "posts pp, 
       " . TABLE_PLAYERS." p, recs_aoc_flags b 
      WHERE a.attach_id = r.attach_id 
       AND a.attach_rel_id = pp.pid 
       AND r.Id_Player > 0 
       AND p.Id_Player = r.Id_Player 
       AND b.flag_id = p.flag_id 
      ORDER BY r.Id_RecordedGame DESC 
      LIMIT " . PACK_GAMES_TO_SHOW; 

$this->DB->query($query);  
$packs = array(); 
while ($player = $this->DB->fetch()) 
{ 
    $flag = '<img src="' . PATH_FLAGS . $player['flag_image'] . '" alt="'.$player['flag_country'].'" title="' . $player['flag_country'] . '" align="absmiddle" border="0">'; 

    $packs[] = array (
     'GAMES' => $player['Players'], 
     'PLAYER' => $player['Nick'], 
     'FLAG' => $flag, 
     'RATING' => $player['Rating'], 
     'ID_POST' => $player['topic_id'] 
    ); 
} 
$tmp = $this->registry->getClass('output')->getTemplate('recgames')->Show_LastRec_Pack ($packs);  
echo $tmp; 
?> 

回答

0

不管這個對象調用模板返回,它不是一個對象。在調用鏈上做一些var_dumps(),找出返回null或其他非對象的位置。最有可能在getTemplate()

+0

謝謝您的回覆!我試過了:echo var_dump($ tmp);但無濟於事!它在這條線上一直提醒同樣的錯誤: $ tmp = $ this-> registry-> getClass('output') - > getTemplate('recgames') - > Show_LastRec_Pack($ packs); – 2012-08-13 05:43:31

相關問題