]> git.mjollnir.org Git - s9y.git/commitdiff
plugin_comments: URLs of writers may now be shown in the sitebar. This only worked...
authorbrockhaus <brockhaus>
Sat, 12 Jan 2008 13:47:16 +0000 (13:47 +0000)
committerbrockhaus <brockhaus>
Sat, 12 Jan 2008 13:47:16 +0000 (13:47 +0000)
docs/NEWS
plugins/serendipity_plugin_comments/UTF-8/lang_de.inc.php
plugins/serendipity_plugin_comments/lang_de.inc.php
plugins/serendipity_plugin_comments/lang_en.inc.php
plugins/serendipity_plugin_comments/serendipity_plugin_comments.php

index baf4044363cb7219a421424fdc093379ff88d348..58c91caf888e177247daa5fff4894417d921ae89 100644 (file)
--- a/docs/NEWS
+++ b/docs/NEWS
@@ -3,6 +3,11 @@
 Version 1.3 ()
 ------------------------------------------------------------------------
 
+    * Sitebar plugin comments: URLs of writers now are shown for all 
+      entries not only for trackbacks. You may configure if they should
+      be shown for all, none, normal writers or trackback/pingbacks.
+      (brockhaus)
+
     * Pingback/Trackback textfetching: HTML Entities are now converted
       to characters. Character encoding defaults to UTF-8 but can be 
       configured via $serendipity['pingbackEntityEncoding'] = "UTF-8"
index 66a02e5d386796bdd95ca0e778f824df55515789..8e6a1f4d96e05114fcee0c465fedc2c73d28c299 100644 (file)
@@ -8,3 +8,5 @@
         @define('PLUGIN_COMMENTS_MAXENTRIES', 'Anzahl an Kommentaren');
         @define('PLUGIN_COMMENTS_MAXENTRIES_BLAHBLAH', 'Wieviele Kommentare sollen gezeigt werden? (Standard: 15)');
         @define('PLUGIN_COMMENTS_ABOUT', '%s zu%s');
+
+        @define('PLUGIN_COMMENTS_ADDURL', 'Kommentatoren URL anzeigen bei');
index fa2655801192ec8cdfa53a3d1a18d75cb94609be..2265eefdef64b3241e504f7e923eafd44aff4432 100644 (file)
@@ -8,3 +8,5 @@
         @define('PLUGIN_COMMENTS_MAXENTRIES', 'Anzahl an Kommentaren');
         @define('PLUGIN_COMMENTS_MAXENTRIES_BLAHBLAH', 'Wieviele Kommentare sollen gezeigt werden? (Standard: 15)');
         @define('PLUGIN_COMMENTS_ABOUT', '%s zu%s');
+
+        @define('PLUGIN_COMMENTS_ADDURL', 'Kommentatoren URL anzeigen bei');
index 4bc8e073500d5d45d4e8d7742568a77d0ba11a61..fc2490147a1e907c99076b8eac418d00a34aa467 100644 (file)
@@ -15,4 +15,6 @@
 @define('PLUGIN_COMMENTS_MAXENTRIES_BLAHBLAH', 'How many comments will be shown? (Default: 15)');
 @define('PLUGIN_COMMENTS_ABOUT', '%s about%s');
 @define('PLUGIN_COMMENTS_ANONYMOUS', 'anon');
-?>
+
+@define('PLUGIN_COMMENTS_ADDURL', 'Add writers URL to');
+
index fb1218aec5c68e70bbd74e2b2f8dcbaa80aa5e3e..589b086f5eca90683a79fc1b0e6cbed4974ee51d 100644 (file)
@@ -35,12 +35,27 @@ class serendipity_plugin_comments extends serendipity_plugin
                                              'max_chars',
                                              'max_entries',
                                              'dateformat',
-                                             'viewmode'));
+                                             'viewmode',
+                                             'showurls'));
     }
 
     function introspect_config_item($name, &$propbag)
     {
         switch($name) {
+            case 'showurls':
+                $urltypes = array(
+                    'none'       => NONE,
+                    'comments'   => COMMENTS,
+                    'trackbacks' => TRACKBACKS,
+                    'all'        => COMMENTS . ' + ' . TRACKBACKS
+                );
+                $propbag->add('type',        'select');
+                $propbag->add('name',        PLUGIN_COMMENTS_ADDURL);
+                $propbag->add('description', '');
+                $propbag->add('select_values', $urltypes);
+                $propbag->add('default',     'trackbacks');
+                break;
+
             case 'viewmode':
                 $types = array(
                     'comments'   => COMMENTS,
@@ -160,8 +175,11 @@ class serendipity_plugin_comments extends serendipity_plugin
                         $comment .= ' [...]';
                     }
                 }
-
-                if ($row['comment_type'] == 'TRACKBACK' && $row['comment_url'] != '') {
+                
+                $showurls = $this->get_config('showurls','trackbacks');
+                $isTrackBack = $row['comment_type'] == 'TRACKBACK' || $row['comment_type'] == 'PINGBACK';
+                
+                if ($row['comment_url'] != '' && ( ($isTrackBack && ($showurls =='trackbacks' || $showurls =='all') || !$isTrackBack && ($showurls =='comments' || $showurls =='all')))) {
                     $user = '<a class="highlight" href="' . htmlspecialchars(strip_tags($row['comment_url'])) . '" title="' . htmlspecialchars(strip_tags($row['comment_title'])) . '">' . htmlspecialchars(strip_tags($row['user'])) . '</a>';
                 } else {
                     $user = htmlspecialchars(strip_tags($row['user']));