vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Global.php access from different website? (https://vborg.vbsupport.ru/showthread.php?t=320267)

brandon515 09-16-2015 04:09 PM

Global.php access from different website?
 
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

Dave 09-16-2015 05:12 PM

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?

Dave 09-16-2015 07:48 PM

In case your forum is located at /forum, I believe it's a matter of doing:
PHP Code:

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

Quote:

Originally Posted by Zachery (Post 2555168)
A different server? No.

Did the op say anything about a different server?

Zachery 09-17-2015 12:00 AM

Quote:

Originally Posted by ozzy47 (Post 2555170)
Did the op say anything about a different server?

Quote:

Originally Posted by brandon515 (Post 2555166)
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.


All times are GMT. The time now is 10:59 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
  • Page Generation 0.01397 seconds
  • Memory Usage 1,732KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete