Changeset 1296 for branches/1.2/content/plugins
- Timestamp:
- 03/11/10 14:24:36 (3 years ago)
- Location:
- branches/1.2/content/plugins/comments
- Files:
-
- 2 edited
-
comments.php (modified) (3 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/1.2/content/plugins/comments/comments.php
r1247 r1296 3 3 * name: Comments 4 4 * description: Enables logged-in users to comment on posts 5 * version: 1. 65 * version: 1.7 6 6 * folder: comments 7 7 * class: Comments … … 148 148 } 149 149 150 if ($h->pageName == 'comments') { 150 if ($h->pageName == 'comments') 151 { 152 // set current comment and responses to pending: 153 if ($h->cage->get->getAlpha('action') == 'setpending') { 154 155 // before setting pending, we need to be certain this user has permission: 156 if ($h->currentUser->getPermission('can_set_comments_pending') == 'yes') { 157 $cid = $h->cage->get->testInt('cid'); // comment id 158 $comment = $h->comment->getComment($h, $cid); 159 $h->comment->readComment($h, $comment); // read comment 160 $h->comment->status = 'pending'; // set to pending 161 $h->comment->editComment($h); // update this comment 162 163 $h->comment->postId = $h->cage->get->testInt('pid'); // post id 164 $h->comment->setPendingCommentTree($h,$cid); // set all responses to 'pending', too. 165 166 // redirect back to thread: 167 $h->post = new Post(); 168 $h->readPost($h->comment->postId); 169 header("Location: " . $h->url(array('page'=>$h->post->id))); // Go to the post 170 die(); 171 } 172 } 173 174 // delete current comment and responses: 175 if ($h->cage->get->getAlpha('action') == 'delete') { 176 177 // before deleting a comment, we need to be certain this user has permission: 178 if ($h->currentUser->getPermission('can_delete_comments') == 'yes') { 179 $cid = $h->cage->get->testInt('cid'); // comment id 180 $comment = $h->comment->getComment($h, $cid); 181 $h->comment->readComment($h, $comment); // read comment 182 183 $h->pluginHook('comments_delete_comment'); 184 185 $h->comment->deleteComment($h, $cid); // delete this comment 186 $h->comment->deleteCommentTree($h, $cid); // delete all responses, too. 187 188 $h->clearCache('html_cache', false); // clear HTML cache to refresh Comments and Activity widgets 189 190 $h->comment->postId = $h->cage->get->testInt('pid'); // post id 191 192 // redirect back to thread: 193 $h->readPost($h->comment->postId); 194 header("Location: " . $h->url(array('page'=>$h->comment->postId))); // Go to the post 195 die(); 196 } 197 } 198 199 // FOR THE COMMENTS PAGE: 151 200 $h->pageTitle = $h->lang['comments']; 152 201 if ($h->cage->get->keyExists('user')) { … … 257 306 258 307 } 259 260 // set current comment and responses to pending:261 if ($h->cage->get->getAlpha('action') == 'setpending') {262 263 // before setting pending, we need to be certain this user has permission:264 if ($h->currentUser->getPermission('can_set_comments_pending') == 'yes') {265 $cid = $h->cage->get->testInt('cid'); // comment id266 $comment = $h->comment->getComment($h, $cid);267 $h->comment->readComment($h, $comment); // read comment268 $h->comment->status = 'pending'; // set to pending269 $h->comment->editComment($h); // update this comment270 271 $h->comment->postId = $h->cage->get->testInt('pid'); // post id272 $h->comment->setPendingCommentTree($h,$cid); // set all responses to 'pending', too.273 274 // redirect back to thread:275 $h->post = new Post();276 $h->readPost($h->comment->postId);277 header("Location: " . $h->url(array('page'=>$h->post->id))); // Go to the post278 die();279 }280 }281 282 // delete current comment and responses:283 if ($h->cage->get->getAlpha('action') == 'delete') {284 285 // before deleting a comment, we need to be certain this user has permission:286 if ($h->currentUser->getPermission('can_delete_comments') == 'yes') {287 $cid = $h->cage->get->testInt('cid'); // comment id288 $comment = $h->comment->getComment($h, $cid);289 $h->comment->readComment($h, $comment); // read comment290 291 $h->pluginHook('comments_delete_comment');292 293 $h->comment->deleteComment($h, $cid); // delete this comment294 $h->comment->deleteCommentTree($h, $cid); // delete all responses, too.295 296 $h->clearCache('html_cache', false); // clear HTML cache to refresh Comments and Activity widgets297 298 $h->comment->postId = $h->cage->get->testInt('pid'); // post id299 300 // redirect back to thread:301 $h->readPost($h->comment->postId);302 header("Location: " . $h->url(array('page'=>$h->comment->postId))); // Go to the post303 die();304 }305 }306 307 308 } 308 309 -
branches/1.2/content/plugins/comments/readme.txt
r1247 r1296 15 15 Changelog 16 16 --------- 17 v.1.7 2010/03/11 - Nick - Fix for a previous change that broke the set pending and delete links within comments. 17 18 v.1.6 2010/02/26 - Nick - Adds link to profile navigation; Email changed to go through Hotaru's "email" function 18 19 v.1.5 2010/02/23 - Nick - Shows messages for moderated comments: "Awaiting approval", "Exceeded Daily Limit", etc.
Note: See TracChangeset
for help on using the changeset viewer.