Admin switch Admin switch
 

News:

CPG Release 1.6.27
change DB IP storage fields to accommodate IPv6 addresses
remove use of E_STRICT (PHP 8.4 deprecated)
update README to reflect new website
align code with new .com CPG website
correct deprecation in captcha

Main Menu

Admin switch

Started by Zajda, July 21, 2006, 05:00:47 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Zajda

I dont want users in my gallery to edit or delete their comments. How to do this in 1.4.8 version?


I know that buttons "edit" and "delete" are:
<!-- BEGIN buttons -->
                                       <a href="javascript:;" onclick="blocking('cbody{MSG_ID}','', 'block'); blocking('cedit{MSG_ID}','', 'block'); return false;" title="{EDIT_TITLE}"><img src="images/edit.gif" border="0" align="middle" /></a>
                                     <a href="delete.php?msg_id={MSG_ID}&what=comment"  onclick="return confirm('{CONFIRM_DELETE}');"><img src="images/delete.gif" border="0" align="middle" /></a>
<!-- END buttons -->


But i would like to disable this for normal users and keep it working for me - admin. So how to do a switch? Thanks.

Paver

Yes, that is the template code.  So if you look where that is used, it is in the function theme_html_comments.  Scanning the code, you'll see this line:
$user_can_edit = (GALLERY_ADMIN_MODE) || (USER_ID && USER_ID == $row['author_id'] && USER_CAN_POST_COMMENTS) || (!USER_ID && USER_CAN_POST_COMMENTS && ($USER['ID'] == $row['author_md5_id']));

If you replace the line above with this line, you should have what you want:
$user_can_edit = GALLERY_ADMIN_MODE;