okay im trying to learn how to use the template rendering system on vbulletin 4, and i tried something very easy to learn how to do stuff, this is just something simple i want to do to learn how to use templating system because this is a much more complex than vb3 templating system:
im making a simple modification to print a random generated message on the postbit, right under the post count, what i have so far is this:
plugin at postbit_display_complete:
PHP Code:
$randmsg[1] = "hello";
$randmsg[2] = "wazzap";
$randmsg[3] = "hola";
$randmsg[4] = "bonjour";
$randmsg[5] = "guten taj";
$randgen = rand(1, 5);
$finalvar = $randmsg[$randgen];
$templater = vB_Template::create('randtemplate');
$templater->register('finalvar', $finalvar);
$template_hook[postbit_userinfo_right_after_posts] .= $templater->render();
template named randtemplate:
Code:
hello your random greeting is {vb.raw finalvar} !
<vb:if condition="$post[field5]"><div class="smallfont"> Gender: $post[field5]</div></vb:if>
$post[field5]
this template is supposed to display the value generated by the plugin AND print the gender field if there is any chosen by the user
now, the exact trouble im having is that i get printed EXACTLY the content of the template in my postbit, and the text inside the vb:if tags its completey ignored:
Code:
hello your random greeting is {vb.raw finalvar} ! $post[field5]
thats the text im getting, vb.raw finalvar doesnt changes as it is supposed nor $post[field5] does, all is printed just as i wrote it, and i have no idea why the text isnt being processed as it should
thanks for your help!