Restructure repository
[scuttle] / templates / sidebar.block.popular.php
1 <?php
2 $tagservice =& ServiceFactory::getServiceInstance('TagService');
3 $userservice =& ServiceFactory::getServiceInstance('UserService');
4
5 $logged_on_userid = $userservice->getCurrentUserId();
6 if ($logged_on_userid === false) {
7     $logged_on_userid = NULL;
8 }
9 $popularTags =& $tagservice->getPopularTags($userid, $popCount, $logged_on_userid);
10 $popularTags =& $tagservice->tagCloud($popularTags, 5, 90, 225, 'alphabet_asc'); 
11
12 if ($popularTags && count($popularTags) > 0) {
13 ?>
14
15 <h2><?php echo T_('Popular Tags'); ?></h2>
16 <div id="popular">
17     <p class="tags">
18     <?php
19     $contents = '';
20     foreach ($popularTags as $row) {
21         $entries = T_ngettext('bookmark', 'bookmarks', $row['bCount']);
22         $contents .= '<a href="'. sprintf($cat_url, $user, filter($row['tag'], 'url')) .'" title="'. $row['bCount'] .' '. $entries .'" rel="tag" style="font-size:'. $row['size'] .'">'. filter($row['tag']) .'</a> ';
23     }
24     echo $contents ."\n";
25     ?>
26     </p>
27 </div>
28
29 <?php
30 }
31 ?>

Benjamin Mako Hill || Want to submit a patch?