Topic: Error in post.php querry

when a user group has only access to post on a forum its not possible to really post on this forum ...


what i did:
- created a new forum
- allowed the members group to only post on this forum
- created a link to the post page of this forum (post.php?fid=<id here>)

When i load this page i get a "bad request" error so i started looking into this and it seems that the querry below is wrong....

$query = array(
                'SELECT'        => 'f.id, f.forum_name, f.moderators, f.redirect_url, fp.post_replies, fp.post_topics',
                'FROM'          => 'forums AS f',
                'JOINS'         => array(
                        array(
                                'LEFT JOIN'             => 'forum_perms AS fp',
                                'ON'                    => '(fp.forum_id=f.id AND fp.group_id='.$forum_user['g_id'].')'
                        )
                ),
                'WHERE'         => '(fp.read_forum IS NULL OR fp.read_forum=1) AND f.id='.$fid
        );

as you can see that the where is cheking on read_forum and not on post_topics

i think this querry should be:

$query = array(
                'SELECT'        => 'f.id, f.forum_name, f.moderators, f.redirect_url, fp.post_replies, fp.post_topics',
                'FROM'          => 'forums AS f',
                'JOINS'         => array(
                        array(
                                'LEFT JOIN'             => 'forum_perms AS fp',
                                'ON'                    => '(fp.forum_id=f.id AND fp.group_id='.$forum_user['g_id'].')'
                        )
                ),
                'WHERE'         => '(fp.read_forum IS NULL OR fp.post_topics=1) AND f.id='.$fid
        );
~Cereal
I've finally learned what "upward compatible" means. It means we get to keep all our old mistakes.
The limits of language are the limits of one's world.

Re: Error in post.php querry

anyone?

~Cereal
I've finally learned what "upward compatible" means. It means we get to keep all our old mistakes.
The limits of language are the limits of one's world.

Re: Error in post.php querry

Thanks for reporting, we will investigate this problem.