vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Allow specific users to access forums while closed (https://vborg.vbsupport.ru/showthread.php?t=243567)

MadK 05-30-2010 12:27 AM

Allow specific users to access forums while closed
 
Hey there,
I would like to make a request for a product that could allow specific users (by their ID) to be allowed access to the forums while those are closed.

Thanks,
M.

Speysider 05-30-2010 08:38 AM

I doubt such a mod may be made. vB is hard coded to only allow admins access to view a closed forum.

MadK 05-30-2010 07:36 PM

Quote:

Originally Posted by Speysider (Post 2045400)
I doubt such a mod may be made. vB is hard coded to only allow admins access to view a closed forum.

I was, however, told by Zachary of vBulletin.com that it could be made into a mod.

http://www.vbulletin.com/forum/showt...=1#post1986857

Speysider 05-30-2010 08:15 PM

"could be" doesn't mean "yes it can be done" :)
Try it out yourself, but there could be some side effects.

kall 05-30-2010 08:19 PM

Your lack of knowledge (and then spouting non-facts as if they were facts) still astounds me, Homeworld/Spey.

@MadK If existing code = "if admin{allow access}", then changing it to "if admin OR userid = 1{allow access}" would do exactly what is being asked for. Just a matter of finding someone who can do that for you, may require a file edit though.

MadK 05-30-2010 08:45 PM

Quote:

Originally Posted by kall (Post 2045694)
Your lack of knowledge (and then spouting non-facts as if they were facts) still astounds me, Homeworld/Spey.

@MadK If existing code = "if admin{allow access}", then changing it to "if admin OR userid = 1{allow access}" would do exactly what is being asked for. Just a matter of finding someone who can do that for you, may require a file edit though.

Nah, I understand what Spey was trying to say, there's no real need to be aggressive on him!

As for the file edit, do you have any general idea of which file it could be? I could always try it myself.

Boofo 05-30-2010 08:53 PM

This was done a while back. I don't remember what version it was done for, but I have seen it somewhere.

MadK 05-30-2010 09:08 PM

Quote:

Originally Posted by Boofo (Post 2045712)
This was done a while back. I don't remember what version it was done for, but I have seen it somewhere.

Yeah, I know what you are talking about. I remember a mod was made for this, but I cannot find it anywhere.

Lynne 05-31-2010 01:51 PM

There was a mod to do this for usergroups, not users. Maybe search the word "usergroup" in "all mods" "titles only"?

Speysider 05-31-2010 02:29 PM

Quote:

Originally Posted by kall (Post 2045694)
Your lack of knowledge (and then spouting non-facts as if they were facts) still astounds me, Homeworld/Spey.

You need to stop attacking me for what I say. Just because it doesn't agree with what you say doesn't give you any added benefit to constantly attack me.


/rant

MadK 06-01-2010 04:36 AM

Quote:

Originally Posted by Lynne (Post 2046025)
There was a mod to do this for usergroups, not users. Maybe search the word "usergroup" in "all mods" "titles only"?

Yup, I was able to find that infamous mod, right here! With the help of ragtek, I got the location of the permissions hook for if the board is active or not, but I tried something and ultimately failed! I am shown a blank page.

http://www.vbulletin.com/forum/showt...=1#post1987765

Hoping someone can do it. :)

kall 06-02-2010 07:27 PM

But there's no hook before or within the code snippet that could help you.

PHP Code:

if (!$vbulletin->options['bbactive'] AND
            (
$vbulletin->userinfo['permissions']['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['cancontrolpanel'])) 

That is the condition.. you would most likely have to add something to that.

borbole 06-06-2010 06:33 PM

I don''t have time to make this into a plugin but make these edits manually at the class_bootstrap.php file.

Find this code:

PHP Code:

if (!$vbulletin->options['bbactive'] AND
            (
$vbulletin->userinfo['permissions']['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['cancontrolpanel']))
        {
            
// show the board disabled warning message so that admins don't leave the board turned off by accident
            
$warning vB_Template::create('board_inactive_warning')->render();
            
$header $warning $header;
            
$footer .= $warning;
        } 


And replace it with:

PHP Code:

if (!$vbulletin->options['bbactive'] AND
            (
$vbulletin->userinfo['permissions']['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['cancontrolpanel']) OR (is_member_of($vbulletin->userinfo5)))    
        {
        
            
// show the board disabled warning message so that admins don't leave the board turned off by accident
            
$warning vB_Template::create('board_inactive_warning')->render();
            
$header $warning $header;
            
$footer .= $warning;
        } 



Find this other code:


PHP Code:

// check that board is active - if not admin, then display error
        
if (
            !
defined('BYPASS_FORUM_DISABLED')
                AND
            !
$vbulletin->options['bbactive']
                AND
            !
in_array(THIS_SCRIPT, array('login''css'))
                AND
            !(
$vbulletin->userinfo['permissions']['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['cancontrolpanel'])
        ) 


And replace it with:


PHP Code:

// check that board is active - if not admin, then display error
        
if (
            !
defined('BYPASS_FORUM_DISABLED')
                AND
            !
$vbulletin->options['bbactive']
                AND
            !
in_array(THIS_SCRIPT, array('login''css'))
                AND
            !(
$vbulletin->userinfo['permissions']['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['cancontrolpanel'])
                AND
            (!
is_member_of($vbulletin->userinfo5))    
        ) 


In my example I did it so the supermoderator group with the gid 5 can enter the board while being of line. You can replace the gid, 5, with whatever group you want to allow access to the off line board.

If you want to allow multiple groups, then separate their id with commas (,).


Hope it helps. I might make a mod out of this later on if I will have some free time.

erbodega 12-08-2015 10:29 AM

the code from @borbole works even on vb 4.2.3, just tested, but the additional usergroup will see the closed board message even if the board is active.

To solve the issue, just edit the board_inactive_warning template from
Code:

    <div class="forum_disabled">{vb:rawphrase alert_board_off}</div>
to

Code:

<vb:if condition="!$vboptions['bbactive']">
    <div class="forum_disabled">{vb:rawphrase alert_board_off}</div>
</vb:if>

or try to fix the posted php code like this:
PHP Code:

if (!$vbulletin->options['bbactive'] AND 
            (
$vbulletin->userinfo['permissions']['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['cancontrolpanel']) OR !$vbulletin->options['bbactive'] AND (is_member_of($vbulletin->userinfo5)))     
        { 
         
            
// show the board disabled warning message so that admins don't leave the board turned off by accident
            
$warning vB_Template::create('board_inactive_warning')->render(); 
            
$header $warning $header
            
$footer .= $warning
        } 



All times are GMT. The time now is 05:23 PM.

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.01150 seconds
  • Memory Usage 1,787KB
  • 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
  • (6)bbcode_php_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (14)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete