PDA

View Full Version : Accessing user data outside of VB


swellinfo
08-01-2012, 10:00 PM
Hi,

I am currently access VB user data outside of the forum software by including global.php

These are the variables I am referencing:

$vbuserid = $vbulletin->userinfo['userid'];
$vbusername = $vbulletin->userinfo['username'];
$vbpmtotal = $vbulletin->userinfo['pmtotal'];
$vbpmunread = $vbulletin->userinfo['pmunread'];
$vblogouthash = $vbuserid > 0 ? $vbulletin->userinfo['logouthash'] : "";

My questions is, is there a lighter way to do this. It seems that reading in the entire global.php isn't necessary for what I need. Also, I am running into a problem where a session_start() in the /forum/includes/facebook/facebook.php is interfering with my files outside of VB, so I'd like to just grab the $vbulletin->userinfo and cut out all the other stuff.

Any suggestions?

Lynne
08-01-2012, 11:12 PM
You can try just getting init.php instead of global.php. It may work fine.

swellinfo
08-01-2012, 11:45 PM
SWEET!! That worked, and is so much lighter weight.

The only thing I needed to add on was to define VB_AREA before including init.php
define('VB_AREA', 'Forum');

Thanks!