vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Help on Correcting Code - Userage Permission (https://vborg.vbsupport.ru/showthread.php?t=111131)

Exitilus 03-22-2006 09:53 PM

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 :)

Cyricx 03-23-2006 01:22 AM

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'])))
:)

Exitilus 03-23-2006 03:51 AM

*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']))); 



Andreas 03-23-2006 04:15 AM

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



Exitilus 03-23-2006 04:34 AM

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 :)

Andreas 03-23-2006 04:53 AM

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?

Exitilus 03-23-2006 05:58 AM

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

Exitilus 03-24-2006 05:46 PM

Anyone have any other ideas? :)

Exitilus 03-28-2006 01:32 AM

None?

Andreas 03-28-2006 11:16 AM

Works for me.


All times are GMT. The time now is 11: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.03138 seconds
  • Memory Usage 1,762KB
  • 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
  • (1)bbcode_code_printable
  • (6)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete