Variables in templates

Robust

Well-known member
I have created a column called 'column' in xf_post, for example

If I use {$post.column} or {$message.column} (in templates post and message, respectively), would it refer to the database or some cached value?
 
@Chris D Right, I imagined so, so I have a situation here then.

Template modification to: message

Replace:
Code:
<xen:if is="{$xenOptions.baShowVoteRibbon} AND {$message.bestanswers} >= {$xenOptions.baVoteIndicatorMinimumVotes} AND in_array({$thread.node_id}, {$xenOptions.baEnabledForums})"><strong class="apBAVoteIndicator"><span></span>{xen:phrase bestanswer_voteindicator, 'votes={$message.bestanswers}'}</strong></xen:if>
// debug line below
{$message.bestanswers}

This gives me: 1 If I use another account and click the vote button, it says 2. So it's incrementing by one. That's not what is in the database.

79ee29fd80.png


bestanswers is 1500. If I make a vote, the $post.bestanswers is increased by 1, however the database increases by 50 (as expected, some usergroups can have more power to affect the vote), so it's not a problem on the PHP code end of things, the database is being edited as it should, something is just wrong with the addition of it into the template.
 
Back
Top Bottom