Make WordPress Core


Ignore:
Timestamp:
05/24/2004 08:22:18 AM (21 years ago)
Author:
saxmatt
Message:

Giant commit, sorry mailing list people. Move all table names to new $wpdb versions. Works but the whole app needs thorough testing now.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/template-functions-post.php

    r1254 r1355  
    276276
    277277function 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;
    279279    global $p, $posts, $posts_per_page, $s, $single;
    280280    global $querystring_start, $querystring_equal, $querystring_separator;
     
    300300
    301301        $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");
    303303        if ($lastpost) {
    304304            $string = '<a href="'.get_permalink($lastpost->ID).'">'.$previous;
     
    314314
    315315function 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;
    317317    if(1 == $posts_per_page || 1 == $single) {
    318318
     
    338338        $limitnext--;
    339339
    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");
    341341        if ($nextpost) {
    342342            $string = '<a href="'.get_permalink($nextpost->ID).'">'.$next;
Note: See TracChangeset for help on using the changeset viewer.