The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
PHP page for guests...
Hi I tried to make a PHP landing page using the global.php so its links to the database but it always requires people to login before showing it how can I make it visible even if the rest of the site is locked out for guests thanks
|
#2
|
||||
|
||||
You can use a conditional but I'm not exactly sure what you are trying to do.
|
#3
|
||||
|
||||
sounds like he has a vb page which he wants to display to guests, even though VB is not viewable to guests (forces a login to view)
|
#4
|
|||
|
|||
thats exactly what im after on vB 4.2.3
|
#5
|
||||
|
||||
Post your page code. You probably have some code in there that requires the user to login.
|
#6
|
|||
|
|||
it happens when i include the global.php file if I dont it works but it does not grab the theme info..
Im trying to use the Standard error template and add an intro video inside where the error message is as a welcome page but it requires a login when I include the global.php which I have to when displaying the theme / templates. |
#7
|
||||
|
||||
You probably need to add the below conditional to your page template
Code:
<vb:if condition="$bbuserinfo['userid'] == 0"> show this to guests </vb:if> Code:
if ($bbuserinfo['userid'] == 0) { do this for guests } |
#8
|
|||
|
|||
Quote:
Code:
<?php // ####################### SET PHP ENVIRONMENT ########################### error_reporting(E_ALL & ~E_NOTICE); // #################### DEFINE IMPORTANT CONSTANTS ####################### define('THIS_SCRIPT', 'welcome'); define('CSRF_PROTECTION', true); // change this depending on your filename // ################### PRE-CACHE TEMPLATES AND DATA ###################### // get special phrase groups $phrasegroups = array(); // get special data templates from the datastore $specialtemplates = array(); // pre-cache templates used by all actions $globaltemplates = array('WELCOME_PAGE'); // pre-cache templates used by specific actions $actiontemplates = array(); // ######################### REQUIRE BACK-END ############################ // if your page is outside of your normal vb forums directory, you should change directories by uncommenting the next line // chdir ('/path/to/your/forums'); require_once('./global.php'); // ####################################################################### // ######################## START MAIN SCRIPT ############################ // ####################################################################### $navbits = construct_navbits(array('' => 'Welcome PAge')); $navbar = render_navbar_template($navbits); // ###### YOUR CUSTOM CODE GOES HERE ##### $pagetitle = 'Welcome Page'; // ###### NOW YOUR TEMPLATE IS BEING RENDERED ###### $templater = vB_Template::create('WELCOME_PAGE'); $templater->register_page_templates(); $templater->register('navbar', $navbar); $templater->register('pagetitle', $pagetitle); print_output($templater->render()); ?> |
#9
|
||||
|
||||
Since you don't have any custom php code in there (you are just displaying a template), I would try adding the conditional to your template
|
#10
|
||||
|
||||
Do you allow Unregistered Users to view the regular start page of your site?
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|