Topic: What do I change to disable guests viewing forums by default?

I'm using the mod here:

http://www.punres.org/viewtopic.php?id=1093

to make a website where people can make group forums. Where it's invitation only, and
you cannot read the board unless your a member (or moderator) of the group.

I already got a plugin for inviting people, and I already changed it so that new registrations is off by default. Now I just need to set it so that guests cannot read the forums by default. I found where the code is in admin_forums, but since I know almost no php, I coulnd't really make anything of it. What would I need to change so that the checkbox for guests viewing the forums is automatically unchecked?

I appreciate any help.

Re: What do I change to disable guests viewing forums by default?

Err, why not just change the default usergroup option?

3 (edited by Plubyblop 2007-03-16 00:16)

Re: What do I change to disable guests viewing forums by default?

Well, the mod I'm using creates an unlimited number of punbb forums from one install.
I'm making a website designed for bible studies, and everyone can make there own forum for their study. I would just tell them to change it, but it would be easier if all the forums just started with it automatically unchecked, because most of the people I know who would use it are not very web-oriented at all.

Re: What do I change to disable guests viewing forums by default?

I guess you could change it in your database, just change the default.

FluxBB - v1.4.8

Re: What do I change to disable guests viewing forums by default?

Plubyblop wrote:

Well, the mod I'm using creates an unlimited number of punbb forums from one install.
I'm making a website designed for bible studies, and everyone can make there own forum for their study. I would just tell them to change it, but it would be easier if all the forums just started with it automatically unchecked, because most of the people I know who would use it are not very web-oriented at all.

Yes, so change the rows it inserts when creating the forums?

6 (edited by Plubyblop 2007-03-16 01:05)

Re: What do I change to disable guests viewing forums by default?

Well, it seems given the way the mod works, that changing the code of the base forum will change the code of all the forums created from it, so I'm trying to change the code of the base forum so that all the other forums will automatically disallow a guest from reading the forums. I did this successfully for turning off new registrations, but it was a lot more straightforward.

I think all I need to do is edit a number somewhere in this code, but I don't even have an idea of what; short of trial and error.

<?php

    $result = $db->query('SELECT g.g_id, g.g_title, g.g_read_board, g.g_post_replies, g.g_post_topics, fp.read_forum, fp.post_replies, fp.post_topics FROM '.$db->prefix.'groups AS g LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (g.g_id=fp.group_id AND fp.forum_id='.$forum_id.') WHERE g.g_id!='.PUN_ADMIN.' ORDER BY g.g_id') or error('Unable to fetch group forum permission list', __FILE__, __LINE__, $db->error());

    while ($cur_perm = $db->fetch_assoc($result))
    {
        $read_forum = ($cur_perm['read_forum'] != '0') ? true : false;
        $post_replies = (($cur_perm['g_post_replies'] == '0' && $cur_perm['post_replies'] == '1') || ($cur_perm['g_post_replies'] == '1' && $cur_perm['post_replies'] != '0')) ? true : false;
        $post_topics = (($cur_perm['g_post_topics'] == '0' && $cur_perm['post_topics'] == '1') || ($cur_perm['g_post_topics'] == '1' && $cur_perm['post_topics'] != '0')) ? true : false;

        // Determine if the current sittings differ from the default or not
        $read_forum_def = ($cur_perm['read_forum'] == '0') ? false : true;
        $post_replies_def = (($post_replies && $cur_perm['g_post_replies'] == '0') || (!$post_replies && ($cur_perm['g_post_replies'] == '' || $cur_perm['g_post_replies'] == '1'))) ? false : true;
        $post_topics_def = (($post_topics && $cur_perm['g_post_topics'] == '0') || (!$post_topics && ($cur_perm['g_post_topics'] == '' || $cur_perm['g_post_topics'] == '1'))) ? false : true;

?>
                                <tr>
                                    <th class="atcl"><?php echo pun_htmlspecialchars($cur_perm['g_title']) ?></th>
                                    <td<?php if (!$read_forum_def) echo ' class="nodefault"'; ?>>
                                        <input type="hidden" name="read_forum_old[<?php echo $cur_perm['g_id'] ?>]" value="<?php echo ($read_forum) ? '1' : '0'; ?>" />
                                        <input type="checkbox" name="read_forum_new[<?php echo $cur_perm['g_id'] ?>]" value="0"<?php echo ($read_forum) ? ' checked="checked"' : ''; ?><?php echo ($cur_perm['g_read_board'] == '0') ? ' disabled="disabled"' : ''; ?> />
                                    </td>

Re: What do I change to disable guests viewing forums by default?

That's not the way the mod works: check out activate.php, where the create table and insert statement for new forums are kept