2009-04-18 20:08:33 +01:00
|
|
|
<?php
|
2020-07-21 16:06:39 +01: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-18 20:08:33 +01:00
|
|
|
/**
|
|
|
|
* Personal tag cloud section
|
|
|
|
*
|
|
|
|
* @category Widget
|
2020-07-21 16:06:39 +01:00
|
|
|
* @package GNUsocial
|
2009-08-25 23:19:04 +01:00
|
|
|
* @author Evan Prodromou <evan@status.net>
|
2009-08-25 23:12:20 +01:00
|
|
|
* @copyright 2009 StatusNet, Inc.
|
2020-07-21 16:06:39 +01:00
|
|
|
* @license https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later
|
2009-04-18 20:08:33 +01:00
|
|
|
*/
|
|
|
|
|
2020-07-21 16:06:39 +01:00
|
|
|
defined('GNUSOCIAL') || die();
|
2009-04-18 20:08:33 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Personal tag cloud section
|
|
|
|
*
|
2020-07-21 16:06:39 +01:00
|
|
|
* @category Widget
|
|
|
|
* @package GNUsocial
|
|
|
|
* @author Evan Prodromou <evan@status.net>
|
|
|
|
* @license https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later
|
2009-04-18 20:08:33 +01:00
|
|
|
*/
|
|
|
|
class SubscriptionsPeopleTagCloudSection extends SubPeopleTagCloudSection
|
|
|
|
{
|
2020-07-21 16:06:39 +01:00
|
|
|
public function title()
|
2009-04-18 20:08:33 +01:00
|
|
|
{
|
2011-04-03 13:24:55 +01:00
|
|
|
// TRANS: Title of personal tag cloud section.
|
2009-04-18 20:08:33 +01:00
|
|
|
return _('People Tagcloud as tagged');
|
|
|
|
}
|
|
|
|
|
2020-07-21 16:06:39 +01:00
|
|
|
public function tagUrl($tag)
|
|
|
|
{
|
2009-04-18 20:08:33 +01:00
|
|
|
$nickname = $this->out->profile->nickname;
|
|
|
|
return common_local_url('subscriptions', array('nickname' => $nickname, 'tag' => $tag));
|
|
|
|
}
|
|
|
|
|
2020-07-21 16:06:39 +01:00
|
|
|
public function query()
|
|
|
|
{
|
|
|
|
return <<<'END'
|
|
|
|
SELECT profile_tag.tag, COUNT(profile_tag.tag) AS weight
|
|
|
|
FROM profile_tag
|
|
|
|
INNER JOIN subscription AS sub
|
|
|
|
ON profile_tag.tagger = sub.subscriber
|
|
|
|
AND profile_tag.tagged = sub.subscribed
|
|
|
|
LEFT JOIN profile_list
|
|
|
|
ON profile_tag.tag = profile_list.tag
|
|
|
|
AND profile_tag.tagger = profile_list.tagger
|
|
|
|
WHERE profile_list.private IS NOT TRUE
|
|
|
|
AND sub.subscriber = %d AND sub.subscriber <> sub.subscribed
|
|
|
|
GROUP BY profile_tag.tag ORDER BY weight DESC;
|
|
|
|
END;
|
2009-04-18 20:08:33 +01:00
|
|
|
}
|
|
|
|
}
|