Topic: limit posts

hello all can anyone help me please i have a problem i don`t know how to limit posts in punBB but i don`t know if it`s possible do that if someone know please reply or PM me

Thank YOU

Re: limit posts

Limit posts in what way?

Re: limit posts

I mean to put a limit of posts on topics , a topic contains 2,000 posts and then be closed automatically

Re: limit posts

After line 105 on 'viewtopic.php':

$max_posts = 2000;
$postnumber = array_pop($db->fetch_assoc($db->query('SELECT num_replies FROM '.$db->prefix.'topics')));
if($number >= 2000 && intval($cur_topic['closed'])==0)
$db->query('UPDATE '.$db->prefix.'topics SET closed=1 WHERE id=\''.$cur_topic['forum_id'].'\'');

Note: Code not tested.

Re: limit posts

the code does not work sad

Re: limit posts

$max_posts = 2000;
$postnumber = array_pop($db->fetch_assoc($db->query('SELECT num_replies FROM '.$db->prefix.'topics')));
if($postnumber >= 2000 && intval($cur_topic['closed'])==0)
{
    $db->query('UPDATE '.$db->prefix.'topics SET closed=1 WHERE id=\''.$id.'\'');
    header('Location: '.$pun_config['o_base_url'].'/viewtopic.php?id='.$id);
}

Works now.