Hi,
my users ask me for a listing of their own votes likely like the listing from ".../profile.php?do=helpfulans".
I also found the plugin (Helpful Answers -- List Notifications) which creates that list:
Code:
if ($_REQUEST['do'] == 'helpfulans'){
$db->query_write("
UPDATE " . TABLE_PREFIX . "user
SET helpfulcnt = 0
WHERE userid = ". $vbulletin->userinfo['userid'] ."
");
$helpfulposts = $db->query_read("
SELECT ha.yesno,post.title,post.postid,user.username
FROM " . TABLE_PREFIX . "helpfulanswer as ha
LEFT JOIN " . TABLE_PREFIX . "post as post ON (ha.postid = post.postid)
LEFT JOIN " . TABLE_PREFIX . "user as user ON (ha.userid = user.userid)
WHERE post.userid = ". $vbulletin->userinfo['userid'] ."
ORDER BY ha.dateline DESC
LIMIT 50
");
while ($helpfulpost = $db->fetch_array($helpfulposts))
{
if($helpfulpost['yesno'] == 1){ $helpfulpost['yesno'] = 'Good'; }
else if($helpfulpost['yesno'] == 0 OR !$helpfulpost['yesno']){ $helpfulpost['yesno'] = 'Bad'; }
eval('$resultsbits .= "' . fetch_template('helpful_answers_notbit') . '";');
}
// draw cp nav bar
construct_usercp_nav('helpfulanswer_mosthelpful');
$templatename = 'helpful_answers_not';
}
but I can't change it for my needs. May anyone could help please.
I think it's not that different from the existing query, but I didn't find a clue.