Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

{html_select_date} select_day select_month select_year

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: Russian
View previous topic :: View next topic  
Author Message
ZeRoLeVeL
Smarty Rookie


Joined: 13 May 2014
Posts: 6

PostPosted: Tue May 13, 2014 12:25 pm    Post subject: {html_select_date} select_day select_month select_year Reply with quote

Нужно было устанавливать нужную дату, а не текущую. Сделал небольшое изменение. Возможно кому то пригодится.

Code:
libs/plugins/function.html_select_date.php

Code:
{html_select_date ... select_month="0" select_month="05" select_year="2000"}


Ищем
Code:
/* Default values. */
    $prefix = "Date_";

Добавить после
Code:
// select day, month, year
$select_day = null;
$select_month = null;
$select_year = null;

Ищем
Code:
      case 'day_id':
        case 'year_id':

Добавить после
Code:
      case 'select_day':
        case 'select_month':
        case 'select_year':



Ищем
Code:
                    $_html_years .= '<option value="' . $i . '"'
                        . ($_year == $i ? ' selected="selected"' : '')
                        . '>' . $i . '</option>' . $option_separator;

Заменить
Code:
// select year
                if ( $select_year != null ) {
                    $_html_years .= '<option value="' . $i . '"'
                        . ($i == $select_year ? ' selected="selected"' : '')
                        . '>' . $i . '</option>' . $option_separator;
                } else {
                    $_html_years .= '<option value="' . $i . '"'
                        . ($_year == $i ? ' selected="selected"' : '')
                        . '>' . $i . '</option>' . $option_separator;
                }
// select year

Ищем
Code:
                $_html_months .= '<option value="' . $_value . '"'
                    . ($_val == $_month ? ' selected="selected"' : '')
                    . '>' . $_text . '</option>' . $option_separator;

Заменить
Code:
// select month
            if ( $select_month != null ) {
                $_html_months .= '<option value="' . $_value . '"'
                    . ($_value == $select_month ? ' selected="selected"' : '')
                    . '>' . $_text . '</option>' . $option_separator;
            } else {
                $_html_months .= '<option value="' . $_value . '"'
                    . ($_val == $_month ? ' selected="selected"' : '')
                    . '>' . $_text . '</option>' . $option_separator;
            }
// select month

Ищем
Code:
                $_html_days .= '<option value="' . $_value . '"'
                    . ($_val == $_day ? ' selected="selected"' : '')
                    . '>' . $_text . '</option>' . $option_separator;

Заменить
Code:
// select day
            if ( $select_day != null ) {
                $_html_days .= '<option value="' . $_value . '"'
                    . ($_value == $select_day ? ' selected="selected"' : '')
                    . '>' . $_text . '</option>' . $option_separator;
            } else {
                $_html_days .= '<option value="' . $_value . '"'
                    . ($_val == $_day ? ' selected="selected"' : '')
                    . '>' . $_text . '</option>' . $option_separator;
            }
// select day
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: Russian All times are GMT
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP