Topic: I need a little something..

Alright, I want to make a forums that users are not credited with posts when posting in it.
In this example, users are not suposed to be credited when posting in forum with id 5.

I tried
if ($fid != 5) {
$db->query ... num_posts=num_posts+1
}
if ($fid == 5) {
$db->query ... num_posts=num_posts
}

But that dosn't seem to work. Any idea how it can be done?

Thanks in advance!

2 (edited by Ludo 2005-06-22 18:00)

Re: I need a little something..

without having to modify code, you can go in admin/options/features/user ranks (put no)
but it affects the whole forum

Ludo,

Re: I need a little something..

FIND

        // If the posting user is logged in, increment his/her post count
        if (!$pun_user['is_guest'])
        {
            $low_prio = ($db_type == 'mysql') ? 'LOW_PRIORITY ' : '';
            $db->query('UPDATE '.$low_prio.$db->prefix.'users SET num_posts=num_posts+1, last_post='.$now.' WHERE id='.$pun_user['id']) or error('Unable to update user', __FILE__, __LINE__, $db->error());
        }

REPLACE WITH

        // If the posting user is logged in, increment his/her post count
        if (!$pun_user['is_guest'] && $fid != '5')
        {
            $low_prio = ($db_type == 'mysql') ? 'LOW_PRIORITY ' : '';
            $db->query('UPDATE '.$low_prio.$db->prefix.'users SET num_posts=num_posts+1, last_post='.$now.' WHERE id='.$pun_user['id']) or error('Unable to update user', __FILE__, __LINE__, $db->error());
        }

Re: I need a little something..

This works but only for topics, I tried before, I would need to do it like this: if the post is being posted inside a topic that is inside the forum 5, then to not higher post count.

Right now:
Topics: not credited
posts: credited

Re: I need a little something..

Ah, I see
replace $fid there with $cur_posting['id']

Re: I need a little something..

Works great, thanks, I was going to create a long sql query for that! $cur_posting['id'] is quite smaller.. smile
Thanks again!