[geeklog-hg] geeklog: Fixed sql error on comment submit if comment submission...

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Thu Sep 20 15:05:03 EDT 2012


changeset 8822:5dd0a7a49226
url:  http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/5dd0a7a49226
user: Tom <websitemaster at cogeco.net>
date: Thu Sep 20 15:04:29 2012 -0400
description:
Fixed sql error on comment submit if comment submission is true and comment notification is true. Also fixed bug where article page did not display system message (bug #0001476)

diffstat:

 public_html/article.php |  4 ++--
 system/lib-comment.php  |  6 ++++--
 2 files changed, 6 insertions(+), 4 deletions(-)

diffs (53 lines):

diff -r d83d1a709356 -r 5dd0a7a49226 public_html/article.php
--- a/public_html/article.php	Tue Sep 18 07:04:17 2012 +0900
+++ b/public_html/article.php	Thu Sep 20 15:04:29 2012 -0400
@@ -443,10 +443,10 @@
         } else {
             $story_template->set_var ('trackback', '');
         }
-        $display = $story_template->finish ($story_template->parse ('output', 'article'));
+        $display .= $story_template->finish ($story_template->parse ('output', 'article'));
         
         $breadcrumbs = TOPIC_breadcrumbs('article', $story->getSid());
-        
+
         $display = COM_createHTMLDocument($display, array('pagetitle' => $pagetitle, 'breadcrumbs' => $breadcrumbs, 'headercode' => $headercode));
     }
 } else {
diff -r d83d1a709356 -r 5dd0a7a49226 system/lib-comment.php
--- a/system/lib-comment.php	Tue Sep 18 07:04:17 2012 +0900
+++ b/system/lib-comment.php	Thu Sep 20 15:04:29 2012 -0400
@@ -1315,7 +1315,7 @@
                    . 'to submit a comment with invalid $title and/or $comment.');
         return $ret = 5;
     } 
-    
+
     if (($_CONF['commentsubmission'] == 1) && !SEC_hasRights('comment.submit')) {
         // comment into comment submission table enabled
         if (isset($name)) {
@@ -1326,6 +1326,8 @@
                    . "VALUES ('$sid',$uid,'$comment','$type',NOW(),'$title',$pid,'{$_SERVER['REMOTE_ADDR']}')");
         }
 
+        $cid = DB_insertId('',$_TABLES['commentsubmissions'].'_cid_seq');
+        
         $ret = -1; // comment queued
     } elseif ($pid > 0) {
         DB_lockTable ($_TABLES['comments']);
@@ -1381,6 +1383,7 @@
             DB_save ($_TABLES['comments'], 'sid,uid,comment,date,title,pid,lft,rht,indent,type,ipaddress',
                 "'$sid',$uid,'$comment',now(),'$title',$pid,$rht2,$rht3,0,'$type','{$_SERVER['REMOTE_ADDR']}'");
         }
+        
         $cid = DB_insertId('',$_TABLES['comments'].'_cid_seq');
         DB_unlockTable($_TABLES['comments']);
     }
@@ -1954,7 +1957,6 @@
     $newcid = DB_insertId('','comments_cid_seq');
 
     DB_delete($_TABLES['commentsubmissions'], 'cid', $cid);
-
     DB_change($_TABLES['commentnotifications'], 'cid', $newcid, 'mid', $cid);
 
     // notify of new published comment



More information about the geeklog-cvs mailing list