? 324530-perm-name-16-D6.patch
? 418524-moderator-stats-4.patch
? 418524-moderator-stats-6.patch
? 668900-double-message-2.patch
? 715838-pgsql-7.patch
? 729960-modr8-node-save-3.patch
? 729960-modr8-node-save-6.patch
? 729960-modr8-node-save-8-D5.patch
? cleanup-modr8-450142-6-D6.patch
Index: modr8.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/modr8/modr8.install,v
retrieving revision 1.4
diff -u -p -r1.4 modr8.install
--- modr8.install	9 Apr 2008 01:38:31 -0000	1.4
+++ modr8.install	2 Apr 2010 01:42:25 -0000
@@ -70,3 +70,13 @@ function modr8_update_1000() {
   db_create_table($ret, $name, $table);
   return $ret;
 }
+
+/**
+ * Fix index for new block.
+ */
+function modr8_update_6001() {
+  $ret = array();
+  db_drop_index($ret, 'modr8_log', 'action');
+  db_add_index($ret, 'modr8_log', 'time_action', array('timestamp', 'action'));
+  return $ret;
+}
Index: modr8.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/modr8/modr8.module,v
retrieving revision 1.31
diff -u -p -r1.31 modr8.module
--- modr8.module	2 Apr 2010 00:53:33 -0000	1.31
+++ modr8.module	2 Apr 2010 01:42:25 -0000
@@ -251,10 +251,23 @@ function modr8_cron() {
 function modr8_block($op = 'list', $delta = 0) {
   if ($op == 'list') {
     $blocks[0]['info'] = t("Modr8 moderator's block");
+    $blocks['modr8-moderators']['info'] = t("Modr8 moderators credit list");
     return $blocks;
   }
   elseif ($op == 'view') {
-    if (user_access('moderate content')) {
+    if ($delta == 'modr8-moderators') {
+      $block['subject'] = t('Top moderators');
+      $cutoff = strtotime('now -6 months');
+      $result = db_query_range("SELECT COUNT(ml.modid) AS number, u.* FROM {modr8_log} ml INNER JOIN {users} u on u.uid = ml.uid WHERE ml.action != 'Response' AND ml.timestamp > %d AND u.status = 1 GROUP BY u.uid ORDER BY number DESC", $cutoff, 0, variable_get('modr8_top_moderators_limit', 10));
+      $header = array(t('User'), t('Number of actions'));
+      $rows = array();
+      while ($account = db_fetch_object($result)) {
+        $rows[] = array(theme('username', $account), $account->number);
+      }
+      $block['content'] = t('Last 6 months:') . '<br />' . theme('table', $header, $rows);
+      return $block;
+    }
+    elseif (user_access('moderate content')) {
       $block['subject'] = t('Moderation queue');
       $is_published = '';
       if (!user_access('administer nodes')) {
