1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.1 Year limit for age

Discussion in 'XenForo Questions and Support' started by Crazyace, Jul 11, 2012.

  1. Crazyace

    Crazyace Member

    I noticed that I can't set an age before 1900's. For fun I was going to make my RSS Bot from the 1300's but I'm not able too. Any ideas of where I could edit this limitation?
     
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    library/XenForo/DataWriter/User.php

    Remove the red code:

    Code:
    	public function checkDob()
    	{
    		if ($this->isChanged('dob_day') || $this->isChanged('dob_month') || $this->isChanged('dob_year'))
    		{
    			if (!$this->get('dob_day') || !$this->get('dob_month'))
    			{
    				$this->set('dob_day', 0);
    				$this->set('dob_month', 0);
    				$this->set('dob_year', 0);
    			}
    			else
    			{
    				$year = $this->get('dob_year');
    				if (!$year)
    				{
    					$year = 2008; // pick a leap year to be sure
    				}
    				else if ($year < 100)
    				{
    					$year += ($year < 20 ? 2000 : 1900);
    					$this->set('dob_year', $year);
    				}
    
    				if ($year > intval(date('Y')) || $year < 1900 || !checkdate($this->get('dob_month'), $this->get('dob_day'), $year))
    				{
    					if ($this->_importMode)
    					{
    						// don't error, wipe it out
    						$this->set('dob_day', 0);
    						$this->set('dob_month', 0);
    						$this->set('dob_year', 0);
    					}
    					else
    					{
    						$this->error(new XenForo_Phrase('please_enter_valid_date_of_birth'), 'dob');
    					}
    
    					return false;
    				}
    			}
    		}
    
    		return true;
    	}
    
     
    Crazyace likes this.
  3. Crazyace

    Crazyace Member

    Fixed thank you. RSS Bot was born Jan 1 1337 :)
     

Share This Page