- Timestamp:
- Jun 23, 2007, 9:40:38 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/functions_search.inc.php
r1906 r2043 418 418 // before returning the result "as is", make sure the user has the 419 419 // permissions for every item 420 global $conf; 420 421 $query = ' 421 422 SELECT DISTINCT(id) … … 432 433 ), 433 434 'AND' 434 ); 435 $allowed_image_ids = array_from_query( $query, 'id'); 436 $by_weights = array_intersect_key($by_weights, array_flip($allowed_image_ids)); 435 ).' 436 '.$conf['order_by']; 437 $allowed_images = array_flip( array_from_query( $query, 'id') ); 438 $by_weights = array_intersect_key($by_weights, $allowed_images ); 439 $divisor = 4.0 * count($allowed_images); 440 // decrease weight from 0 to 0.25 corresponding to the order 441 foreach ($allowed_images as $id=>$rank ) 442 { 443 $by_weights[$id] -= $rank / $divisor; 444 } 437 445 $permissions_checked = true; 438 446 }
Note: See TracChangeset
for help on using the changeset viewer.