X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModel%2FTerm.php;h=868f2bf0532380ee8bef06655f8e5e8bd6a594df;hb=7b7132971a64a92a685a5fd860fe4709dce1765a;hp=669d2167c7bf106e6af2f454ac8d580e67e1787a;hpb=a0bf7a8c94ca60747d146de00970c871a57d3de2;p=friendica.git
diff --git a/src/Model/Term.php b/src/Model/Term.php
index 669d2167c7..868f2bf053 100644
--- a/src/Model/Term.php
+++ b/src/Model/Term.php
@@ -1,10 +1,27 @@
.
+ *
*/
+
namespace Friendica\Model;
-use Friendica\Core\Cache\Cache;
+use Friendica\Core\Cache\Duration;
use Friendica\Core\Logger;
use Friendica\Database\DBA;
use Friendica\DI;
@@ -16,8 +33,6 @@ use Friendica\Util\Strings;
* This Model class handles term table interactions.
* This tables stores relevant terms related to posts, photos and searches, like hashtags, mentions and
* user-applied categories.
- *
- * @package Friendica\Model
*/
class Term
{
@@ -67,7 +82,7 @@ class Term
WHERE `thread`.`visible`
AND NOT `thread`.`deleted`
AND NOT `thread`.`moderated`
- AND NOT `thread`.`private`
+ AND `thread`.`private` = ?
AND t.`uid` = 0
AND t.`otype` = ?
AND t.`type` = ?
@@ -76,6 +91,7 @@ class Term
GROUP BY `term`
ORDER BY `score` DESC
LIMIT ?",
+ Item::PUBLIC,
Term::OBJECT_TYPE_POST,
Term::HASHTAG,
$period,
@@ -84,7 +100,7 @@ class Term
if (DBA::isResult($tagsStmt)) {
$tags = DBA::toArray($tagsStmt);
- DI::cache()->set('global_trending_tags', $tags, Cache::HOUR);
+ DI::cache()->set('global_trending_tags', $tags, Duration::HOUR);
}
}
@@ -107,11 +123,10 @@ class Term
FROM `term` t
JOIN `item` i ON i.`id` = t.`oid` AND i.`uid` = t.`uid`
JOIN `thread` ON `thread`.`iid` = i.`id`
- JOIN `user` ON `user`.`uid` = `thread`.`uid` AND NOT `user`.`hidewall`
WHERE `thread`.`visible`
AND NOT `thread`.`deleted`
AND NOT `thread`.`moderated`
- AND NOT `thread`.`private`
+ AND `thread`.`private` = ?
AND `thread`.`wall`
AND `thread`.`origin`
AND t.`otype` = ?
@@ -121,6 +136,7 @@ class Term
GROUP BY `term`
ORDER BY `score` DESC
LIMIT ?",
+ Item::PUBLIC,
Term::OBJECT_TYPE_POST,
Term::HASHTAG,
$period,
@@ -129,7 +145,7 @@ class Term
if (DBA::isResult($tagsStmt)) {
$tags = DBA::toArray($tagsStmt);
- DI::cache()->set('local_trending_tags', $tags, Cache::HOUR);
+ DI::cache()->set('local_trending_tags', $tags, Duration::HOUR);
}
}
@@ -447,13 +463,13 @@ class Term
$item['body'] = str_replace($orig_tag, $tag['url'], $item['body']);
}
- $return['hashtags'][] = $prefix . '' . htmlspecialchars($tag['term']) . '';
- $return['tags'][] = $prefix . '' . htmlspecialchars($tag['term']) . '';
+ $return['hashtags'][] = $prefix . '' . htmlspecialchars($tag['term']) . '';
+ $return['tags'][] = $prefix . '' . htmlspecialchars($tag['term']) . '';
break;
case self::MENTION:
$tag['url'] = Contact::magicLink($tag['url']);
- $return['mentions'][] = $prefix . '' . htmlspecialchars($tag['term']) . '';
- $return['tags'][] = $prefix . '' . htmlspecialchars($tag['term']) . '';
+ $return['mentions'][] = $prefix . '' . htmlspecialchars($tag['term']) . '';
+ $return['tags'][] = $prefix . '' . htmlspecialchars($tag['term']) . '';
break;
case self::IMPLICIT_MENTION:
$return['implicit_mentions'][] = $prefix . $tag['term'];