[Snippet] Force Set Birthday

Little Mods and Snips 1

[Snippet] Force Set Birthday

Postby Sekuro » 16 Jun 2012, 14:32

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.

Screen
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
Mod-Bot / Service-Team
User avatar
Sekuro

Tiptop

Tiptop
 
Posts: 241
Joined: 11 Feb 2008, 11:49
 
Resolution: 1440x900


Return to Snip Cl@ss I

Who is online

Users browsing this forum: No registered users and 1 guest

cron