Settings'); $links=array_merge($links,$mylinks); return $links; } function astound_errorsonoff($old=null) { $debug=true; // change to true to debug, false to stop all debugging. if (!$debug) return; if (empty($old)) return set_error_handler("astound_ErrorHandler"); restore_error_handler(); } function astound_ErrorHandler($errno, $errmsg, $filename, $linenum, $vars) { // write the answers to the file // we are only concerned with the errors and warnings, not the notices //if ($errno==E_NOTICE || $errno==E_WARNING) return false; //if ($errno==2048) return; // wordpress throws deprecated all over the place. $serrno=""; if ( (strpos($filename,'kpg')===false) &&(strpos($filename,'admin-options')===false) &&(strpos($filename,'mu-options')===false) &&(strpos($filename,'stop-spam')===false) &&(strpos($filename,'sfr_mu')===false) &&(strpos($filename,'settings.php')===false) &&(strpos($filename,'options-general.php')===false) ) return false; switch ($errno) { case E_ERROR: $serrno="Fatal run-time errors. These indicate errors that can not be recovered from, such as a memory allocation problem. Execution of the script is halted. "; break; case E_WARNING: $serrno="Run-time warnings (non-fatal errors). Execution of the script is not halted. "; break; case E_NOTICE: $serrno="Run-time notices. Indicate that the script encountered something that could indicate an error, but could also happen in the normal course of running a script. "; break; default; $serrno="Unknown Error type $errno"; } if (strpos($errmsg,'modify header information')) return false; $now=date('Y/m/d H:i:s',time() + ( get_option( 'gmt_offset' ) * 3600 )); $m1=memory_get_usage(true); $m2=memory_get_peak_usage(true); $ip=kpg_get_ip(); $msg=" Time: $now Error number: $errno Error type: $serrno Error Msg: $errmsg IP address: $ip File name: $filename Line Number: $linenum Memory used, peak: $m1, $m2 --------------------- "; // write out the error astound_log($msg); return false; } ?>