4images Forum & Community

4images Modifications / Modifikationen => Requests for paid modifications / Jobbörse => Topic started by: riansyah on September 10, 2008, 05:50:29 AM

Title: Comments before upload
Post by: riansyah on September 10, 2008, 05:50:29 AM
Hello

I was just wondering if it would be possible to create the following:

a new user should rate and comment 2 or more of photos first before he is able to upload own pictures. Expectation on this is to keep out users who only want to show and are not interested in community. I want them to think about it before they sign in and would like to explain it before registration.

Does anyone have make how to manage this?

Thanks in advance!
Title: Re: Comments before upload
Post by: V@no on September 10, 2008, 06:09:02 AM
Try this:
in member.php find:if ($action == "uploadform") {
  if ($cat_id != 0 && (!isset($cat_cache[$cat_id]) || !check_permission("auth_upload", $cat_id))) {
    show_error_page($lang['no_permission']);
    exit;
  }


Insert below:  $min_num = 2; //minimum number of comments
  $sql = "SELECT COUNT(comment_id) as num
          FROM " . COMMENTS_TABLE . "
          WHERE user_id = " . $user_info['user_id'];
  $result = $site_db->query_firstrow($sql);
  if ((int)$result['num'] < $min_num)
  {
//    show_error_page($lang['no_permission']);
    show_error_page("You must post at least " . ($min_num - $result['num']) . " more comment(s) before you may upload.");
    exit;
  }
Title: Re: Comments before upload
Post by: riansyah on September 16, 2008, 08:29:48 PM
thanks for V@no,
It's work..

I want ask again, can we limit the comment, i mean in one foto user only can give one comment and the image owner cannot comment his foto?

Regards,
riansyah
Title: Re: Comments before upload
Post by: V@no on September 16, 2008, 08:42:49 PM
Please start a new topic if you have more questions not related to "Comments before upload" topic ;)