2009-04-19 04:08:33 +09:00
|
|
|
<?php
|
2019-09-11 16:12:49 +09:00
|
|
|
// This file is part of GNU social - https://www.gnu.org/software/social
|
|
|
|
//
|
|
|
|
// GNU social is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU Affero General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
//
|
|
|
|
// GNU social 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 Affero General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU Affero General Public License
|
|
|
|
// along with GNU social. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
2009-04-19 04:08:33 +09:00
|
|
|
/**
|
|
|
|
* Personal tag cloud section
|
|
|
|
*
|
|
|
|
* @category Widget
|
2019-09-11 16:12:49 +09:00
|
|
|
* @package GNUsocial
|
2009-08-26 07:19:04 +09:00
|
|
|
* @author Evan Prodromou <evan@status.net>
|
2009-08-26 07:12:20 +09:00
|
|
|
* @copyright 2009 StatusNet, Inc.
|
2019-09-11 16:12:49 +09:00
|
|
|
* @license https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later
|
2009-04-19 04:08:33 +09:00
|
|
|
*/
|
|
|
|
|
2019-09-11 16:12:49 +09:00
|
|
|
defined('GNUSOCIAL') || die();
|
2009-04-19 04:08:33 +09:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Personal tag cloud section
|
|
|
|
*
|
2019-09-11 16:12:49 +09:00
|
|
|
* @copyright 2009 StatusNet, Inc.
|
|
|
|
* @license https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later
|
2009-04-19 04:08:33 +09:00
|
|
|
*/
|
|
|
|
|
|
|
|
class SubPeopleTagCloudSection extends TagCloudSection
|
|
|
|
{
|
2019-09-11 16:12:49 +09:00
|
|
|
public function getTags()
|
2009-04-19 04:08:33 +09:00
|
|
|
{
|
|
|
|
$qry = $this->query();
|
2019-09-11 16:12:49 +09:00
|
|
|
$qry .= ' LIMIT ' . TAGS_PER_SECTION;
|
2009-04-19 04:08:33 +09:00
|
|
|
|
2019-09-11 16:12:49 +09:00
|
|
|
$profile_tag = Memcached_DataObject::cachedQuery(
|
|
|
|
'Profile_tag',
|
|
|
|
sprintf($qry, $this->out->user->id)
|
|
|
|
);
|
2009-04-19 04:08:33 +09:00
|
|
|
return $profile_tag;
|
|
|
|
}
|
|
|
|
|
2019-09-11 16:12:49 +09:00
|
|
|
public function tagUrl($tag)
|
|
|
|
{
|
2009-04-19 04:08:33 +09:00
|
|
|
return common_local_url('peopletag', array('tag' => $tag));
|
|
|
|
}
|
|
|
|
|
2019-09-11 16:12:49 +09:00
|
|
|
public function showTag($tag, $weight, $relative)
|
|
|
|
{
|
2009-04-19 04:08:33 +09:00
|
|
|
$rel = 'tag-cloud-';
|
2019-09-11 16:12:49 +09:00
|
|
|
$rel .= 1 + (int) (7 * $relative * $weight - 0.01);
|
2009-04-19 04:08:33 +09:00
|
|
|
|
|
|
|
$this->out->elementStart('li', $rel);
|
|
|
|
$this->out->element('a', array('href' => $this->tagUrl($tag)), $tag);
|
|
|
|
$this->out->elementEnd('li');
|
|
|
|
}
|
|
|
|
}
|