[geeklog-cvs] geeklog: Add number of comments waiting in the moderation queue ...

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Fri Apr 10 16:17:58 EDT 2009


details:   http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/727097e8a198
changeset: 6908:727097e8a198
user:      Dirk Haun <dirk at haun-online.de>
date:      Fri Apr 10 21:04:16 2009 +0200
description:
Add number of comments waiting in the moderation queue to the Submissions count; hide comment moderation list when disabled

diffstat:

2 files changed, 30 insertions(+), 29 deletions(-)
public_html/admin/moderation.php |   12 +++++----
public_html/lib-common.php       |   47 ++++++++++++++++++--------------------

diffs (96 lines):

diff -r d12ae9331d4d -r 727097e8a198 public_html/admin/moderation.php
--- a/public_html/admin/moderation.php	Fri Apr 10 20:43:59 2009 +0200
+++ b/public_html/admin/moderation.php	Fri Apr 10 21:04:16 2009 +0200
@@ -215,18 +215,20 @@
         $retval .= itemlist('story', $token);
     }
 
-    if (SEC_hasRights('story.edit')) {
-        if ($_CONF['listdraftstories'] == 1) {
+    if ($_CONF['listdraftstories'] == 1) {
+        if (SEC_hasRights('story.edit')) {
             $retval .= draftlist ($token);
         }
     }
     
-    if (SEC_hasRights('comment.moderate')) {
-        $retval .= itemlist('comment', $token);
+    if ($_CONF['commentsubmission'] == 1) {
+        if (SEC_hasRights('comment.moderate')) {
+            $retval .= itemlist('comment', $token);
+        }
     }
 
     if ($_CONF['usersubmission'] == 1) {
-        if (SEC_hasRights ('user.edit') && SEC_hasRights ('user.delete')) {
+        if (SEC_hasRights('user.edit') && SEC_hasRights('user.delete')) {
             $retval .= userlist ($token);
         }
     }
diff -r d12ae9331d4d -r 727097e8a198 public_html/lib-common.php
--- a/public_html/lib-common.php	Fri Apr 10 20:43:59 2009 +0200
+++ b/public_html/lib-common.php	Fri Apr 10 21:04:16 2009 +0200
@@ -2475,40 +2475,39 @@
         }
 
         $modnum = 0;
-        if( SEC_hasRights( 'story.edit,story.moderate', 'OR' ) || (( $_CONF['usersubmission'] == 1 ) && SEC_hasRights( 'user.edit,user.delete' )))
-        {
-
-            if( SEC_hasRights( 'story.moderate' ))
-            {
-                if( empty( $topicsql ))
-                {
-                    $modnum += DB_count( $_TABLES['storysubmission'] );
-                }
-                else
-                {
-                    $sresult = DB_query( "SELECT COUNT(*) AS count FROM {$_TABLES['storysubmission']} WHERE" . $topicsql );
-                    $S = DB_fetchArray( $sresult );
+        if (SEC_hasRights('story.edit,story.moderate', 'OR') ||
+                (($_CONF['commentsubmission'] == 1) &&
+                    SEC_hasRights('comment.moderate')) ||
+                (($_CONF['usersubmission'] == 1) &&
+                    SEC_hasRights('user.edit,user.delete'))) {
+
+            if (SEC_hasRights('story.moderate')) {
+                if (empty($topicsql)) {
+                    $modnum += DB_count($_TABLES['storysubmission']);
+                } else {
+                    $sresult = DB_query("SELECT COUNT(*) AS count FROM {$_TABLES['storysubmission']} WHERE" . $topicsql);
+                    $S = DB_fetchArray($sresult);
                     $modnum += $S['count'];
                 }
             }
 
-            if(( $_CONF['listdraftstories'] == 1 ) && SEC_hasRights( 'story.edit' ))
-            {
+            if (($_CONF['listdraftstories'] == 1) && SEC_hasRights('story.edit')) {
                 $sql = "SELECT COUNT(*) AS count FROM {$_TABLES['stories']} WHERE (draft_flag = 1)";
-                if( !empty( $topicsql ))
-                {
+                if (!empty($topicsql)) {
                     $sql .= ' AND' . $topicsql;
                 }
-                $result = DB_query( $sql . COM_getPermSQL( 'AND', 0, 3 ));
-                $A = DB_fetchArray( $result );
+                $result = DB_query($sql . COM_getPermSQL('AND', 0, 3));
+                $A = DB_fetchArray($result);
                 $modnum += $A['count'];
             }
 
-            if( $_CONF['usersubmission'] == 1 )
-            {
-                if( SEC_hasRights( 'user.edit' ) && SEC_hasRights( 'user.delete' ))
-                {
-                    $modnum += DB_count( $_TABLES['users'], 'status', '2' );
+            if (($_CONF['commentsubmission'] == 1) && SEC_hasRights('comment.moderate')) {
+                $modnum += DB_count($_TABLES['commentsubmissions']);
+            }
+
+            if ($_CONF['usersubmission'] == 1) {
+                if (SEC_hasRights('user.edit') && SEC_hasRights('user.delete')) {
+                    $modnum += DB_count($_TABLES['users'], 'status', '2');
                 }
             }
         }



More information about the geeklog-cvs mailing list