Beispiel #1
0
 /**
  * Retrieve a font size for a tag
  *
  * @param Fishpig_Wordpress_Model_Post_Tag $tag
  * @return int
  */
 public function getFontSize(Fishpig_Wordpress_Model_Post_Tag $tag)
 {
     $percentage = $tag->getCount() * 100 / $this->getMaximumPopularity();
     foreach (array(25 => 90, 50 => 100, 75 => 120, 90 => 140, 100 => 150) as $percentageLimit => $default) {
         if ($percentage <= $percentageLimit) {
             return $this->_getConfigFontSize($percentage, $default);
         }
     }
     return $this->_getConfigFontSize(100, 150);
 }
 /**
  * Retrieve a font size for a tag
  *
  * @param Fishpig_Wordpress_Model_Post_Tag $tag
  * @return int
  */
 public function getFontSize(Fishpig_Wordpress_Model_Post_Tag $tag)
 {
     if ($this->getMaximumPopularity() > 0) {
         $percentage = $tag->getCount() * 100 / $this->getMaximumPopularity();
         foreach ($this->getFontSizes() as $percentageLimit => $default) {
             if ($percentage <= $percentageLimit) {
                 return $default;
             }
         }
     }
     return 150;
 }