]> projects.mako.cc - scuttle/blob - templates/sidebar.block.recent.php
initial patch to cause scuttle to work with PHP 8.2
[scuttle] / templates / sidebar.block.recent.php
1 <?php
2 $sf = new ServiceFactory();
3 $tagservice  =& $sf->getServiceInstance('TagService');
4 $userservice =& $sf->getServiceInstance('UserService');
5
6 $logged_on_userid = $userservice->getCurrentUserId();
7 if ($logged_on_userid === false) {
8     $logged_on_userid = NULL;
9 }
10
11 if (!isset($userid)) {
12     $userid = NULL;
13 }
14
15 $recentTags = $tagservice->getPopularTags($userid, $popCount, $logged_on_userid, $GLOBALS['defaultRecentDays']);
16 $recentTags =& $tagservice->tagCloud($recentTags, 5, 90, 225, 'alphabet_asc'); 
17
18 if ($recentTags && count($recentTags) > 0) {
19 ?>
20
21 <h2><?php echo T_('Recent Tags'); ?></h2>
22 <div id="recent">
23     <?php
24     $contents = '<p class="tags">';
25     foreach ($recentTags as $row) {
26         $entries = T_ngettext('bookmark', 'bookmarks', $row['bCount']);
27         $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> ';
28     }
29     echo $contents ."</p>\n";
30     ?>
31     <p><a href="<?php echo createURL('populartags'); ?>"><?php echo T_('Popular Tags'); ?></a> &rarr;</p>
32 </div>
33
34 <?php
35 }
36 ?>

Benjamin Mako Hill || Want to submit a patch?