[geeklog-cvs] geeklog: Made the link to a comment's parent object from the com...

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Sat Jun 13 15:33:16 EDT 2009


details:   http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/f6f31488be02
changeset: 7115:f6f31488be02
user:      Dirk Haun <dirk at haun-online.de>
date:      Sat Jun 13 21:18:12 2009 +0200
description:
Made the link to a comment's parent object from the comment bar work properly for plugins

diffstat:

 public_html/docs/history |   2 ++
 system/lib-comment.php   |  44 ++++++++++++++++++++++----------------------
 2 files changed, 24 insertions(+), 22 deletions(-)

diffs (71 lines):

diff -r cf17ba63ceb9 -r f6f31488be02 public_html/docs/history
--- a/public_html/docs/history	Sat Jun 13 18:18:12 2009 +0200
+++ b/public_html/docs/history	Sat Jun 13 21:18:12 2009 +0200
@@ -11,6 +11,8 @@
 + Comment moderation and editable comments, by Jared Wenerd
 
 Changes since 1.6.0b2:
+- Made the link to a comment's parent object from the comment bar work properly
+  for plugins [Dirk]
 - Allow searching by topic (without a query string) again (reported by Markus
   Wollschläger) [Dirk]
 - Fixed handling of $_CONF['comment_close_rec_stories'] (bug #0000899) [Dirk]
diff -r cf17ba63ceb9 -r f6f31488be02 system/lib-comment.php
--- a/system/lib-comment.php	Sat Jun 13 18:18:12 2009 +0200
+++ b/system/lib-comment.php	Sat Jun 13 21:18:12 2009 +0200
@@ -93,33 +93,33 @@
     $cmt_title = stripslashes($title);
     $commentbar->set_var('story_title', $cmt_title);
     // Article's are pre-escaped.
-    if( $type != 'article' ) {
+    if ($type != 'article') {
         $cmt_title = htmlspecialchars($cmt_title);
     }
     $commentbar->set_var('comment_title', $cmt_title);
 
-    if( $type == 'article' ) {
-        $articleUrl = COM_buildUrl( $_CONF['site_url']
-                                    . "/article.php?story=$sid" );
-        $commentbar->set_var( 'story_link', $articleUrl );
-        $commentbar->set_var( 'article_url', $articleUrl );
+    if ($type == 'article') {
+        $articleUrl = COM_buildUrl($_CONF['site_url']
+                                   . "/article.php?story=$sid");
+    } else { // for a plugin
+        /**
+        * Link to plugin defined link or lacking that a generic link
+        * that the plugin should support (hopefully)
+        */
+        list($plgurl, $plgid) = PLG_getCommentUrlId($type);
+        $articleUrl = "$plgurl?$plgid=$sid";
+    }
 
-        if( $page == 'comment.php' ) {
-            $commentbar->set_var('story_link',
-                COM_createLink(
-                    stripslashes( $title ),
-                    $articleUrl,
-                    array('class'=>'non-ul b')
-                )
-            );
-            $commentbar->set_var( 'start_storylink_anchortag', '<a href="'
-                . $articleUrl . '" class="non-ul">' );
-            $commentbar->set_var( 'end_storylink_anchortag', '</a>' );
-        }
-    } else { // for a plugin
-        // Link to plugin defined link or lacking that a generic link that the plugin should support (hopefully)
-        list($plgurl, $plgid) = PLG_getCommentUrlId($type);
-        $commentbar->set_var( 'story_link', "$plgurl?$plgid=$sid" );
+    $commentbar->set_var('article_url', $articleUrl);
+    if ($page == 'comment.php') {
+        $link = COM_createLink($cmt_title, $articleUrl,
+                               array('class' => 'non-ul b'));
+        $commentbar->set_var('story_link', $link);
+        $commentbar->set_var('start_storylink_anchortag',
+                             '<a href="' . $articleUrl . '" class="non-ul">');
+        $commentbar->set_var('end_storylink_anchortag', '</a>');
+    } else {
+        $commentbar->set_var('story_link', $articleUrl);
     }
 
     if( !empty( $_USER['uid'] ) && ( $_USER['uid'] > 1 )) {



More information about the geeklog-cvs mailing list