Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 03-22-2006, 09:53 PM
Exitilus Exitilus is offline
 
Join Date: Jul 2004
Location: Spokane, WA
Posts: 432
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Help on Correcting Code - Userage Permission

I'm trying to correct the code with the following Plugin:

https://vborg.vbsupport.ru/showthread.php?t=93138
Registration Denied if Under 18

The issue is even if you are 18 Today, you have to wait till the end of the month before this plugin will let you register.

So basically you have to be 18 + the remainder of days in the month.

I'm not yet at the expertise needed to fix this, but I believe I've located the part of the code that needs fixing:

PHP Code:
if ((($current['year'] - $vbulletin->GPC['year']) <  $vbulletin->options['minjoinage']) OR ((($current['year'] - $vbulletin->GPC['year']) == $vbulletin->options['minjoinage']) AND ($vbulletin->GPC['month'] <= $current['month']))) 
Just trying to figure out how to correctly set it up so it doesn't do what I stated above. I've tried a few variables but so far no luck....

Some help would be greatly appreciated
Reply With Quote
  #2  
Old 03-23-2006, 01:22 AM
Cyricx Cyricx is offline
 
Join Date: Aug 2002
Location: Missouri
Posts: 1,144
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Code:
if ((($current['year'] - $vbulletin->GPC['year']) <  $vbulletin->options['minjoinage']) OR ((($current['year'] - $vbulletin->GPC['year']) == $vbulletin->options['minjoinage']) AND ($vbulletin->GPC['month'] <= $current['month']) AND ($vbulletin->GPC['day'] < $current['day'])))
Reply With Quote
  #3  
Old 03-23-2006, 03:51 AM
Exitilus Exitilus is offline
 
Join Date: Jul 2004
Location: Spokane, WA
Posts: 432
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

*blink*

After many hours of trying to figure this out with Cyricx STILL having issues. Mainly with the month part not working properly :| We've gotten it to work with "March" .. all the way up to the end of the month. But when the month after starts. It stops working and lets them register all the way up to December 31, 1988.

This is the code Me and cyricx were using. If someone else could try this and figure it out i'd GREATLY appreciate it.

Basically We have been replacing the code in register_checkdate hook

We had to define $current['day'] = date('d'); because it wasn't in register.php

PHP Code:
$current['day'] = date('d');
if (((
$current['year'] - $vbulletin->GPC['year']) <  $vbulletin->options['minjoinage']) OR ((($current['year'] - $vbulletin->GPC['year']) == $vbulletin->options['minjoinage']) AND ($vbulletin->GPC['month'] <= $current['month']) AND ($vbulletin->GPC['day'] > $current['day'])))
{
    eval(
standard_error(fetch_error('underage_registration_denied'$vbulletin->options['minjoinage']))); 

Reply With Quote
  #4  
Old 03-23-2006, 04:15 AM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PHP Code:
if ((($current['year'] - $vbulletin->GPC['year']) <  $vbulletin->options['minjoinage']) OR ((($current['year'] - $vbulletin->GPC['year']) == $vbulletin->options['minjoinage']) AND (($vbulletin->GPC['month'] < $current['month']) OR ($vbulletin->GPC['month'] == $current['month'] AND $current['day'] < $vbulletin->GPC['day'])))) 
OR

PHP Code:
$age $current['year'] - $vbulletin->GPC['year'];
if (
$current['month'] < $vbulletin->GPC['month'] OR ($current['month'] == $vbulletin->GPC['month'] AND date('d') < $vbulletin->GPC['day']))
{
    
$age--;

Reply With Quote
  #5  
Old 03-23-2006, 04:34 AM
Exitilus Exitilus is offline
 
Join Date: Jul 2004
Location: Spokane, WA
Posts: 432
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmm... still having issues. The 1st one doesn't work at all. I've been putting it in as

PHP Code:
if ((($current['year'] - $vbulletin->GPC['year']) <  $vbulletin->options['minjoinage']) OR ((($current['year'] - $vbulletin->GPC['year']) == $vbulletin->options['minjoinage']) AND (($vbulletin->GPC['month'] < $current['month']) OR ($vbulletin->GPC['month'] == $current['month'] AND $current['day'] < $vbulletin->GPC['day'])))

    eval(
standard_error(fetch_error('underage_registration_denied'$vbulletin->options['minjoinage'])));  

The code produces a parse error anytime you try Registering.

and the 2nd code. Trying it by itself or with the

PHP Code:

    eval(
standard_error(fetch_error('underage_registration_denied'$vbulletin->options['minjoinage'])));  

part won't let any registration seem to work. Tried a few dates that should of worked and didn't

BTW Thanks for responding. It's greatly appreciated
Reply With Quote
  #6  
Old 03-23-2006, 04:53 AM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Exitilus
The code produces a parse error anytime you try Registering.
As always when I post code without actually testing it ... there was one missing ) at the end

Don't know why the alternative doesn't work ... it shoud.
Did you try to output $age?
Reply With Quote
  #7  
Old 03-23-2006, 05:58 AM
Exitilus Exitilus is offline
 
Join Date: Jul 2004
Location: Spokane, WA
Posts: 432
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Now it seems to be working in the opposit direction O.o

Everything From March 24, 2006 to Jan 01, 2006 says your under 18.

Everything After March 24, 2006 works *lol*

These are some of the same things I was getting when working with Cyricx. It's a tough lil bugger
Reply With Quote
  #8  
Old 03-24-2006, 05:46 PM
Exitilus Exitilus is offline
 
Join Date: Jul 2004
Location: Spokane, WA
Posts: 432
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Anyone have any other ideas?
Reply With Quote
  #9  
Old 03-28-2006, 02:32 AM
Exitilus Exitilus is offline
 
Join Date: Jul 2004
Location: Spokane, WA
Posts: 432
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

None?
Reply With Quote
  #10  
Old 03-28-2006, 12:16 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Works for me.
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 03:23 AM.


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.04039 seconds
  • Memory Usage 2,284KB
  • Queries Executed 11 (?)
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
  • (1)bbcode_code
  • (6)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete