Update of /cvsroot/php-blog/serendipity/plugins/serendipity_event_statistics
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2883
Modified Files:
serendipity_event_statistics.php
Log Message:
Fixed issues reported by Tom, thanks.
Index: serendipity_event_statistics.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/plugins/serendipity_event_statistics/serendipity_event_statistics.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- serendipity_event_statistics.php 29 Mar 2004 07:18:12 -0000 1.3
+++ serendipity_event_statistics.php 30 Mar 2004 08:03:42 -0000 1.4
@@ -4,50 +4,52 @@
case 'de':
@define('PLUGIN_EVENT_STATISTICS_NAME', 'Statistiken');
@define('PLUGIN_EVENT_STATISTICS_DESC', 'Zeigt einen Link zu Statistiken in der Autorenoberfläche');
- @define('PLUGIN_EVENT_OUT_STATISTICS', 'Statistik');
- @define('PLUGIN_EVENT_OUT_FIRST_ENTRY', 'Erster Eintrag');
- @define('PLUGIN_EVENT_OUT_LAST_ENTRY', 'Letzter Eintrag');
- @define('PLUGIN_EVENT_OUT_TOTAL_ENTRIES', 'Insgesamt verfasste Artikel');
- @define('PLUGIN_EVENT_OUT_ENTRIES', 'Artikel');
- @define('PLUGIN_EVENT_OUT_TOTAL_PUBLIC', ' ... davon öffentlich');
- @define('PLUGIN_EVENT_OUT_TOTAL_DRAFTS', ' ... davon Entwürfe');
- @define('PLUGIN_EVENT_OUT_CATEGORIES', 'Vorhandene Kategorien');
- @define('PLUGIN_EVENT_OUT_CATEGORIES2', 'Kategorie(n)');
- @define('PLUGIN_EVENT_OUT_DISTRIBUTION_CATEGORIES', 'Verteilung der Artikel auf Kategorien');
- @define('PLUGIN_EVENT_OUT_DISTRIBUTION_CATEGORIES2', 'eingetragene(r) Artikel');
- @define('PLUGIN_EVENT_OUT_UPLOADED_IMAGES', 'Hochgeladene Bilder');
- @define('PLUGIN_EVENT_OUT_UPLOADED_IMAGES2', 'Bild(er)');
- @define('PLUGIN_EVENT_OUT_DISTRIBUTION_IMAGES', 'Verteilung der Bild-Dateitypen');
- @define('PLUGIN_EVENT_OUT_DISTRIBUTION_IMAGES2', 'vorhandene Datei(en)');
- @define('PLUGIN_EVENT_OUT_COMMENTS', 'Erhaltene Kommentare');
- @define('PLUGIN_EVENT_OUT_COMMENTS2', 'Kommentar(e)');
- @define('PLUGIN_EVENT_OUT_COMMENTS3', 'Top kommentierte Artikel');
- @define('PLUGIN_EVENT_OUT_TOPCOMMENTS', 'Top Kommentatoren');
- @define('PLUGIN_EVENT_OUT_LINK', 'Link');
- @define('PLUGIN_EVENT_OUT_SUBSCRIBERS', 'Abonnenten');
- @define('PLUGIN_EVENT_OUT_SUBSCRIBERS2', 'Abonnent(en)');
- @define('PLUGIN_EVENT_OUT_TOPSUBSCRIBERS', 'Top abonnierte Artikel');
- @define('PLUGIN_EVENT_OUT_TOPSUBSCRIBERS2', 'eingetragene(r) Abonnent(en)');
- @define('PLUGIN_EVENT_OUT_TRACKBACKS', 'Erhaltene Trackbacks');
- @define('PLUGIN_EVENT_OUT_TRACKBACKS2', 'Trackback(s)');
- @define('PLUGIN_EVENT_OUT_TOPTRACKBACK', 'Top Trackback-Artikel');
- @define('PLUGIN_EVENT_OUT_TOPTRACKBACK2', 'eingetragene(r) Trackback(s)');
- @define('PLUGIN_EVENT_OUT_TOPTRACKBACKS3', 'Top Trackbacker');
- @define('PLUGIN_EVENT_OUT_COMMENTS_PER_ARTICLE', 'Durchschnittliche Kommentare pro Artikel');
- @define('PLUGIN_EVENT_OUT_TRACKBACKS_PER_ARTICLE', 'Durchschnittliche Trackbacks pro Artikel');
- @define('PLUGIN_EVENT_OUT_ARTICLES_PER_DAY', 'Durchschnittliche Artikel pro Tag');
- @define('PLUGIN_EVENT_OUT_ARTICLES_PER_WEEK', 'Durchschnittliche Artikel pro Woche');
- @define('PLUGIN_EVENT_OUT_ARTICLES_PER_MONTH', 'Durchschnittliche Artikel pro Monat');
- @define('PLUGIN_EVENT_OUT_COMMENTS_PER_ARTICLE2', 'Kommentare/Artikel');
- @define('PLUGIN_EVENT_OUT_TRACKBACKS_PER_ARTICLE2', 'Trackbacks/Artikel');
- @define('PLUGIN_EVENT_OUT_ARTICLES_PER_DAY2', 'Artikel/Tag');
- @define('PLUGIN_EVENT_OUT_ARTICLES_PER_WEEK2', 'Artikel/Woche');
- @define('PLUGIN_EVENT_OUT_ARTICLES_PER_MONTH2', 'Artikel/Monat');
- @define('PLUGIN_EVENT_OUT_CHARS', 'Menge der verfassten Zeichen');
- @define('PLUGIN_EVENT_OUT_CHARS2', 'Zeichen');
- @define('PLUGIN_EVENT_OUT_CHARS_PER_ARTICLE', 'Zeichen pro Artikel');
- @define('PLUGIN_EVENT_OUT_CHARS_PER_ARTICLE2', 'Zeichen/Artikel');
- @define('PLUGIN_EVENT_OUT_LONGEST_ARTICLES', 'Die %s längsten Artikel');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_STATISTICS', 'Statistik');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_FIRST_ENTRY', 'Erster Eintrag');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_LAST_ENTRY', 'Letzter Eintrag');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_TOTAL_ENTRIES', 'Insgesamt verfasste Artikel');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_ENTRIES', 'Artikel');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_TOTAL_PUBLIC', ' ... davon öffentlich');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_TOTAL_DRAFTS', ' ... davon Entwürfe');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_CATEGORIES', 'Vorhandene Kategorien');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_CATEGORIES2', 'Kategorie(n)');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_DISTRIBUTION_CATEGORIES', 'Verteilung der Artikel auf Kategorien');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_DISTRIBUTION_CATEGORIES2', 'eingetragene(r) Artikel');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_UPLOADED_IMAGES', 'Hochgeladene Bilder');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_UPLOADED_IMAGES2', 'Bild(er)');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_DISTRIBUTION_IMAGES', 'Verteilung der Bild-Dateitypen');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_DISTRIBUTION_IMAGES2', 'vorhandene Datei(en)');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_COMMENTS', 'Erhaltene Kommentare');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_COMMENTS2', 'Kommentar(e)');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_COMMENTS3', 'Top kommentierte Artikel');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_TOPCOMMENTS', 'Top Kommentatoren');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_LINK', 'Link');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_SUBSCRIBERS', 'Abonnenten');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_SUBSCRIBERS2', 'Abonnent(en)');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_TOPSUBSCRIBERS', 'Top abonnierte Artikel');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_TOPSUBSCRIBERS2', 'eingetragene(r) Abonnent(en)');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_TRACKBACKS', 'Erhaltene Trackbacks');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_TRACKBACKS2', 'Trackback(s)');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_TOPTRACKBACK', 'Top Trackback-Artikel');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_TOPTRACKBACK2', 'eingetragene(r) Trackback(s)');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_TOPTRACKBACKS3', 'Top Trackbacker');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_COMMENTS_PER_ARTICLE', 'Durchschnittliche Kommentare pro Artikel');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_TRACKBACKS_PER_ARTICLE', 'Durchschnittliche Trackbacks pro Artikel');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_ARTICLES_PER_DAY', 'Durchschnittliche Artikel pro Tag');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_ARTICLES_PER_WEEK', 'Durchschnittliche Artikel pro Woche');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_ARTICLES_PER_MONTH', 'Durchschnittliche Artikel pro Monat');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_COMMENTS_PER_ARTICLE2', 'Kommentare/Artikel');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_TRACKBACKS_PER_ARTICLE2', 'Trackbacks/Artikel');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_ARTICLES_PER_DAY2', 'Artikel/Tag');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_ARTICLES_PER_WEEK2', 'Artikel/Woche');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_ARTICLES_PER_MONTH2', 'Artikel/Monat');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_CHARS', 'Menge der verfassten Zeichen');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_CHARS2', 'Zeichen');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_CHARS_PER_ARTICLE', 'Zeichen pro Artikel');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_CHARS_PER_ARTICLE2', 'Zeichen/Artikel');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_LONGEST_ARTICLES', 'Die %s längsten Artikel');
+ @define('PLUGIN_EVENT_STATISTICS_MAX_ITEMS', 'Anzahl Einträge');
+ @define('PLUGIN_EVENT_STATISTICS_MAX_ITEMS_DESC', 'Wieviele Einträge sollen pro Wert dargestellt werden? (Standard: 20)');
break;
case 'en':
@@ -55,50 +57,52 @@
default:
@define('PLUGIN_EVENT_STATISTICS_NAME', 'Statistics');
@define('PLUGIN_EVENT_STATISTICS_DESC', 'Display a link to statistics in entries-panel');
- @define('PLUGIN_EVENT_OUT_STATISTICS', 'Statistics');
- @define('PLUGIN_EVENT_OUT_FIRST_ENTRY', 'First entry');
- @define('PLUGIN_EVENT_OUT_LAST_ENTRY', 'Last entry');
- @define('PLUGIN_EVENT_OUT_TOTAL_ENTRIES', 'Total entries');
- @define('PLUGIN_EVENT_OUT_ENTRIES', 'entries');
- @define('PLUGIN_EVENT_OUT_TOTAL_PUBLIC', ' ... public');
- @define('PLUGIN_EVENT_OUT_TOTAL_DRAFTS', ' ... drafts');
- @define('PLUGIN_EVENT_OUT_CATEGORIES', 'Categories');
- @define('PLUGIN_EVENT_OUT_CATEGORIES2', 'categories');
- @define('PLUGIN_EVENT_OUT_DISTRIBUTION_CATEGORIES', 'Distribution of entries');
- @define('PLUGIN_EVENT_OUT_DISTRIBUTION_CATEGORIES2', 'entry');
- @define('PLUGIN_EVENT_OUT_UPLOADED_IMAGES', 'Uploaded images');
- @define('PLUGIN_EVENT_OUT_UPLOADED_IMAGES2', 'image(s)');
- @define('PLUGIN_EVENT_OUT_DISTRIBUTION_IMAGES', 'Distribution of image types');
- @define('PLUGIN_EVENT_OUT_DISTRIBUTION_IMAGES2', 'file(s)');
- @define('PLUGIN_EVENT_OUT_COMMENTS', 'Received comments');
- @define('PLUGIN_EVENT_OUT_COMMENTS2', 'comment(s)');
- @define('PLUGIN_EVENT_OUT_COMMENTS3', 'Most frequently commented entries');
- @define('PLUGIN_EVENT_OUT_TOPCOMMENTS', 'Most frequently commenting people');
- @define('PLUGIN_EVENT_OUT_LINK', 'link');
- @define('PLUGIN_EVENT_OUT_SUBSCRIBERS', 'Subscribers');
- @define('PLUGIN_EVENT_OUT_SUBSCRIBERS2', 'subscriber(s)');
- @define('PLUGIN_EVENT_OUT_TOPSUBSCRIBERS', 'Most frequently subscribed entries');
- @define('PLUGIN_EVENT_OUT_TOPSUBSCRIBERS2', 'subscriber(s)');
- @define('PLUGIN_EVENT_OUT_TRACKBACKS', 'Received trackbacks');
- @define('PLUGIN_EVENT_OUT_TRACKBACKS2', 'trackback(s)');
- @define('PLUGIN_EVENT_OUT_TOPTRACKBACK', 'Most frequently trackbacked entires');
- @define('PLUGIN_EVENT_OUT_TOPTRACKBACK2', 'trackback(s)');
- @define('PLUGIN_EVENT_OUT_TOPTRACKBACKS3', 'Most frequently trackbacking people');
- @define('PLUGIN_EVENT_OUT_COMMENTS_PER_ARTICLE', 'estimated comments per entry');
- @define('PLUGIN_EVENT_OUT_TRACKBACKS_PER_ARTICLE', 'estimated trackbacks per entry');
- @define('PLUGIN_EVENT_OUT_ARTICLES_PER_DAY', 'estimated entries per day');
- @define('PLUGIN_EVENT_OUT_ARTICLES_PER_WEEK', 'estimated entries per week');
- @define('PLUGIN_EVENT_OUT_ARTICLES_PER_MONTH', 'estimated entries per month');
- @define('PLUGIN_EVENT_OUT_COMMENTS_PER_ARTICLE2', 'comments/entries');
- @define('PLUGIN_EVENT_OUT_TRACKBACKS_PER_ARTICLE2', 'trackbacks/entry');
- @define('PLUGIN_EVENT_OUT_ARTICLES_PER_DAY2', 'entries/day');
- @define('PLUGIN_EVENT_OUT_ARTICLES_PER_WEEK2', 'entries/week');
- @define('PLUGIN_EVENT_OUT_ARTICLES_PER_MONTH2', 'entries/month');
- @define('PLUGIN_EVENT_OUT_CHARS', 'Total amount of characters');
- @define('PLUGIN_EVENT_OUT_CHARS2', 'characters');
- @define('PLUGIN_EVENT_OUT_CHARS_PER_ARTICLE', 'Characters per entry');
- @define('PLUGIN_EVENT_OUT_CHARS_PER_ARTICLE2', 'chars/entry');
- @define('PLUGIN_EVENT_OUT_LONGEST_ARTICLES', 'The %s longest entries');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_STATISTICS', 'Statistics');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_FIRST_ENTRY', 'First entry');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_LAST_ENTRY', 'Last entry');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_TOTAL_ENTRIES', 'Total entries');
+ @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_CATEGORIES', 'Categories');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_CATEGORIES2', 'categories');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_DISTRIBUTION_CATEGORIES', 'Distribution of entries');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_DISTRIBUTION_CATEGORIES2', 'entry');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_UPLOADED_IMAGES', 'Uploaded images');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_UPLOADED_IMAGES2', 'image(s)');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_DISTRIBUTION_IMAGES', 'Distribution of image types');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_DISTRIBUTION_IMAGES2', 'file(s)');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_COMMENTS', 'Received comments');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_COMMENTS2', 'comment(s)');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_COMMENTS3', 'Most frequently commented entries');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_TOPCOMMENTS', 'Most frequently commenting people');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_LINK', 'link');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_SUBSCRIBERS', 'Subscribers');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_SUBSCRIBERS2', 'subscriber(s)');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_TOPSUBSCRIBERS', 'Most frequently subscribed entries');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_TOPSUBSCRIBERS2', 'subscriber(s)');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_TRACKBACKS', 'Received trackbacks');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_TRACKBACKS2', 'trackback(s)');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_TOPTRACKBACK', 'Most frequently trackbacked entires');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_TOPTRACKBACK2', 'trackback(s)');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_TOPTRACKBACKS3', 'Most frequently trackbacking people');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_COMMENTS_PER_ARTICLE', 'estimated comments per entry');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_TRACKBACKS_PER_ARTICLE', 'estimated trackbacks per entry');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_ARTICLES_PER_DAY', 'estimated entries per day');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_ARTICLES_PER_WEEK', 'estimated entries per week');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_ARTICLES_PER_MONTH', 'estimated entries per month');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_COMMENTS_PER_ARTICLE2', 'comments/entries');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_TRACKBACKS_PER_ARTICLE2', 'trackbacks/entry');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_ARTICLES_PER_DAY2', 'entries/day');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_ARTICLES_PER_WEEK2', 'entries/week');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_ARTICLES_PER_MONTH2', 'entries/month');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_CHARS', 'Total amount of characters');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_CHARS2', 'characters');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_CHARS_PER_ARTICLE', 'Characters per entry');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_CHARS_PER_ARTICLE2', 'chars/entry');
+ @define('PLUGIN_EVENT_STATISTICS_OUT_LONGEST_ARTICLES', 'The %s longest entries');
+ @define('PLUGIN_EVENT_STATISTICS_MAX_ITEMS', 'Maximum items');
+ @define('PLUGIN_EVENT_STATISTICS_MAX_ITEMS_DESC', 'How many items to display per statistical value? (Default: 20)');
break;
}
@@ -115,10 +119,19 @@
'backend_sidebar_entries_event_display_statistics' => true
));
+ $propbag->add('configuration', array('max_items'));
}
function introspect_config_item($name, &$propbag)
{
+ switch($name) {
+ case 'max_items':
+ $propbag->add('type', 'string');
+ $propbag->add('name', PLUGIN_EVENT_STATISTICS_MAX_ITEMS);
+ $propbag->add('description', PLUGIN_EVENT_STATISTICS_MAX_ITEMS_DESC);
+ break;
+ }
+
return true;
}
@@ -143,6 +156,12 @@
break;
case 'backend_sidebar_entries_event_display_statistics':
+ $max_items = $this->get_config('max_items');
+
+ if (!$max_items || !is_numeric($max_items) || $max_items < 1) {
+ $max_items = 20;
+ }
+
$first_entry = serendipity_db_query("SELECT timestamp FROM {$serendipity['dbPrefix']}entries ORDER BY timestamp ASC limit 1", true);
$last_entry = serendipity_db_query("SELECT timestamp FROM {$serendipity['dbPrefix']}entries ORDER BY timestamp DESC limit 1", true);
$total_count = serendipity_db_query("SELECT count(id) FROM {$serendipity['dbPrefix']}entries", true);
@@ -165,7 +184,8 @@
{$serendipity['dbPrefix']}entries e
WHERE e.id = c.entry_id AND type = 'NORMAL' AND subscribed = 'true'
GROUP BY e.id, c.email
- ORDER BY postings DESC");
+ ORDER BY postings DESC
+ LIMIT $max_items");
$comment_count = serendipity_db_query("SELECT count(id) FROM {$serendipity['dbPrefix']}comments WHERE type = 'NORMAL'", true);
$comment_rows = serendipity_db_query("SELECT e.id, e.title, count(c.id) as postings
@@ -173,13 +193,15 @@
{$serendipity['dbPrefix']}entries e
WHERE e.id = c.entry_id AND type = 'NORMAL'
GROUP BY e.id
- ORDER BY postings DESC");
+ ORDER BY postings DESC
+ LIMIT $max_items");
$commentor_rows = serendipity_db_query("SELECT author, email, url, count(id) as postings
FROM {$serendipity['dbPrefix']}comments c
WHERE type = 'NORMAL'
GROUP BY author
- ORDER BY postings DESC");
+ ORDER BY postings DESC
+ LIMIT $max_items");
$tb_count = serendipity_db_query("SELECT count(id) FROM {$serendipity['dbPrefix']}comments WHERE type = 'TRACKBACK'", true);
$tb_rows = serendipity_db_query("SELECT e.id, e.title, count(c.id) as postings
@@ -187,57 +209,59 @@
{$serendipity['dbPrefix']}entries e
WHERE e.id = c.entry_id AND type = 'TRACKBACK'
GROUP BY e.id
- ORDER BY postings DESC");
+ ORDER BY postings DESC
+ LIMIT $max_items");
$tbr_rows = serendipity_db_query("SELECT author, email, url, count(id) as postings
FROM {$serendipity['dbPrefix']}comments c
WHERE type = 'TRACKBACK'
GROUP BY author
- ORDER BY postings DESC");
+ ORDER BY postings DESC
+ LIMIT $max_items");
$length = serendipity_db_query("SELECT SUM(LENGTH(body) + LENGTH(extended)) FROM {$serendipity['dbPrefix']}entries", true);
- $length_rows = serendipity_db_query("SELECT id, title, (LENGTH(body) + LENGTH(extended)) as full_length FROM {$serendipity['dbPrefix']}entries ORDER BY full_length DESC LIMIT 5");
+ $length_rows = serendipity_db_query("SELECT id, title, (LENGTH(body) + LENGTH(extended)) as full_length FROM {$serendipity['dbPrefix']}entries ORDER BY full_length DESC LIMIT $max_items");
?>
- <h3><?php echo PLUGIN_EVENT_OUT_STATISTICS; ?></h3>
+ <h3><?php echo PLUGIN_EVENT_STATISTICS_OUT_STATISTICS; ?></h3>
<div style="margin: 5px; padding: 5px">
<dl>
- <dt><strong><?php echo PLUGIN_EVENT_OUT_FIRST_ENTRY; ?></strong></dt>
+ <dt><strong><?php echo PLUGIN_EVENT_STATISTICS_OUT_FIRST_ENTRY; ?></strong></dt>
<dd><?php echo ucfirst(strftime(DATE_FORMAT_ENTRY . ' %H:%m', $first_entry[0])); ?></dd>
<br />
- <dt><strong><?php echo PLUGIN_EVENT_OUT_LAST_ENTRY; ?></strong></dt>
+ <dt><strong><?php echo PLUGIN_EVENT_STATISTICS_OUT_LAST_ENTRY; ?></strong></dt>
<dd><?php echo ucfirst(strftime(DATE_FORMAT_ENTRY . ' %H:%m', $last_entry[0])); ?></dd>
<br />
<hr />
<br />
- <dt><strong><?php echo PLUGIN_EVENT_OUT_TOTAL_ENTRIES; ?></strong></dt>
- <dd><?php echo $total_count[0]; ?> <?php echo PLUGIN_EVENT_OUT_ENTRIES; ?></dd>
+ <dt><strong><?php echo PLUGIN_EVENT_STATISTICS_OUT_TOTAL_ENTRIES; ?></strong></dt>
+ <dd><?php echo $total_count[0]; ?> <?php echo PLUGIN_EVENT_STATISTICS_OUT_ENTRIES; ?></dd>
<br />
<dl>
- <dt><strong><?php echo PLUGIN_EVENT_OUT_TOTAL_PUBLIC; ?></strong></dt>
- <dd><?php echo $publish_count[0]; ?> <?php echo PLUGIN_EVENT_OUT_ENTRIES; ?></dd>
- <dt><strong><?php echo PLUGIN_EVENT_OUT_TOTAL_DRAFTS; ?></strong></dt>
- <dd><?php echo $draft_count[0]; ?> <?php echo PLUGIN_EVENT_OUT_ENTRIES; ?></dd>
+ <dt><strong><?php echo PLUGIN_EVENT_STATISTICS_OUT_TOTAL_PUBLIC; ?></strong></dt>
+ <dd><?php echo $publish_count[0]; ?> <?php echo PLUGIN_EVENT_STATISTICS_OUT_ENTRIES; ?></dd>
+ <dt><strong><?php echo PLUGIN_EVENT_STATISTICS_OUT_TOTAL_DRAFTS; ?></strong></dt>
+ <dd><?php echo $draft_count[0]; ?> <?php echo PLUGIN_EVENT_STATISTICS_OUT_ENTRIES; ?></dd>
</dl>
<br />
<hr />
<br />
- <dt><strong><?php echo PLUGIN_EVENT_OUT_CATEGORIES; ?></strong></dt>
- <dd><?php echo $category_count[0]; ?> <?php echo PLUGIN_EVENT_OUT_CATEGORIES2; ?></dd>
+ <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>
<br />
- <dt><strong><?php echo PLUGIN_EVENT_OUT_DISTRIBUTION_CATEGORIES; ?></strong></dt>
+ <dt><strong><?php echo PLUGIN_EVENT_STATISTICS_OUT_DISTRIBUTION_CATEGORIES; ?></strong></dt>
<dl>
<?php
if (is_array($category_rows)) {
foreach($category_rows AS $category => $cat_stat) {
?>
<dt><strong><?php echo $cat_stat['category_name']; ?></strong></dt>
- <dd><?php echo $cat_stat['postings']; ?> <?php echo PLUGIN_EVENT_OUT_DISTRIBUTION_CATEGORIES2; ?></dd>
+ <dd><?php echo $cat_stat['postings']; ?> <?php echo PLUGIN_EVENT_STATISTICS_OUT_DISTRIBUTION_CATEGORIES2; ?></dd>
<?php
}
}
@@ -247,18 +271,18 @@
<hr />
<br />
- <dt><strong><?php echo PLUGIN_EVENT_OUT_UPLOADED_IMAGES; ?></strong></dt>
- <dd><?php echo $image_count[0]; ?> <?php echo PLUGIN_EVENT_OUT_UPLOADED_IMAGES2; ?></dd>
+ <dt><strong><?php echo PLUGIN_EVENT_STATISTICS_OUT_UPLOADED_IMAGES; ?></strong></dt>
+ <dd><?php echo $image_count[0]; ?> <?php echo PLUGIN_EVENT_STATISTICS_OUT_UPLOADED_IMAGES2; ?></dd>
<br />
- <dt><strong><?php echo PLUGIN_EVENT_OUT_DISTRIBUTION_IMAGES; ?></strong></dt>
+ <dt><strong><?php echo PLUGIN_EVENT_STATISTICS_OUT_DISTRIBUTION_IMAGES; ?></strong></dt>
<dl>
<?php
if (is_array($image_rows)) {
foreach($image_rows AS $image => $image_stat) {
?>
<dt><strong><?php echo $image_stat['extension']; ?></strong></dt>
- <dd><?php echo $image_stat['images']; ?> <?php echo PLUGIN_EVENT_OUT_DISTRIBUTION_IMAGES2; ?></dd>
+ <dd><?php echo $image_stat['images']; ?> <?php echo PLUGIN_EVENT_STATISTICS_OUT_DISTRIBUTION_IMAGES2; ?></dd>
<?php
}
}
@@ -268,18 +292,18 @@
<hr />
<br />
- <dt><strong><?php echo PLUGIN_EVENT_OUT_COMMENTS; ?></strong></dt>
- <dd><?php echo $comment_count[0]; ?> <?php echo PLUGIN_EVENT_OUT_COMMENTS2; ?></dd>
+ <dt><strong><?php echo PLUGIN_EVENT_STATISTICS_OUT_COMMENTS; ?></strong></dt>
+ <dd><?php echo $comment_count[0]; ?> <?php echo PLUGIN_EVENT_STATISTICS_OUT_COMMENTS2; ?></dd>
<br />
- <dt><strong><?php echo PLUGIN_EVENT_OUT_COMMENTS3; ?></strong></dt>
+ <dt><strong><?php echo PLUGIN_EVENT_STATISTICS_OUT_COMMENTS3; ?></strong></dt>
<dl>
<?php
if (is_array($comment_rows)) {
foreach($comment_rows AS $comment => $com_stat) {
?>
<dt><strong><a href="<?php echo serendipity_archiveURL($com_stat['id'], $com_stat['title'], 'serendipityHTTPPath'); ?>"><?php echo $com_stat['title']; ?></a></strong></dt>
- <dd><?php echo $com_stat['postings']; ?> <?php echo PLUGIN_EVENT_OUT_COMMENTS2; ?></dd>
+ <dd><?php echo $com_stat['postings']; ?> <?php echo PLUGIN_EVENT_STATISTICS_OUT_COMMENTS2; ?></dd>
<?php
}
}
@@ -287,14 +311,14 @@
</dl>
<br />
- <dt><strong><?php echo PLUGIN_EVENT_OUT_TOPCOMMENTS; ?></strong></dt>
+ <dt><strong><?php echo PLUGIN_EVENT_STATISTICS_OUT_TOPCOMMENTS; ?></strong></dt>
<dl>
<?php
if (is_array($commentor_rows)) {
foreach($commentor_rows AS $comment => $com_stat) {
?>
- <dt><strong><a href="mailto:<?php echo $com_stat['email']; ?>"><?php echo $com_stat['author']; ?></a> (<a href="<?php echo $com_stat['url']; ?>"><?php echo PLUGIN_EVENT_OUT_LINK; ?></a>)</strong></dt>
- <dd><?php echo $com_stat['postings']; ?> <?php echo PLUGIN_EVENT_OUT_COMMENTS2; ?></dd>
+ <dt><strong><a href="mailto:<?php echo $com_stat['email']; ?>"><?php echo $com_stat['author']; ?></a> (<a href="<?php echo $com_stat['url']; ?>"><?php echo PLUGIN_EVENT_STATISTICS_OUT_LINK; ?></a>)</strong></dt>
+ <dd><?php echo $com_stat['postings']; ?> <?php echo PLUGIN_EVENT_STATISTICS_OUT_COMMENTS2; ?></dd>
<?php
}
}
@@ -304,18 +328,18 @@
<hr />
<br />
- <dt><strong><?php echo PLUGIN_EVENT_OUT_SUBSCRIBERS; ?></strong></dt>
- <dd><?php echo $subscriber_count; ?> <?php echo PLUGIN_EVENT_OUT_SUBSCRIBERS2; ?></dd>
+ <dt><strong><?php echo PLUGIN_EVENT_STATISTICS_OUT_SUBSCRIBERS; ?></strong></dt>
+ <dd><?php echo $subscriber_count; ?> <?php echo PLUGIN_EVENT_STATISTICS_OUT_SUBSCRIBERS2; ?></dd>
<br />
- <dt><strong><?php echo PLUGIN_EVENT_OUT_TOPSUBSCRIBERS; ?></strong></dt>
+ <dt><strong><?php echo PLUGIN_EVENT_STATISTICS_OUT_TOPSUBSCRIBERS; ?></strong></dt>
<dl>
<?php
if (is_array($subscriber_rows)) {
foreach($subscriber_rows AS $subscriber => $subscriber_stat) {
?>
<dt><strong><a href="<?php echo serendipity_archiveURL($subscriber_stat['id'], $subscriber_stat['title'], 'serendipityHTTPPath'); ?>"><?php echo $subscriber_stat['title']; ?></a></strong></dt>
- <dd><?php echo $subscriber_stat['postings']; ?> <?php echo PLUGIN_EVENT_OUT_TOPSUBSCRIBERS2; ?></dd>
+ <dd><?php echo $subscriber_stat['postings']; ?> <?php echo PLUGIN_EVENT_STATISTICS_OUT_TOPSUBSCRIBERS2; ?></dd>
<?php
}
}
@@ -325,18 +349,18 @@
<hr />
<br />
- <dt><strong><?php echo PLUGIN_EVENT_OUT_TRACKBACKS; ?></strong></dt>
- <dd><?php echo $tb_count[0]; ?> <?php echo PLUGIN_EVENT_OUT_TRACKBACKS2; ?></dd>
+ <dt><strong><?php echo PLUGIN_EVENT_STATISTICS_OUT_TRACKBACKS; ?></strong></dt>
+ <dd><?php echo $tb_count[0]; ?> <?php echo PLUGIN_EVENT_STATISTICS_OUT_TRACKBACKS2; ?></dd>
<br />
- <dt><strong><?php echo PLUGIN_EVENT_OUT_TOPTRACKBACK; ?></strong></dt>
+ <dt><strong><?php echo PLUGIN_EVENT_STATISTICS_OUT_TOPTRACKBACK; ?></strong></dt>
<dl>
<?php
if (is_array($tb_rows)) {
foreach($tb_rows AS $tb => $tb_stat) {
?>
<dt><strong><a href="<?php echo serendipity_archiveURL($tb_stat['id'], $tb_stat['title'], 'serendipityHTTPPath'); ?>"><?php echo $tb_stat['title']; ?></a></strong></dt>
- <dd><?php echo $tb_stat['postings']; ?> <?php echo PLUGIN_EVENT_OUT_TOPTRACKBACK2; ?></dd>
+ <dd><?php echo $tb_stat['postings']; ?> <?php echo PLUGIN_EVENT_STATISTICS_OUT_TOPTRACKBACK2; ?></dd>
<?php
}
}
@@ -344,14 +368,14 @@
</dl>
<br />
- <dt><strong><?php echo PLUGIN_EVENT_OUT_TOPTRACKBACKS3; ?></strong></dt>
+ <dt><strong><?php echo PLUGIN_EVENT_STATISTICS_OUT_TOPTRACKBACKS3; ?></strong></dt>
<dl>
<?php
if (is_array($tbr_rows)) {
foreach($tbr_rows AS $tb => $tb_stat) {
?>
<dt><strong><a href="mailto:<?php echo $tb_stat['email']; ?>"><?php echo $tb_stat['author']; ?></a> (<a href="<?php echo $tb_stat['url']; ?>">Link</a>)</strong></dt>
- <dd><?php echo $tb_stat['postings']; ?> <?php echo PLUGIN_EVENT_OUT_TOPTRACKBACK2; ?></dd>
+ <dd><?php echo $tb_stat['postings']; ?> <?php echo PLUGIN_EVENT_STATISTICS_OUT_TOPTRACKBACK2; ?></dd>
<?php
}
}
@@ -361,37 +385,37 @@
<hr />
<br />
- <dt><strong><?php echo PLUGIN_EVENT_OUT_COMMENTS_PER_ARTICLE; ?></strong></dt>
- <dd><?php echo round($comment_count[0] / $publish_count[0], 2); ?> <?php echo PLUGIN_EVENT_OUT_COMMENTS_PER_ARTICLE;2 ?></dd>
+ <dt><strong><?php echo PLUGIN_EVENT_STATISTICS_OUT_COMMENTS_PER_ARTICLE; ?></strong></dt>
+ <dd><?php echo round($comment_count[0] / $publish_count[0], 2); ?> <?php echo PLUGIN_EVENT_STATISTICS_OUT_COMMENTS_PER_ARTICLE;2 ?></dd>
<br />
- <dt><strong><?php echo PLUGIN_EVENT_OUT_TRACKBACKS_PER_ARTICLE; ?></strong></dt>
- <dd><?php echo round($tb_count[0] / $publish_count[0], 2); ?> <?php echo PLUGIN_EVENT_OUT_TRACKBACKS_PER_ARTICLE2; ?></dd>
+ <dt><strong><?php echo PLUGIN_EVENT_STATISTICS_OUT_TRACKBACKS_PER_ARTICLE; ?></strong></dt>
+ <dd><?php echo round($tb_count[0] / $publish_count[0], 2); ?> <?php echo PLUGIN_EVENT_STATISTICS_OUT_TRACKBACKS_PER_ARTICLE2; ?></dd>
<br />
- <dt><strong><?php echo PLUGIN_EVENT_OUT_ARTICLES_PER_DAY; ?></strong></dt>
- <dd><?php echo round($publish_count[0] / ((time() - $first_entry[0]) / (60*60*24)), 2);?> <?php echo PLUGIN_EVENT_OUT_ARTICLES_PER_DAY2; ?></dd>
+ <dt><strong><?php echo PLUGIN_EVENT_STATISTICS_OUT_ARTICLES_PER_DAY; ?></strong></dt>
+ <dd><?php echo round($publish_count[0] / ((time() - $first_entry[0]) / (60*60*24)), 2);?> <?php echo PLUGIN_EVENT_STATISTICS_OUT_ARTICLES_PER_DAY2; ?></dd>
<br />
- <dt><strong><?php echo PLUGIN_EVENT_OUT_ARTICLES_PER_WEEK; ?></strong></dt>
- <dd><?php echo round($publish_count[0] / ((time() - $first_entry[0]) / (60*60*24*7)), 2);?> <?php echo PLUGIN_EVENT_OUT_ARTICLES_PER_WEEK2; ?></dd>
+ <dt><strong><?php echo PLUGIN_EVENT_STATISTICS_OUT_ARTICLES_PER_WEEK; ?></strong></dt>
+ <dd><?php echo round($publish_count[0] / ((time() - $first_entry[0]) / (60*60*24*7)), 2);?> <?php echo PLUGIN_EVENT_STATISTICS_OUT_ARTICLES_PER_WEEK2; ?></dd>
<br />
- <dt><strong><?php echo PLUGIN_EVENT_OUT_ARTICLES_PER_MONTH; ?></strong></dt>
- <dd><?php echo round($publish_count[0] / ((time() - $first_entry[0]) / (60*60*24*7*31)), 2);?> <?php echo PLUGIN_EVENT_OUT_ARTICLES_PER_MONTH2; ?></dd>
+ <dt><strong><?php echo PLUGIN_EVENT_STATISTICS_OUT_ARTICLES_PER_MONTH; ?></strong></dt>
+ <dd><?php echo round($publish_count[0] / ((time() - $first_entry[0]) / (60*60*24*31)), 2);?> <?php echo PLUGIN_EVENT_STATISTICS_OUT_ARTICLES_PER_MONTH2; ?></dd>
<br />
<hr />
<br />
- <dt><strong><?php echo PLUGIN_EVENT_OUT_CHARS; ?></strong></dt>
- <dd><?php echo $length[0]; ?> <?php echo PLUGIN_EVENT_OUT_CHARS2; ?></dd>
+ <dt><strong><?php echo PLUGIN_EVENT_STATISTICS_OUT_CHARS; ?></strong></dt>
+ <dd><?php echo $length[0]; ?> <?php echo PLUGIN_EVENT_STATISTICS_OUT_CHARS2; ?></dd>
<br />
- <dt><strong><?php echo PLUGIN_EVENT_OUT_CHARS_PER_ARTICLE; ?></strong></dt>
- <dd><?php echo round($length[0] / $publish_count[0], 2); ?> <?php echo PLUGIN_EVENT_OUT_CHARS_PER_ARTICLE2; ?></dd>
+ <dt><strong><?php echo PLUGIN_EVENT_STATISTICS_OUT_CHARS_PER_ARTICLE; ?></strong></dt>
+ <dd><?php echo round($length[0] / $publish_count[0], 2); ?> <?php echo PLUGIN_EVENT_STATISTICS_OUT_CHARS_PER_ARTICLE2; ?></dd>
<br />
- <dt><strong><?php printf(PLUGIN_EVENT_OUT_LONGEST_ARTICLES, 5); ?></strong></dt>
+ <dt><strong><?php printf(PLUGIN_EVENT_STATISTICS_OUT_LONGEST_ARTICLES, 5); ?></strong></dt>
<br />
<dl>
<?php
@@ -399,7 +423,7 @@
foreach($length_rows AS $tb => $length_stat) {
?>
<dt><strong><a href="<?php echo serendipity_archiveURL($length_stat['id'], $length_stat['title'], 'serendipityHTTPPath'); ?>"><?php echo $length_stat['title']; ?></a></strong></dt>
- <dd><?php echo $length_stat['full_length']; ?> <?php echo PLUGIN_EVENT_OUT_CHARS2; ?></dd>
+ <dd><?php echo $length_stat['full_length']; ?> <?php echo PLUGIN_EVENT_STATISTICS_OUT_CHARS2; ?></dd>
<?php
}
}
|