Merge branch 'extended-cookie'
[scuttle] / templates / sidebar.block.recent.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 $recentTags = $tagservice->getPopularTags($userid, $popCount, $logged_on_userid, $GLOBALS['defaultRecentDays']);
10 $recentTags =& $tagservice->tagCloud($recentTags, 5, 90, 225, 'alphabet_asc'); 
11
12 if ($recentTags && count($recentTags) > 0) {
13 ?>
14
15 <h2><?php echo T_('Recent Tags'); ?></h2>
16 <div id="recent">
17     <?php
18     $contents = '<p class="tags">';
19     foreach ($recentTags as $row) {
20         $entries = T_ngettext('bookmark', 'bookmarks', $row['bCount']);
21         $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> ';
22     }
23     echo $contents ."</p>\n";
24     ?>
25     <p><a href="<?php echo createURL('populartags'); ?>"><?php echo T_('Popular Tags'); ?></a> &rarr;</p>
26 </div>
27
28 <?php
29 }
30 ?>

Benjamin Mako Hill || Want to submit a patch?