![]() |
Must be member for X days before can vote on polls.
Recently I ran a contest in which the members voted on the winner. Problem I ran into was that people were registering new names just to vote multiple times. I figured the best way to prevent this was to disallow new members from voting on polls for X amount of days. Being I ran the poll for 7 days I set my code to not allow members who have registered within the last 10 days from voting.
I thought I would share my work being I have gotten so much from others here. It's very simple and only requires modifying one file. Open poll.php and search for: Code:
// other permissions? Code:
$bbuserinfo['datejoined'] = vbdate($vboptions['dateformat'], $bbuserinfo['joindate']); Code:
if (!($forumperms & CANVIEW) OR !($forumperms & CANVOTE)) Code:
if (!($forumperms & CANVIEW) OR !($forumperms & CANVOTE) OR $jointime<10 ) Change $jointime<10 to how ever many days you wish to set it to. This means a user can not vote on a poll if they have not been a member for at least 10 days. I also added this line to my nopermission_loggedin phrase: <li>If you are trying to vote on a poll, you must be a member for at least 10 days before you can vote on polls.</li> Enjoy! |
Thanks for this hack IndyWebDesign
|
Or, you could use vB 3.x's built in promotions system. Disallow the Registered Users group the ability to vote on polls, and set a Promotion into a second usergroup (identical, but can vote on polls) after being a member for 10 days.
|
Yes, you can use the Promotion system however I thought a little extra code was much easier than adding extra usergroups. At least it was for me...
|
is there a way to set this to be after so many days OR post count
|
Change:
Code:
if (!($forumperms & CANVIEW) OR !($forumperms & CANVOTE) OR $jointime<10 ) Code:
if (!($forumperms & CANVIEW) OR !($forumperms & CANVOTE) OR $jointime<10 OR $bbuserinfo['posts'] <10 ) |
This is just what I'm looking for, but I can't get it to work. My existing members can't vote.
|
any one have this hack for 3.6.5
|
Who can change this mod for V3.7.x?
@Admin: can you help me for this mod? I really need this mod. Thanks! |
All times are GMT. The time now is 06:14 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|