From 2aed4f1f9f71e668c9c60449a12847ea171d1812 Mon Sep 17 00:00:00 2001
From: mensonge
Date: Tue, 22 Jan 2008 16:16:06 +0000
Subject: 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
---
templates/sidebar.block.linked.php | 25 +++++++++++++++++++++----
templates/tags.tpl.php | 3 ++-
2 files changed, 23 insertions(+), 5 deletions(-)
(limited to 'templates')
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.= '
';
$output.= ' | ';
$output.= ''. str_repeat(' ', $level*2) .''. filter($tag) .'';
+ //$output.= ' - '. $tagstatservice->getMaxDepth($tag, $linkType, $uId);
+
if($editingMode) {
$output.= ' (';
$output.= 'add';
@@ -22,7 +25,7 @@ function displayLinkedTags($tag, $linkType, $uId, $cat_url, $user, $editingMode
$output.= ' |
';
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) {
?>
-
+
+getUser($userid);
+ echo '('.T_('plus').')';
+ //}
+?>
+
+
+
includeTemplate('sidebar.tpl');
$this->includeTemplate($GLOBALS['bottom_include']);
-?>
\ No newline at end of file
+?>
--
cgit v1.2.3-54-g00ecf