The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Defining global variables in plugin.
What I need is a plugin that defines global variables, to be used for userprofilefields.
This needs to be done in a way that the variables are loaded in EVERY template. So I think it should be a plugin that uses the "global_start" hook. However I cannot get it working. Here is an example of what code is present in some of my templates (such as postbit_legacy, memberinfo, search_resultbit etc etc). Code:
<if condition="$pf_job"><img src="job.gif" /></if> <if condition="$pf_employee"><img src="employee.gif" /></if> <if condition="$pf_occu & 1"><img src="/images/1-0.gif" border="0" alt="" /></if> <if condition="$pf_occu & 2"> <img src="/images/1-1.gif" border="0" alt=""></if> <if condition="$pf_occu & 4"><img src="/images/2-0.gif" border="0" alt=""></if> <if condition="$pf_occu & 8"><img src="/images/2-1.gif" border="0" alt=""></if> <if condition="$pf_occu & 16"><img src="/images/3-0.gif" border="0" alt=""></if> <if condition="$pf_occu & 32"><img src="/images/3-1.gif" border="0" alt=""></if> <if condition="$pf_artpref">$pf_artpref</if> and many more. This is what I have so far: PHP Code:
I don't want to modify the source php files, it HAS to be done in a plugin. thx in advance. |
#2
|
|||
|
|||
there's got to be SOMEONE who knows more about this kind of stuff
im pretty much stuck here |
#3
|
||||
|
||||
There is no such array as $post available to the global_start hook, you would need to use $vbulletin->userinfo['field14'] etc.
|
#4
|
|||
|
|||
No luck
plugin hook: global_start PHP Code:
Code:
<if condition="$pf_level">$pf_level</if> |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|