Topic: Minimum Number Of Posts To Enter A Forum?...

My message board users have been posting some cool downloads in the downloads section of my message board. Unfortunately their are some leechers that steal the links and then post them on every other related message board without credit.

Is their a way to stop new members entering the downloads section of my board? I only want users with a minimum post level of 50 posts to have access.

Re: Minimum Number Of Posts To Enter A Forum?...

nice idea, i need it too tongue

3

Re: Minimum Number Of Posts To Enter A Forum?...

add in the beginning of viewtopic.php and viewforum.php (after require PUN_ROOT.'include/common.php';)

if ($pun_user['num_posts'] < 50)
message($lang_common['No view']);
Hm... every pixel has it's own destiny

Re: Minimum Number Of Posts To Enter A Forum?...

seva: Well, that works well for completely stopping access tongue
You'd have to include something about the forum id as well
Or, assuming Mediator's download mod is in use, you put that check there smile

Re: Minimum Number Of Posts To Enter A Forum?...

need do some Plug tongue
can help..

6

Re: Minimum Number Of Posts To Enter A Forum?...

Oooh, sorry, of coz:
In viewforum.php:

if ($id == n)
if ($pun_user['num_posts'] < 50)
message($lang_common['No view']);

where n - your private forum id

And in viewtopic.php after
$cur_topic = $db->fetch_assoc($result);
$forum_id = $cur_topic['forum_id'];

if ($forum_id == n)
if ($pun_user['num_posts'] < 50)
message($lang_common['No view']);
Hm... every pixel has it's own destiny

7

Re: Minimum Number Of Posts To Enter A Forum?...

seva wrote:

Oooh, sorry, of coz:
In viewforum.php:

if ($id == n)
if ($pun_user['num_posts'] < 50)
message($lang_common['No view']);

where n - your private forum id

And in viewtopic.php after
$cur_topic = $db->fetch_assoc($result);
$forum_id = $cur_topic['forum_id'];

if ($forum_id == n)
if ($pun_user['num_posts'] < 50)
message($lang_common['No view']);

with this, could you do

if ($id == 1,2,3,4,8,9)

? Not specifically those, but can you make this affect multiple forums like that?
Also, the code for viewforum.php, does this need to go in a specific place or overwrite a specific piece of code? I dont think it does, but would like to make sure.

Re: Minimum Number Of Posts To Enter A Forum?...

Code:

if ($id == 1,2,3,4,8,9)

? Not specifically those, but can you make this affect multiple forums like that?
Also, the code for viewforum.php, does this need to go in a specific place or overwrite a specific piece of code? I dont think it does, but would like to make sure.

More as in:

$forum_ids = array(1,2,3,4,8,9);
if(in_array($id,$forum_ids))
  {
  ...
  }

9

Re: Minimum Number Of Posts To Enter A Forum?...

$forum_ids = array(1,2,3,4,8,9);
if(in_array($id,$forum_ids))
  {
if ($pun_user['num_posts'] < 50)
message($lang_common['No view']);
  }

so like that?

10

Re: Minimum Number Of Posts To Enter A Forum?...

ya neither that code nor the original works at preventing users under a certain amount of posts in.

11 (edited by CodeXP 2006-02-03 16:16)

Re: Minimum Number Of Posts To Enter A Forum?...

The following code does work:

$fora_id = array(1, 2, 3);
if (in_array(intval($_GET['id']), $fora_id) && $pun_user['num_posts'] < 50 && $pun_user['g_id'] > PUN_MOD)
        message($lang_common['No view']);

Add it to viewforum.php, after the inclusion of common.php


Also, to prevent displaying topics in a certain forum, for users with below 50 posts (will also prevent people from giving out direct links to topics, to users will < 50 posts), open viewtopic.php and find on line: 109

$is_admmod = ($pun_user['g_id'] == PUN_ADMIN || ($pun_user['g_id'] == PUN_MOD && array_key_exists($pun_user['username'], $mods_array))) ? true : false;

Below, add:

$fora_id = array(1, 2, 3);
if (in_array($cur_topic['forum_id'], $fora_id) && $pun_user['num_posts'] < 50 && $pun_user['g_id'] > PUN_MOD)
    message($lang_common['No permission']);