Changeset 17
- Timestamp:
- 08/29/06 14:43:58 (2 years ago)
- Files:
-
- trunk/apps/snippets/config/app.yml (modified) (1 diff)
- trunk/apps/snippets/modules/tag/actions/actions.class.php (modified) (1 diff)
- trunk/lib/model/SnippetTagPeer.php (modified) (2 diffs)
- trunk/web/css/main.css (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/apps/snippets/config/app.yml
r7 r17 6 6 feed_size: 10 7 7 sidebar_comments: 5 8 tag_list_columns: 4 trunk/apps/snippets/modules/tag/actions/actions.class.php
r15 r17 18 18 { 19 19 $this->tags = SnippetTagPeer::getAllWithCount(1000); 20 $this->column_count = intval(count($this->tags)/ 3);20 $this->column_count = intval(count($this->tags)/sfConfig::get('app_tag_list_columns')); 21 21 } 22 22 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 } trunk/web/css/main.css
r16 r17 196 196 list-position:inside; 197 197 } 198 199 #bar .tag_1 {200 font-size: 0.9em;201 }202 203 #bar .tag_2 {204 205 }206 207 #bar .tag_3 {208 font-size: 1.2em;209 }210 198 211 199 .tags td { 212 200 padding-right:15px; 201 padding-left:10px; 213 202 } 214 203 … … 332 321 background-position: left 20px; 333 322 } 323 324 #bar a:link.tag_1 { 325 color: #A09385; 326 } 327 328 #bar a:link.tag_2 { 329 color: #836540; 330 } 331 332 #bar a.tag_3 { 333 334 }
