vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Private Forum Improvement (https://vborg.vbsupport.ru/showthread.php?t=32805)

amykhar 11-28-2001 10:00 PM

It irked me to no end that when I added a new usergroup, they had access to all private forums if I wasn't careful. Thus, I wrote this.

It should also be useful for other things. With this field in the forum table, queries to exclude private forums are MUCH easier.

Do not download this attachment for new installs. Download this one

Tommy Boy 11-29-2001 05:23 PM

Can you please explain in more details what this hack does?

I have a similar problem, that when I opened a new hidden forum, all people who had access to the first one also had access to the new one, and I don't like it. Will your hack help me?

amykhar 11-29-2001 05:40 PM

What it does is when you create a new private forum or make a forum private that wasn't private before, it sets a field in the database to mark it as private.

Then, when you create a new user group, it sets the forumpermissions to can't view for all private forums. This way, you can create a new group and not have them see your private forums by default.

I am not 100% sure, but cutting this code:

PHP Code:

$mods=$DB_site->query("SELECT DISTINCT moderator.userid FROM moderator,user WHERE moderator.userid=user.userid AND user.usergroupid<>6 AND user.usergroupid<>5");
    if (
$DB_site->num_rows($mods)) {
      while (
$mod=$DB_site->fetch_array($mods)) {
        
$accessto[] = $mod['userid'];
      }
      while ( list(
$key,$userid)=each($accessto) ) {
        
$DB_site->query("INSERT INTO access (userid,forumid,accessmask) VALUES ('$userid','$forumid',1)");
      }
    }
  } 

out of your forum.php file should fix your problem for NEW forums that you create. However, if you take an existing forum and make it private, the same thing would still happen. I will investigate the code for changing a forum a little closer and see if I can't get that fixed as well.

Amy

Admin 11-30-2001 11:15 AM

Just one thing. :)

Instead of this:
Code:

$tempGroupid=$DB_site->query_first("Select usergroupid from usergroup ORDER BY usergroupid DESC limit 1");
You can simply do this:
Code:

$tempGroupid=$DB_site->insert_id();
For more info:
http://www.php.net/manual/en/functio...-insert-id.php

:)

amykhar 11-30-2001 11:37 AM

Cool. I learn something every day.

Amy

DarkReaper 12-15-2001 07:57 PM

Hm...ok. Lets say I have 2 private forums already, and all moderators and admins have access to it. I then create another private forum, but want the moderators for that one not to have access to the previous forum, and I don't want any existing moderators to have access to the forum I just created. Can I do this?

Wayne2k1.com 03-28-2002 01:13 PM

[QUOTE]Originally posted by DarkReaper
Hm...ok. Lets say I have 2 private forums already, and all moderators and admins have access to it. I then create another private forum, but want the moderators for that one not to have access to the previous forum, and I don't want any existing moderators to have access to the forum I just created. Can I do this?

The Red Devil 03-09-2003 09:15 PM

Installed the hack, but it dont work for me. Im using 2.3.0
Everything is added and I get no error messages, but the new usergroup's I make still got access to all "hidden" forums.

Wayne2k1.com: A quite fast and easy solution to your problem would be to make another usergroup and make that "moderators" too, then edit the settings on who got rights of the usergroups to view the different forums.

amykhar 03-09-2003 09:18 PM

This is a real oldie and I can't guarantee it works anymore. I don't use it because I don't install more usergroups.

Amy

Dean C 03-10-2003 04:12 PM

Wow this is an oldie but a lovely idea :)!

How do i miss these hacks :p?

- miSt


All times are GMT. The time now is 03:04 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01035 seconds
  • Memory Usage 1,739KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete