I have currently installed modx for testing purposes and I have integrated it with a vBulletin forum using the banzaitokyo Plugin which is all working fine.
I have now written a snippet that gets the logged in users details using the vBulletin sessionid which is all fine but currently I have to include the php code in each plugin/module/snippet (I don’t know what to call them they were plugins in subdreamer) i.e. latest posts, users online, latest polls etc.....
What I would like to do is create a global variable so I can access this from any piece of code i.e create something like $modx->vbinfo->id or create my own $vbinfo to be used wherever I would like.
Should I do this via a plugin and call it on page load ?
I am not the most technical so bare with me...
Thanks in advance
Paul
You could save the info in a $_SESSION variable as long as MODx and VBulletin are sharing the same session.
$_SESSION['vbinfo'] = $your_info;
$my_info = $_SESSION['vbinfo'];
The second line should be good anywhere, although you may have to put a session_start(); above it to make it work.
http://us.php.net/session