Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #11  
Old 06-01-2010, 04:36 AM
MadK's Avatar
MadK MadK is offline
 
Join Date: Feb 2008
Location: Canada
Posts: 109
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
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.
Reply With Quote
  #12  
Old 06-02-2010, 07:27 PM
kall's Avatar
kall kall is offline
 
Join Date: Apr 2004
Location: New Zealand
Posts: 2,608
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #13  
Old 06-06-2010, 06:33 PM
borbole's Avatar
borbole borbole is offline
 
Join Date: Jan 2010
Posts: 2,559
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #14  
Old 12-08-2015, 10:29 AM
erbodega erbodega is offline
 
Join Date: Nov 2015
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
        } 
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:35 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03960 seconds
  • Memory Usage 2,227KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_code
  • (6)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (4)post_thanks_box
  • (4)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (4)post_thanks_postbit_info
  • (4)postbit
  • (4)postbit_onlinestatus
  • (4)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete