[geeklog-hg] geeklog: When user clicks link to post a comment it will now jum...

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Sat May 10 11:07:14 EDT 2014


changeset 9529:a8b20ff1f4d2
url:  http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/a8b20ff1f4d2
user: Tom
date: Sat May 10 11:07:00 2014 -0400
description:
When user clicks link to post a comment it will now jump to the comment editor on the new page when config settings are set as "when Comment on Same Page?" = False and "Show Comments at Replying?" = True (bug #0001762)

diffstat:

 public_html/layout/denim/comment/commentbar.thtml            |  10 ++++++--
 public_html/layout/modern_curve/comment/commentbar.thtml     |  14 +++++++----
 public_html/layout/professional/comment/commentbar.thtml     |  10 ++++++--
 public_html/layout/professional_css/comment/commentbar.thtml |  14 +++++++----
 system/lib-comment.php                                       |   6 +++-
 system/lib-story.php                                         |   6 +++++
 6 files changed, 42 insertions(+), 18 deletions(-)

diffs (151 lines):

diff -r b156bcfa9233 -r a8b20ff1f4d2 public_html/layout/denim/comment/commentbar.thtml
--- a/public_html/layout/denim/comment/commentbar.thtml	Sun May 04 19:30:52 2014 -0400
+++ b/public_html/layout/denim/comment/commentbar.thtml	Sat May 10 11:07:00 2014 -0400
@@ -18,9 +18,7 @@
       <input type="hidden" name="{nprefix}type" value="{comment_type}"{xhtml}>
       <input type="hidden" name="title" value="{comment_title}"{xhtml}>
       {hidden_field_reply}
-      <div style="padding:0.3em;{show_link_to_commenteditform}">
-          <a class="button" href="#commenteditform">{lang_reply}</a>
-      </div>
+      {jump_link_for_commenteditform}
     </div>
   </form>
 
@@ -37,4 +35,10 @@
 
 <p class="disclaimer">{lang_disclaimer}</p>
 
+<!-- BEGIN commenteditform_jumplink -->
+      <div style="padding:0.3em;">
+          <a class="button" href="#commenteditform">{lang_reply}</a>
+      </div>
+<!-- END commenteditform_jumplink -->
+
 <!-- } comment/commentbar.thtml -->
diff -r b156bcfa9233 -r a8b20ff1f4d2 public_html/layout/modern_curve/comment/commentbar.thtml
--- a/public_html/layout/modern_curve/comment/commentbar.thtml	Sun May 04 19:30:52 2014 -0400
+++ b/public_html/layout/modern_curve/comment/commentbar.thtml	Sat May 10 11:07:00 2014 -0400
@@ -34,14 +34,18 @@
         <input type="{reply_hidden_or_submit}" name="reply" value="{lang_reply}" class="submit"{xhtml}>
       </li>
     </ul>
-    <div style="{show_link_to_commenteditform}">
-        [
-        <a class="button" href="#commenteditform">{lang_reply}</a>
-        ]
-    </div>
+    {jump_link_for_commenteditform}
   </div>
 </form>
 
 <p class="disclaimer">{lang_disclaimer}</p>
 
+<!-- BEGIN commenteditform_jumplink -->
+    <div>
+        [
+        <a class="button" href="#commenteditform">{lang_reply}</a>
+        ]
+    </div>
+<!-- END commenteditform_jumplink -->
+
 {# end {templatelocation} #}
diff -r b156bcfa9233 -r a8b20ff1f4d2 public_html/layout/professional/comment/commentbar.thtml
--- a/public_html/layout/professional/comment/commentbar.thtml	Sun May 04 19:30:52 2014 -0400
+++ b/public_html/layout/professional/comment/commentbar.thtml	Sat May 10 11:07:00 2014 -0400
@@ -12,9 +12,7 @@
             <input type="hidden" name="{nprefix}type" value="{comment_type}"{xhtml}>
             <input type="hidden" name="title" value="{comment_title}"{xhtml}>
             <input type="{reply_hidden_or_submit}" name="reply" value="{lang_reply}"{xhtml}>
-            <div style="padding:3px;{show_link_to_commenteditform}">
-                <a class="button" href="#commenteditform">{lang_reply}</a>
-            </div>
+            {jump_link_for_commenteditform}
         </div>
     </form>
     <form action="{parent_url}" method="post" class="floatright" style="display:inline;">
@@ -31,3 +29,9 @@
 <div class="commentbar-line3">
     {lang_disclaimer}
 </div>
+
+<!-- BEGIN commenteditform_jumplink -->
+            <div style="padding:3px;">
+                <a class="button" href="#commenteditform">{lang_reply}</a>
+            </div>
+<!-- END commenteditform_jumplink -->
diff -r b156bcfa9233 -r a8b20ff1f4d2 public_html/layout/professional_css/comment/commentbar.thtml
--- a/public_html/layout/professional_css/comment/commentbar.thtml	Sun May 04 19:30:52 2014 -0400
+++ b/public_html/layout/professional_css/comment/commentbar.thtml	Sat May 10 11:07:00 2014 -0400
@@ -35,14 +35,18 @@
         <input type="{reply_hidden_or_submit}" name="reply" value="{lang_reply}" class="submit"{xhtml}>
       </li>
     </ul>
-    <div style="{show_link_to_commenteditform}">
-        [
-        <a class="button" href="#commenteditform">{lang_reply}</a>
-        ]
-    </div>
+    {jump_link_for_commenteditform}
   </div>
 </form>
 
 <p class="disclaimer">{lang_disclaimer}</p>
 
+<!-- BEGIN commenteditform_jumplink -->
+    <div>
+        [
+        <a class="button" href="#commenteditform">{lang_reply}</a>
+        ]
+    </div>
+<!-- END commenteditform_jumplink -->
+
 <!-- } comment/commentbar.thtml -->
diff -r b156bcfa9233 -r a8b20ff1f4d2 system/lib-comment.php
--- a/system/lib-comment.php	Sun May 04 19:30:52 2014 -0400
+++ b/system/lib-comment.php	Sat May 10 11:07:00 2014 -0400
@@ -82,6 +82,7 @@
 
     $commentbar = COM_newTemplate($_CONF['path_layout'] . 'comment');
     $commentbar->set_file( array( 'commentbar' => 'commentbar.thtml' ));
+    $commentbar->set_block('commentbar', 'commenteditform_jumplink');
 
     $commentbar->set_var( 'lang_comments', $LANG01[3] );
     $commentbar->set_var( 'lang_refresh', $LANG01[39] );
@@ -90,10 +91,11 @@
 
     if ( $ccode == 0 && !COMMENT_ON_SAME_PAGE) {
         $commentbar->set_var( 'reply_hidden_or_submit', 'submit' );
-        $commentbar->set_var( 'show_link_to_commenteditform', 'display:none;' );
+        // $commentbar->set_var( 'show_link_to_commenteditform', 'display:none;' );
+        $commentbar->set_var( 'jump_link_for_commenteditform', '' );
     } else {
         $commentbar->set_var( 'reply_hidden_or_submit', 'hidden' );
-        $commentbar->set_var( 'show_link_to_commenteditform', '' );
+		$commentbar->parse( 'jump_link_for_commenteditform', 'commenteditform_jumplink' );
     }
     $commentbar->set_var( 'num_comments', COM_numberFormat( $nrows ));
     $commentbar->set_var( 'comment_type', $type );
diff -r b156bcfa9233 -r a8b20ff1f4d2 system/lib-story.php
--- a/system/lib-story.php	Sun May 04 19:30:52 2014 -0400
+++ b/system/lib-story.php	Sat May 10 11:07:00 2014 -0400
@@ -451,6 +451,9 @@
                         $recent_post_anchortag = COM_createLink($LANG01[60],
                             $_CONF['site_url'] . '/comment.php?sid=' . $story->getSid()
                                 . '&pid=0&type=article');
+						if ($_CONF['show_comments_at_replying'] == true) {
+							$recent_post_anchortag .= '#commenteditform';
+						}
                     }
                 }
                 if( $story->DisplayElements( 'commentcode' ) == 0 )
@@ -461,6 +464,9 @@
                     } else {
                         $postCommentUrl = $_CONF['site_url'] . '/comment.php?sid='
                                     . $story->getSid() . '&pid=0&type=article';
+						if ($_CONF['show_comments_at_replying'] == true) {
+							$postCommentUrl .= '#commenteditform';
+						}
                     }
                     $article->set_var( 'post_comment_link',
                             COM_createLink($LANG01[60], $postCommentUrl,



More information about the geeklog-cvs mailing list