!strstr($show, 'home')) {
$info = apply_filters('bloginfo', $info, $show);
$info = convert_chars($info);
+ } else {
+ $info = apply_filters('bloginfo_url', $info, $show);
}
echo $info;
function wp_title($sep = '»', $display = true) {
- global $wpdb;
- global $m, $year, $monthnum, $day, $category_name, $month, $posts;
+ global $wpdb, $posts, $month;
$cat = get_query_var('cat');
$p = get_query_var('p');
$category_name = get_query_var('category_name');
$author = get_query_var('author');
$author_name = get_query_var('author_name');
+ $m = (int) get_query_var('m');
+ $year = (int) get_query_var('year');
+ $monthnum = (int) get_query_var('monthnum');
+ $day = (int) get_query_var('day');
+ $title = '';
// If there's a category
if ( !empty($cat) ) {
// category exclusion
if ( !stristr($cat,'-') )
- $title = get_the_category_by_ID($cat);
- }
- if ( !empty($category_name) ) {
+ $title = apply_filters('single_cat_title', get_the_category_by_ID($cat));
+ } elseif ( !empty($category_name) ) {
if ( stristr($category_name,'/') ) {
$category_name = explode('/',$category_name);
if ( $category_name[count($category_name)-1] )
$category_name = $category_name[count($category_name)-2]; // there was a trailling slash
}
$title = $wpdb->get_var("SELECT cat_name FROM $wpdb->categories WHERE category_nicename = '$category_name'");
+ $title = apply_filters('single_cat_title', $title);
}
// If there's an author
}
$prefix = '';
- if ( isset($title) )
+ if ( !empty($title) )
$prefix = " $sep ";
$title = $prefix . $title;
function single_month_title($prefix = '', $display = true ) {
- global $m, $monthnum, $month, $year;
+ global $month;
+
+ $m = (int) get_query_var('m');
+ $year = (int) get_query_var('year');
+ $monthnum = (int) get_query_var('monthnum');
+
if ( !empty($monthnum) && !empty($year) ) {
$my_year = $year;
$my_month = $month[str_pad($monthnum, 2, '0', STR_PAD_LEFT)];
/* link navigation hack by Orien http://icecode.com/ */
function get_archives_link($url, $text, $format = 'html', $before = '', $after = '') {
$text = wptexturize($text);
- $title_text = wp_specialchars($text, 1);
+ $title_text = attribute_escape($text);
if ('link' == $format)
return "\t<link rel='archives' title='$title_text' href='$url' />\n";
foreach ( $arcresults as $arcresult ) {
$url = get_month_link($arcresult->year, $arcresult->month);
if ( $show_post_count ) {
- $text = sprintf('%s %d', $month[zeroise($arcresult->month,2)], $arcresult->year);
+ $text = sprintf(__('%1$s %2$d'), $month[zeroise($arcresult->month,2)], $arcresult->year);
$after = ' ('.$arcresult->posts.')' . $afterafter;
} else {
- $text = sprintf('%s %d', $month[zeroise($arcresult->month,2)], $arcresult->year);
+ $text = sprintf(__('%1$s %2$d'), $month[zeroise($arcresult->month,2)], $arcresult->year);
}
echo get_archives_link($url, $text, $format, $before, $after);
}
if ( $arcresults ) {
foreach ( $arcresults as $arcresult ) {
$url = get_day_link($arcresult->year, $arcresult->month, $arcresult->dayofmonth);
- $date = sprintf("%d-%02d-%02d 00:00:00", $arcresult->year, $arcresult->month, $arcresult->dayofmonth);
+ $date = sprintf('%1$d-%2$02d-%3$02d 00:00:00', $arcresult->year, $arcresult->month, $arcresult->dayofmonth);
$text = mysql2date($archive_day_date_format, $date);
echo get_archives_link($url, $text, $format, $before, $after);
}
$arc_week = get_weekstartend($arcresult->yyyymmdd, get_settings('start_of_week'));
$arc_week_start = date_i18n($archive_week_start_date_format, $arc_week['start']);
$arc_week_end = date_i18n($archive_week_end_date_format, $arc_week['end']);
- $url = sprintf('%s/%s%sm%s%s%sw%s%d', get_settings('home'), '', '?', '=', $arc_year, '&', '=', $arcresult->week);
+ $url = sprintf('%1$s/%2$s%3$sm%4$s%5$s%6$sw%7$s%8$d', get_settings('home'), '', '?', '=', $arc_year, '&', '=', $arcresult->week);
$text = $arc_week_start . $archive_week_separator . $arc_week_end;
echo get_archives_link($url, $text, $format, $before, $after);
}
else
$thismonth = ''.zeroise(intval(substr($m, 4, 2)), 2);
} else {
- $thisyear = gmdate('Y', current_time('timestamp') + get_settings('gmt_offset') * 3600);
- $thismonth = gmdate('m', current_time('timestamp') + get_settings('gmt_offset') * 3600);
+ $thisyear = gmdate('Y', current_time('timestamp'));
+ $thismonth = gmdate('m', current_time('timestamp'));
}
$unixmonth = mktime(0, 0 , 0, $thismonth, 1, $thisyear);