1 (edited by newera70 2004-12-31 23:39)

Topic: Login Detection

First off I would like to apolpgize for asking so many questions once someone answers this problem I will cut back greatly...
Also I know this is a punbb forum but I have VBulletin installed and have a problem not with VBulletin but with PHP...

Ok here is my problem: I am trying to make a type of detection thing for my mainpage of my site punkera.net/index.php and its supposed to show "Welcome Back, [Username] hope you enjoy your stay!" if it detects your logged in if it detects that you not logged in or you a guest its supposed to say "( Login | Register )" so i have this for code

<?php
$login = 'Login';
$register = 'Register';
$userid = $bbuserinfo['userid'];
$username = $bbuserinfo['username']
?>

<?php
if ($userid)
{
echo "Welcome Back, " . $username . " hope you enjoy your stay!";
}
else
{
echo "<b>(</b> <a href=" . "forums/login.php" . ">" . $login . "</a> <b>|</b> <a href=" . "forums/register.php" . ">" . $register . "</a> <b>)</b>";
}
?>

I got $bbuserinfo['userid'] and $bbuserinfo['username'] from index.php of the url is punkera.net/forums/index.php ...


All this does is show "( Login | Register )" all the time even when the user is logged into the forum...

I hope someone can help me...

Here is a file you might need: the index.php of Vbulletin

EDIT: link works now

Sincerely,
Newera70


EDIT: I found this for the VBulletin login message if it helps any

if ($bbuserinfo['userid'])
{    // registered user
    $showmemberwelcome = true;
}
else
{    // guest
    $showmemberwelcome = false;
}

2

Re: Login Detection

If you check if ($userid) I think it's always false (except the rare case of user id being 1). I think you should check if(isset($bbuserinfo['userid'])) instead. I don't think if(isset($userid)) works either because you actually set it there.

Re: Login Detection

No it does not work... :-(

4

Re: Login Detection

If nothing sets that $bbuserinfo then it will be false all the time. Do you have the code to read the user data from the database in the punkera.net/index.php file?

5 (edited by newera70 2005-01-02 02:22)

Re: Login Detection

no i donno how to do that can someone help me plz?

6

Re: Login Detection

It's all in the vbulletin code so asking their support forums for help could prove more fruitful.

Re: Login Detection

I have tried asking thier support forums but there screwed up so much everytime i try to sign up i never get my email to activate so my accounts are always dead

Re: Login Detection

^^^

9

Re: Login Detection

It's in the vBulletin code to which I don't have access so I really can't help you.

Try Google: http://www.google.fi/search?q=integrate+vbulletin+login
or try again the vbulletin support forums. I found the answers there too, but I can't see the code because I don't own a license.

Re: Login Detection

Removed link

Oh no, you don't. vBulletin is not open source smile /Rickard

Re: Login Detection

Jacq wrote:

It's in the vBulletin code to which I don't have access so I really can't help you.

Try Google: http://www.google.fi/search?q=integrate+vbulletin+login
or try again the vbulletin support forums. I found the answers there too, but I can't see the code because I don't own a license.

Do the licenses cost? i have tryed to reg 3 times 2 times i never got a email and once it didnt work...

Re: Login Detection

Connorhd wrote:

Removed linkOh no, you don't. vBulletin is not open source smile /Rickard

whoops my mistake tongue