[geeklog-devel] [PATCH] Allow the comment form to be displayed regardless of speed limit

Andrew Church achurch at achurch.org
Tue Sep 4 18:02:05 EDT 2007


Per request by PJ of Groklaw, I'd like to submit the following patch
(against 1.4.1, but also applies correctly to current CVS) to Geeklog;
the patch which is intended to allow users to display the comment
submission form even before the "speed limit" timeout expires, rather
than forcing them to wait for that period before being able to start
typing a new comment.  For clarity, the patch does not correct
indentation between the two deleted hunks.

It looks like relying on the speed limit test at comment submission time
will generate a log message whenever the test fails, so it may also be
desirable to remove the following lines (at system/lib-comment.php:827
before patching):
        COM_errorLog("CMT_saveComment: $uid from {$_SERVER['REMOTE_ADDR']} tried "
                   . 'to submit a comment before the speed limit expired');


Note that this is my first encounter with the Geeklog source, and I don't
have a local installation with which to test, so please take this patch
with a grain of salt.

  --Andrew Church
    achurch at achurch.org
    http://achurch.org/

---------------------------------------------------------------------------

--- geeklog-1.4.1/system/lib-comment.php.old	2006-12-10 07:35:17 +0900
+++ geeklog-1.4.1/system/lib-comment.php	2007-09-04 15:30:12 +0900
@@ -615,19 +615,6 @@
         $retval .= COM_endBlock (COM_getBlockTemplate ('_msg_block', 'footer'));
         return $retval;
     } else {
-        COM_clearSpeedlimit ($_CONF['commentspeedlimit'], 'comment');
-
-        $last = COM_checkSpeedlimit ('comment');
-
-        if ($last > 0) {
-            $retval .= COM_startBlock ($LANG12[26], '',
-                               COM_getBlockTemplate ('_msg_block', 'header'))
-                . $LANG03[7]
-                . $last
-                . $LANG03[8]
-                . COM_endBlock (COM_getBlockTemplate ('_msg_block', 'footer'));
-        } else {
-
             if (($_CONF['advanced_editor'] == 1) && file_exists ($_CONF['path_layout'] . 'comment/commentform_advanced.thtml')) {
                 $postmode = 'html';
             } elseif (empty ($postmode)) {
@@ -773,7 +760,6 @@
             $comment_template->set_var('end_block', COM_endBlock());        
             $comment_template->parse('output', 'form');
             $retval .= $comment_template->finish($comment_template->get_var('output'));
-        }
     }
 
     return $retval;



More information about the geeklog-devel mailing list