Changeset 22175
- Timestamp:
- Apr 12, 2013, 9:57:51 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/functions_search.inc.php
r19703 r22175 373 373 for ($i=0; $i<count($tokens); $i++) 374 374 { 375 if ( strstr($token_modifiers[$i], 'q')===false)375 if ( !($token_modifiers[$i] & QST_QUOTED) ) 376 376 { 377 377 if ( substr($tokens[$i], -1)=='*' ) 378 378 { 379 379 $tokens[$i] = rtrim($tokens[$i], '*'); 380 $token_modifiers[$i] .= '*';380 $token_modifiers[$i] |= QST_WILDCARD_END; 381 381 } 382 382 } … … 550 550 array_splice($token_tag_ids[$i], $j, 1); 551 551 array_splice($token_tag_scores[$i], $j, 1); 552 $j--; 553 continue; 552 554 } 553 555 … … 561 563 } 562 564 } 563 565 564 566 usort($all_tags, 'tag_alpha_compare'); 565 567 foreach ( $all_tags as &$tag ) … … 767 769 $allowed_images = array_flip( $allowed_images ); 768 770 $divisor = 5.0 * count($allowed_images); 769 foreach ($allowed_images as $id=> $rank )771 foreach ($allowed_images as $id=> &$rank ) 770 772 { 771 773 $weight = isset($by_weights[$id]) ? $by_weights[$id] : 1; 772 774 $weight -= $rank/$divisor; 773 $allowed_images[$id] = $weight; 774 } 775 $rank = $weight; 776 } 777 unset($rank); 778 775 779 arsort($allowed_images, SORT_NUMERIC); 776 780 $search_results['items'] = array_keys($allowed_images);
Note: See TracChangeset
for help on using the changeset viewer.