Download only after x amount of posts

Since Opentools.de has now gone away I've created this forum to house FAQs and support for this mod in phpBB2.

Moderator: Experts

Locked
User avatar
DavidIQ
Site Admin
Posts: 581
Joined: Thu Sep 07, 2006 4:31 pm
Location: Earth
Contact:

Download only after x amount of posts

Post by DavidIQ » Tue May 29, 2007 2:40 pm

This has been a repeated request over on phpBB so here is a simple way to do it:

Code: Select all

#
# -----[ OPEN ]-----
download.php

#
# -----[ FIND ]-----
#
if ($attach_config['disable_mod'] && $userdata['user_level'] != ADMIN)
{
   message_die(GENERAL_MESSAGE, $lang['Attachment_feature_disabled']);
}

#
# -----[ AFTER, ADD ] -----
#
$minposts = 30;

if ($userdata['user_posts'] < $minposts && $userdata['user_level'] != ADMIN)
{
   message_die(GENERAL_MESSAGE, "You need to make " . $minposts . " posts before you are able to download files");
}
There are other ways to achieve this without it being so plain but this is as good as it gets at this point. Not willing to do a whole lot of work with phpBB3 just around the corner ;-)

Locked