Advertisement:

Posting BEFORE Voting in a Poll??

Aloittaja THE Mike, elokuu 21, 2007, 08:25:02 AP

« edellinen - seuraava »

THE Mike

I'm looking for (or hoping), there is a mod out there (or one that can be done) that will force people to make a post BEFORE voting on a poll in that specific thread.

I know I've seen things where people would need to make post before they can download a file, so I would think this wouldn't be too hard to do?

Anyone have any suggestions? Or have something like this?

Any help would be greatly appreciated.
Thanks everyone.
mike

THE Mike

No one has done anything like this at all?...

codenaught

You can do this by editing Sources/Poll.php:

Find:

// Even with poll_vote permission we would never be able to register you.
if ($user_info['is_guest'])
fatal_lang_error('cannot_poll_vote');

loadLanguage('Post');


After add:

if (!empty($_POST['options']))
{
$request = db_query("
SELECT COUNT(msg.ID_MSG)
FROM {$db_prefix}topics AS t
LEFT JOIN {$db_prefix}messages AS msg ON (t.ID_TOPIC = msg.ID_TOPIC)
WHERE msg.ID_MEMBER = $ID_MEMBER AND t.ID_TOPIC = $topic", __FILE__, __LINE__);
list($num_posts) = mysql_fetch_row($request);
if ($num_posts < 1)
fatal_error("You must make a post in this topic in order to vote.");
}


How do I modify files?

With this method the poll will still be shown but when you try to vote it will give you an error message. Would you like the poll to not be shown at all, or is this fine?
Dev Consultant
Former SMF Doc Coordinator

THE Mike

THANKS! I tested it out and it works like a charm!

I appreciate it!

Advertisement: