Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: Admin switch  (Read 2876 times)

0 Members and 1 Guest are viewing this topic.

Zajda

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Admin switch
« on: July 21, 2006, 05:00:47 am »

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:
Code: [Select]
<!-- 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.
Logged

Paver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1609
  • Paul V.
Re: Admin switch
« Reply #1 on: July 21, 2006, 05:28:31 am »

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:
Code: [Select]
$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:
Code: [Select]
$user_can_edit = GALLERY_ADMIN_MODE;
Logged
Pages: [1]   Go Up
 

Page created in 0.015 seconds with 19 queries.