Log in

View Full Version : if ($bbuserinfo['userid']!=0) doesn't work :(


bartek24m
11-09-2008, 12:18 AM
Hello i just wanna show on the some page php
avatar when visitor is a member
and otherwise some text when is guest

i have file php with this content

but it doesnt work properly


<?php

// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'tabrecentthreadsexp'); // 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(
);

// pre-cache templates used by specific actions
$actiontemplates = array(
);

// ######################### REQUIRE BACK-END ############################
require_once('./global.php');
//require_once('./includes/vba_cmps_include_template.php');
require_once('./includes/vba_cmps_global.php');

// ################################################## #####################
// ######################## START MAIN SCRIPT ############################
// ################################################## #####################

?>

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

echo 'Hi member it is your avatar
<img src="' . $vbulletin->options['bburl'] . '/image.php?u=' . $vbulletin->userinfo['userid'] . '">';

} else {


echo 'Hello guest you have no avatar';

}
?>


When I'am logged/log out i see the second messages :(
do you know what I made mistake ?

Dismounted
11-09-2008, 02:18 AM
$bbuserinfo is only used in templates, everywhere else, use $vbulletin->userinfo.