![]() |
$vbulletin->$userinfo ?
Hi,
I'm working on a vb-powered comment system for my site, and I'm quite done - just one last problem I don't get solved (probably a real dumb one...) I already checked whether the user is logged in. Now, a new thread is to be created. For this I'm using code from the "How to create a thread"-thread. As long as I define a variable for the userid, it works like a charm. But when I try to read the userid of the currently logged in user, something goes wrong. Here's the relevant part of the code I'm using: PHP Code:
Sven |
Quote:
PHP Code:
PHP Code:
|
I am new to Vbulletin...
Can you show me how you "checked to see if the user was logged in" I am allowing a form to be submitted by the user and posted to an html table. I have all that working with html and php but would like to check to make sure they are logged in to VBulletin before they submit the data and also capture thier login name for the post. Thanks, --jake |
PHP Code:
PHP Code:
|
Or you can use:
PHP Code:
|
PHP Code:
Unable to add cookies, header already sent. File: /htdocs/forums/services.php Line: 5 |
Quote:
yes, thats much more efficiant. i am a noob :banana: as for the error, shouldnt you be including the html files not requiring them? |
I am using the code above to test whether someone is logged in or not. When a user is NOT logged in i get this error:
Unable to add cookies, header already sent. File: /htdocs/forums/services.php Line: 5 If the user is already logged in, its works perfectly!! The problem is with this line. Why can't you use this line if a user is not logged in? include("global.php"); I need help!! I have vb 3.6 beta 3. Thanks, --jake |
If this is just to display different html then it would be more efficient to do it as a template conditional using $bbuserinfo[userid].
|
Can you tell me how to use $bbuserinfo as a template conditional? I have to explore other ways of figureing out whether someone is logged in or not. The previously discussed method does not work. Really its just that require_once('global.php'); statement that does not work if you are not logged in.
Does your method need the global.php ?? Thanks, still need help, --jake Its not just to display html differently, its to allow access to my custome code if they are logged in. |
I don't see why global.php would not work if your not logged in.
Why are you turning off the session? PHP Code:
PHP Code:
|
Thanks for everyone's help.
The problem is finally solved. < html > tag was interfereing with php script. I had actually removed everything from the script for testing but left the < html > start and stop tags. I thought that was legal. Guess it causes havoc with vb. According to W3 schools its ok. Thanks, --jake |
All times are GMT. The time now is 04:09 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|