Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
vbulletin / php question?
#1
Ok guys and gals.
I have a VB forum as some of you are aware.
Now i want to be able to put custom scripts in my forum but still call up the global.php file to make sure the user is logged in in order to see the contents.
Thats simple enough to do.
I just use the below code.
PHP Code:
<?php 
require_once('./global.php'); 
if (
$vbulletin->userinfo['userid']!=0) {
  echo 
"Welcome Back, <b>"
  echo 
$vbulletin->userinfo['username'];  
  } else {
  echo 
"Sorry No Joy, <b>";
  }
 
?>

Now that works fine from the root.
But if i try this in a directory i get errors.
Obviously i have to point to ../global.php?
Well when i try that i get further errors?
It detects the global just fine but it trips up with a bootstrap hook in the global.php file. I assume because it does not know where it is?
Im sure its a simple answer but its got me buggered.
I tried to define the root path also
Code:
define( ROOT_PATH , "./" );
and no luck still!

Any help would be appreciated thanks all.
The Rules!
FTW Forum <-- Home of the Damned! --> Join me On MM


Reply


Messages In This Thread
vbulletin / php question? - by DAMINK™ - 10-16-2010, 08:05 PM
RE: vbulletin / php question? - by Omniscient - 10-17-2010, 11:08 AM
RE: vbulletin / php question? - by DAMINK™ - 10-17-2010, 01:12 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  vBulletin Template Errors. Sam 6 2,070 01-01-2012, 08:09 PM
Last Post: Sam
  Can vBulletin recover from it's negative reputation? Terrorz 12 2,346 07-11-2011, 02:40 PM
Last Post: Kyle FYI™
  [ImpEx] MyBB -> vBulletin Maestro 2 1,812 02-25-2011, 05:54 AM
Last Post: Maestro
  vBulletin, Invision, phpBB or MyBB? KissXsis 58 18,576 01-22-2011, 04:37 PM
Last Post: Tyler8746
  Need vBulletin Installed? Simplicity 10 3,499 08-02-2010, 06:05 PM
Last Post: Simplicity

Forum Jump:


Users browsing this thread: 1 Guest(s)