[wp-cvs] wordpress/wp-includes template-functions-category.php, 1.57, 1.58

Michel Valdrighi michelvaldrighi at users.sourceforge.net
Fri Feb 18 16:42:51 GMT 2005


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

Modified Files:
	template-functions-category.php 
Log Message:
reverting the previous patch: it made it impossible to sort the list by category name

Index: template-functions-category.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-includes/template-functions-category.php,v
retrieving revision 1.57
retrieving revision 1.58
diff -C2 -d -r1.57 -r1.58
*** template-functions-category.php	16 Feb 2005 16:06:07 -0000	1.57
--- template-functions-category.php	18 Feb 2005 16:42:49 -0000	1.58
***************
*** 270,294 ****
  	}
  
! 	if ($hide_empty) {
! 		$categories = array();
! 		$extra_fields = 'cat_name, category_nicename, category_description,';
! 	} else {
! 		if (intval($categories)==0 && !$hide_empty){
! 			$sort_column = 'cat_'.$sort_column;
  
! 			$query  = "
! 				SELECT cat_ID, cat_name, category_nicename, category_description, category_parent
! 				FROM $wpdb->categories
! 				WHERE cat_ID > 0 $exclusions
! 				ORDER BY $sort_column $sort_order";
  
! 			$categories = $wpdb->get_results($query);
! 		}
! 		$extra_fields = '';
  	}
- 
  	if (!count($category_posts)) {
  		$now = current_time('mysql', 1);
! 		$cat_counts = $wpdb->get_results("	SELECT cat_ID, $extra_fields
  		COUNT($wpdb->post2cat.post_id) AS cat_count
  		FROM $wpdb->categories 
--- 270,287 ----
  	}
  
! 	if (intval($categories)==0){
! 		$sort_column = 'cat_'.$sort_column;
  
! 		$query  = "
! 			SELECT cat_ID, cat_name, category_nicename, category_description, category_parent
! 			FROM $wpdb->categories
! 			WHERE cat_ID > 0 $exclusions
! 			ORDER BY $sort_column $sort_order";
  
! 		$categories = $wpdb->get_results($query);
  	}
  	if (!count($category_posts)) {
  		$now = current_time('mysql', 1);
! 		$cat_counts = $wpdb->get_results("	SELECT cat_ID,
  		COUNT($wpdb->post2cat.post_id) AS cat_count
  		FROM $wpdb->categories 
***************
*** 302,308 ****
                  if (1 != intval($hide_empty) || $cat_count > 0) {
                      $category_posts["$cat_count->cat_ID"] = $cat_count->cat_count;
-                     if ($hide_empty) {
-                     	$categories[] = $cat_count;
-                     }
                  }
              }
--- 295,298 ----



More information about the cvs mailing list