PDA

View Full Version : A little PHP code help in my vbulletin php script PLEASE PLEASE HELP!


Selene
09-11-2006, 03:40 PM
I am using this chat.php in my /forums

it is an integrated chat page so it logs in users in realchat from vbulletin (those who are logged in)

now its working fine, but if the person is not logged in vbulletin forums and clicks on chat.php then he gets entered as the nick "Unregistered".

I want it so that if its not a logged in user from vbulletin then he should end up with a error msg or like the login applet.

Here is the php code for the embeded vb thing:


<param name="nick" value="<?php echo $vbulletin->userinfo[username]; ?>">
<param name="embedded" value="yes">


so what shud i change so only registered and logged in vb users can enter chat, and other guests get a error msg or login applet

Delphiprogrammi
09-11-2006, 03:58 PM
I am using this chat.php in my /forums

it is an integrated chat page so it logs in users in realchat from vbulletin (those who are logged in)

now its working fine, but if the person is not logged in vbulletin forums and clicks on chat.php then he gets entered as the nick "Unregistered".

I want it so that if its not a logged in user from vbulletin then he should end up with a error msg or like the login applet.

Here is the php code for the embeded vb thing:


<param name="nick" value="<?php echo $vbulletin->userinfo[username]; ?>">
<param name="embedded" value="yes">


so what shud i change so only registered and logged in vb users can enter chat, and other guests get a error msg or login applet


<param name="nick" value="<?php echo {$vbulletin->userinfo['username']};?>">


but you could do this in the chat.php file ...


if(!$vbulletin->userinfo['userid'])
{
eval(standard_error(print_error('error_enteringcha t')));
}


"error_enteringchat" is a phrase you need to add to the error messages group and enter the message you would like yo appaer (in the phrases manager)