From ca18240a96bae2747d112baeabc74aef7c05176f Mon Sep 17 00:00:00 2001 From: saxmatt Date: Mon, 27 Oct 2003 20:27:38 +0000 Subject: [PATCH] Permalink related bugfixes. git-svn-id: http://svn.automattic.com/wordpress/trunk@492 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- b2-include/b2template.functions.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/b2-include/b2template.functions.php b/b2-include/b2template.functions.php index 5ec851c83..02aedd136 100644 --- a/b2-include/b2template.functions.php +++ b/b2-include/b2template.functions.php @@ -777,10 +777,10 @@ function link_pages($before='
', $after='
', $next_or_number='number', function previous_post($format='%', $previous='previous post: ', $title='yes', $in_same_cat='no', $limitprev=1, $excluded_categories='') { global $tableposts, $id, $post, $siteurl, $blogfilename, $querycount, $wpdb; - global $p, $posts, $posts_per_page, $s; + global $p, $posts, $posts_per_page, $s, $single; global $querystring_start, $querystring_equal, $querystring_separator; - if(($p) || ($posts_per_page==1)) { + if(($p) || ($posts_per_page == 1) || 1 == $single) { $current_post_date = $post->post_date; $current_category = $post->post_category; @@ -816,9 +816,9 @@ function previous_post($format='%', $previous='previous post: ', $title='yes', $ function next_post($format='%', $next='next post: ', $title='yes', $in_same_cat='no', $limitnext=1, $excluded_categories='') { global $tableposts, $p, $posts, $id, $post, $siteurl, $blogfilename, $querycount, $wpdb; - global $time_difference; + global $time_difference, $single; global $querystring_start, $querystring_equal, $querystring_separator; - if(($p) || ($posts==1)) { + if(($p) || ($posts==1) || 1 == $single) { $current_post_date = $post->post_date; $current_category = $post->post_category; @@ -1428,18 +1428,18 @@ function get_permalink($id=false) { return $file.$querystring_start.'p'.$querystring_equal.$post->ID; } } else { // if an ID is given - $post = $wpdb->get_row("SELECT post_date, post_name FROM $tableposts WHERE ID = $id"); + $idpost = $wpdb->get_row("SELECT post_date, post_name FROM $tableposts WHERE ID = $id"); if ('' != get_settings('permalink_structure')) { - $unixtime = strtotime($post->post_date); + $unixtime = strtotime($idpost->post_date); $rewritereplace = array( date('Y', $unixtime), date('n', $unixtime), date('j', $unixtime), - $post->post_name + $idpost->post_name ); return str_replace($rewritecode, $rewritereplace, get_settings('permalink_structure')); } else { - return $file.$querystring_start.'p'.$querystring_equal.$post->ID; + return $file.$querystring_start.'p'.$querystring_equal.$idpost->ID; } } }