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
#2
VB Should have definition for script path.

For MyBB it's MYBB_ROOT

You can also try using a global like $_SERVER['PATH_INFO'] or $_SERVER['DOCUMENT_ROOT']
Superman I am here to rescue you.
This is Support Forums not Support PMs.  Do not PM me for support unless it's private and site related.
Reply
#3
(10-17-2010, 11:08 AM)Omniscient Wrote: VB Should have definition for script path.

For MyBB it's MYBB_ROOT

You can also try using a global like $_SERVER['PATH_INFO'] or $_SERVER['DOCUMENT_ROOT']

Yep thats exactly the way i ended up going. However for some reason that did not work.
I did use the chdir option and that seemed to fix it.
Thanks for your help Omni.
The Rules!
FTW Forum <-- Home of the Damned! --> Join me On MM


Reply


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

Forum Jump:


Users browsing this thread: 1 Guest(s)