Ticket #388: templates.patch

File templates.patch, 0.8 kB (added by joerosa, 5 months ago)
  • lib/templates.php

    old new  
    10641064            } else {  
    10651065              $vars[1] = "20";  
    10661066            }  
    1067             if ($tags = get_records_sql("SELECT tag, count(ident) as numtags FROM `".$CFG->prefix."tags` WHERE access = 'PUBLIC' and tag!='' group by tag having numtags > 1 order by ident desc limit " . $vars[1])) { 
     1067            if ($tags = get_records_sql("SELECT tag, count(ident) AS numtags, MAX(ref) AS ref FROM `".$CFG->prefix."tags` WHERE access = 'PUBLIC' AND tag!='' AND tagtype = 'weblog' GROUP BY tag HAVING numtags > 1 ORDER BY ref DESC LIMIT " . $vars[1])) { 
    10681068                $max = 0; 
    10691069                foreach($tags as $tag) { 
    10701070                    if ($tag->numtags > $max) {