Changeset 2548
- Timestamp:
- Sep 17, 2008, 11:42:50 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/ws_functions.inc.php
r2520 r2548 365 365 global $user,$conf; 366 366 367 $query = ' 368 SELECT 369 category_id, 370 MAX(rank) AS max_rank 371 FROM '.IMAGE_CATEGORY_TABLE.' 372 WHERE rank IS NOT NULL 373 GROUP BY category_id 374 ;'; 375 $max_image_rank_of = simple_hash_from_query( 376 $query, 377 'category_id', 378 'max_rank' 379 ); 380 367 381 $where = array(); 368 382 … … 416 430 $row[$key] = (int)$row[$key]; 417 431 } 432 433 if (isset($max_image_rank_of[ $row['id'] ])) 434 { 435 $row['images_max_rank'] = $max_image_rank_of[ $row['id'] ]; 436 } 437 418 438 array_push($cats, $row); 419 439 } 420 440 usort($cats, 'global_rank_compare'); 421 441 return array( 422 'categories' => 423 new PwgNamedArray($cats,'category', 424 array('id','url','nb_images','total_nb_images','nb_categories','date_last','max_date_last') 425 ) 442 'categories' => new PwgNamedArray( 443 $cats, 444 'category', 445 array( 446 'id', 447 'url', 448 'nb_images', 449 'total_nb_images', 450 'nb_categories', 451 'date_last', 452 'max_date_last', 453 'images_max_rank', 454 ) 455 ) 426 456 ); 427 457 }
Note: See TracChangeset
for help on using the changeset viewer.