$tags = $this->getTags();
if (!$tags) {
+ $this->out->element('p', null, _('None'));
return false;
}
$sum += $tags->weight;
}
+ if ($cnt == 0) {
+ $this->out->element('p', null, _('(None)'));
+ return false;
+ }
+
ksort($tw);
$this->out->elementStart('ul', 'tags xoxo tag-cloud');
foreach ($tw as $tag => $weight) {
- $this->showTag($tag, $weight, $weight/$sum);
+ $this->showTag($tag, $weight, ($sum == 0) ? 0 : $weight/$sum);
}
$this->out->elementEnd('ul');
function tagUrl($tag)
{
- return common_local_url('tag', array('tag' => $tag));
+ if ('showstream' === $this->out->trimmed('action')) {
+ return common_local_url('showstream', array('nickname' => $this->out->profile->nickname, 'tag' => $tag));
+ } else {
+ return common_local_url('tag', array('tag' => $tag));
+ }
+ }
+
+ function divId()
+ {
+ return 'tagcloud';
}
}