summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2008-05-12 04:33:12 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2008-05-12 04:33:12 +0000
commit3e36e0b01e843ec8d4e8a63a72e5f7425921dab8 (patch)
treea188dee01ac306152b68609b31772fca450a22d6 /templates
parent693e26e2ad074f8cc9d37098a0568cd93ae30f52 (diff)
downloadampache-3e36e0b01e843ec8d4e8a63a72e5f7425921dab8.tar.gz
ampache-3e36e0b01e843ec8d4e8a63a72e5f7425921dab8.tar.bz2
ampache-3e36e0b01e843ec8d4e8a63a72e5f7425921dab8.zip
forgot to add some important files
Diffstat (limited to 'templates')
-rw-r--r--templates/show_tagcloud.inc.php86
1 files changed, 86 insertions, 0 deletions
diff --git a/templates/show_tagcloud.inc.php b/templates/show_tagcloud.inc.php
new file mode 100644
index 00000000..3d028dfb
--- /dev/null
+++ b/templates/show_tagcloud.inc.php
@@ -0,0 +1,86 @@
+<?php
+/*
+
+ Copyright (c) 2001 - 2007 Ampache.org
+ All Rights Reserved
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+*/
+$web_path = Config::get('web_path');
+?>
+<?php
+function rebuild_query($ar) {
+ $ret = split('?', $_SERVER['REQUEST_URI']);
+ $ret = $ret[0] . '?';
+ foreach($ar as $k=>$v)
+ {
+ $ret .= urlencode($k).'='.urlencode($v).'&';
+ }
+ return $ret;
+}
+show_box_top($tagcloudHead, 'info-box');
+//make a map id->name
+$tagbyid = array();
+foreach ($tagcloudList as $f)
+ $tagbyid[$f['id']] = $f;
+$ar = $_GET;
+unset($ar['tag']);
+$base = rebuild_query($ar);
+$currentTags = array_fill_keys($_SESSION['browse']['filter']['tag'], '1');
+$filter=0;
+foreach ($_SESSION['browse']['filter']['tag'] as $t) {
+ if (!$filter) {
+ $filter = 1;
+ echo 'Filters(remove): ';
+ }
+ $ctags = $currentTags;
+ unset($ctags[$t]);
+ $stags = implode(',', array_keys($ctags));
+ $col = 'black';
+ $alt = '';
+ if (isset($tagbyid[$t]['color'])) {
+ $col = $tagbyid[$t]['color'];
+ $alt = ' title="owner: '. $tagbyid[$t]['username'].'" ';
+ }
+ echo '<a style="color:'. $col.'"'.$alt .' href="' .$base
+ . 'tag='.$stags.'">'.$tagbyid[$t]['name'].'</a> ';
+}
+echo '<br/>';
+$filter = 0;
+foreach ($tagcloudList as $f) {
+ $n = $f['name'];
+ $id = $f['id'];
+ if (!$currentTags[$id]) {
+ if (!$filter) {
+ $filter = 1;
+ echo 'Matching tags: ';
+ }
+ $ctags = $currentTags;
+ $ctags[$id] = 1;
+ $stags = implode(',', array_keys($ctags));
+ $col = 'black';
+ $alt = '';
+ if (isset($f['color'])) {
+ $col = $f['color'];
+ $alt = ' title="owner: '. $f['username'].'" ';
+ }
+ echo '<a style="color:'.$col.'"'.$alt.' href="' .$base
+ . 'tag='.$stags.'">'.$n.'</a> ';
+ }
+}
+
+?>
+<?php show_box_bottom(); ?>