|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
ZeRoLeVeL Smarty Rookie
Joined: 13 May 2014 Posts: 6
|
Posted: Tue May 13, 2014 12:25 pm Post subject: {html_select_date} select_day select_month select_year |
|
|
Нужно было устанавливать нужную дату, а не текущую. Сделал небольшое изменение. Возможно кому то пригодится.
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 |
|
|
|
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
|