x
 
Create New Page
 View Previous Changes    ( Last updated by BrandB )

Deleting Comments

Question:

How can I as a Superadmin quickly and easily edit or delete comments?

Answer:

Use the following code to add frontend editing capabilities to your comment template:

<?php global $SESS; if ($SESS->userdata['group_id'] == 1) {
print '<a href="/system/index.php?S=0&C=edit&M=edit_comment&weblog_id=2&entry;_id={entry_id}&current_page=0&comment;_id={comment_id}"><img src="comment_edit.png" alt="edit this comment" class="icon"></a>

<a href="/system/index.php?S=0&C=edit&M=del_comment_conf&weblog_id=2&entry;_id={entry_id}&current_page=0&comment;_id={comment_id}"><img src="comment_delete.png" alt="delete this comment" class="icon"></a>'
; }

?>

Obviously, you will need to adjust weblog_id and probably the images accordingly.

NOTE: Your path to the system directory may differ, or you can use the /admin.php link instead if it is in your path.

ANOTHER NOTE: You can get the same effect without using PHP:

{if (member_group == '1'}
<a href="/system/index.php?S=0&C=edit&M=edit_comment&weblog_id=2&entry;_id={entry_id}&current_page=0&comment;_id={comment_id}">Edit Comment</a>

<
a href="/system/index.php?S=0&C=edit&M=del_comment_conf&weblog_id=2&entry;_id={entry_id}&current_page=0&comment;_id={comment_id}">Delete Comment</a>
{/if}

Obviously, if your system folder is named differently, sub it in for the word ‘system’

If you want to use multiple member groups (such as for admin and moderators) add an OR operator to the IF statement like so:

{if (member_group == '1' OR member_group == '7')}

Category:Comments Category:Templates

Categories: