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 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 03:03 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.01041 seconds
  • Memory Usage 1,762KB
  • 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
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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