Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases
Must be member for X days before can vote on polls. Details »»
Must be member for X days before can vote on polls.
Version: 1.00, by WreckRman2 WreckRman2 is offline
Developer Last Online: Jul 2014 Show Printable Version Email this Page

Version: 3.0.3 Rating:
Released: 08-27-2004 Last Update: Never Installs: 3
 
No support by the author.

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!

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 08-28-2004, 07:35 AM
HiDeo's Avatar
HiDeo HiDeo is offline
 
Join Date: Oct 2003
Posts: 306
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for this hack IndyWebDesign
Reply With Quote
  #3  
Old 08-31-2004, 02:27 AM
kall's Avatar
kall kall is offline
 
Join Date: Apr 2004
Location: New Zealand
Posts: 2,608
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #4  
Old 08-31-2004, 02:14 PM
WreckRman2 WreckRman2 is offline
 
Join Date: Dec 2001
Location: Indianapolis, IN
Posts: 158
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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...
Reply With Quote
  #5  
Old 09-06-2004, 04:29 PM
dsotmoon dsotmoon is offline
 
Join Date: Jun 2003
Location: VA - USA
Posts: 194
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

is there a way to set this to be after so many days OR post count
Reply With Quote
  #6  
Old 09-06-2004, 04:47 PM
WreckRman2 WreckRman2 is offline
 
Join Date: Dec 2001
Location: Indianapolis, IN
Posts: 158
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #7  
Old 10-26-2004, 03:25 PM
oldford's Avatar
oldford oldford is offline
 
Join Date: Feb 2003
Posts: 100
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is just what I'm looking for, but I can't get it to work. My existing members can't vote.
Reply With Quote
  #8  
Old 11-03-2008, 12:20 PM
home9000 home9000 is offline
 
Join Date: Aug 2005
Posts: 126
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

any one have this hack for 3.6.5
Reply With Quote
  #9  
Old 12-08-2008, 10:16 AM
tiengnhat tiengnhat is offline
 
Join Date: Feb 2008
Posts: 56
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Who can change this mod for V3.7.x?
@Admin: can you help me for this mod?
I really need this mod.
Thanks!
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:17 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04780 seconds
  • Memory Usage 2,270KB
  • Queries Executed 22 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (6)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (8)postbit
  • (9)postbit_onlinestatus
  • (9)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete