From: rabuzarus <> Date: Wed, 22 Nov 2017 22:18:01 +0000 (+0100) Subject: tag-cloud: some polishing + remove authors (we don't use it at the moment) X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=59ae5633ec9080845a02de99665293655bd8b726;p=friendica.git tag-cloud: some polishing + remove authors (we don't use it at the moment) --- diff --git a/include/tags.php b/include/tags.php index bae3e77ea4..fb3315441c 100644 --- a/include/tags.php +++ b/include/tags.php @@ -151,8 +151,7 @@ function update_items() { dba::close($messages); } -// Tag cloud functions - need to be adpated to this database format -function tagadelic($uid, $count = 0, $authors = '', $owner = '', $flags = 0, $type = TERM_HASHTAG) { +function tagadelic($uid, $count = 0, $owner = 0, $flags = 0, $type = TERM_HASHTAG) { require_once('include/security.php'); $item_condition = item_condition(); @@ -163,12 +162,7 @@ function tagadelic($uid, $count = 0, $authors = '', $owner = '', $flags = 0, $ty $sql_options .= " AND `item`.`wall` "; } } - if ($authors) { - if (!is_array($authors)) { - $authors = array($authors); - } - $sql_options .= " AND `item`.`author-id` IN (".implode(',', $authors).") "; - } + if ($owner) { $sql_options .= " AND `item`.`owner-id` = ".intval($owner)." "; } @@ -192,9 +186,9 @@ function tagadelic($uid, $count = 0, $authors = '', $owner = '', $flags = 0, $ty return tag_calc($r); } -function wtagblock($uid, $count = 0, $authors = '', $owner = '', $flags = 0, $type = TERM_HASHTAG) { +function wtagblock($uid, $count = 0,$owner = 0, $flags = 0, $type = TERM_HASHTAG) { $o = ''; - $r = tagadelic($uid, $count, $authors, $owner, $flags, $type); + $r = tagadelic($uid, $count, $owner, $flags, $type); if($r) { foreach ($r as $rr) { $tag['level'] = $rr[2]; @@ -233,7 +227,7 @@ function tag_calc($arr) { $x ++; } - usort($tags, 'self::tags_sort'); + usort($tags, 'tags_sort'); $range = max(.01, $max - $min) * 1.0001; for ($x = 0; $x < count($tags); $x ++) { @@ -259,13 +253,14 @@ function tagcloud_wall_widget($arr = array()) { } $limit = ((array_key_exists('limit', $arr)) ? intval($arr['limit']) : 50); + if(feature_enabled($a->profile['profile_uid'], 'tagadelic')) { $owner_id = Contact::getIdForURL($a->profile['url']); - logger("public contact id: ".$owner_id); + if(!$owner_id) { return ""; } - return wtagblock($a->profile['profile_uid'], $limit, '', $owner_id, 'wall'); + return wtagblock($a->profile['profile_uid'], $limit, $owner_id, 'wall'); } return ""; diff --git a/view/global.css b/view/global.css index cf8ad8d4e2..f3ca22b75a 100644 --- a/view/global.css +++ b/view/global.css @@ -564,7 +564,9 @@ img.invalid-src:after { vertical-align: top;} font-size: 1.8em; color: DeepPink; } -.tag1:hover, .tag2:hover, .tag3:hover, .tag4:hover, .tag5:hover, -.tag6:hover, .tag7:hover, .tag8:hover, .tag9:hover, .tag10:hover { +.tags > a:hover { text-decoration: underline; +} +.tag-cloud { + word-wrap: break-word; } \ No newline at end of file diff --git a/view/templates/tagblock_widget.tpl b/view/templates/tagblock_widget.tpl index 3317d66730..602d762aa5 100644 --- a/view/templates/tagblock_widget.tpl +++ b/view/templates/tagblock_widget.tpl @@ -2,10 +2,11 @@

{{$title}}

-
+
{{foreach $tags as $tag}} - # - {{$tag.name}} + + #{{$tag.name}} + {{/foreach}}
diff --git a/view/theme/frio/css/style.css b/view/theme/frio/css/style.css index a606f06296..f37c02e636 100644 --- a/view/theme/frio/css/style.css +++ b/view/theme/frio/css/style.css @@ -1240,7 +1240,7 @@ aside #group-sidebar li .group-edit-tool:first-child { } /* Tag cloud widget */ -.tagblock.widget > .tags { +.tagblock.widget > .tag-cloud { text-align: center; } /* Section */