1 (edited by hacklover99 2013-10-24 00:11)

Topic: [Request] Guest can see hidden forums in home page

WRONG TOPIC, MOVE IT WHERE YOU WANT, MODERATORS

Hi, how can I set permissions to make guests able to see forums (in homepage) only for members, showing them "You must be registred to view this forum"?

I tried to edit index.php at line 26 removing

if (!$forum_user['is_guest']) { }

from the query but nothing appears

2 (edited by hacklover99 2013-10-24 00:09)

Re: [Request] Guest can see hidden forums in home page

Ok lol before I removed a wrong thing.


To do what I need, you must go on line 70 of index.php and replace

// Print the categories and forums
$query = array(
    'SELECT'    => 'c.id AS cid, c.cat_name, f.id AS fid, f.forum_name, f.forum_desc, f.redirect_url, f.moderators, f.num_topics, f.num_posts, f.last_post, f.last_post_id, f.last_poster',
    'FROM'        => 'categories AS c',
    'JOINS'        => array(
        array(
            'INNER JOIN'    => 'forums AS f',
            'ON'            => 'c.id=f.cat_id'
        ),
        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',
    'ORDER BY'    => 'c.disp_position, c.id, f.disp_position'
);

with

// Print the categories and forums
$query = array(
    'SELECT'    => 'c.id AS cid, c.cat_name, f.id AS fid, f.forum_name, f.forum_desc, f.redirect_url, f.moderators, f.num_topics, f.num_posts, f.last_post, f.last_post_id, f.last_poster',
    'FROM'        => 'categories AS c',
    'JOINS'        => array(
        array(
            'INNER JOIN'    => 'forums AS f',
            'ON'            => 'c.id=f.cat_id'
        )
    ),
    'ORDER BY'    => 'c.disp_position, c.id, f.disp_position'
);

to make the query for get all forums.



Then, open lang/your_language/common.php and search

'Bad request'

and edit the text.

This works for me on PunBB 1.4
Enjoy PunBB!

Re: [Request] Guest can see hidden forums in home page

Just wanted to say, this works perfectly

It also keeps out other member groups that do not have permission.

You can see the forum on the board but when you click on it you cannot read unless you have the specified member level.

I edited my language file to say....

This forum is restricted to a specific member level.