X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;ds=sidebyside;f=nucleus%2Flibs%2FACTIONLOG.php;fp=nucleus%2Flibs%2FACTIONLOG.php;h=0000000000000000000000000000000000000000;hb=de619b6a58b1cfb0a63a70fff2fc93a7452a8698;hp=57d15e1251a63aeef64c7146bebc5013b1033703;hpb=2aea8996769a2e7b80b250d03e66e6ac19b0d540;p=nucleus-jp%2Fnucleus-jp-ancient.git diff --git a/nucleus/libs/ACTIONLOG.php b/nucleus/libs/ACTIONLOG.php deleted file mode 100755 index 57d15e1..0000000 --- a/nucleus/libs/ACTIONLOG.php +++ /dev/null @@ -1,88 +0,0 @@ -isLoggedIn()) - $message = "[" . $member->getDisplayName() . "] " . $message; - - $message = sql_real_escape_string($message); // add slashes - $timestamp = date("Y-m-d H:i:s",time()); // format timestamp - $query = "INSERT INTO " . sql_table('actionlog') . " (timestamp, message) VALUES ('$timestamp', '$message')"; - - sql_query($query); - - ACTIONLOG::trimLog(); - } - - /** - * (Static) Method to clear the whole action log - */ - function clear() { - global $manager; - - $query = 'DELETE FROM ' . sql_table('actionlog'); - - $manager->notify('ActionLogCleared',array()); - - return sql_query($query); - } - - /** - * (Static) Method to trim the action log (from over 500 back to 250 entries) - */ - function trimLog() { - static $checked = 0; - - // only check once per run - if ($checked) return; - - // trim - $checked = 1; - - $iTotal = quickQuery('SELECT COUNT(*) AS result FROM ' . sql_table('actionlog')); - - // if size > 500, drop back to about 250 - $iMaxSize = 500; - $iDropSize = 250; - if ($iTotal > $iMaxSize) { - $tsChop = quickQuery('SELECT timestamp as result FROM ' . sql_table('actionlog') . ' ORDER BY timestamp DESC LIMIT '.$iDropSize.',1'); - sql_query('DELETE FROM ' . sql_table('actionlog') . ' WHERE timestamp < \'' . $tsChop . '\''); - } - - } - -} - -?> \ No newline at end of file