Blog Date Fix
Posted by NickTheGreek, 21 Jan 2015, 08:01 PM
Took me quite some time to remember this, had this fixed again 3-4 years ago...
in
CODE
./sources/components_public/blog/lib/lib_post.php
you need to change line 423 accordingly
CODE
/* Build year dropdown */
for( $i = 2006; $i < 2020; $i++ )
for( $i = 2006; $i < 2020; $i++ )
and the code block in total is:
CODE
function html_date_field( $curr_date='' )
{
/* INI */
$curr_date = $curr_date ? $curr_date : time();
$_days = '';
$_months = '';
$_years = '';
/* Defaults */
$_defaults = explode( '/', date( "m/d/Y/G/i", $curr_date ) );
/* Build day dropdown */
for( $i = 1; $i < 32; $i++ )
{
$sel = $_defaults[1] == $i ? ' selected=\'selected\'' : '';
$_days .= "<option value='{$i}'{$sel}>{$i}</option>";
}
/* Build month dropdown */
for( $i = 1; $i < 13; $i++ )
{
$sel = $_defaults[0] == $i ? ' selected=\'selected\'' : '';
$_months .= "<option value='{$i}'{$sel}>{$this->ipsclass->lang['M_'.$i]}</option>";
}
/* Build year dropdown */
for( $i = 2006; $i < 2015; $i++ )
{
$sel = $_defaults[2] == $i ? ' selected=\'selected\'' : '';
$_years .= "<option value='{$i}'{$sel}>{$i}</option>";
}
/* Return HTML */
return $this->ipsclass->compiled_templates['skin_blog_post']->date_fields( $_days, $_months, $_years, $_defaults[3], $_defaults[4] );
}
{
/* INI */
$curr_date = $curr_date ? $curr_date : time();
$_days = '';
$_months = '';
$_years = '';
/* Defaults */
$_defaults = explode( '/', date( "m/d/Y/G/i", $curr_date ) );
/* Build day dropdown */
for( $i = 1; $i < 32; $i++ )
{
$sel = $_defaults[1] == $i ? ' selected=\'selected\'' : '';
$_days .= "<option value='{$i}'{$sel}>{$i}</option>";
}
/* Build month dropdown */
for( $i = 1; $i < 13; $i++ )
{
$sel = $_defaults[0] == $i ? ' selected=\'selected\'' : '';
$_months .= "<option value='{$i}'{$sel}>{$this->ipsclass->lang['M_'.$i]}</option>";
}
/* Build year dropdown */
for( $i = 2006; $i < 2015; $i++ )
{
$sel = $_defaults[2] == $i ? ' selected=\'selected\'' : '';
$_years .= "<option value='{$i}'{$sel}>{$i}</option>";
}
/* Return HTML */
return $this->ipsclass->compiled_templates['skin_blog_post']->date_fields( $_days, $_months, $_years, $_defaults[3], $_defaults[4] );
}
Comments
There are no comments on this entry
on For Transparency