[Phpslash-commit] CVS: phpslash-ft/public_html/admin commentAdmin.php3,1.13,1.14 storyAdmin.php3,1.1
Brought to you by:
joestewart,
nhruby
From: Joe S. <joe...@us...> - 2002-11-22 19:01:36
|
Update of /cvsroot/phpslash/phpslash-ft/public_html/admin In directory sc8-pr-cvs1:/tmp/cvs-serv9467/phpslash-ft/public_html/admin Modified Files: commentAdmin.php3 storyAdmin.php3 Log Message: experimental expire cache on update Index: commentAdmin.php3 =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/public_html/admin/commentAdmin.php3,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** commentAdmin.php3 11 Nov 2002 22:22:36 -0000 1.13 --- commentAdmin.php3 22 Nov 2002 19:01:32 -0000 1.14 *************** *** 43,46 **** --- 43,50 ---- if ($cmt->delete($HTTP_GET_VARS['comment_id'], $HTTP_GET_VARS['story_id'])) { $content .= "The comment was deleted<br>\n"; + + // expire cache for this story_id + jpcache_gc('string', "-story_id-" . $HTTP_GET_VARS['story_id'], "100"); + } else { $content .= getError($cmt->getMessage()); *************** *** 54,58 **** case pslgetText("Bulk Delete"): $bulkdel_ary = $HTTP_POST_VARS['bulkdel_ary']; ! if (count($bulkdel_ary) == 0) { $content .= "You didn't select any items to delete!"; } else { --- 58,62 ---- case pslgetText("Bulk Delete"): $bulkdel_ary = $HTTP_POST_VARS['bulkdel_ary']; ! if (count($bulkdel_ary) == 0) { $content .= "You didn't select any items to delete!"; } else { *************** *** 60,63 **** --- 64,70 ---- if ($cmt->delete($bulkdel_ary[$i], $HTTP_POST_VARS['story_id'])) { $content .= "Comment #" . $bulkdel_ary[$i] . " has been deleted\n"; + // expire cache for this story_id + jpcache_gc('string', "-story_id-" . $HTTP_POST_VARS['story_id'], "100"); + } else { $content .= "There was an ERROR <em>deleting</em> comment #" . $bulkdel_ary[$i] . "\n"; *************** *** 87,90 **** --- 94,101 ---- if ($cmt->reparentUp($HTTP_GET_VARS['comment_id'], $HTTP_GET_VARS['story_id'])) { $content .= getMessage("The comment was moved up one level."); + + // expire cache for this story_id + jpcache_gc('string', "-story_id-" . $HTTP_GET_VARS['story_id'], "100"); + } else { $content .= getError($cmt->getMessage()); *************** *** 95,98 **** --- 106,113 ---- if ($cmt->reparentTop($HTTP_GET_VARS['comment_id'], $HTTP_GET_VARS['story_id'])) { $content .= getMessage("The comment was moved to the top."); + + // expire cache for this story_id + jpcache_gc('string', "-story_id-" . $HTTP_GET_VARS['story_id'], "100"); + } else { $content .= getError($cmt->getMessage()); *************** *** 103,111 **** $content .= getTitlebar("100%","Edit Comment"); $returned = $cmt->commentEdit($HTTP_GET_VARS); ! if($returned) { $content .= $returned; ! } else { $content .= getError($cmt->getMessage()); ! } break; --- 118,126 ---- $content .= getTitlebar("100%","Edit Comment"); $returned = $cmt->commentEdit($HTTP_GET_VARS); ! if($returned) { $content .= $returned; ! } else { $content .= getError($cmt->getMessage()); ! } break; *************** *** 113,126 **** if($cmt->update($HTTP_POST_VARS)) { $content .= getMessage($cmt->getMessage()); ! } else { $content .= getError($cmt->getMessage()); ! } $returned = $cmt->commentEdit(); ! if($returned) { $content .= $returned; ! } else { $content .= getError($cmt->getMessage()); ! } ! break; default: --- 128,145 ---- if($cmt->update($HTTP_POST_VARS)) { $content .= getMessage($cmt->getMessage()); ! ! // expire cache for this story_id ! jpcache_gc('string', "-story_id-" . $HTTP_POST_VARS['story_id'], "100"); ! ! } else { $content .= getError($cmt->getMessage()); ! } $returned = $cmt->commentEdit(); ! if($returned) { $content .= $returned; ! } else { $content .= getError($cmt->getMessage()); ! } ! break; default: Index: storyAdmin.php3 =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/public_html/admin/storyAdmin.php3,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** storyAdmin.php3 11 Nov 2002 22:38:43 -0000 1.15 --- storyAdmin.php3 22 Nov 2002 19:01:33 -0000 1.16 *************** *** 55,58 **** --- 55,61 ---- $content .= $story->newStory($HTTP_POST_VARS, "array"); } + + // expire cache for this story_id + jpcache_gc('string', "-story_id-" . $HTTP_POST_VARS['story_id'], "100"); } if ($perm->have_perm("storyList")) { |