diff options
author | mensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f> | 2008-01-22 16:16:06 +0000 |
---|---|---|
committer | mensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f> | 2008-01-22 16:16:06 +0000 |
commit | 2aed4f1f9f71e668c9c60449a12847ea171d1812 (patch) | |
tree | 08f65bdc393c667985a97356cbed49b324fc2fa1 /templates/sidebar.block.linked.php | |
parent | b3b802434f4f1a17467baacd34c551885b7c9f37 (diff) | |
download | semanticscuttle-2aed4f1f9f71e668c9c60449a12847ea171d1812.tar.gz semanticscuttle-2aed4f1f9f71e668c9c60449a12847ea171d1812.tar.bz2 |
add stats to tags relation and use them to display tags
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@21 b3834d28-1941-0410-a4f8-b48e95affb8f
Diffstat (limited to 'templates/sidebar.block.linked.php')
-rw-r--r-- | templates/sidebar.block.linked.php | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/templates/sidebar.block.linked.php b/templates/sidebar.block.linked.php index 5a891ea..7bbde81 100644 --- a/templates/sidebar.block.linked.php +++ b/templates/sidebar.block.linked.php @@ -4,11 +4,14 @@ $userservice =& ServiceFactory::getServiceInstance('UserService'); function displayLinkedTags($tag, $linkType, $uId, $cat_url, $user, $editingMode =false, $precedentTag =null, $level=0, $stopList=array()) { $tag2tagservice =& ServiceFactory::getServiceInstance('Tag2TagService'); + $tagstatservice =& ServiceFactory::getServiceInstance('TagStatService'); $output = ''; $output.= '<tr>'; $output.= '<td></td>'; $output.= '<td>'. str_repeat(' ', $level*2) .'<a href="'. sprintf($cat_url, filter($user, 'url'), filter($tag, 'url')) .'" rel="tag">'. filter($tag) .'</a>'; + //$output.= ' - '. $tagstatservice->getMaxDepth($tag, $linkType, $uId); + if($editingMode) { $output.= ' ('; $output.= '<a href="'.createURL('tag2tagadd', $tag).'">add</a>'; @@ -22,7 +25,7 @@ function displayLinkedTags($tag, $linkType, $uId, $cat_url, $user, $editingMode $output.= '</tr>'; if(!in_array($tag, $stopList)) { - $linkedTags = $tag2tagservice->getLinkedTags($tag, '>', $userid, $level); + $linkedTags = $tag2tagservice->getLinkedTags($tag, '>', $userid); $precedentTag = $tag; $stopList[] = $tag; $level = $level + 1; @@ -33,7 +36,6 @@ function displayLinkedTags($tag, $linkType, $uId, $cat_url, $user, $editingMode return $output; } - $logged_on_userid = $userservice->getCurrentUserId(); if ($logged_on_userid === false) { $logged_on_userid = NULL; @@ -43,7 +45,12 @@ $explodedTags = array(); if ($currenttag) { $explodedTags = explode('+', $currenttag); } else { - $orphewTags = $tag2tagservice->getOrphewTags('>', $userid); + if($userid != null) { + $orphewTags = $tag2tagservice->getOrphewTags('>', $userid); + } else { + $orphewTags = $tag2tagservice->getOrphewTags('>', $userid, 4, "nb"); + } + foreach($orphewTags as $orphewTag) { $explodedTags[] = $orphewTag['tag']; } @@ -60,7 +67,17 @@ if(count($explodedTags) > 0) { if ($displayLinkedZone) { ?> -<h2><?php echo T_('Linked Tags'); ?></h2> +<h2> +<?php + echo T_('Linked Tags').' '; + //if($userid != null) { + $cUser = $userservice->getUser($userid); + echo '<a href="'.createURL('alltags', $cUser['username']).'">('.T_('plus').')</a>'; + //} +?> +</h2> + + <div id="linked"> <table> <?php |