Make WordPress Core

Changeset 597


Ignore:
Timestamp:
12/10/2003 09:05:11 AM (23 years ago)
Author:
saxmatt
Message:

Remove post_category references.

Location:
trunk/b2-include
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/b2-include/b2functions.php

    r594 r597  
    377377        if ((!isset($cache_lastpostdate)) OR (!$use_cache)) {
    378378                $now = date("Y-m-d H:i:s",(time() + ($time_difference * 3600)));
    379                 if ($pagenow != 'wp-post.php') {
    380                         $showcatzero = 'post_category > 0 AND';
    381                 } else {
    382                         $showcatzero = '';
    383                 }
    384                 $lastpostdate = $wpdb->get_var("SELECT post_date FROM $tableposts WHERE $showcatzero post_date <= '$now' ORDER BY post_date DESC LIMIT 1");
     379
     380                $lastpostdate = $wpdb->get_var("SELECT post_date FROM $tableposts WHERE post_date <= '$now' ORDER BY post_date DESC LIMIT 1");
    385381                $cache_lastpostdate = $lastpostdate;
    386382//              echo $lastpostdate;
  • trunk/b2-include/b2template.functions.php

    r595 r597  
    164164
    165165        if ('monthly' == $type) {
    166                 $arcresults = $wpdb->get_results("SELECT DISTINCT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, count(ID) as posts FROM $tableposts WHERE post_date < '$now' AND post_category > 0 AND post_status = 'publish' GROUP BY YEAR(post_date), MONTH(post_date) ORDER BY post_date DESC" . $limit);
     166                $arcresults = $wpdb->get_results("SELECT DISTINCT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, count(ID) as posts FROM $tableposts WHERE post_date < '$now' AND post_status = 'publish' GROUP BY YEAR(post_date), MONTH(post_date) ORDER BY post_date DESC" . $limit);
    167167        if ($arcresults) {
    168168            foreach ($arcresults as $arcresult) {
    … …  
    178178        }
    179179        } elseif ('daily' == $type) {
    180                 $arcresults = $wpdb->get_results("SELECT DISTINCT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, DAYOFMONTH(post_date) AS `dayofmonth` FROM $tableposts WHERE post_date < '$now' AND post_category > 0 AND post_status = 'publish' ORDER BY post_date DESC" . $limit);
     180                $arcresults = $wpdb->get_results("SELECT DISTINCT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, DAYOFMONTH(post_date) AS `dayofmonth` FROM $tableposts WHERE post_date < '$now' AND post_status = 'publish' ORDER BY post_date DESC" . $limit);
    181181        if ($arcresults) {
    182182            foreach ($arcresults as $arcresult) {
    … …  
    191191                        $start_of_week = 1;
    192192                }
    193                 $arcresults = $wpdb->get_results("SELECT DISTINCT WEEK(post_date, $start_of_week) AS `week`, YEAR(post_date) AS yr, DATE_FORMAT(post_date, '%Y-%m-%d') AS yyyymmdd FROM $tableposts WHERE post_date < '$now' AND post_category > 0 AND post_status = 'publish' ORDER BY post_date DESC" . $limit);
     193                $arcresults = $wpdb->get_results("SELECT DISTINCT WEEK(post_date, $start_of_week) AS `week`, YEAR(post_date) AS yr, DATE_FORMAT(post_date, '%Y-%m-%d') AS yyyymmdd FROM $tableposts WHERE post_date < '$now' AND post_status = 'publish' ORDER BY post_date DESC" . $limit);
    194194                $arc_w_last = '';
    195195        if ($arcresults) {
    … …  
    210210        }
    211211        } elseif ('postbypost' == $type) {
    212                 $arcresults = $wpdb->get_results("SELECT ID, post_date, post_title FROM $tableposts WHERE post_date < '$now' AND post_category > 0 AND post_status = 'publish' ORDER BY post_date DESC" . $limit);
     212                $arcresults = $wpdb->get_results("SELECT ID, post_date, post_title FROM $tableposts WHERE post_date < '$now' AND post_status = 'publish' ORDER BY post_date DESC" . $limit);
    213213        if ($arcresults) {
    214214            foreach ($arcresults as $arcresult) {
    … …  
    233233    // Quick check. If we have no posts at all, abort!
    234234    if (!$posts) {
    235         $gotsome = $wpdb->get_var("SELECT ID from $tableposts WHERE post_status = 'publish' AND post_category > 0 ORDER BY post_date DESC LIMIT 1");
     235        $gotsome = $wpdb->get_var("SELECT ID from $tableposts WHERE post_status = 'publish' ORDER BY post_date DESC LIMIT 1");
    236236        if (!$gotsome)
    237237            return;
    … …  
    10481048
    10491049                $limitprev--;
    1050                 $lastpost = @$wpdb->get_row("SELECT ID, post_title FROM $tableposts WHERE post_date < '$current_post_date' AND post_category > 0 AND post_status = 'publish' $sqlcat $sql_exclude_cats ORDER BY post_date DESC LIMIT $limitprev, 1");
     1050                $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");
    10511051                if ($lastpost) {
    10521052                        $string = '<a href="'.get_permalink($lastpost->ID).'">'.$previous;
    … …  
    10881088                $limitnext--;
    10891089
    1090                 $nextpost = @$wpdb->get_row("SELECT ID,post_title FROM $tableposts WHERE post_date > '$current_post_date' AND post_date < '$now' AND post_category > 0 AND post_status = 'publish' $sqlcat $sql_exclude_cats ORDER BY post_date ASC LIMIT $limitnext,1");
     1090                $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 ORDER BY post_date ASC LIMIT $limitnext,1");
    10911091                if ($nextpost) {
    10921092                        $string = '<a href="'.get_permalink($nextpost->ID).'">'.$next;
Note: See TracChangeset for help on using the changeset viewer.