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.
What I am looking for is a plugin that defines these variables (such as $pf_occu and $pf_job) as the profilefield ID's.
This is what I have so far:
PHP Code:
<plugin active="1">
<title>Easy Config</title>
<hookname>global_start</hookname>
<phpcode><![CDATA[
$pf_job = $post['field14'];
$pf_employee = $post['field15'];
$pf_occu = $post['field16'];
$pf_artpref = $post['field17'];
]]></phpcode>
</plugin>
Why is this plugin, in combination with the above posted template code, not working?
I don't want to modify the source php files, it HAS to be done in a plugin.
thx in advance.