Weekly archives fixes. http://mosquito.wordpress.org/view.php?id=1217
git-svn-id: http://svn.automattic.com/wordpress/trunk@2526 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
a19088c2cb
commit
381e0879d0
|
@ -53,8 +53,6 @@ case 'update':
|
|||
if ($user_level >= $option->option_admin_level) {
|
||||
$old_val = $option->option_value;
|
||||
$new_val = trim($_POST[$option->option_name]);
|
||||
if ( !$new_val && $old_val != 0 )
|
||||
$new_val = '';
|
||||
if( in_array($option->option_name, $nonbools) && ( $new_val == '0' || $new_val == '') )
|
||||
$new_val = 'closed';
|
||||
if ($new_val !== $old_val) {
|
||||
|
|
|
@ -84,13 +84,21 @@ function get_weekstartend($mysqlstring, $start_of_week) {
|
|||
$day = mktime(0,0,0, $md, $mm, $my);
|
||||
$weekday = date('w',$day);
|
||||
$i = 86400;
|
||||
|
||||
if ($weekday < get_settings('start_of_week'))
|
||||
$weekday = 7 - (get_settings('start_of_week') - $weekday);
|
||||
|
||||
while ($weekday > get_settings('start_of_week')) {
|
||||
$weekday = date('w',$day);
|
||||
if ($weekday < get_settings('start_of_week'))
|
||||
$weekday = 7 - (get_settings('start_of_week') - $weekday);
|
||||
|
||||
$day = $day - 86400;
|
||||
$i = 0;
|
||||
}
|
||||
$week['start'] = $day + 86400 - $i;
|
||||
$week['end'] = $day + 691199;
|
||||
//$week['end'] = $day - $i + 691199;
|
||||
$week['end'] = $week['start'] + 604799;
|
||||
return $week;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue