Changeset 2502
- Timestamp:
- 07/23/2010 04:03:35 AM (16 years ago)
- Location:
- trunk/bb-includes
- Files:
-
- 2 edited
-
functions.bb-meta.php (modified) (1 diff)
-
functions.bb-posts.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bb-includes/functions.bb-meta.php
r2475 r2502 297 297 break; 298 298 case 'version': 299 return '1.1-alpha-2 475'; // Don't filter299 return '1.1-alpha-2501'; // Don't filter 300 300 break; 301 301 case 'bb_db_version' : -
trunk/bb-includes/functions.bb-posts.php
r2475 r2502 206 206 $the_posts = array_merge( $_cached_posts, $_query_posts ); 207 207 208 global $bb_cache_posts_sort_by; 209 $bb_cache_posts_sort_by = 'post_id'; 210 if ( isset( $_query ) && preg_match( '/ORDER\s+BY\s+`?(?:p\.)?(.+?)(?:[`,\s]|$)/i', $_query, $order_by ) ) 211 $bb_cache_posts_sort_by = $order_by[1]; 208 212 usort( $the_posts, '_bb_cache_posts_sort' ); 209 if ( isset( $_query ) && str pos( $_query, 'DESC' ) !== false )213 if ( isset( $_query ) && stripos( $_query, 'DESC' ) !== false ) 210 214 $the_posts = array_reverse( $the_posts ); 211 215 … … 214 218 215 219 function _bb_cache_posts_sort( $a, $b ) { 216 return (int) $a->post_id - (int) $b->post_id; 220 global $bb_cache_posts_sort_by; 221 222 if ( $a->$bb_cache_posts_sort_by > $b->$bb_cache_posts_sort_by ) 223 return 1; 224 if ( $a->$bb_cache_posts_sort_by < $b->$bb_cache_posts_sort_by ) 225 return -1; 226 return 0; 217 227 } 218 228
Note: See TracChangeset
for help on using the changeset viewer.