[Snippet] Force Set Birthday

Force Set Birthday
Requested by: the_zoker_09
Request Topic: http://www.phpbb.com/community/viewtopi ... &t=2157685
With this snippet you can force the user to fillout the birthday field in ucp.
http://www.loaditup.de/files/714443_65788gttm6.png
Instruction
open
includes/functions.php
find
before add
open
styles/prosilver/template/ucp_profile_profile_info.html
find
after add
find
before add
find
before add
find
after add
Clear all available Board- and Browser-Caches
Requested by: the_zoker_09
Request Topic: http://www.phpbb.com/community/viewtopi ... &t=2157685
With this snippet you can force the user to fillout the birthday field in ucp.
- No matter, which site you call after login, you landing always on this site
http://www.phpbb.com/community/ucp.php? ... ofile_info
which have only the birthday field with a red hint (see screen).
After enter the birthday and submit all is normal again.
http://www.loaditup.de/files/714443_65788gttm6.png
Instruction
open
includes/functions.php
find
- Code: Select all
// The following assigns all _common_ variables that may be used at any point in a template.
$template->assign_vars(array(
before add
- Code: Select all
// Force Set Birthday / 4seven / 2012
$pos_find = stripos($_SERVER['QUERY_STRING'], 'i=profile&mode=profile_info');
$pos_find = ($pos_find === 0) ? true : false;
$user_brt = str_replace(' ','', $user->data['user_birthday']);
if(($user->data['is_registered'])
&& ((!$pos_find)
|| ($user->page['page_name'] !== 'ucp.php'))
&& (($user->data['user_birthday'] == '')
|| ($user_brt == '0-0-0'))){
redirect(append_sid("{$phpbb_root_path}ucp.$phpEx", "i=profile&mode=profile_info"));}
if(($user->data['user_birthday'] == '')
|| ($user_brt == '0-0-0')){
$template->assign_var('S_BIRTHDAY_SET_TRUE', false);}
else{
$template->assign_var('S_BIRTHDAY_SET_TRUE', true);}
// Force Set Birthday / 4seven / 2012
open
styles/prosilver/template/ucp_profile_profile_info.html
find
- Code: Select all
<!-- IF ERROR --><p class="error">{ERROR}</p><!-- ENDIF -->
after add
- Code: Select all
<!-- IF S_BIRTHDAY_SET_TRUE -->
find
- Code: Select all
<!-- IF S_BIRTHDAYS_ENABLED -->
before add
- Code: Select all
<!-- ENDIF -->
<!-- IF not S_BIRTHDAY_SET_TRUE -->
<dl>
<dt><label></label></dt>
<dd style="color: red; font-weight: bold;">You must enter your birthday, before you can use this board</dd>
</dl>
<!-- ENDIF -->
find
- Code: Select all
<!-- BEGIN profile_fields -->
before add
- Code: Select all
<!-- IF S_BIRTHDAY_SET_TRUE -->
find
- Code: Select all
<!-- END profile_fields -->
after add
- Code: Select all
<!-- ENDIF -->
Clear all available Board- and Browser-Caches