Create two new plugins using hook locations newreply_form_start and newreply_post_start, both using this same code:
PHP Code:
if ($threadinfo['pollid'])
{
$pollvotes = $vbulletin->db->query_read_slave("
SELECT voteoption
FROM " . TABLE_PREFIX . "pollvote
WHERE userid = " . $vbulletin->userinfo['userid'] . " AND pollid = $threadinfo[pollid] ");
if ($vbulletin->db->num_rows($pollvotes) == 0)
{
$vbulletin->url = 'showthread.php?' . $vbulletin->session->vars['sessionurl'] . "t=$threadid";
eval(standard_error("You must vote before posting in this thread."));
}
}
(which I mostly took out of showthread where it checks if a user has voted). You need two plugins because a user can post from quick reply or go to the reply form.
I haven't tried this extensively so there may be some other wy to reply that I didn't think of.
many thanks its works, member cannot reply before choosed poll
is there a code for must using poll to create a thread too?
its simple and ready mod, i suggest you create a thread for this in Mods forum