PDA

View Full Version : Using Vbulletin Variables in External PHP


grey_goose
04-08-2016, 04:10 PM
I've got an external trackermini.php that I've got inserted into the postbit_legacy. It's working, with static data.

What I'd like to do is pass variables from the poster's info to the script -- but I can't seem to snag them. How do I grab fields from the POSTER to use?

Plugin at SHOWTHREAD_START
$templater->register('post', $post);
ob_start();
$var1 = $vbulletin->userinfo['userid']; <----- LOGGED IN USER VARIABLE WORKS
$var2 = $vbulletin->post['field109']; <----- NO WORKY
$var3 = $foruminfo[title_clean]; <----- GLOBAL VARIABLE WORKS
require_once('includes/trackermini.php');
$trackermini = ob_get_contents();
ob_end_clean();
vB_Template::preRegister('postbit_legacy',array('t rackermini' => $trackermini));

grey_goose
04-24-2016, 10:29 PM
No one?

Dave
04-24-2016, 10:43 PM
You should take a look at the showthread.php file so you can see what variables can or can't be used.
At the showthread_start hook, there's no reference to the post array yet since it's literally at the beginning of the script.

See if you can figure it out from there. If not feel free to ask.

grey_goose
05-03-2016, 02:04 PM
Ah. I realized my problem. I've gotten so used to using profile fields from CES Parser permissions in my postbit_legacy that I forgot that's not a native vbulletin feature. So, I'm guessing my problem here is that I want to use variables that mod creates before they're created.