Show
Ignore:
Timestamp:
08/06/08 08:20:40 (4 months ago)
Author:
misja
Message:

Fixes #375

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • devel/mod/search/lib/tags_display.php

    r1593 r1615  
    99$searchline = "(" . run("users:access_level_sql_where",$USER->ident) . ")"; 
    1010 
    11 if ($tags = get_records_sql('SELECT DISTINCT tag,count(ident) AS number, '.$db->random.' AS rand  
    12                              FROM '.$CFG->prefix."tags WHERE " . $searchline . " 
    13                              GROUP BY tag ASC having number > 1 limit 200")) { 
     11if ($tags = get_records_sql( "SELECT DISTINCT tag,count(ident) AS number FROM {$CFG->prefix}tags WHERE $searchline GROUP BY tag ASC having number > 1 ORDER BY number DESC LIMIT 200")) { 
    1412    $max = 0; 
    1513    foreach($tags as $tag) { 
     
    1816        } 
    1917    } 
     18    // Alpha sort the tags. This can't be done in SQL because we need to 
     19    // sort by relevance (tag count) there and use a LIMIT. 
     20    // We use keysort here because the key contains the tag. 
     21    uksort($tags, strcasecmp); 
    2022     
    2123    $tag_count = 0;