The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Usergroup condition without global.php
We're using ExpressionEngine with vB and whenever I include global.php within EE I get various PHP errors, so instead I was wondering if it was possible to use '$vbulletin->userinfo['usergroupid']' without including global.php and if so how .
Thanks |
#2
|
|||
|
|||
The current directory needs to be your forum directory (the directory that contains global.php) before including it. So do a chdir() to the forum dir, include global.php, then chdir() back if you need to.
Also, if you want to do the include inside a function, you need to declare some variables as global before you do the include (I keep forgetting what they are - if you want to do this, I'll try to find where someone posted it before). |
#3
|
|||
|
|||
Quote:
Fatal error: Call to a member function load_editor_settings() on a non-object in /home/nextgenupdate/public_html/forums/infernoshout/engine/inferno_load.php on line 24 Is there really no way of defining it without global.php? I feel it'd be so much simpler . |
#4
|
|||
|
|||
So you did something like:
Code:
$curdir = getcwd(); chdir('forumid'); // change to path to your actual forum directory require_once('./global.php'); chdir($curdir); |
#5
|
|||
|
|||
Quote:
I'm not convinced it's that plugin, I was getting another error message before that so I assume the two are intertwined. It just doesn't seem to want me to include global.php in any sense. |
#6
|
|||
|
|||
Quote:
|
#7
|
|||
|
|||
I'm not familiar with EE. I don't have any other ideas without seeing the error messages. Like I mentioned above, if the include call is being done inside a function then that won't work without more "global" staements. It could also be that there is some conflict in naming between vB and EE.
You could connect to the db and read the user table to get the usergroupid, but you'd need the username or userid. |
#8
|
|||
|
|||
Another thought - I remember a while back someone had managed to include init.php, and cut down on unnecessary code being executed by define()ing a number of values. Unfortunately I can't think of what to search for to find the post.
|
#9
|
|||
|
|||
Quote:
Quote:
--------------- Added [DATE]1364808655[/DATE] at [TIME]1364808655[/TIME] --------------- Quote:
Thanks for your help. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|