diff --git a/code/CommentAdmin.php b/code/CommentAdmin.php index f8061c7e..24a1a0bb 100644 --- a/code/CommentAdmin.php +++ b/code/CommentAdmin.php @@ -260,6 +260,27 @@ JS; statusMessage("Accepted $numComments comments."); JS; } + + /** + * Return the number of moderated comments + */ + function NumModerated() { + return DB::query("SELECT COUNT(*) FROM PageComment WHERE !IsSpam AND !NeedsModeration")->value(); + } + + /** + * Return the number of unmoderated comments + */ + function NumUnmoderated() { + return DB::query("SELECT COUNT(*) FROM PageComment WHERE !IsSpam AND NeedsModeration")->value(); + } + + /** + * Return the number of comments marked as spam + */ + function NumSpam() { + return DB::query("SELECT COUNT(*) FROM PageComment WHERE IsSpam")->value(); + } } ?> diff --git a/templates/Includes/CommentAdmin_SiteTree.ss b/templates/Includes/CommentAdmin_SiteTree.ss index 66ff19fc..4b0cef1e 100644 --- a/templates/Includes/CommentAdmin_SiteTree.ss +++ b/templates/Includes/CommentAdmin_SiteTree.ss @@ -2,13 +2,13 @@