Hi Ted,
thanks for your work.
There might be a bug in the product file, tho: I tried to install, but the script threw a mysql error at me, saying there was no field "helpfulanswerid" in the fieldset of table "helpfulpost".
I checked and found that there had been no tables installed into my database and thought: Well, of course, there's no field if the tables did not get installed. So I looked at your product file and took out the mysql-CREATEs and created the tables in phpmyadmin.
I tried to install again, and yet again the script threw the same error at me, tho I was pretty sure the tables were created as they were supposed to be. Indeed, there was no such field in helpfulpost. After a closer look at your script, I was pretty sure that the line
Code:
SELECT COUNT(helpfulanswerid) as count FROM " . TABLE_PREFIX . "helpfulpost
was supposed to read
Code:
SELECT COUNT(helpfulanswerid) as count FROM " . TABLE_PREFIX . "helpfulanswer
i.e., the query was going to the wrong table. After changing this, I had no further problems installing, and the mod works just fine (at least, I did not find any errors up to now).
Another question concerning phrase helpfulanswer_postshavebeen. It reads "{1}'s Posts have been rated good {2} out of {3} times</span>". Is that </span>-Tag really supposed to be there?
Then I did a little modification to the helpful_answers_roll-Template. I was somewhat disappointed that there was no way to have icons when I want to allow only positive ratings (or did I miss something?). So I set the options to "Images - Thumbs with rollover" anyway and changed the template code as follows:
Find:
Code:
<if condition="$show['rate_helpfulanswer']">
<strong>$vbphrase[helpfulanswer_didyoufind] <a href="./helpfulanswers.php?do=rate&postid=$post[postid]&rank=1">$vbphrase[helpfulanswer_yesidid]</a></strong>
</if>
Replace with:
Code:
<if condition="$show['rate_helpfulanswer']">
$vbphrase[helpfulanswer_didyoufind] <a href="./helpfulanswers.php?do=rate&postid=$post[postid]&rank=1" <if condition="$vboptions[disable_ajax] != 2"> onclick="return helpfulanswers_rate($post[postid], 1);" </if> rel="nofollow" onmouseover="document.post_$post[postid]_up.src='images/buttons/ha_thumbsup.gif';" onmouseout="document.post_$post[postid]_up.src='images/buttons/ha_thumbsup_gray.gif';"><img name="post_$post[postid]_up" src="images/buttons/ha_thumbsup_gray.gif" width="11" height="20" border="0" alt="$vbphrase[helpfulanswer_yes]" align="absmiddle" /></a>
<if condition="$show['guest'] AND $vboptions['helpans_guestshow']">
$vbphrase[helpfulanswer_didyoufind]
<a href="./helpfulanswers.php?do=guestrate" <if condition="$vboptions[disable_ajax] != 2"> onclick="return helpfulanswers_rate($post[postid], 1);" </if> rel="nofollow" onmouseover="document.post_$post[postid]_up.src='images/buttons/ha_plus.png';" onmouseout="document.post_$post[postid]_up.src='images/buttons/ha_plus_gray.png';"><img name="post_$post[postid]_up" src="images/buttons/ha_plus_gray.png" width="20" height="20" border="0" alt="$vbphrase[helpfulanswer_yes]" align="absmiddle" /></a>
</if>
It will also show the green thumbsup for posts the user has already rated.