Seems obvious, but you need a [HIDE-VOTE] option as well so that people can say things in a thread thats hidden to people who haven't already voted.
Approximately this;
Code:
/**
* Callback function for Parsing [HIDE-VOTE] Tag
*
* @param string Message text
*
* @return Message (Parsed)
*/
function p_bb_code_hv($message)
{
global $vbphrase;
$message = str_replace('\"', '"', $message);
// Checking if user can view the message
if (!$this->_registry->owner)
{
if ($this->_registry->threadid)
{
$creply = $this->_vbulletin->db->query_first("
SELECT p.pollid, p.votedate
FROM " . TABLE_PREFIX . "thread t
left join " . TABLE_PREFIX . "pollvote p on t.pollid = p.pollid
WHERE
p.userid = " . $this->_vbulletin->userinfo[userid] . "
AND t.threadid = " . $this->_registry->threadid . "
AND userid > 0 LIMIT 1 ");
if ($creply['pollid'] > 0 AND $creply['votedate'] > 0)
$this->_registry->hvote = true;
}
if ($this->_registry->dohtml)
{
if ($this->_registry->owner OR $this->_registry->hvote)
{ $usercansee = true; }
$templater = vB_Template::create('vfc_hide_hack_bbcode_vote');
$templater->register('usercansee', $usercansee);
$templater->register('postid', $this->_registry->postid);
$templater->register('message', $message);
$message = $templater->render();
return $message;
}
else
{
if ($this->_registry->owner OR $this->_registry->hvote)
{
return $message;
}
else
{
return $vbphrase[vfc_hidden_content_reply_vote];;
}
}
}
return $message;
}
Plus the associated vfc_hide_hack_bbcode_vote template.
And adding this
'HIDE-VOTE' => 'p_bb_code_hv',
to $taglist
etc.
You could go one step more complex and make a hide-vote-option that's only visible to people who selected a specific vote option, but seems unnecessarily complex for most usage.
Otherwise very good mod.