PDA

View Full Version : Displaying different headers on non-VB page


shawno
09-26-2004, 02:07 PM
Hello,

I have been trying all weekend to get 2 different headers to show up on NON-VB pages on for when the user is

a) Logged Out
b) Logged In

I am now looking for a bit of assistance to tell me what is wrong with the code I have used from about 3 other threads.

<?php

error_reporting(E_ALL & ~E_NOTICE);

$path = "./forum/";

chdir($path);
require_once("./includes/config.php");

if ($bbuserinfo['userid']!=0) {

echo "

Header html code for a user not logged in

";

} else {

echo "

Header html code for a user logged in

";

}

The html code shows up fine in the PHP script but for some reason I can't seem to get the IF or ELSE statement to work properly when I log in and log out accordingly (ie either header 'a' or header 'b').

I have even tried substituting 'usergroupid' instead of 'userid' with no avail.

Any help would be much appreciated as I feel I am so close (but yet so far!).....

Thanks

Shawno

shawno
09-26-2004, 04:25 PM
It would seem that I found the error in my ways (which probably means in about 30 minutes I'll be back on these boards posting another 'help!').....change the top bit as detailed below.


<?php

error_reporting(E_ALL & ~E_NOTICE);

$path = "./forum/"; // path to your forums folder, normally /forum/

chdir($path);
require_once("./global.php");

if ($bbuserinfo['usergroupid'] ==1) {


If any one else is interested we ended up creating a seperate PHP file for each header (for each different page). Don't forget this PHP file has to go at the top of each page that it is included in.

This thread was quite useful as well in trying to work this out:
http://www.vbulletin.com/forum/showthread.php?t=81549

Also the search word of 'non-VB pages' gave the most accurate hits.

Later