Quote:
Originally Posted by CvP
It seems post.goodrank is not initialized to 0 (but post.badrank is 0) when a post is not voted (up or down) even once.
|
So you mean it's blank? Yes. It's not set unless there's a value... simple solution is to edit the plugin to make this variable an INT so if it's empty it goes to 0. This is changed for the next release but you can do it yourself... around like 946
Code:
$post['goodrank'] = int($post['goodrank']);
Quote:
2nd problem: I'm not sure how I can update the counters and images using ajax.
if you can give me some hint, I'm sure i can manage it.
I have modified the _roll template properly. all it needs to do is update codes according to the template.
|
You need to use the javascript voting code:
Code:
<a href="./helpfulanswers.php?do=rate&postid={vb:raw post.postid}&rank=1" <vb:if condition="$vboptions[disable_ajax] != 2"> onclick="return helpfulanswers_rate({vb:raw post.postid}, 1);" </vb:if> rel="nofollow" onmouseover="document.post_{vb:raw post.postid}_up.src='images/buttons/ha_arrowup.gif';" onmouseout="document.post_{vb:raw post.postid}_up.src='images/buttons/ha_arrowup_gray.gif';"><img name="post_{vb:raw post.postid}_up" src="images/buttons/ha_arrowup_gray.gif" width="11" height="20" border="0" alt="{vb:rawphrase helpfulanswer_yes}" /></a>