From c33ec2baf89e15b3bafd10d573990e86ddf94227 Mon Sep 17 00:00:00 2001 From: garvinhicking Date: Fri, 9 Jun 2006 10:25:07 +0000 Subject: [PATCH] Plugin improvements by SVOlli: Show author names and percantage --- .../serendipity_event_statistics.php | 4 ++-- .../serendipity_plugin_history/lang_en.inc.php | 3 +-- .../serendipity_plugin_history.php | 16 +++++++++++++--- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/plugins/serendipity_event_statistics/serendipity_event_statistics.php b/plugins/serendipity_event_statistics/serendipity_event_statistics.php index a766852..8427888 100644 --- a/plugins/serendipity_event_statistics/serendipity_event_statistics.php +++ b/plugins/serendipity_event_statistics/serendipity_event_statistics.php @@ -20,7 +20,7 @@ class serendipity_event_statistics extends serendipity_event $propbag->add('description', PLUGIN_EVENT_STATISTICS_DESC); $propbag->add('stackable', false); $propbag->add('author', 'Arnan de Gans, Garvin Hicking, Fredrik Sandberg'); - $propbag->add('version', '1.42'); + $propbag->add('version', '1.43'); $propbag->add('requirements', array( 'serendipity' => '0.8', 'smarty' => '2.6.7', @@ -302,7 +302,7 @@ class serendipity_event_statistics extends serendipity_event foreach($author_rows AS $author => $author_stat) { ?>
-
+
(%)
+@define('PLUGIN_HISTORY_DISPLAYAUTHOR', 'Show author\'s name'); diff --git a/plugins/serendipity_plugin_history/serendipity_plugin_history.php b/plugins/serendipity_plugin_history/serendipity_plugin_history.php index db7cc97..64f1a9c 100644 --- a/plugins/serendipity_plugin_history/serendipity_plugin_history.php +++ b/plugins/serendipity_plugin_history/serendipity_plugin_history.php @@ -22,7 +22,7 @@ class serendipity_plugin_history extends serendipity_plugin $propbag->add('description', PLUGIN_HISTORY_DESC); $propbag->add('stackable', true); $propbag->add('author', 'Jannis Hermanns'); - $propbag->add('version', '1.1'); + $propbag->add('version', '1.2'); $propbag->add('requirements', array( 'serendipity' => '0.8', 'smarty' => '2.6.7', @@ -40,6 +40,7 @@ class serendipity_plugin_history extends serendipity_plugin 'full', 'amount', 'displaydate', + 'displayauthor', 'dateformat')); } @@ -109,6 +110,13 @@ class serendipity_plugin_history extends serendipity_plugin $propbag->add('select_values', array('false','true')); $propbag->add('default', 'true'); break; + case 'displayauthor': + $propbag->add('type', 'select'); + $propbag->add('name', PLUGIN_HISTORY_DISPLAYAUTHOR); + $propbag->add('description', ''); + $propbag->add('select_values', array('false','true')); + $propbag->add('default', 'false'); + break; case 'dateformat': $propbag->add('type', 'string'); $propbag->add('name', GENERAL_PLUGIN_DATEFORMAT); @@ -135,6 +143,7 @@ class serendipity_plugin_history extends serendipity_plugin $displaydate = $this->get_config('displaydate', 'true'); $dateformat = $this->get_config('dateformat'); $full = ($this->get_config('full', 'false') != 'true') ? false : true; + $displayauthor = serendipity_db_bool($this->get_config('displayauthor', false)); if (!is_numeric($min_age) || $min_age < 0 || $specialage == 'year') { $min_age = 365 + date('L', serendipity_serverOffsetHour()); @@ -177,11 +186,12 @@ class serendipity_plugin_history extends serendipity_plugin true, array('timestamp' => $e[$x]['timestamp']) ); - $date = ($displaydate=='0') ? '' : serendipity_strftime($dateformat,$e[$x]['timestamp']); + $date = ($displaydate=='0') ? '' : serendipity_strftime($dateformat,$e[$x]['timestamp']); + $author = ($displayauthor) ? $e[$x]['author'] . ': ' : ''; $t = ($maxlength==0 || strlen($e[$x]['title'])<=$maxlength) ? $e[$x]['title'] : (trim(serendipity_mb('substr', $e[$x]['title'], 0, $maxlength-3)).' [...]'); - echo $date . "".$t." " . + echo $author . $date . "".$t." " . strip_tags($e[$x]['body']) . '
'; } echo $outro; -- 2.39.5