vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Must be member for X days before can vote on polls. (https://vborg.vbsupport.ru/showthread.php?t=68808)

WreckRman2 08-27-2004 10:00 PM

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?
Add below it:

Code:

$bbuserinfo['datejoined'] = vbdate($vboptions['dateformat'], $bbuserinfo['joindate']);
$jointime = (TIMENOW - $bbuserinfo['joindate']) / 86400; // Days Joined

Directly below that look for:

Code:

if (!($forumperms & CANVIEW) OR !($forumperms & CANVOTE))
{
print_no_permission();
}

Change to:

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!

HiDeo 08-28-2004 07:35 AM

Thanks for this hack IndyWebDesign

kall 08-31-2004 02:27 AM

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.

WreckRman2 08-31-2004 02:14 PM

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...

dsotmoon 09-06-2004 04:29 PM

is there a way to set this to be after so many days OR post count

WreckRman2 09-06-2004 04:47 PM

Change:

Code:

if (!($forumperms & CANVIEW) OR !($forumperms & CANVOTE) OR $jointime<10 )
{
print_no_permission();
}

To:

Code:

if (!($forumperms & CANVIEW) OR !($forumperms & CANVOTE) OR $jointime<10 OR $bbuserinfo['posts'] <10 )
{
print_no_permission();
}

That should do it but it is untested.

oldford 10-26-2004 03:25 PM

This is just what I'm looking for, but I can't get it to work. My existing members can't vote.

home9000 11-03-2008 12:20 PM

any one have this hack for 3.6.5

tiengnhat 12-08-2008 10:16 AM

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
  • Page Generation 0.01141 seconds
  • Memory Usage 1,723KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (6)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete