Author Topic: A user can comment on that ?¿  (Read 7281 times)

0 Members and 1 Guest are viewing this topic.

Offline bacterio

  • Jr. Member
  • **
  • Posts: 82
    • View Profile
A user can comment on that ?¿
« on: October 14, 2008, 11:40:51 PM »
Hello.
As a user could avoid making comments.
I must add that online detail.php?
Greetings :?:

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: A user can comment on that ?¿
« Reply #1 on: October 14, 2008, 11:49:59 PM »
I'm sorry, I didn't understand your question...
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 bacterio

  • Jr. Member
  • **
  • Posts: 82
    • View Profile
Re: A user can comment on that ?¿
« Reply #2 on: October 15, 2008, 12:14:36 AM »
Yes...  for example:

if user is number xxx  go to error

In detail.php:
Quote
//-----------------------------------------------------
//--- Save Comment ------------------------------------
//-----------------------------------------------------

$error = 0;

if ($action == "postcomment" && isset($HTTP_POST_VARS[URL_ID])) {
  $id = intval($HTTP_POST_VARS[URL_ID]);
  $sql = "SELECT cat_id, image_allow_comments
          FROM ".IMAGES_TABLE."
          WHERE image_id = $id";
  $row = $site_db->query_firstrow($sql);

  if ($row['image_allow_comments'] == 0 || !check_permission("auth_postcomment", $row['cat_id']) || !$row) {
    $msg = $lang['comments_deactivated'];
  }


else if ( $user_info['user_id'] == 200 ) {
    show_error_page($lang['Not posible']);

}



For example..... but this does not work for me .... This is not my php code ....

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: A user can comment on that ?¿
« Reply #3 on: October 15, 2008, 02:41:13 AM »
In details.php find: unset($random_cat_image);


Insert below:
$ids = array(200); //user ids who you don't want allow post comments
if (in_array($user_info['user_id'], $ids))
{
  
$cat_cache[$cat_id]['auth_postcomment'] = AUTH_ADMIN;
}

You can add as many user_id as you wish, separate them with comma.
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 bacterio

  • Jr. Member
  • **
  • Posts: 82
    • View Profile
Re: A user can comment on that ?¿
« Reply #4 on: October 15, 2008, 01:50:27 PM »
Thank you very much, it works fine. I'd like to leave a text diciedo (You can not make comments) ... I will see if it do so.

Greetings!