dai-kun |
11-05-2009 07:44 AM |
Hey thanks for the addon. I tried using "Enable Single Post Voting" as "yes" but members can still vote for multiple post in single thread. :(
You're missing a curly bracket and onevote should be helpans_onevote I believe
In helpfulanswers.php
Quote:
// check if they can vote more than once per thread
if($vbulletin->options['onevote']){
$helpfulvote = $db->query_first_slave("
SELECT COUNT(helpfulanswerid) as count FROM " . TABLE_PREFIX . "helpfulanswer
WHERE userid = $safeuserid AND threadid = $postinfo[threadid]
");
$count = $helpfulvote['count'];
|
Quote:
// check if they can vote more than once per thread
if($vbulletin->options['helpans_onevote']){
$helpfulvote = $db->query_first_slave("
SELECT COUNT(helpfulanswerid) as count FROM " . TABLE_PREFIX . "helpfulanswer
WHERE userid = $safeuserid AND threadid = $postinfo[threadid]
");
} $count = $helpfulvote['count'];
|
There is no threadid field under helpfulanswer table so we need to run a query to add that field in.
Then we need to have the query update the threadid when a user votes
In helpfulanswers.php
Quote:
// add the vote to the db log
$db->query_write("
INSERT INTO " . TABLE_PREFIX . "helpfulanswer
SET postid = $postinfo[postid], userid = $safeuserid, yesno = '$saferank', dateline = ". TIMENOW ."
");
|
Quote:
// add the vote to the db log
$db->query_write("
INSERT INTO " . TABLE_PREFIX . "helpfulanswer
SET postid = $postinfo[postid], threadid = $postinfo[threadid], userid = $safeuserid, yesno = '$saferank', dateline = ". TIMENOW ."
");
|
Now I got it to work :D
|