vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Send Guests to an External URL or Static Page (https://vborg.vbsupport.ru/showthread.php?t=293588)

firebrand media 01-04-2013 06:47 PM

Send Guests to an External URL or Static Page
 
We're working on a heavily customized site for a client. This is a closed, "invitation-only" site.
So all guests need to go to a static HTML page with information and a login form.
The external page works fine, and the login works fine.

Right now, I'm able to force guests to log in with a custom plugin hooked on global_state_check

Code:

if ($vbulletin->userinfo['usergroupid'] == 1)
{
  if ((THIS_SCRIPT == 'login') or ($_POST['do'] == 'login'))
  {
 
  } else {
  $templater = vB_Template::create('custom_login');
  print_output( $templater->render());
  }
}

This is very close to what I need, but is there a way to just http redirect to the static page instead of rendering a template?

Running vBulletin 4.1 (Still porting our customized navigation to 4.2.)

gamaken 01-04-2013 07:38 PM

You want to redirect them with header location?
Code:

header( 'Location: http://www.foobar.net/login' ) ;

firebrand media 01-04-2013 08:26 PM

Exactly.
But I don't know how to get vBulletin 4.1 to send that header.

mokujin 01-04-2013 09:45 PM

Try this:

HTML Code:

exec_header_redirect('http://www.foobar.net/login');
May help you :D

firebrand media 01-07-2013 04:33 PM

Thanks so much!
That was exactly the magic that was needed. :)


All times are GMT. The time now is 09:18 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.01014 seconds
  • Memory Usage 1,712KB
  • 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_html_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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