The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
![]()
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 |
#2
|
|||
|
|||
![]() Quote:
PHP Code:
PHP Code:
|
#3
|
|||
|
|||
![]()
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 |
#4
|
||||
|
||||
![]() PHP Code:
PHP Code:
|
#5
|
||||
|
||||
![]()
Or you can use:
PHP Code:
|
#6
|
|||
|
|||
![]() PHP Code:
Unable to add cookies, header already sent. File: /htdocs/forums/services.php Line: 5 |
#7
|
||||
|
||||
![]() 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? |
#8
|
|||
|
|||
![]()
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 |
#9
|
||||
|
||||
![]()
If this is just to display different html then it would be more efficient to do it as a template conditional using $bbuserinfo[userid].
|
#10
|
|||
|
|||
![]()
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. |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|