This is a simple mod, just to log errors.
SQL's
[mysql]CREATE TABLE IF NOT EXISTS `error_logs` (
`ID` INT(11) NOT NULL auto_increment,
`Time` INT(11) NOT NULL,
`Error` VARCHAR(225) NOT NULL,
`Query` TEXT NOT NULL,
PRIMARY KEY(`ID`)
) auto_increment=1;[/mysql]
Then open your databse class diver
find
function query_error()
{
after the bracket add this:
$this->log_error(mysql_error());
Then after that whole function (or before the
?>
)
add this:
<?php //not this :P
function log_error($mysql_error) {
$this->query("INSERT INTO `error_logs` VALUES('', unix_timestamp(), '".addslashes($mysql_error)."', '".addslashes($this->last_query)."');");
}
Open Staff_logs.php beofre
?>
add this:
<?php //not this
function error_logs() {
global $db;
echo'<center><h3>Error Logs</h3></center>
<table width=100% cellspacing="1" class="table">
<tr>
<th>ID</th>
<th>Time</th>
<th>Mysql Error</th>
<th>Query</th>
<th>Page</th>
</tr>';
$get_errors = $db->query("SELECT * FROM `error_logs` ORDER BY `ID`;");
while($error = $db->fetch_row($get_error)) {
echo'<tr>
<td>'.number_format($error['ID']).'</td>
<td>'.date('F j Y', $error['Time']).'
'.date('g:i:s a', $error['Time']).'</td>
<td>'.$error['Error'].'</td>
<td>'.$error['Query'].'</td>
<td>'.$error['Page'].'</td>
</tr>';
}
echo'</table>';
stafflog_add("Viewed the error logs.");
}
Its a simple table, no pagnation, because i simple cbb :P
open smenu, find staff logs link, add this before/after:
(still in the same print statment)
> Error Logs