MyBB Community Forums

Full Version: make b-day require field
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
Hi i have a question about age restriction can i use it on lateste version of mybb at 1.2.10 if yes then i have small problem with this mod i try to install it but after installation i found my site automatically goes to portal page when i give my site address on address bar its access on my portal page directly again when i log out its automatically goes to my portal page but i dont want to use portal page is there any way to make my site as like before like when user try to accesses my site he found my index page. after login he will be right in my index page and same to when he log out coz i dont want to use portal page anymore plz help
pepotiger Wrote:Hello all.
just little modify if you would like to force your members to type they birhday date whene registerring
we will 2 files and one template to do this
  1. Edit member.php file
    • find
      $user['birthday'] = array(
      		"day" => $mybb->input['bday1'],
      		"month" => $mybb->input['bday2'],
      		"year" => $mybb->input['bday3']
      	);
      Add after
      $bdaysel = '';
      	for($i = 1; $i <= 31; $i++)
      	{
      		if($user['birthday'][0] == $i)
      		{
      			$bdaydaysel .= "<option value=\"$i\" selected=\"selected\">$i</option>\n";
      		}
      		else
      		{
      			$bdaydaysel .= "<option value=\"$i\">$i</option>\n";
      		}
      	}
      
    • close and save the file
  2. Edit inc/datahandlers/user.php
    • find
      $birthday['day'] = intval($birthday['day']);
      		$birthday['month'] = intval($birthday['month']);
      		$birthday['year'] = intval($birthday['year']);
      Add after
      if(!$birthday['day'] || !$birthday['month'] || !$birthday['year'])
      			{
      				$this->set_error("invalid_birthday");
      				return false;
      			}
    • close and save it
  3. replace all the code in the following attached file with your member_register template
all done now test it your self..
regards


i have done everything possible but i dont know where to put the template you made.as in memeber_register.txt
go to acp under Templates click on Modify / Delete then click on your template name, and Member Templates you will find the template there

@bold_handsome yes I think it's still work as well with mybb 1.2.11
bro its work on mybb 1.2.11 but how i change portal redirection coz when i change template setting my portal come 1st i dont want to use portal, what i have to do plz let me know
Pages: 1 2 3