4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Requests & Discussions) => Topic started by: bacterio on October 14, 2008, 11:40:51 PM

Title: A user can comment on that ?¿
Post by: bacterio on October 14, 2008, 11:40:51 PM
Hello.
As a user could avoid making comments.
I must add that online detail.php?
Greetings :?:
Title: Re: A user can comment on that ?¿
Post by: V@no on October 14, 2008, 11:49:59 PM
I'm sorry, I didn't understand your question...
Title: Re: A user can comment on that ?¿
Post by: bacterio 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 ....
Title: Re: A user can comment on that ?¿
Post by: V@no 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.
Title: Re: A user can comment on that ?¿
Post by: bacterio 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!