Get started with PHP-Fusion

Start a New Thread

Users Participated

  • Chan
    Post made: 3
  • karrak
    Post made: 4

  1. PHP-Fusion Support Forums
  2. PHP-Fusion 9 Support
  3. User Fields

user_birthadate_include.php

Questions about 9īs User Fields and the User Fields API

6 Replies 724 Views Last Updated on 7 months ago

karrak


Senior Member

#1

Posted 7 months ago

this can be changed so
Code Gist: Download source  

       include LOCALE.LOCALESET."global.php";
    if ($field_value != "1900-01-01") {
//        $months = explode("|", $locale['months']);
       $user_birthDate = explode("-", $field_value);
 //       print_p($user_birthDate);
        $lastday = mktime(0, 0, 0, $user_birthDate[1], $user_birthDate[2], $user_birthDate[0]);
//$lastday = mktime(0, 0, 0, 3, 0, $user_birthDate[0]);
//echo showdate("%Y %B %d", $lastday);
$fmt = array('0' => "%Y %B %d", '1' => "%d %B %Y");
$fmt_lg = array("hu","eo","eu","ko","it","si","zh-cn","zh-tw");

        $user_fields = array(
            'title' => $locale['uf_birthdate'],
            'value' => showdate($fmt[(in_array($locale['datepicker'], $fmt_lg) ? 0: 1)], $lastday)
        );



Or If you do not trust your php days notice

Code Gist: Download source  

    include LOCALE.LOCALESET."global.php";
    if ($field_value != "1900-01-01") {
        $months = explode("|", $locale['months']);
      $user_birthDate = explode("-", $field_value);
      $lastday = mktime(0, 0, 0, $user_birthDate[1], $user_birthDate[2], $user_birthDate[0]);

   $month_name = $months[number_format($user_birthDate[1])];

   $fmt = array('0' => "%Y $month_name %d", '1' => "%d $month_name %Y");
   $fmt_lg = array("hu","eo","eu","ko","it","si","zh-cn","zh-tw");

        $user_fields = array(
            'title' => $locale['uf_birthdate'],
            'value' => showdate($fmt[(in_array($locale['datepicker'], $fmt_lg) ? 0: 1)], $lastday)
        );

Edited by karrak on 28-08-2016 12:46

Posts: 219

Joined: 20/07/2008

Chan


Super Admin

#2

Posted 7 months ago

Which one is recommended? The above one or the below one? Have you tested it on Version 7 upgrades?

Posts: 3397

Joined: 25/09/2007

karrak


Senior Member

#3

Posted 7 months ago

be lower, mistakes are not met.

Posts: 219

Joined: 20/07/2008

Chan


Super Admin

#4

Posts: 3397

Joined: 25/09/2007

karrak


Senior Member

#5

Posted 7 months ago

If you've changed it on me ..
Code Gist: Download source  

$months = explode("|", $locale['months']);


this

Code Gist: Download source  

        $months = explode("|", fusion_get_locale('months', LOCALE.LOCALESET.'global.php'));


AND
Code Gist: Download source  

$user_fields = array('title' => $locale['uf_birthdate'], 'value' => $locale['na']);

this

Code Gist: Download source  

$user_fields = array('title' => $locale['uf_birthdate'], 'value' => fusion_get_locale('na', LOCALE.LOCALESET.'global.php'));

Edited by karrak on 29-08-2016 15:57

Posts: 219

Joined: 20/07/2008

karrak


Senior Member

#6

Posted 7 months ago

The modification of these lagging behind part.

Posts: 219

Joined: 20/07/2008

Chan


Super Admin

#7

Posts: 3397

Joined: 25/09/2007

Jump to Forum:
9 users are online
0 member and 9 guests