]> git.mjollnir.org Git - s9y.git/commitdiff
1347639
authorgarvinhicking <garvinhicking>
Mon, 7 Nov 2005 16:22:21 +0000 (16:22 +0000)
committergarvinhicking <garvinhicking>
Mon, 7 Nov 2005 16:22:21 +0000 (16:22 +0000)
docs/NEWS
plugins/serendipity_event_statistics/serendipity_event_statistics.php

index e054dd6b9522f77b7bbcf88bbd9796a899a2549d..0018fa33cbbb8587a313aa106b76e7eaf02050ff 100644 (file)
--- a/docs/NEWS
+++ b/docs/NEWS
@@ -3,6 +3,9 @@
 Version 0.9.1 ()
 ------------------------------------------------------------------------
 
+    * Statistics plugin now contains entries per author. Patch #1347639
+      by SvOlli
+         
     * Fix thumbnail generation for imageMagick when target image is
       smaller than the target size, it should not be blown up
       (garvinhicking)
index 58d30c5e72d4e3dc68e895d43b4f94f9fa0ec41b..c49b32a5f0a72ccad14e2d115dca57ad354925f9 100644 (file)
@@ -15,6 +15,7 @@ if (file_exists($probelang)) {
 @define('PLUGIN_EVENT_STATISTICS_OUT_ENTRIES', 'entries');
 @define('PLUGIN_EVENT_STATISTICS_OUT_TOTAL_PUBLIC', ' ... public');
 @define('PLUGIN_EVENT_STATISTICS_OUT_TOTAL_DRAFTS', ' ... drafts');
+@define('PLUGIN_EVENT_STATISTICS_OUT_PER_AUTHOR', 'Entries per user');
 @define('PLUGIN_EVENT_STATISTICS_OUT_CATEGORIES', 'Categories');
 @define('PLUGIN_EVENT_STATISTICS_OUT_CATEGORIES2', 'categories');
 @define('PLUGIN_EVENT_STATISTICS_OUT_DISTRIBUTION_CATEGORIES', 'Distribution of entries');
@@ -85,7 +86,7 @@ class serendipity_event_statistics extends serendipity_event
         $propbag->add('description',   PLUGIN_EVENT_STATISTICS_DESC);
         $propbag->add('stackable',     false);
         $propbag->add('author',        'Garvin Hicking, Fredrik Sandberg');
-        $propbag->add('version',       '1.22');
+        $propbag->add('version',       '1.23');
         $propbag->add('requirements',  array(
             'serendipity' => '0.8',
             'smarty'      => '2.6.7',
@@ -200,6 +201,7 @@ class serendipity_event_statistics extends serendipity_event
                     $total_count    = serendipity_db_query("SELECT count(id) FROM {$serendipity['dbPrefix']}entries", true);
                     $draft_count    = serendipity_db_query("SELECT count(id) FROM {$serendipity['dbPrefix']}entries WHERE isdraft = 'true'", true);
                     $publish_count  = serendipity_db_query("SELECT count(id) FROM {$serendipity['dbPrefix']}entries WHERE isdraft = 'false'", true);
+                    $author_rows    = serendipity_db_query("SELECT author, count(author) as entries FROM {$serendipity['dbPrefix']}entries GROUP BY author ORDER BY author");
                     $category_count = serendipity_db_query("SELECT count(categoryid) FROM {$serendipity['dbPrefix']}category", true);
                     $cat_sql        = "SELECT c.category_name, count(e.id) as postings
                                                     FROM {$serendipity['dbPrefix']}entrycat ec,
@@ -284,6 +286,23 @@ class serendipity_event_statistics extends serendipity_event
         <br />
         <hr />
         <br />
+        <dt><strong><?php echo PLUGIN_EVENT_STATISTICS_OUT_PER_AUTHOR; ?></strong></dt>
+        <br />
+        <dl>
+<?php
+                    if (is_array($author_rows)) {
+                        foreach($author_rows AS $author => $author_stat) {
+?>
+            <dt><strong><?php echo $author_stat['author']; ?></strong></dt>
+            <dd><?php echo $author_stat['entries']; ?> <?php echo PLUGIN_EVENT_STATISTICS_OUT_ENTRIES; ?></dd>
+<?php
+                        }
+                    }
+?>
+        </dl>
+        <br />
+        <hr />
+        <br />
 
         <dt><strong><?php echo PLUGIN_EVENT_STATISTICS_OUT_CATEGORIES; ?></strong></dt>
         <dd><?php echo $category_count[0]; ?> <?php echo PLUGIN_EVENT_STATISTICS_OUT_CATEGORIES2; ?></dd>