Changeset 1083 in ExiteCMS


Ignore:
Timestamp:
11/07/07 18:29:04 (4 years ago)
Author:
root
Message:

Fixed a typo in rev01082.php
Replaced date selection HTML by smarty html_select_date function

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/administration/upgrade/rev01082.php

    r1082 r1083  
    3131 
    3232// add the new fields to the locales table 
    33 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ##PREFIX##locales ADD locale_locale VARCHAR(25) NOT NULL DEFAULT '' AFTER locale_name"); 
    34 $commands[] = array('type' => 'db', 'value' => "ALTER TABLE ##PREFIX##locales ADD locale_charset VARCHAR(25) NOT NULL DEFAULT '' AFTER locale_locale"); 
     33$commands[] = array('type' => 'db', 'value' => "ALTER TABLE ##PREFIX##locale ADD locale_locale VARCHAR(25) NOT NULL DEFAULT '' AFTER locale_name"); 
     34$commands[] = array('type' => 'db', 'value' => "ALTER TABLE ##PREFIX##locale ADD locale_charset VARCHAR(25) NOT NULL DEFAULT '' AFTER locale_locale"); 
    3535 
    36 // and pupulate them with default values 
    37 $commands[] = array('type' => 'db', 'value' => "UPDATE ##PREFIX##locales SET locale_locale = 'en_US|en_GB|english|eng', locale_charset = 'iso-8859-1'"); 
     36// and populate them with a default value 
     37$commands[] = array('type' => 'db', 'value' => "UPDATE ##PREFIX##locale SET locale_locale = 'en_US|en_GB|english|eng', locale_charset = 'iso-8859-1'"); 
    3838 
    3939?> 
  • trunk/edit_profile.php

    r1071 r1083  
    134134    $user_hide_email = isNum($_POST['user_hide_email']) ? $_POST['user_hide_email'] : "1"; 
    135135    $user_location = isset($_POST['user_location']) ? stripinput(trim($_POST['user_location'])) : ""; 
    136     if ($_POST['user_month'] != "--" && $_POST['user_day'] != "--" && $_POST['user_year'] != "----") { 
    137         $user_birthdate = (isNum($_POST['user_year']) ? $_POST['user_year'] : "0000") 
    138         ."-".(isNum($_POST['user_month']) ? $_POST['user_month'] : "00") 
    139         ."-".(isNum($_POST['user_day']) ? $_POST['user_day'] : "00"); 
     136    if ($_POST['user_Month'] != "--" && $_POST['user_Day'] != "--" && $_POST['user_Year'] != "----") { 
     137        $user_birthdate = (isNum($_POST['user_Year']) ? $_POST['user_Year'] : "0000") 
     138        ."-".(isNum($_POST['user_Month']) ? $_POST['user_Month'] : "00") 
     139        ."-".(isNum($_POST['user_Day']) ? $_POST['user_Day'] : "00"); 
    140140    } else { 
    141141        $user_birthdate = "0000-00-00"; 
     
    227227} 
    228228 
    229 if ($this_userdata['user_birthdate']!="0000-00-00") { 
    230     $user_birthdate = explode("-", $this_userdata['user_birthdate']); 
    231     $variables['user_day'] = number_format($user_birthdate['2']); 
    232     $variables['user_month'] = number_format($user_birthdate['1']); 
    233     $variables['user_year'] = $user_birthdate['0']; 
    234 } else { 
    235     $variables['user_day'] = 0; $variables['user_month'] = 0; $variables['user_year'] = 0; 
    236 } 
     229$this_userdata['user_birthdate'] = str_replace("00", "--", $this_userdata['user_birthdate']); 
     230 
    237231if (!isset($this_userdata['user_fullname']) or empty($this_userdata['user_fullname'])) { 
    238232    $this_userdata['user_fullname'] = $this_userdata['user_name']; 
  • trunk/includes/templates/main.edit_profile.tpl

    r1082 r1083  
    117117        </td> 
    118118            <td class='tbl'> 
    119                 <select name='user_year' class='textbox'> 
    120                     <option>&nbsp;</option> 
    121                     {section name=y start=1900 loop=$smarty.now|date_format:"%Y"} 
    122                         <option{if $smarty.section.y.index == $user_year} selected="selected"{/if}>{$smarty.section.y.index}</option> 
    123                     {/section} 
    124                 </select> 
    125                 <select name='user_month' class='textbox'> 
    126                     <option>&nbsp;</option> 
    127                     {section name=m start=1 loop=13} 
    128                         <option{if $smarty.section.m.index == $user_month} selected="selected"{/if}>{$smarty.section.m.index}</option> 
    129                     {/section} 
    130                 </select> 
    131                 <select name='user_day' class='textbox'> 
    132                     <option>&nbsp;</option> 
    133                     {section name=d start=1 loop=32} 
    134                         <option{if $smarty.section.d.index == $user_day} selected="selected"{/if}>{$smarty.section.d.index}</option> 
    135                     {/section} 
    136                 </select> 
     119                {html_select_date prefix='user_' time=$this_userdata.user_birthdate start_year="1900" end_year="-1" all_extra="class='textbox" field_order="YMD"} 
    137120                <span class='small2'>(yyyy/mm/dd)</span> 
    138121            </td> 
  • trunk/includes/templates/main.register.tpl

    r1082 r1083  
    125125                </td> 
    126126                <td class='tbl'>} 
    127                     <select name='user_year' class='textbox'> 
    128                         <option> </option> 
    129                         {section name=y start=1900 loop=$smarty.now|date_format:"%Y"} 
    130                             <option{if $smarty.section.y.index == $user_year} selected{/if}>{$smarty.section.y.index}</option> 
    131                         {/section} 
    132                     </select> 
    133                     <select name='user_month' class='textbox'> 
    134                         <option> </option> 
    135                         {section name=m start=1 loop=13} 
    136                             <option{if $smarty.section.m.index == $user_month} selected{/if}>{$smarty.section.m.index}</option> 
    137                         {/section} 
    138                     </select> 
    139                     <select name='user_day' class='textbox'> 
    140                         <option> </option> 
    141                         {section name=d start=1 loop=32} 
    142                             <option{if $smarty.section.d.index == $user_day} selected{/if}>{$smarty.section.d.index}</option> 
    143                         {/section} 
    144                     </select> 
     127                    {html_select_date prefix='user_' time=$this_userdata.user_birthdate start_year="1900" end_year="-1" all_extra="class='textbox" field_order="YMD"} 
    145128                </td> 
    146129            </tr> 
  • trunk/register.php

    r1071 r1083  
    144144        if ($settings['email_verification'] == "0") { 
    145145            $user_location = isset($_POST['user_location']) ? stripinput(trim($_POST['user_location'])) : ""; 
    146             if ($_POST['user_month'] != 0 && $_POST['user_day'] != 0 && $_POST['user_year'] != 0) { 
    147                 $user_birthdate = (isNum($_POST['user_year']) ? $_POST['user_year'] : "0000") 
    148                 ."-".(isNum($_POST['user_month']) ? $_POST['user_month'] : "00") 
    149                 ."-".(isNum($_POST['user_day']) ? $_POST['user_day'] : "00"); 
     146            if ($_POST['user_Month'] != 0 && $_POST['user_Day'] != 0 && $_POST['user_Year'] != 0) { 
     147                $user_birthdate = (isNum($_POST['user_Year']) ? $_POST['user_Year'] : "0000") 
     148                ."-".(isNum($_POST['user_Month']) ? $_POST['user_Month'] : "00") 
     149                ."-".(isNum($_POST['user_Day']) ? $_POST['user_Day'] : "00"); 
    150150            } else { 
    151151                $user_birthdate = "0000-00-00"; 
Note: See TracChangeset for help on using the changeset viewer.