We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 47350322 authored by fauno's avatar fauno

tag cloud from TagCloud class

parent cd0d82fc
......@@ -22,6 +22,7 @@
require_once('database.php');
require_once('templating.php');
require_once('data/User.php');
require_once('data/TagCloud.php');
if(!isset($_GET['user']) && $logged_in == false) {
$smarty->assign('error', 'Error!');
......@@ -31,6 +32,8 @@ if(!isset($_GET['user']) && $logged_in == false) {
}
$user = new User($_GET['user']);
$tagcloud = new TagCloud('Scrobbles', 'artist', 40, $_GET['user']);
if(isset($user->name)) {
$smarty->assign('user', $user->name);
$smarty->assign('email', $user->email);
......@@ -42,7 +45,7 @@ if(isset($user->name)) {
$smarty->assign('userlevel', $user->userlevel);
$smarty->assign('avatar', $user->getAvatar());
$smarty->assign('nowplaying', $user->getNowPlaying(10));
$smarty->assign('tagcloud', $user->getTagCloud());
$smarty->assign('tagcloud', $tagcloud->tagcloud);
$smarty->assign('profile', true);
$smarty->display('profile.tpl');
} else {
......@@ -50,4 +53,7 @@ if(isset($user->name)) {
$smarty->assign('details', 'Shall I call in a missing persons report?');
$smarty->display('error.tpl');
}
$tagcloud->__destruct();
?>
......@@ -3,7 +3,7 @@
<h2>{$user}'{if $user|substr:-1 != 's'}s{/if} profile</h2>
<dl class='user vcard'>
<dt class='fn'>
<span class='family-name'>{$fullname}</span>
<span class='family-name'>{$fullname|utf8_encode}</span>
(<span class='nickname'>{$user}</span>)
</dt>
<dd class='avatar'>
......@@ -52,7 +52,7 @@
<h3>User's favorite artists</h3>
<ul class="tagcloud">
{section name=i loop=$tagcloud}
<li class="tc t{$tagcloud[i].percent}"><a href="/artist/{$tagcloud[i].artist|stripslashes}">{$tagcloud[i].artist|stripslashes}</a></li>
<li style='font-size:{$tagcloud[i].size}'><a href='/artist/{$tagcloud[i].artist|urlencode}' rel='tag'>{$tagcloud[i].artist}</a></li>
{/section}
</ul>
{include file='footer.tpl'}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment