Welcome!
Welcome! ( Recent posts | Mark all | Login | Register )
» Quicksilver Forums » Project » Patches/Additions » [patch] Bringing some sanity ...

[patch] Bringing some sanity to the moderator logs
< Newer Topic :: Older Topic >

Post is unread #1 Aug 14, 2007, 1:21 pm
Go to the bottom of the page Go to the top of the page
Avatar

This member is currently offline matt
Pool Member Level
GroupDevelopers
Posts911
JoinedSep 16, 2005
WWW PM

With about 60,000 odd moderator actions the page in the admincp is rather slow to load, to the point where it is no longer used.

Code:
Index: install/skin_default.xml
===================================================================
--- install/skin_default.xml    (revision 725)
+++ install/skin_default.xml    (working copy)
@@ -502,6 +502,7 @@
       <displayname>View Moderator Logs</displayname>
       <description>Format of the moderator log view</description>
       <html><![CDATA[
+{$pages}
 {$this->table}
  <div class="title">{$this->lang->logs_view}</div>
  <span class="head">
@@ -512,6 +513,7 @@
  </span>
  {$out}
 {$this->etable}
+{$pages}
       ]]></html>
     </template>
     <template><set>logs</set><name>ADMIN_MOD_LOGS_ENTRY</name>
Index: admincp/sources/logs.php
===================================================================
--- admincp/sources/logs.php    (revision 725)
+++ admincp/sources/logs.php    (working copy)
@@ -34,8 +34,17 @@
                $this->set_title($this->lang->logs_view);
                $this->tree($this->lang->logs_view);
 
-               $data = $this->db->query("SELECT l.*, u.user_name FROM %plogs l, %pusers u WHERE u.user_id=l.log_user ORDER BY l.log_time DESC");
+               $data = $this->db->query('SELECT l.*, u.user_name FROM %plogs l, %pusers u WHERE u.user_id=l.log_user ORDER BY l.log_time DESC');
 
+               $this->lang->main();
+
+               $this->get['min'] = array_key_exists( 'min', $this->get ) ? (int)$this->get['min'] : 0;
+               $this->get['num'] = array_key_exists( 'num', $this->get ) ? (int)$this->get['num'] : 60;
+               $pages = $this->htmlwidgets->get_pages( $data, 'a=logs', $this->get['min'], $this->get['num'] );
+
+               $data = $this->db->query('SELECT l.*, u.user_name FROM %plogs l, %pusers u WHERE u.user_id=l.log_user ORDER BY l.log_time DESC LIMIT %d, %d',
+                       $this->get['min'], $this->get['num']);
+
                $this->iterator_init('tablelight', 'tabledark');
 
                $out = null;



This still needs the upgrade to be added in (I'm unsure how this is done with the new skin etc.) .........................
`Nothing stops random n00b questions. Nothing. We are doomed, do you hear me? DOOMED!`
'You need 90 more levels before you can eat this egg....'
       
Post is unread #2 Aug 25, 2007, 10:02 pm
Go to the bottom of the page Go to the top of the page
Avatar

This member is currently offline matt
Pool Member Level
GroupDevelopers
Posts911
JoinedSep 16, 2005
WWW PM

committed in rev 733. .........................
`Nothing stops random n00b questions. Nothing. We are doomed, do you hear me? DOOMED!`
'You need 90 more levels before you can eat this egg....'
       
Pages:<< prev 1 next >>