View Full Version : Global.php access from different website?
brandon515
09-16-2015, 04:09 PM
Is it possible for me to include the global.php file in some code from a website that is different than my vbulletin site?
What I am trying to accomplish is to allow members of a specific usergroup on my vb site, to have access to a private section on one of my non vb sites.
Thanks
Yes that is possible, you may also have to use the chdir PHP function to change to the right directory.
brandon515
09-16-2015, 06:35 PM
Thanks for the reply. How would I call it? Would I need to include db info?
In case your forum is located at /forum, I believe it's a matter of doing:
chdir('forum');
require_once './forum/global.php';
Then you should be able to use the $vbulletin object.
brandon515
09-16-2015, 08:37 PM
This is going to be called from a different website, so wouldnt I need to use the full url of where the forum resides?
Zachery
09-16-2015, 08:47 PM
A different server? No.
ozzy47
09-16-2015, 09:29 PM
A different server? No.
Did the op say anything about a different server?
Zachery
09-17-2015, 12:00 AM
Did the op say anything about a different server?
This is going to be called from a different website, so wouldnt I need to use the full url of where the forum resides?
Context is important I suppose :)
If both sites are not on the same server, then you can't do what you want all that easily, in some cases even if it is, it may prove difficult. Session/Domain checking is not likely to work well cross domain.
I would suggest using something on the vBulletin side of things to send an auth token to your other site, to authenticate them when they leave to go to your other site.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.