[wp-cvs] wordpress/wp-includes classes.php,1.54,1.55
Ryan Boren
rboren at users.sourceforge.net
Sun Feb 13 17:53:00 GMT 2005
Update of /cvsroot/cafelog/wordpress/wp-includes
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26962/wp-includes
Modified Files:
classes.php
Log Message:
Allow category and date filtering to coincide. Allow any number of spaces or commas to serve as item separators in the category and author arrays. http://mosquito.wordpress.org/view.php?id=221
Index: classes.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-includes/classes.php,v
retrieving revision 1.54
retrieving revision 1.55
diff -C2 -d -r1.54 -r1.55
*** classes.php 11 Feb 2005 02:16:38 -0000 1.54
--- classes.php 13 Feb 2005 17:52:58 -0000 1.55
***************
*** 354,362 ****
if ((empty($q['cat'])) || ($q['cat'] == '0') ||
// Bypass cat checks if fetching specific posts
! (
! intval($q['year']) || intval($q['monthnum']) || intval($q['day']) || intval($q['w']) ||
! intval($q['p']) || !empty($q['name']) || !empty($q['s'])
! )
! ) {
$whichcat='';
} else {
--- 354,358 ----
if ((empty($q['cat'])) || ($q['cat'] == '0') ||
// Bypass cat checks if fetching specific posts
! ( is_single() || is_page() )) {
$whichcat='';
} else {
***************
*** 376,380 ****
}
$join = " LEFT JOIN $wpdb->post2cat ON ($wpdb->posts.ID = $wpdb->post2cat.post_id) ";
! $cat_array = explode(' ',$q['cat']);
$whichcat .= ' AND (category_id '.$eq.' '.intval($cat_array[0]);
$whichcat .= get_category_children($cat_array[0], ' '.$andor.' category_id '.$eq.' ');
--- 372,376 ----
}
$join = " LEFT JOIN $wpdb->post2cat ON ($wpdb->posts.ID = $wpdb->post2cat.post_id) ";
! $cat_array = preg_split('/[,\s]+/', $q['cat']);
$whichcat .= ' AND (category_id '.$eq.' '.intval($cat_array[0]);
$whichcat .= get_category_children($cat_array[0], ' '.$andor.' category_id '.$eq.' ');
***************
*** 425,429 ****
$andor = 'OR';
}
! $author_array = explode(' ', $q['author']);
$whichauthor .= ' AND (post_author '.$eq.' '.intval($author_array[0]);
for ($i = 1; $i < (count($author_array)); $i = $i + 1) {
--- 421,425 ----
$andor = 'OR';
}
! $author_array = preg_split('/[,\s]+/', $q['author']);
$whichauthor .= ' AND (post_author '.$eq.' '.intval($author_array[0]);
for ($i = 1; $i < (count($author_array)); $i = $i + 1) {
More information about the cvs
mailing list