![]() |
Must be member for X days before can vote on polls?
I started a contest on my site wouldn't you know it I am seeing new members signup then vote on a poll. I'd like to set up a way to stop this and the simplest way would be to require a member to be registered for X amount of days before they can vote on a poll. This way if I run a poll for 7 days I can set it to not allow new members to vote until they have been a member for 8 days.
Anyone know how this can be done? Thanks in advance! |
Quote:
How, well set the usergroup settings for registered users to not be able to vote, and then make a new user group based of registered that CAN vote. Then make a promotion that runs after you have been there for X days. and have that put them in an additional group that you made. =3 |
That would work but seem like alot of extra work needed. Changing usergroups just for this seems like too much.
Thanks. |
aw, wouldn't be that much. We have a LOT of additional groups for priveledges. ;)
|
Seems like it would be simpler to edit the permissions line in poll.php.
Code:
if (!($forumperms & CANVIEW) OR !($forumperms & CANVOTE)) I know thats all wrong because first you must determine the join date and todays date then see if they are more than the desired time frame. |
Well I took the easy way out for now and used :
Code:
if (!($forumperms & CANVIEW) OR !($forumperms & CANVOTE) OR $bbuserinfo[posts]<1 ) I just want to prevent someone from registering new names just to vote for themselves. |
OK, here we go...
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 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> |
I know this is an old post, but I wanted to thank IndyWebDesign for the code. It was exactly what I needed. Many times people figure out the answer to their original question, but don't ever come back and let the rest of us know what it is.
|
it's good, but we need it as a real hack, to set deffrint amount of days and posts to every poll.
|
All times are GMT. The time now is 02:43 PM. |
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:
|