Changeset 3676 for trunk/wp-includes/template-functions-general.php
- Timestamp:
- 04/02/2006 12:20:11 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/template-functions-general.php
r3566 r3676 135 135 function wp_title($sep = '»', $display = true) { 136 136 global $wpdb; 137 global $m, $year, $monthnum, $day, $category_name, $ month, $posts;137 global $m, $year, $monthnum, $day, $category_name, $wp_locale, $posts; 138 138 139 139 $cat = get_query_var('cat'); … … 174 174 if ( !empty($m) ) { 175 175 $my_year = substr($m, 0, 4); 176 $my_month = $ month[substr($m, 4, 2)];176 $my_month = $wp_locale->get_month($m); 177 177 $title = "$my_year $sep $my_month"; 178 178 } … … 181 181 $title = $year; 182 182 if ( !empty($monthnum) ) 183 $title .= " $sep ".$ month[zeroise($monthnum, 2)];183 $title .= " $sep ".$wp_locale->get_month($monthnum); 184 184 if ( !empty($day) ) 185 185 $title .= " $sep ".zeroise($day, 2); … … 241 241 242 242 function single_month_title($prefix = '', $display = true ) { 243 global $m, $monthnum, $ month, $year;243 global $m, $monthnum, $wp_locale, $year; 244 244 if ( !empty($monthnum) && !empty($year) ) { 245 245 $my_year = $year; 246 $my_month = $ month[str_pad($monthnum, 2, '0', STR_PAD_LEFT)];246 $my_month = $wp_locale->get_month($monthnum); 247 247 } elseif ( !empty($m) ) { 248 248 $my_year = substr($m, 0, 4); 249 $my_month = $ month[substr($m, 4, 2)];249 $my_month = $wp_locale->get_month($m); 250 250 } 251 251 … … 293 293 294 294 function get_archives($type='', $limit='', $format='html', $before = '', $after = '', $show_post_count = false) { 295 global $ month, $wpdb;295 global $wp_locale, $wpdb; 296 296 297 297 if ( '' == $type ) … … 331 331 $url = get_month_link($arcresult->year, $arcresult->month); 332 332 if ( $show_post_count ) { 333 $text = sprintf('%s %d', $ month[zeroise($arcresult->month,2)], $arcresult->year);333 $text = sprintf('%s %d', $wp_locale->get_month($arcresult->month), $arcresult->year); 334 334 $after = ' ('.$arcresult->posts.')' . $afterafter; 335 335 } else { 336 $text = sprintf('%s %d', $ month[zeroise($arcresult->month,2)], $arcresult->year);336 $text = sprintf('%s %d', $wp_locale->get_month($arcresult->month), $arcresult->year); 337 337 } 338 338 echo get_archives_link($url, $text, $format, $before, $after); … … 394 394 395 395 396 function get_calendar($ daylength = 1) {397 global $wpdb, $m, $monthnum, $year, $timedifference, $ month, $month_abbrev, $weekday, $weekday_initial, $weekday_abbrev, $posts;396 function get_calendar($initial = true) { 397 global $wpdb, $m, $monthnum, $year, $timedifference, $wp_locale, $posts; 398 398 399 399 // Quick check. If we have no posts at all, abort! … … 451 451 452 452 echo '<table id="wp-calendar"> 453 <caption>' . $ month[zeroise($thismonth, 2)]. ' ' . date('Y', $unixmonth) . '</caption>453 <caption>' . $wp_locale->get_month($thismonth) . ' ' . date('Y', $unixmonth) . '</caption> 454 454 <thead> 455 455 <tr>'; 456 456 457 $day_abbrev = $weekday_initial;458 if ( $daylength > 1 )459 $day_abbrev = $weekday_abbrev;460 461 457 $myweek = array(); 462 458 463 459 for ( $wdcount=0; $wdcount<=6; $wdcount++ ) { 464 $myweek[] =$weekday[($wdcount+$week_begins)%7];460 $myweek[] = $wp_locale->get_weekday(($wdcount+$week_begins)%7); 465 461 } 466 462 467 463 foreach ( $myweek as $wd ) { 468 echo "\n\t\t<th abbr=\"$wd\" scope=\"col\" title=\"$wd\">" . $day_abbrev[$wd] . '</th>'; 464 $day_name = (true == $initial) ? $wp_locale->get_weekday_initial($wd) : $wp_locale->get_weekday_abbrev($wd); 465 echo "\n\t\t<th abbr=\"$wd\" scope=\"col\" title=\"$wd\">$day_name</th>"; 469 466 } 470 467 … … 477 474 478 475 if ( $previous ) { 479 echo "\n\t\t".'<td abbr="' . $ month[zeroise($previous->month, 2)]. '" colspan="3" id="prev"><a href="' .480 get_month_link($previous->year, $previous->month) . '" title="' . sprintf(__('View posts for %1$s %2$s'), $ month[zeroise($previous->month, 2)],481 date('Y', mktime(0, 0 , 0, $previous->month, 1, $previous->year))) . '">« ' . $ month_abbrev[$month[zeroise($previous->month, 2)]]. '</a></td>';476 echo "\n\t\t".'<td abbr="' . $wp_locale->get_month($previous->month) . '" colspan="3" id="prev"><a href="' . 477 get_month_link($previous->year, $previous->month) . '" title="' . sprintf(__('View posts for %1$s %2$s'), $wp_locale->get_month($previous->month), 478 date('Y', mktime(0, 0 , 0, $previous->month, 1, $previous->year))) . '">« ' . $wp_locale->get_month_abbrev($wp_locale->get_month($previous->month)) . '</a></td>'; 482 479 } else { 483 480 echo "\n\t\t".'<td colspan="3" id="prev" class="pad"> </td>'; … … 487 484 488 485 if ( $next ) { 489 echo "\n\t\t".'<td abbr="' . $ month[zeroise($next->month, 2)]. '" colspan="3" id="next"><a href="' .490 get_month_link($next->year, $next->month) . '" title="' . sprintf(__('View posts for %1$s %2$s'), $ month[zeroise($next->month, 2)],491 date('Y', mktime(0, 0 , 0, $next->month, 1, $next->year))) . '">' . $ month_abbrev[$month[zeroise($next->month, 2)]]. ' »</a></td>';486 echo "\n\t\t".'<td abbr="' . $wp_locale->get_month($next->month) . '" colspan="3" id="next"><a href="' . 487 get_month_link($next->year, $next->month) . '" title="' . sprintf(__('View posts for %1$s %2$s'), $wp_locale->get_month($next->month), 488 date('Y', mktime(0, 0 , 0, $next->month, 1, $next->year))) . '">' . $wp_locale->get_month_abbrev($wp_locale->get_month($next->month)) . ' »</a></td>'; 492 489 } else { 493 490 echo "\n\t\t".'<td colspan="3" id="next" class="pad"> </td>'; … … 676 673 677 674 function the_weekday() { 678 global $w eekday, $id, $post;679 $the_weekday = $w eekday[mysql2date('w', $post->post_date)];675 global $wp_locale, $id, $post; 676 $the_weekday = $wp_locale->get_weekday(mysql2date('w', $post->post_date)); 680 677 $the_weekday = apply_filters('the_weekday', $the_weekday); 681 678 echo $the_weekday; … … 684 681 685 682 function the_weekday_date($before='',$after='') { 686 global $w eekday, $id, $post, $day, $previousweekday;683 global $wp_locale, $id, $post, $day, $previousweekday; 687 684 $the_weekday_date = ''; 688 685 if ( $day != $previousweekday ) { 689 686 $the_weekday_date .= $before; 690 $the_weekday_date .= $w eekday[mysql2date('w', $post->post_date)];687 $the_weekday_date .= $wp_locale->get_weekday(mysql2date('w', $post->post_date)); 691 688 $the_weekday_date .= $after; 692 689 $previousweekday = $day;
Note: See TracChangeset
for help on using the changeset viewer.