vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Must be member for X days before can vote on polls? (https://vborg.vbsupport.ru/showthread.php?t=68800)

WreckRman2 08-28-2004 02:18 AM

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!

Tekton 08-28-2004 04:52 AM

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

WreckRman2 08-28-2004 05:25 AM

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

Thanks.

Tekton 08-28-2004 05:28 AM

aw, wouldn't be that much. We have a LOT of additional groups for priveledges. ;)

WreckRman2 08-28-2004 05:40 AM

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.

WreckRman2 08-28-2004 05:56 AM

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.

WreckRman2 08-28-2004 06:47 AM

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>

oldford 09-19-2005 04:10 PM

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.

SilverBoy 03-29-2006 10:49 AM

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
  • Page Generation 0.01053 seconds
  • Memory Usage 1,732KB
  • 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)bbcode_quote_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