vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Disable maintenance for external pages? (https://vborg.vbsupport.ru/showthread.php?t=209655)

Riotblade 03-28-2009 12:19 AM

Disable maintenance for external pages?
 
Hi, I'm using the basic integration method by calling global.php. Today, I put the Forum into maintenance mode to find out that whatever calls global.php will be redirected to the maintenance page. I was wondering if there was any way to prevent this?

Thanks

Lynne 03-28-2009 02:11 AM

If your page is calling global.php, then it will follow the same maintenance 'rules'. global.php looks at your user properties and if you aren't an admin, you get the maintenance page.

Riotblade 03-28-2009 02:56 AM

I dont suppose there's a way around it such as moving the maintenance code to another file? I dont want the forum maintenance to interfere with my main site.

JamesAB 03-28-2009 04:24 AM

You can use the global_start hook and tell it to bypass this on certain pages.

Here's a snippet I used.

PHP Code:

if (in_array(THIS_SCRIPT, array('400_forum''401_forum''403_forum',
    
'404_forum''500_forum')))
{
    
$vbulletin->options['bbactive'] = true;
    
$servertoobusy 0;
    
$vbulletin->userinfo['permissions']['forumpermissions'] |= $vbulletin->
        
bf_ugp_forumpermissions['canview'];


Just change the THIS_SCRIPT array to contain your external pages.

Riotblade 03-28-2009 04:41 AM

Thanks for the snippet. However, in what form do my pages show up in the THIS_SCRIPT array? Let's say I'm loading it from "http://domain.com" or "http://domain.com/page.php". Do they show up with the http:// stripped?

Lynne 03-28-2009 02:50 PM

THIS_SCRIPT is defined at the top of your php page. For instance, this is at the top of the showthread.php page:
PHP Code:

define('THIS_SCRIPT''showthread'); 


Riotblade 03-28-2009 04:30 PM

Works great, thanks

My next question would be if it's possible to create a session for each guest who visits the external pages to include them in the total "Who's online" count.

TigerC10 03-28-2009 04:32 PM

It already does that... If you view the "who's online" page, it'll show you guests and members. The bottom of the forum home says, "x people online, y members and z guests". If your custom pages aren't compatible with the "who's online" stuff, then guests won't be shown.

View this article:
https://vborg.vbsupport.ru/showthread.php?t=157329


All times are GMT. The time now is 02:56 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.01449 seconds
  • Memory Usage 1,727KB
  • 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_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)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