- Timestamp:
- 08/29/06 14:43:58 (2 years ago)
- Files:
-
- trunk/lib/model/SnippetTagPeer.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lib/model/SnippetTagPeer.php
r15 r17 48 48 } 49 49 50 public function getPopular( )50 public function getPopular($levels = 3, $floor = 0.2, $power = 0.4) 51 51 { 52 52 $all_tags = self::getAllWithCount(200); … … 55 55 foreach($all_tags as $tag => $count) 56 56 { 57 if($count/$max_count > 0.2)57 if($count/$max_count > $floor) 58 58 { 59 $tags[$tag] = intval( 3*$count/$max_count);59 $tags[$tag] = intval(($levels-1)*pow($count/$max_count, $power)+1); 60 60 } 61 61 }
