Area51 @ 4seven.de

Mod Base and Testarea
It is currently 23 Feb 2025, 19:16

All times are UTC + 1 hour




Post new topic TOPIC_LOCKED  [ 1 post ] 
Author Message
PostPosted: 16 Jun 2012, 14:32 
Offline
Tiptop
Tiptop
User avatar

Joined: 11 Feb 2008, 11:49
Posts: 241
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:
    // The following assigns all _common_ variables that may be used at any point in a template.
    
$template->assign_vars(array( 


before add

Code:
// 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:
    <!-- IF ERROR --><p class="error">{ERROR}</p><!-- ENDIF -->


after add

Code:
    <!-- IF S_BIRTHDAY_SET_TRUE -->


find

Code:
    <!-- IF S_BIRTHDAYS_ENABLED -->


before add

Code:
    <!-- 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:
    <!-- BEGIN profile_fields -->


before add

Code:
    <!-- IF S_BIRTHDAY_SET_TRUE -->


find

Code:
    <!-- END profile_fields -->


after add

Code:
    <!-- ENDIF -->


Clear all available Board- and Browser-Caches

_________________
Mod-Bot / Service-Team


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic TOPIC_LOCKED  [ 1 post ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group
[ Time : 0.010s | 22 Queries | GZIP : Off ]