Author Topic: [Solved] Users can edit only own comments  (Read 2179 times)

0 Members and 1 Guest are viewing this topic.

Offline Joss

  • Jr. Member
  • **
  • Posts: 68
    • View Profile
    • All about digital photography
[Solved] Users can edit only own comments
« on: February 07, 2010, 10:35:48 PM »
Users can edit only own comments in details page of their images.

details.php
Find:

Code: [Select]
      elseif ($is_image_owner) {
        $admin_links .= ($config['user_edit_comments'] != 1) ? "" : "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=editcomment&amp;".URL_COMMENT_ID."=".$comment_row[$i]['comment_id'])."\">".$lang['edit']."</a>&nbsp;";
        $admin_links .= ($config['user_delete_comments'] != 1) ? "" : "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=removecomment&amp;".URL_COMMENT_ID."=".$comment_row[$i]['comment_id'])."\">".$lang['delete']."</a>";
      }

Replace string

Code: [Select]
      elseif ($is_image_owner) {
to

Code: [Select]
      elseif ($is_image_owner && $user_info['user_id'] == $comment_user_id) { 
Digital Photo Gallery: http://gallery.imagemaster.ru