load($comment_id); $cid = $comment->content_id; $content = Content::load_content((int)$cid, (int)$_SESSION['user']['id']); if($comment->user_id == $_SESSION['user']['id']) {// $comment->comment_id = $_GET['comment_id']; try { $comment->delete(); } catch (PAException $e) { $msg = "$e->message"; $error = TRUE; } } else { throw new PAException(CONTENT_NOT_AUTHORISED_TO_ACCESS, "You are not authorised to access this page."); } $err = "Comment deleted successfully"; //invalidate cache of this content if($network_info) { $nid = '_network_'.$network_info->network_id; } else { $nid=''; } //unique name $cache_id = 'content_'.$cid.$nid; CachedTemplate::invalidate_cache($cache_id); if($content->parent_collection_id > 0) { $location = "$base_url/content.php?cid=$cid&ccid=$content->parent_collection_id&err=$err"; } else { $location = "$base_url/content.php?cid=$cid&err=$err"; } header("Location: $location"); exit; } ?>