vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   VBExperience 4 - allow variables everywhere (https://vborg.vbsupport.ru/showthread.php?t=312787)

josh_krz 07-07-2014 02:56 PM

VBExperience 4 - allow variables everywhere
 
Hi there,

I'm pretty proficient with HTML, PHP and MYSQL but I have never dabbled with vBulletin plugins / products.

I would like to use variables from VBExperience such as user points everywhere on my forum.

I know that this variable isn't registered in the header template so I know I'll have to change some PHP but every attempt I make fails and nothing shows up.

I would like the logged in users points to be visible in the header template. Some explanation of how variables and templates work would be a great start, I don't expect to be spoon fed.

Thanks!

ozzy47 07-07-2014 03:21 PM

Questions/Problems regarding modifications/styles need to be asked in the modification/style thread. That is where the support for modification/style is - not out here in the main forums. Please note that if a modification/style is unsupported (or even if it says it is supported), you may be on your own if you chose to install it.

Although you can read through this article, https://vborg.vbsupport.ru/showthread.php?t=228078

vBNinja 07-07-2014 05:22 PM

1 Attachment(s)
you can use any of these in any template:

like this
PHP Code:

{vb:raw bbuserinfo.X

(replace X with the variable you want to use)

josh_krz 07-07-2014 05:59 PM

Quote:

Originally Posted by vBNinja (Post 2505734)
you can use any of these in any template:

like this
PHP Code:

{vb:raw bbuserinfo.X

(replace X with the variable you want to use)

Although you were slightly off you gave me the ideas I needed to complete this. In fact I used:
HTML Code:

{vb:raw bbuserinfo.xperience}
This show the points on all pages, thank you very much!

Is there a way to list all variables within bbuserinfo?

vBNinja 07-07-2014 06:03 PM

create a plugin using the global_complete hook

with:
PHP Code:

print_r($vbulletin->userinfo); 


Dave 07-07-2014 06:48 PM

And in case you don't want to use a hook or plugin, you can do it in a template as well:

PHP Code:

<vb:each from="$bbuserinfokey="key" value="value">
    {
vb:raw $key} - {vb:raw $value}<br>
</
vb:each


josh_krz 07-07-2014 08:00 PM

Thats fantastic! Really valuable information thanks a lot!


All times are GMT. The time now is 01:13 AM.

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.01049 seconds
  • Memory Usage 1,731KB
  • 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_html_printable
  • (4)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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