WP_Locale. Props Sewar. fixes #2568

git-svn-id: https://develop.svn.wordpress.org/trunk@3676 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2006-04-02 00:20:11 +00:00
parent b6d7b43d2d
commit e622346b7d
7 changed files with 179 additions and 114 deletions
+5 -9
View File
@@ -969,7 +969,7 @@ function get_post_meta_by_id($mid) {
}
function touch_time($edit = 1, $for_post = 1) {
global $month, $post, $comment;
global $wp_locale, $post, $comment;
if ( $for_post )
$edit = ( ('draft' == $post->post_status) && (!$post->post_date || '0000-00-00 00:00:00' == $post->post_date) ) ? false : true;
@@ -989,13 +989,8 @@ function touch_time($edit = 1, $for_post = 1) {
for ($i = 1; $i < 13; $i = $i +1) {
echo "\t\t\t<option value=\"$i\"";
if ($i == $mm)
echo " selected='selected'";
if ($i < 10) {
$ii = "0".$i;
} else {
$ii = "$i";
}
echo ">".$month["$ii"]."</option>\n";
echo ' selected="selected"';
echo '>' . $wp_locale->get_month($i) . "</option>\n";
}
?>
</select>
@@ -1007,7 +1002,8 @@ function touch_time($edit = 1, $for_post = 1) {
<?php
if ( $edit ) {
_e('Existing timestamp');
echo ": {$month[$mm]} $jj, $aa @ $hh:$mn";
//echo ': ' . $wp_locale->get_month($mm) . "$jj, $aa @ $hh:$mn";
echo sprintf(__(': %1$s %2$s, %3$s @ %4$s:%5$s'), $wp_locale->get_month($mm), $jj, $aa, $hh, $mn);
}
?>
</fieldset>
+4 -3
View File
@@ -93,14 +93,15 @@ if ( count($arc_result) ) { ?>
foreach ($arc_result as $arc_row) {
$arc_year = $arc_row->yyear;
$arc_month = $arc_row->mmonth;
$arc_month = zeroise($arc_month, 2);
if( isset($_GET['m']) && $arc_year . zeroise($arc_month, 2) == (int) $_GET['m'] )
if( isset($_GET['m']) && $arc_year . $arc_month == (int) $_GET['m'] )
$default = 'selected="selected"';
else
$default = null;
echo "<option $default value=\"" . $arc_year.zeroise($arc_month, 2) . '">';
echo $month[zeroise($arc_month, 2)] . " $arc_year";
echo "<option $default value=\"" . $arc_year . $arc_month . '">';
echo $wp_locale->get_month($arc_month) . " $arc_year";
echo "</option>\n";
}
?>
+2 -3
View File
@@ -94,9 +94,8 @@ foreach($wp_roles->role_names as $role => $name) {
<td><select name="start_of_week" id="start_of_week">
<?php
for ($day_index = 0; $day_index <= 6; $day_index++) :
if ($day_index == get_settings('start_of_week')) $selected = " selected='selected'";
else $selected = '';
echo "\n\t<option value='$day_index' $selected>$weekday[$day_index]</option>";
$selected = (get_settings('start_of_week') == $day_index) ? 'selected="selected"' : '';
echo "\n\t<option value='$day_index' $selected>" . $wp_locale->get_weekday($day_index) . '</option>';
endfor;
?>
</select></td>