Changeset 1528

Show
Ignore:
Timestamp:
01/25/08 18:27:37 (10 months ago)
Author:
ewout
Message:

Allow to specify the limit for the {{populartags}} keyword. Resolves #246. Thanks, joerosa.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • devel/lib/templates.php

    r1447 r1528  
    10571057        case "populartags": 
    10581058            $result = ""; 
    1059             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 20")) { 
     1059            if (isset($vars[1])) {  
     1060              $vars[1] = (int) $vars[1];  
     1061            } else {  
     1062              $vars[1] = "20";  
     1063            }  
     1064            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])) { 
    10601065                $max = 0; 
    10611066                foreach($tags as $tag) {