Changeset 17 for trunk/lib

Show
Ignore:
Timestamp:
08/29/06 14:43:58 (2 years ago)
Author:
fabien
Message:

tweaked appearance of tag cloud

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/model/SnippetTagPeer.php

    r15 r17  
    4848  } 
    4949   
    50   public function getPopular(
     50  public function getPopular($levels = 3, $floor = 0.2, $power = 0.4
    5151  { 
    5252    $all_tags = self::getAllWithCount(200); 
     
    5555    foreach($all_tags as $tag => $count) 
    5656    { 
    57       if($count/$max_count > 0.2
     57      if($count/$max_count > $floor
    5858      { 
    59         $tags[$tag] = intval(3*$count/$max_count); 
     59        $tags[$tag] = intval(($levels-1)*pow($count/$max_count, $power)+1); 
    6060      } 
    6161    }