Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 08-28-2004, 02:18 AM
WreckRman2 WreckRman2 is offline
 
Join Date: Dec 2001
Location: Indianapolis, IN
Posts: 158
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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!
Reply With Quote
  #2  
Old 08-28-2004, 04:52 AM
Tekton Tekton is offline
 
Join Date: Jun 2004
Location: Wisconsin
Posts: 362
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by IndyWebDesign
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!
Sounds as simple as a user promotion to a "can vote" additional group.

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

That would work but seem like alot of extra work needed. Changing usergroups just for this seems like too much.

Thanks.
Reply With Quote
  #4  
Old 08-28-2004, 05:28 AM
Tekton Tekton is offline
 
Join Date: Jun 2004
Location: Wisconsin
Posts: 362
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

aw, wouldn't be that much. We have a LOT of additional groups for priveledges.
Reply With Quote
  #5  
Old 08-28-2004, 05:40 AM
WreckRman2 WreckRman2 is offline
 
Join Date: Dec 2001
Location: Indianapolis, IN
Posts: 158
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Seems like it would be simpler to edit the permissions line in poll.php.

Code:
		if (!($forumperms & CANVIEW) OR !($forumperms & CANVOTE))
	{
		print_no_permission();
	}
Simply add another OR $bbuserinfo[joindate ]<10

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

Well I took the easy way out for now and used :

Code:
if (!($forumperms & CANVIEW) OR !($forumperms & CANVOTE) OR $bbuserinfo[posts]<1 )
	{
		print_no_permission();
	}
This will deny a member from voting unless they have at least one post. I'd rather have a date because many members register and never post but still enjoy polls, etc. Once I figure it out I will share my findings.

I just want to prevent someone from registering new names just to vote for themselves.
Reply With Quote
  #7  
Old 08-28-2004, 06:47 AM
WreckRman2 WreckRman2 is offline
 
Join Date: Dec 2001
Location: Indianapolis, IN
Posts: 158
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK, here we go...

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

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.
Reply With Quote
  #9  
Old 03-29-2006, 10:49 AM
SilverBoy SilverBoy is offline
 
Join Date: Feb 2002
Location: Libya
Posts: 497
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

it's good, but we need it as a real hack, to set deffrint amount of days and posts to every poll.
Reply With Quote
Reply


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:14 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
  • Page Generation 0.04069 seconds
  • Memory Usage 2,237KB
  • Queries Executed 13 (?)
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
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (6)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)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
  • (9)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_postinfo_query
  • fetch_postinfo
  • 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