Author Topic: only the owner of the image and the Adminatrator can comment the image  (Read 3650 times)

0 Members and 1 Guest are viewing this topic.

Offline Sun Zaza

  • Sr. Member
  • ****
  • Posts: 399
    • View Profile
Hi,

How can I make that only the owner of the image and the Adminatrator can comment this image?


Thank you in advance,
Cruxy

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: only the owner of the image and the Adminatrator can comment the image
« Reply #1 on: December 12, 2010, 11:15:08 PM »
In details.php find:
  $allow_posting check_permission("auth_postcomment"$cat_id);
insert below:
  if ($user_info['user_level'] != ADMIN && $user_info['user_id'] != $image_row['user_id'])
    
$allow_posting false;
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Sun Zaza

  • Sr. Member
  • ****
  • Posts: 399
    • View Profile
Re: only the owner of the image and the Adminatrator can comment the image
« Reply #2 on: December 12, 2010, 11:54:20 PM »
Thank you V@no.

It was my mistake to not explain my request very good.

I need it only for some categories. So I was thinking about adding a new radio additional cat fields: cat_comments_private.
It is already done, but I stoped there.

What do you think? Or maybe you have a better idea?

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: only the owner of the image and the Adminatrator can comment the image
« Reply #3 on: December 13, 2010, 12:02:48 AM »
Shouldn't be too difficult to implement.

Follow these instructions [TUT] Zusätzliches Image Feld anlegen / Additional Image Field and add your cat_comments_private field into images table.
Then use something like this:

  if ($image_row['cat_comments_private'] && $user_info['user_level'] != ADMIN && $user_info['user_id'] != $image_row['user_id'])
    
$allow_posting false;


P.S.
It would be much more difficult to implement new permissions in categories.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)