[geeklog-cvs] geeklog: Updated to allow comments with multiple pages to work p...

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Tue Feb 16 11:26:13 EST 2010


changeset 7725:3fffe09ae6cd
url:  http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/3fffe09ae6cd
user: Tom <websitemaster at cogeco.net>
date: Tue Feb 16 11:22:08 2010 -0500
description:
Updated to allow comments with multiple pages to work properly.

diffstat:

 plugins/staticpages/functions.inc |   8 ++++----
 public_html/staticpages/index.php |  15 ++++++++-------
 2 files changed, 12 insertions(+), 11 deletions(-)

diffs (82 lines):

diff -r 9cb9ec9d1341 -r 3fffe09ae6cd plugins/staticpages/functions.inc
--- a/plugins/staticpages/functions.inc	Tue Feb 16 11:17:53 2010 -0500
+++ b/plugins/staticpages/functions.inc	Tue Feb 16 11:22:08 2010 -0500
@@ -276,7 +276,7 @@
 * @return   string                  HTML for the static page
 *
 */
-function SP_displayPage($page, $A, $comment_order = 'ASC', $comment_mode = 'nested', $msg = 0, $query = '')
+function SP_displayPage($page, $A, $comment_order = 'ASC', $comment_mode = 'nested', $comment_page = 1, $msg = 0, $query = '')
 {
     global $_CONF, $_TABLES, $_USER,
            $LANG01, $LANG11, $LANG_STATIC, $_IMAGE_TYPE, $_SP_CONF;
@@ -405,7 +405,7 @@
         require_once $_CONF['path_system'] . 'lib-comment.php';
         $spage->set_var('commentbar',
                         CMT_userComments($page, $A['sp_title'], 'staticpages',
-                                    $comment_order, $comment_mode, 0, 1, false,
+                                    $comment_order, $comment_mode, 0, $comment_page, false,
                                     $delete_option, $A['commentcode']));
     }
 
@@ -600,7 +600,7 @@
 * @return   string                  HTML for the static page
 *
 */
-function SP_returnStaticpage($page='', $mode='', $comment_order = 'ASC', $comment_mode = 'nested', $msg = 0, $query = '')
+function SP_returnStaticpage($page='', $mode='', $comment_order = 'ASC', $comment_mode = 'nested', $comment_page = 1, $msg = 0, $query = '')
 {
     global $_TABLES;
 
@@ -619,7 +619,7 @@
         } elseif ($mode =='autotag') {
             $retval = SP_render_content(stripslashes($retval['sp_content']), $retval['sp_php']);
         } else {
-            $retval = SP_displayPage($page, $retval, $comment_order, $comment_mode, $msg, $query);
+            $retval = SP_displayPage($page, $retval, $comment_order, $comment_mode, $comment_page, $msg, $query);
         }
 
         // increment hit counter for page
diff -r 9cb9ec9d1341 -r 3fffe09ae6cd public_html/staticpages/index.php
--- a/public_html/staticpages/index.php	Tue Feb 16 11:17:53 2010 -0500
+++ b/public_html/staticpages/index.php	Tue Feb 16 11:22:08 2010 -0500
@@ -55,16 +55,16 @@
 $page = COM_applyFilter(COM_getArgument('page'));
 $display_mode = COM_applyFilter(COM_getArgument('disp_mode'));
 $query = '';
-if (isset($_GET['query'])) {
+if (isset($_REQUEST['query'])) {
     $query = COM_applyfilter($_GET['query']);
 }
 
 // from comments display refresh:
-if (isset($_POST['order'])) {
-    $comment_order = COM_applyFilter($_POST['order']);
-    $comment_mode  = COM_applyFilter($_POST['mode']);
-    if (isset($_POST['page'])) {
-        $page = COM_applyFilter($_POST['page']);
+if (isset($_REQUEST['order'])) {
+    $comment_order = COM_applyFilter($_REQUEST['order']);
+    $comment_mode  = COM_applyFilter($_REQUEST['mode']);
+    if (isset($_REQUEST['cpage'])) {
+        $comment_page = COM_applyFilter($_REQUEST['cpage']);
     }
     if ((strcasecmp($comment_order, 'ASC') != 0) &&
             (strcasecmp($comment_order, 'DESC') != 0)) {
@@ -73,6 +73,7 @@
 } else {
     $comment_order = '';
     $comment_mode  = '';
+    $comment_page = 1;
 }
 
 if ($display_mode != 'print') {
@@ -87,7 +88,7 @@
     }
 }
 
-$retval = SP_returnStaticpage($page, $display_mode, $comment_order, $comment_mode, $msg, $query);
+$retval = SP_returnStaticpage($page, $display_mode, $comment_order, $comment_mode, $comment_page, $msg, $query);
 
 if ($display_mode == 'print') {
     header('Content-Type: text/html; charset=' . COM_getCharset());



More information about the geeklog-cvs mailing list