[wp-cvs] wordpress/wp-includes classes.php,1.48,1.49

Ryan Boren rboren at users.sourceforge.net
Tue Feb 1 01:49:53 GMT 2005


Update of /cvsroot/cafelog/wordpress/wp-includes
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6174/wp-includes

Modified Files:
	classes.php 
Log Message:
Remove support for 'all' queries and for poststart and postend.

Index: classes.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-includes/classes.php,v
retrieving revision 1.48
retrieving revision 1.49
diff -C2 -d -r1.48 -r1.49
*** classes.php	1 Feb 2005 01:04:08 -0000	1.48
--- classes.php	1 Feb 2005 01:49:51 -0000	1.49
***************
*** 67,71 ****
  		if ('' != $qv['name']) {
  			$this->is_single = true;
! 		} elseif ( $qv['p'] && $qv['p'] != 'all' ) {
  			$this->is_single = true;
  		} elseif (('' != $qv['hour']) && ('' != $qv['minute']) &&('' != $qv['second']) && ('' != $qv['year']) && ('' != $qv['monthnum']) && ('' != $qv['day'])) {
--- 67,71 ----
  		if ('' != $qv['name']) {
  			$this->is_single = true;
! 		} elseif ( $qv['p'] ) {
  			$this->is_single = true;
  		} elseif (('' != $qv['hour']) && ('' != $qv['minute']) &&('' != $qv['second']) && ('' != $qv['year']) && ('' != $qv['monthnum']) && ('' != $qv['day'])) {
***************
*** 134,138 ****
  			}
  
! 			if (empty($qv['cat']) || ($qv['cat'] == 'all') || ($qv['cat'] == '0')) {
  				$this->is_category = false;
  			} else {
--- 134,138 ----
  			}
  
! 			if (empty($qv['cat']) || ($qv['cat'] == '0')) {
  				$this->is_category = false;
  			} else {
***************
*** 148,152 ****
  			}
              
! 			if ((empty($qv['author'])) || ($qv['author'] == 'all') || ($qv['author'] == '0')) {
  				$this->is_author = false;
  			} else {
--- 148,152 ----
  			}
              
! 			if ((empty($qv['author'])) || ($qv['author'] == '0')) {
  				$this->is_author = false;
  			} else {
***************
*** 299,308 ****
  
  		// If a post number is specified, load that post
! 		if (($q['p'] != '') && ($q['p'] != 'all') && intval($q['p']) != 0) {
  			$q['p'] =  (int) $q['p'];
  			$where = ' AND ID = ' . $q['p'];
  		}
  
! 		if (($q['page_id'] != '') && ($q['page_id'] != 'all')) {
  			$q['page_id'] = intval($q['page_id']);
  			$q['p'] = $q['page_id'];
--- 299,308 ----
  
  		// If a post number is specified, load that post
! 		if (($q['p'] != '') && intval($q['p']) != 0) {
  			$q['p'] =  (int) $q['p'];
  			$where = ' AND ID = ' . $q['p'];
  		}
  
! 		if (($q['page_id'] != '') && (intval($q['page_id']) != 0)) {
  			$q['page_id'] = intval($q['page_id']);
  			$q['p'] = $q['page_id'];
***************
*** 339,343 ****
  		// Category stuff
  
! 		if ((empty($q['cat'])) || ($q['cat'] == 'all') || ($q['cat'] == '0') || 
  				// Bypass cat checks if fetching specific posts
  				(
--- 339,343 ----
  		// Category stuff
  
! 		if ((empty($q['cat'])) || ($q['cat'] == '0') || 
  				// Bypass cat checks if fetching specific posts
  				(
***************
*** 398,402 ****
  		// Author/user stuff
  
! 		if ((empty($q['author'])) || ($q['author'] == 'all') || ($q['author'] == '0')) {
  			$whichauthor='';
  		} else {
--- 398,402 ----
  		// Author/user stuff
  
! 		if ((empty($q['author'])) || ($q['author'] == '0')) {
  			$whichauthor='';
  		} else {
***************
*** 465,479 ****
  		}
  
- 		if ($q['p'] == 'all') {
- 			$where = '';
- 		}
- 
  		$now = gmdate('Y-m-d H:i:59');
  
  		if ($pagenow != 'post.php' && $pagenow != 'edit.php') {
! 			if ((empty($q['poststart'])) || (empty($q['postend'])) || !($q['postend'] > $q['poststart'])) {
! 				$where .= " AND post_date_gmt <= '$now'";
! 			}
! 
  			$distinct = 'DISTINCT';
  		}
--- 465,472 ----
  		}
  
  		$now = gmdate('Y-m-d H:i:59');
  
  		if ($pagenow != 'post.php' && $pagenow != 'edit.php') {
! 			$where .= " AND post_date_gmt <= '$now'";
  			$distinct = 'DISTINCT';
  		}
***************
*** 497,518 ****
  
  		// Paging
! 		if ( !empty($q['postend']) && ($q['postend'] > $q['poststart']) ) {
! 			if ($q['what_to_show'] == 'posts') {
! 				$q['poststart'] = intval($q['poststart']);
! 				$q['postend'] = intval($q['postend']);
! 				$limposts = $q['postend'] - $q['poststart'];
! 				$limits = ' LIMIT '.$q['poststart'].','.$limposts;
! 			} elseif ($q['what_to_show'] == 'days') {
! 				$q['poststart'] = intval($q['poststart']);
! 				$q['postend'] = intval($q['postend']);
! 				$limposts = $q['postend'] - $q['poststart'];
! 				$lastpostdate = get_lastpostdate();
! 				$lastpostdate = mysql2date('Y-m-d 00:00:00',$lastpostdate);
! 				$lastpostdate = mysql2date('U',$lastpostdate);
! 				$startdate = date('Y-m-d H:i:s', ($lastpostdate - (($q['poststart'] -1) * 86400)));
! 				$otherdate = date('Y-m-d H:i:s', ($lastpostdate - (($q['postend'] -1) * 86400)));
! 				$where .= " AND post_date > '$otherdate' AND post_date < '$startdate'";
! 			}
! 		} else if (empty($q['nopaging']) && ! is_single()) {
  			$page = $q['paged'];
  			if (empty($page)) {
--- 490,494 ----
  
  		// Paging
! 		if (empty($q['nopaging']) && ! is_single()) {
  			$page = $q['paged'];
  			if (empty($page)) {



More information about the cvs mailing list