caparuni Posted May 22, 2010 Share Posted May 22, 2010 last night when take closed look on block tags module, i found out that this module maybe need a little fixblocktags.php (original) function hookLeftColumn($params) { global $smarty; $tags = Tag::getMainTags(intval($params['cookie']->id_lang), intval(Configuration::get('BLOCKTAGS_NBR'))); if (!sizeof($tags)) return ''; $maxFontSize = 18; $minFontSize = 10; $maxNumber = intval($tags[0]['times']); $classPrefix = 'tag_level'; for ($i = 0; $i < sizeof($tags); ++$i) { $tags[$i]['fontSize'] = floor(($maxFontSize * $tags[$i]['times']) / $maxNumber); if ($tags[$i]['fontSize'] < $minFontSize) $tags[$i]['fontSize'] = $minFontSize; // 2nd version: use CSS class $tags[$i]['class'] = $classPrefix.$tags[$i]['times']; if ($tags[$i]['times'] > 3) $tags[$i]['class'] = $classPrefix; } $smarty->assign('tags', $tags); return $this->display(__FILE__, 'blocktags.tpl'); } change it to function hookLeftColumn($params) { global $smarty; $tags = Tag::getMainTags(intval($params['cookie']->id_lang), intval(Configuration::get('BLOCKTAGS_NBR'))); if (!sizeof($tags)) return ''; $maxLevel = 3; $minLevel = 1; $classPrefix = 'tag_level'; for ($i = 0; $i < sizeof($tags); ++$i) { $tags[$i]['class'] = $classPrefix.mt_rand($minLevel,$maxLevel); } $smarty->assign('tags', $tags); return $this->display(__FILE__, 'blocktags.tpl'); } since in blocktags.tpl only use css class to define font size, so i remove all thing related to $tags[$i]['fontSize'] such as $maxFontSize, $minFontSize, $maxNumber etc...well thats it, now we get smaller and simplify block tags with a random font size handled by css ps: if u want to made random tags just read my old post Link to comment Share on other sites More sharing options...
redfordnl Posted November 5, 2010 Share Posted November 5, 2010 Thanks very much for this solution! Link to comment Share on other sites More sharing options...
Patrick_64 Posted December 23, 2010 Share Posted December 23, 2010 Thank you for your help,have a nice day Link to comment Share on other sites More sharing options...
villagedefrance Posted December 23, 2010 Share Posted December 23, 2010 Works perfectly in 1.3.3! much better than the default code.Thank you. Link to comment Share on other sites More sharing options...
amanuensis Posted September 8, 2012 Share Posted September 8, 2012 Hi I am trying to reduce the clumsy looking text in the Tag Cloud - I have PS v 1.4.9 installed and the blocktags.php file has been changed a lot since your recommendation - any ideas as to how I can achieve the text reduction in the new version. Many thanks Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now