The Arcive of vBulletin Modifications Site. |
|
Must be member for X days before can vote on polls. Details »»
|
|||||||||||||||||||||||||||
|
Must be member for X days before can vote on polls.
Developer Last Online: Jul 2014
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']); $jointime = (TIMENOW - $bbuserinfo['joindate']) / 86400; // Days Joined Code:
if (!($forumperms & CANVIEW) OR !($forumperms & CANVOTE))
{
print_no_permission();
}
Code:
if (!($forumperms & CANVIEW) OR !($forumperms & CANVOTE) OR $jointime<10 )
{
print_no_permission();
}
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! Show Your Support
|
|||||||||||||||||||||||||||
| Comments |
|
#2
|
||||
|
||||
|
Thanks for this hack IndyWebDesign
|
|
#3
|
||||
|
||||
|
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.
|
|
#4
|
|||
|
|||
|
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...
|
|
#5
|
|||
|
|||
|
is there a way to set this to be after so many days OR post count
|
|
#6
|
|||
|
|||
|
Change:
Code:
if (!($forumperms & CANVIEW) OR !($forumperms & CANVOTE) OR $jointime<10 )
{
print_no_permission();
}
Code:
if (!($forumperms & CANVIEW) OR !($forumperms & CANVOTE) OR $jointime<10 OR $bbuserinfo['posts'] <10 )
{
print_no_permission();
}
|
|
#7
|
||||
|
||||
|
This is just what I'm looking for, but I can't get it to work. My existing members can't vote.
|
|
#8
|
|||
|
|||
|
any one have this hack for 3.6.5
|
|
#9
|
|||
|
|||
|
Who can change this mod for V3.7.x?
@Admin: can you help me for this mod? I really need this mod. Thanks! |
![]() |
|
|