Changeset 17

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/apps/snippets/config/app.yml

    r7 r17  
    66  feed_size:      10 
    77  sidebar_comments: 5 
     8  tag_list_columns: 4 
  • trunk/apps/snippets/modules/tag/actions/actions.class.php

    r15 r17  
    1818  { 
    1919    $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')); 
    2121  } 
    2222 
  • 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    } 
  • trunk/web/css/main.css

    r16 r17  
    196196  list-position:inside; 
    197197  } 
    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   } 
    210198 
    211199.tags td { 
    212200  padding-right:15px; 
     201  padding-left:10px; 
    213202} 
    214203 
     
    332321background-position: left 20px; 
    333322 
     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}