vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Best way to get $vbulletin->userinfo from an external page (https://vborg.vbsupport.ru/showthread.php?t=285035)

anakenabcn 06-29-2012 09:44 AM

Best way to get $vbulletin->userinfo from an external page
 
Hi,
I'm currently working on a PHP website (using Zend Framework) with an installation of vBulletin on the same domain. I've implemented an user system on this website that is syncronized with vBulletin.
I redirect the login and logout to vBulletin through "login.php" and "login.php?do=logout" with the requested parameters. And if the user try to access a page that need identification I check if the user is logged in with "$vbulletin->userinfo['userid']".

Right now I'm getting this data using the following code
Code:

$currentDir = getcwd();
chdir('./forum');
require_once('./global.php');
chdir($currentDir);
global $vbulletin;

It's working but I think that loading vBulletin environment for every request bring up an overhead that i'd like to reduce. I have some pages with galleries of user pictures and i use a php script to serve the pictures (so i can restrict the access if needed) and i'm loading "global.php" for everyone of these requests. On top of that, i had some issue with some http headers beeing overrided by my call to 'global.php'.

I've started looking inside vBulletin implementation and for example i found that global.php is initializing a lot of ressources i actually don't need. So maybe a possible fix would be to write a php script inside vBulletin installation loading only the needed ressources (only the userinfo).

So what do you think would be the best solution for this issue?
And is there some advanced documentation about vBulletin API to help me if i need to write this script?

Thank you


All times are GMT. The time now is 02:32 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.00947 seconds
  • Memory Usage 1,707KB
  • 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_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (1)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