]> git.mjollnir.org Git - s9y.git/commitdiff
Add hooks for approving and deleting a comment
authorgarvinhicking <garvinhicking>
Mon, 11 Jun 2007 12:20:31 +0000 (12:20 +0000)
committergarvinhicking <garvinhicking>
Mon, 11 Jun 2007 12:20:31 +0000 (12:20 +0000)
include/functions_comments.inc.php
templates/carl_contest/entries.tpl

index e220566b50d4d37081d5493ee7e7e64ff58559aa..04b3383248b8126a5d4013964a8af76fe1a8b33d 100644 (file)
@@ -441,6 +441,10 @@ function serendipity_deleteComment($id, $entry_id, $type='comments') {
 
             serendipity_db_query("UPDATE {$serendipity['dbPrefix']}comments SET parent_id = " . (int)$sql['parent_id'] . " WHERE parent_id = " . $id);
         }
+        
+        $addData = array('cid' => $id, 'entry_id' => $entry_id);
+        serendipity_plugin_api::hook_event('backend_deletecomment', $sql, $addData);
+        
         return true;
     } else {
         return false;
@@ -523,6 +527,8 @@ function serendipity_approveComment($cid, $entry_id, $force = false) {
     if ($serendipity['allowSubscriptions']) {
         serendipity_mailSubscribers($entry_id, $rs['author'], $rs['email'], $rs['title'], $rs['authoremail'], $cid);
     }
+
+    serendipity_plugin_api::hook_event('backend_approvecomment', $rs);
     return true;
 }
 
index 299fa152e899affab008645e94a18b4f34a72413..b88ab91e47cb0684021e10a7f2c88f89a3114bff 100644 (file)
@@ -2,6 +2,7 @@
     {serendipity_hookPlugin hook="entries_header" addData="$entry_id"}
     {foreach from=$entries item="dategroup"}
        {foreach from=$dategroup.entries item="entry"}
+
     <div class="serendipity_Entry_Date">
         {if $dategroup.is_sticky}
         <h3 class="serendipity_date">{$CONST.STICKY_POSTINGS}</h3>