Hi, I am trying to modify this message board system called FOG, it's a Smarty template based forum.
I getting the error "Call to a member function add() on a non-object " at the bold line:
What's wrong? $fog_log is defined, I don't understand why it's throwing that error.Code:function FOGErrorHandler($n,$str,$file,$line,$context){ global $fog_log; static $array = array( E_NOTICE => 'Notice', E_WARNING => 'Warning', E_USER_NOTICE => 'User Notice', E_USER_WARNING => 'User Warning', E_USER_ERROR => 'User Error' ); $ns = isset($array[$n])?$array[$n]:(' Error #'.$n); if((FOG_OPTION_DISPLAY_ERRORS || $n === E_USER_ERROR) && ($n != E_NOTICE || $fog_log->level > $fog_log->levels['ERROR'])) echo '<pre>PHP : <strong>',$ns,'</strong> : ',$str,'<br /><em> in file <strong>',$file,'</strong> at line <strong>',$line,'</strong></em></pre>'; if($n !== E_NOTICE){ $s = $str.' <strong>'.$file.'#'.$line.'</strong>'; if($fog_log->level > $fog_log->levels['NOTICE']){ $tmp = debug_backtrace(); if(isset($tmp[0]['args'][4])) //Virer l'argument $context, qui prens trop de place dans le log unset($tmp[0]['args'][4]); $s.= '<br />BackTrace : <br /> '.highlight_string("<?php\n".var_export($tmp,TRUE)."\n?>",TRUE); unset($tmp); } $fog_log->add('ERROR','PHP '.$ns,$s); if($n === E_USER_ERROR) exit('<br /><br />Fatal Error, Aborting...'); } }





Bookmarks