vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Using Vbulletin Variables in External PHP (https://vborg.vbsupport.ru/showthread.php?t=322327)

grey_goose 04-08-2016 04:10 PM

Using Vbulletin Variables in External PHP
 
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
PHP Code:

$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('trackermini' => $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.


All times are GMT. The time now is 04:09 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.00984 seconds
  • Memory Usage 1,716KB
  • 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
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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