Changeset 2179

Show
Ignore:
Timestamp:
02/01/05 01:49:51 (4 years ago)
Author:
rboren
Message:

Remove support for 'all' queries and for poststart and postend.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-admin/post.php

    r2172 r2179  
    22require_once('admin.php'); 
    33 
    4 $wpvarstoreset = array('action', 'safe_mode', 'withcomments', 'posts', 'poststart', 'postend', 'content', 'edited_post_title', 'comment_error', 'profile', 'trackback_url', 'excerpt', 'showcomments', 'commentstart', 'commentend', 'commentorder' ); 
     4$wpvarstoreset = array('action', 'safe_mode', 'withcomments', 'posts', 'content', 'edited_post_title', 'comment_error', 'profile', 'trackback_url', 'excerpt', 'showcomments', 'commentstart', 'commentend', 'commentorder' ); 
    55 
    66for ($i=0; $i<count($wpvarstoreset); $i += 1) { 
  • trunk/wp-blog-header.php

    r2106 r2179  
    8383 } 
    8484 
    85 $wpvarstoreset = array('m','p','posts','w', 'cat','withcomments','s','search','exact', 'sentence','poststart','postend','preview','debug', 'calendar','page','paged','more','tb', 'pb','author','order','orderby', 'year', 'monthnum', 'day', 'hour', 'minute', 'second', 'name', 'category_name', 'feed', 'author_name', 'static', 'pagename', 'page_id', 'error'); 
     85$wpvarstoreset = array('m','p','posts','w', 'cat','withcomments','s','search','exact', 'sentence','preview','debug', 'calendar','page','paged','more','tb', 'pb','author','order','orderby', 'year', 'monthnum', 'day', 'hour', 'minute', 'second', 'name', 'category_name', 'feed', 'author_name', 'static', 'pagename', 'page_id', 'error'); 
    8686 
    8787$wpvarstoreset = apply_filters('query_vars', $wpvarstoreset); 
  • trunk/wp-includes/classes.php

    r2177 r2179  
    6767        if ('' != $qv['name']) { 
    6868            $this->is_single = true; 
    69         } elseif ( $qv['p'] && $qv['p'] != 'all' ) { 
     69        } elseif ( $qv['p'] ) { 
    7070            $this->is_single = true; 
    7171        } elseif (('' != $qv['hour']) && ('' != $qv['minute']) &&('' != $qv['second']) && ('' != $qv['year']) && ('' != $qv['monthnum']) && ('' != $qv['day'])) { 
     
    134134            } 
    135135 
    136             if (empty($qv['cat']) || ($qv['cat'] == 'all') || ($qv['cat'] == '0')) { 
     136            if (empty($qv['cat']) || ($qv['cat'] == '0')) { 
    137137                $this->is_category = false; 
    138138            } else { 
     
    148148            } 
    149149             
    150             if ((empty($qv['author'])) || ($qv['author'] == 'all') || ($qv['author'] == '0')) { 
     150            if ((empty($qv['author'])) || ($qv['author'] == '0')) { 
    151151                $this->is_author = false; 
    152152            } else { 
     
    299299 
    300300        // If a post number is specified, load that post 
    301         if (($q['p'] != '') && ($q['p'] != 'all') && intval($q['p']) != 0) { 
     301        if (($q['p'] != '') && intval($q['p']) != 0) { 
    302302            $q['p'] =  (int) $q['p']; 
    303303            $where = ' AND ID = ' . $q['p']; 
    304304        } 
    305305 
    306         if (($q['page_id'] != '') && ($q['page_id'] != 'all')) { 
     306        if (($q['page_id'] != '') && (intval($q['page_id']) != 0)) { 
    307307            $q['page_id'] = intval($q['page_id']); 
    308308            $q['p'] = $q['page_id']; 
     
    339339        // Category stuff 
    340340 
    341         if ((empty($q['cat'])) || ($q['cat'] == 'all') || ($q['cat'] == '0') ||  
     341        if ((empty($q['cat'])) || ($q['cat'] == '0') ||  
    342342                // Bypass cat checks if fetching specific posts 
    343343                ( 
     
    398398        // Author/user stuff 
    399399 
    400         if ((empty($q['author'])) || ($q['author'] == 'all') || ($q['author'] == '0')) { 
     400        if ((empty($q['author'])) || ($q['author'] == '0')) { 
    401401            $whichauthor=''; 
    402402        } else { 
     
    465465        } 
    466466 
    467         if ($q['p'] == 'all') { 
    468             $where = ''; 
    469         } 
    470  
    471467        $now = gmdate('Y-m-d H:i:59'); 
    472468 
    473469        if ($pagenow != 'post.php' && $pagenow != 'edit.php') { 
    474             if ((empty($q['poststart'])) || (empty($q['postend'])) || !($q['postend'] > $q['poststart'])) { 
    475                 $where .= " AND post_date_gmt <= '$now'"; 
    476             } 
    477  
     470            $where .= " AND post_date_gmt <= '$now'"; 
    478471            $distinct = 'DISTINCT'; 
    479472        } 
     
    497490 
    498491        // Paging 
    499         if ( !empty($q['postend']) && ($q['postend'] > $q['poststart']) ) { 
    500             if ($q['what_to_show'] == 'posts') { 
    501                 $q['poststart'] = intval($q['poststart']); 
    502                 $q['postend'] = intval($q['postend']); 
    503                 $limposts = $q['postend'] - $q['poststart']; 
    504                 $limits = ' LIMIT '.$q['poststart'].','.$limposts; 
    505             } elseif ($q['what_to_show'] == 'days') { 
    506                 $q['poststart'] = intval($q['poststart']); 
    507                 $q['postend'] = intval($q['postend']); 
    508                 $limposts = $q['postend'] - $q['poststart']; 
    509                 $lastpostdate = get_lastpostdate(); 
    510                 $lastpostdate = mysql2date('Y-m-d 00:00:00',$lastpostdate); 
    511                 $lastpostdate = mysql2date('U',$lastpostdate); 
    512                 $startdate = date('Y-m-d H:i:s', ($lastpostdate - (($q['poststart'] -1) * 86400))); 
    513                 $otherdate = date('Y-m-d H:i:s', ($lastpostdate - (($q['postend'] -1) * 86400))); 
    514                 $where .= " AND post_date > '$otherdate' AND post_date < '$startdate'"; 
    515             } 
    516         } else if (empty($q['nopaging']) && ! is_single()) { 
     492        if (empty($q['nopaging']) && ! is_single()) { 
    517493            $page = $q['paged']; 
    518494            if (empty($page)) {