Changeset 1355 for trunk/wp-includes/template-functions-post.php
- Timestamp:
- 05/24/2004 08:22:18 AM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/template-functions-post.php
r1254 r1355 276 276 277 277 function previous_post($format='%', $previous='previous post: ', $title='yes', $in_same_cat='no', $limitprev=1, $excluded_categories='') { 278 global $ tableposts, $id, $post, $wpdb;278 global $id, $post, $wpdb; 279 279 global $p, $posts, $posts_per_page, $s, $single; 280 280 global $querystring_start, $querystring_equal, $querystring_separator; … … 300 300 301 301 $limitprev--; 302 $lastpost = @$wpdb->get_row("SELECT ID, post_title FROM $ tableposts WHERE post_date < '$current_post_date' AND post_status = 'publish' $sqlcat $sql_exclude_cats ORDER BY post_date DESC LIMIT $limitprev, 1");302 $lastpost = @$wpdb->get_row("SELECT ID, post_title FROM $wpdb->posts WHERE post_date < '$current_post_date' AND post_status = 'publish' $sqlcat $sql_exclude_cats ORDER BY post_date DESC LIMIT $limitprev, 1"); 303 303 if ($lastpost) { 304 304 $string = '<a href="'.get_permalink($lastpost->ID).'">'.$previous; … … 314 314 315 315 function next_post($format='%', $next='next post: ', $title='yes', $in_same_cat='no', $limitnext=1, $excluded_categories='') { 316 global $ tableposts, $posts_per_page, $post, $wpdb, $single;316 global $posts_per_page, $post, $wpdb, $single; 317 317 if(1 == $posts_per_page || 1 == $single) { 318 318 … … 338 338 $limitnext--; 339 339 340 $nextpost = @$wpdb->get_row("SELECT ID,post_title FROM $ tableposts WHERE post_date > '$current_post_date' AND post_date < '$now' AND post_status = 'publish' $sqlcat $sql_exclude_cats AND ID != $post->ID ORDER BY post_date ASC LIMIT $limitnext,1");340 $nextpost = @$wpdb->get_row("SELECT ID,post_title FROM $wpdb->posts WHERE post_date > '$current_post_date' AND post_date < '$now' AND post_status = 'publish' $sqlcat $sql_exclude_cats AND ID != $post->ID ORDER BY post_date ASC LIMIT $limitnext,1"); 341 341 if ($nextpost) { 342 342 $string = '<a href="'.get_permalink($nextpost->ID).'">'.$next;
Note: See TracChangeset
for help on using the changeset viewer.