[geeklog-hg] geeklog: What's New Block cache will now be reset on any comment...

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Wed Jul 3 11:16:35 EDT 2013


changeset 9159:0b6b9cf0ecdc
url:  http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/0b6b9cf0ecdc
user: Tom <websitemaster at cogeco.net>
date: Wed Jul 03 10:16:45 2013 -0400
description:
What's New Block cache will now be reset on any comment add/edit/delete

diffstat:

 system/lib-comment.php |  32 +++++++++++++++++++++++++++++++-
 1 files changed, 31 insertions(+), 1 deletions(-)

diffs (70 lines):

diff -r b53402a3e66b -r 0b6b9cf0ecdc system/lib-comment.php
--- a/system/lib-comment.php	Wed Jul 03 10:15:35 2013 -0400
+++ b/system/lib-comment.php	Wed Jul 03 10:16:45 2013 -0400
@@ -1369,7 +1369,13 @@
         DB_unlockTable($_TABLES['comments']);
         
         // Update Comment Feeds
-        COM_rdfUpToDateCheck('comment');        
+        COM_rdfUpToDateCheck('comment');    
+        
+        // Delete What's New block cache so it can get updated again
+        if ($_CONF['whatsnew_cache_time'] > 0 AND !$_CONF['hidenewcomments']) {
+            $cacheInstance = 'whatsnew__'; // remove all whatsnew instances
+            CACHE_remove_instance($cacheInstance);        
+        }        
         
         // notify parent of new comment
         // Must occur after table unlock, only with valid $cid and $pid
@@ -1410,6 +1416,12 @@
         
         // Update Comment Feeds
         COM_rdfUpToDateCheck('comment');
+        
+        // Delete What's New block cache so it can get updated again
+        if ($_CONF['whatsnew_cache_time'] > 0 AND !$_CONF['hidenewcomments']) {
+            $cacheInstance = 'whatsnew__'; // remove all whatsnew instances
+            CACHE_remove_instance($cacheInstance);        
+        }        
     }
 
     // save user notification information
@@ -1568,6 +1580,12 @@
         
         // Update Comment Feeds
         COM_rdfUpToDateCheck('comment');
+        
+        // Delete What's New block cache so it can get updated again
+        if ($_CONF['whatsnew_cache_time'] > 0 AND !$_CONF['hidenewcomments']) {
+            $cacheInstance = 'whatsnew__'; // remove all whatsnew instances
+            CACHE_remove_instance($cacheInstance);        
+        }        
     } else {
         DB_unlockTable ($_TABLES['comments']);
         COM_errorLog("CMT_deleteComment: {$_USER['uid']} from {$_SERVER['REMOTE_ADDR']} tried "
@@ -1800,6 +1818,12 @@
             DB_save($_TABLES['commentedits'],'cid,uid,time',"$cid,$uid,NOW()");
             
             COM_rdfUpToDateCheck('comment');
+            
+            // Delete What's New block cache so it can get updated again
+            if ($_CONF['whatsnew_cache_time'] > 0 AND !$_CONF['hidenewcomments']) {
+                $cacheInstance = 'whatsnew__'; // remove all whatsnew instances
+                CACHE_remove_instance($cacheInstance);        
+            }            
         } else {
             return COM_refresh (COM_buildUrl ($_CONF['site_admin_url'] . "/moderation.php"));
         }
@@ -2003,6 +2027,12 @@
     
     // Update Comment Feeds
     COM_rdfUpToDateCheck('comment');
+    
+    // Delete What's New block cache so it can get updated again
+    if ($_CONF['whatsnew_cache_time'] > 0 AND !$_CONF['hidenewcomments']) {
+        $cacheInstance = 'whatsnew__'; // remove all whatsnew instances
+        CACHE_remove_instance($cacheInstance);        
+    }
 
     return $A['sid'];
 }



More information about the geeklog-cvs mailing list