This "mini-mod" will add a "Clear ALL!" button to your syslog page. Clicking the button will truncate the syslog table and refresh the page. Insta-clear syslogs
Hang on boys and girls. Before you get all happy with this suggestion, simply adding this code as described will DELETE your logs by just VISITING the "System Logs" page. This is because this code makes the call to "TRUNCATE..." without clicking on Anything I personally tested this on 2 different sites with 2 different SQL databases. I was wondering, after installing this code, why the logs were there on one visit, and gone the next without clicking on the "red button". My fault, I should have examined the code before adding it. Big bad on my end, but those logs were just test logs anyways.
Just wanted everyone to know this before they add this MOD. Thanks.
EDIT: Now, 2 hours later...
Try this one on for size... Just 2 easy steps...
open /scp/admin.php
Find this code (around line 570):
$nav->addSubMenu(array('desc'=>'System Logs','href'=>'admin.php?t=syslog','iconclass'=>'syslogs'));
Just under that line, add this line:
$nav->addSubMenu(array('desc'=>'Delete All Logs','href'=>'admin.php?t=delsyslog','iconclass'=>'banList'));
You will end up with this:
case 'syslog':
$nav->setTabActive('dashboard');
$nav->addSubMenu(array('desc'=>'System Logs','href'=>'admin.php?t=syslog','iconclass'=>'syslogs'));
$nav->addSubMenu(array('desc'=>'Delete All Logs','href'=>'admin.php?t=delsyslog','iconclass'=>'banList'));
$page='syslogs.inc.php';
break;
Then right under that section, add this code:
case 'delsyslog':
$nav->setTabActive('dashboard');
$nav->addSubMenu(array('desc'=>'System Logs','href'=>'admin.php?t=syslog','iconclass'=>'syslogs'));
$nav->addSubMenu(array('desc'=>'Delete Logs','href'=>'admin.php?t=delsyslog','iconclass'=>'banList'));
mysql_query('TRUNCATE TABLE '.SYSLOG_TABLE.' ');
$page='syslogs.inc.php';
break;
This will add a new link titled 'Delete All Logs' in your 'Dashboard', and when you click on it, it will do just that. It will not give you any note saying that, the logs will just be empty. Any suggestions or improvements are always appreciated. :)