![]() |
using global.php from non-vb page
I have a custom application in which I want to make use of VB's user authentication.
I tried including global.php and checking for bbusrinfo[userid] variable etc.. But since vBulletin is using includes like below ("./includes/xxx.php") the scripts in nonVb folders are failing in includes... Had vBulletin used ("includes/xxx.php") without the preceding "." for current directory, it would have worked. Can you help me how I can check if a user is already logged in from my custom script? Thanks |
Use chdir('./path/to/your/forums'); so from then on all the paths are from vbulletins directory
|
Thankyou Specialist, it resolved the include issue.
One more question..I have my code snippet like this.. <? chdir("../Forums/"); include('global.php'); if($bbuserinfo[userid]) { //my application } else { print_please_login(); } ?> Is this a good way to do? Or any other better ways exist? Also, how can I select a specific style from the code here? I want my Login page/error Page to display from a custom Style. not from the default style. Can I do that by setting some variable here ? Thank you |
Make a plugin in the hook "style_fetch" and put the following in it:
PHP Code:
So maybe in your else{ PHP Code:
|
All times are GMT. The time now is 03:28 PM. |
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:
|