Page 1 of 1

Download only after x amount of posts

Posted: Tue May 29, 2007 2:40 pm
by DavidIQ
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 ;-)