define('NOTIFY_SYSTEM', Notify\Type::SYSTEM);
/* @}*/
-
-/** @deprecated since 2019.03, use Term::UNKNOWN instead */
-define('TERM_UNKNOWN', Term::UNKNOWN);
-/** @deprecated since 2019.03, use Term::HASHTAG instead */
-define('TERM_HASHTAG', Term::HASHTAG);
-/** @deprecated since 2019.03, use Term::MENTION instead */
-define('TERM_MENTION', Term::MENTION);
-/** @deprecated since 2019.03, use Term::CATEGORY instead */
-define('TERM_CATEGORY', Term::CATEGORY);
-/** @deprecated since 2019.03, use Term::PCATEGORY instead */
-define('TERM_PCATEGORY', Term::PCATEGORY);
-/** @deprecated since 2019.03, use Term::FILE instead */
-define('TERM_FILE', Term::FILE);
-/** @deprecated since 2019.03, use Term::SAVEDSEARCH instead */
-define('TERM_SAVEDSEARCH', Term::SAVEDSEARCH);
-/** @deprecated since 2019.03, use Term::CONVERSATION instead */
-define('TERM_CONVERSATION', Term::CONVERSATION);
-
-/** @deprecated since 2019.03, use Term::OBJECT_TYPE_POST instead */
-define('TERM_OBJ_POST', Term::OBJECT_TYPE_POST);
-/** @deprecated since 2019.03, use Term::OBJECT_TYPE_PHOTO instead */
-define('TERM_OBJ_PHOTO', Term::OBJECT_TYPE_PHOTO);
-
/**
* @name Gravity
*
use Friendica\Model\Mail;
use Friendica\Model\Notify;
use Friendica\Model\Photo;
+use Friendica\Model\Term;
use Friendica\Model\User;
use Friendica\Model\UserItem;
use Friendica\Network\FKOAuth1;
$condition = ["`oid` > ?
AND (`uid` = 0 OR (`uid` = ? AND NOT `global`))
AND `otype` = ? AND `type` = ? AND `term` = ?",
- $since_id, local_user(), TERM_OBJ_POST, TERM_HASHTAG, $searchTerm];
+ $since_id, local_user(), Term::OBJECT_TYPE_POST, Term::HASHTAG, $searchTerm];
if ($max_id > 0) {
$condition[0] .= ' AND `oid` <= ?';
$condition[] = $max_id;
STRAIGHT_JOIN `contact` AS `author` ON `author`.`id` = `item`.`author-id`
WHERE `item`.`uid` = 0 AND `item`.$ordering < ? AND `item`.$ordering > ? AND `item`.`gravity` = ?
AND NOT `author`.`hidden` AND NOT `author`.`blocked`" . $sql_tag_nets,
- local_user(), TERM_OBJ_POST, TERM_HASHTAG,
+ local_user(), Term::OBJECT_TYPE_POST, Term::HASHTAG,
$top_limit, $bottom_limit, GRAVITY_PARENT);
$data = DBA::toArray($items);
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Item;
+use Friendica\Model\Term;
use Friendica\Protocol\Activity;
use Friendica\Util\Strings;
use Friendica\Util\XML;
Item::update(['visible' => true], ['id' => $item['id']]);
}
- $term_objtype = ($item['resource-id'] ? TERM_OBJ_PHOTO : TERM_OBJ_POST);
+ $term_objtype = ($item['resource-id'] ? Term::OBJECT_TYPE_PHOTO : Term::OBJECT_TYPE_POST);
$t = q("SELECT count(tid) as tcount FROM term WHERE oid=%d AND term='%s'",
intval($item['id']),
q("INSERT INTO term (oid, otype, type, term, url, uid) VALUE (%d, %d, %d, '%s', '%s', %d)",
intval($item['id']),
$term_objtype,
- TERM_HASHTAG,
+ Term::HASHTAG,
DBA::escape($term),
'',
intval($owner_uid)
q("INSERT INTO term (`oid`, `otype`, `type`, `term`, `url`, `uid`) VALUE (%d, %d, %d, '%s', '%s', %d)",
intval($original_item['id']),
$term_objtype,
- TERM_HASHTAG,
+ Term::HASHTAG,
DBA::escape($term),
'',
intval($owner_uid)
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Item;
+use Friendica\Model\Term;
/**
* TagCloud widget
* @return string HTML formatted output.
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
- public static function getHTML($uid, $count = 0, $owner_id = 0, $flags = '', $type = TERM_HASHTAG)
+ public static function getHTML($uid, $count = 0, $owner_id = 0, $flags = '', $type = Term::HASHTAG)
{
$o = '';
$r = self::tagadelic($uid, $count, $owner_id, $flags, $type);
* @return array Alphabetical sorted array of used tags of an user.
* @throws \Exception
*/
- private static function tagadelic($uid, $count = 0, $owner_id = 0, $flags = '', $type = TERM_HASHTAG)
+ private static function tagadelic($uid, $count = 0, $owner_id = 0, $flags = '', $type = Term::HASHTAG)
{
$sql_options = Item::getPermissionsSQLByUserId($uid);
$limit = $count ? sprintf('LIMIT %d', intval($count)) : '';
GROUP BY `term` ORDER BY `total` DESC $limit",
$uid,
$type,
- TERM_OBJ_POST
+ Term::OBJECT_TYPE_POST
);
if (!DBA::isResult($tag_stmt)) {
return [];
use Friendica\Database\DBA;
use Friendica\DI;
+use Friendica\Model\Term;
/**
* This class handles FileTag related functions
if ($type == 'file') {
$lbracket = '[';
$rbracket = ']';
- $termtype = TERM_FILE;
+ $termtype = Term::FILE;
} else {
$lbracket = '<';
$rbracket = '>';
- $termtype = TERM_CATEGORY;
+ $termtype = Term::CATEGORY;
}
$filetags_updated = $saved;
const HASHTAG = 1;
const MENTION = 2;
const CATEGORY = 3;
- const PCATEGORY = 4;
const FILE = 5;
- const SAVEDSEARCH = 6;
- const CONVERSATION = 7;
/**
* An implicit mention is a mention in a comment body that is redundant with the threading information.
*/
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Util\Strings;
+use Friendica\Model\Term;
class UserItem
{
}
// Or the contact is a mentioned forum
- $tags = DBA::select('term', ['url'], ['otype' => TERM_OBJ_POST, 'oid' => $item['id'], 'type' => TERM_MENTION, 'uid' => $uid]);
+ $tags = DBA::select('term', ['url'], ['otype' => term::OBJECT_TYPE_POST, 'oid' => $item['id'], 'type' => Term::MENTION, 'uid' => $uid]);
while ($tag = DBA::fetch($tags)) {
$condition = ['nurl' => Strings::normaliseLink($tag['url']), 'uid' => $uid, 'notify_new_posts' => true, 'contact-type' => Contact::TYPE_COMMUNITY];
if (DBA::exists('contact', $condition)) {
use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\Util\Strings;
+use Friendica\Model\Term;
/**
* Hashtag module.
$taglist = DBA::p("SELECT DISTINCT(`term`) FROM `term` WHERE `term` LIKE ? AND `type` = ? ORDER BY `term`",
$t . '%',
- intval(TERM_HASHTAG)
+ intval(Term::HASHTAG)
);
while ($tag = DBA::fetch($taglist)) {
$result[] = ['text' => $tag['term']];
use Friendica\Model\Item;
use Friendica\Model\Profile as ProfileModel;
use Friendica\Model\User;
+use Friendica\Model\Term;
use Friendica\Module\BaseProfile;
use Friendica\Module\Security\Login;
use Friendica\Util\DateTimeFormat;
if (!empty($category)) {
$sql_post_table = sprintf("INNER JOIN (SELECT `oid` FROM `term` WHERE `term` = '%s' AND `otype` = %d AND `type` = %d AND `uid` = %d ORDER BY `tid` DESC) AS `term` ON `item`.`id` = `term`.`oid` ",
- DBA::escape(Strings::protectSprintf($category)), intval(TERM_OBJ_POST), intval(TERM_CATEGORY), intval($a->profile['uid']));
+ DBA::escape(Strings::protectSprintf($category)), intval(Term::OBJECT_TYPE_POST), intval(Term::CATEGORY), intval($a->profile['uid']));
}
if (!empty($hashtags)) {
$sql_post_table .= sprintf("INNER JOIN (SELECT `oid` FROM `term` WHERE `term` = '%s' AND `otype` = %d AND `type` = %d AND `uid` = %d ORDER BY `tid` DESC) AS `term` ON `item`.`id` = `term`.`oid` ",
- DBA::escape(Strings::protectSprintf($hashtags)), intval(TERM_OBJ_POST), intval(TERM_HASHTAG), intval($a->profile['uid']));
+ DBA::escape(Strings::protectSprintf($hashtags)), intval(Term::OBJECT_TYPE_POST), intval(Term::HASHTAG), intval($a->profile['uid']));
}
if (!empty($datequery)) {
*/
private static function isSensitive($item_id)
{
- $condition = ['otype' => TERM_OBJ_POST, 'oid' => $item_id, 'type' => TERM_HASHTAG, 'term' => 'nsfw'];
+ $condition = ['otype' => Term::OBJECT_TYPE_POST, 'oid' => $item_id, 'type' => Term::HASHTAG, 'term' => 'nsfw'];
return DBA::exists('term', $condition);
}
use DOMDocument;
use DOMXPath;
use Friendica\App\BaseURL;
-use Friendica\Content\OEmbed;
use Friendica\Content\Text\BBCode;
-use Friendica\Content\Text\HTML;
use Friendica\Core\Hook;
use Friendica\Core\Logger;
use Friendica\Core\Protocol;
use Friendica\Model\Notify\Type;
use Friendica\Model\PermissionSet;
use Friendica\Model\Profile;
+use Friendica\Model\Term;
use Friendica\Model\User;
use Friendica\Network\Probe;
use Friendica\Util\Crypto;
use Friendica\Util\Network;
use Friendica\Util\Strings;
use Friendica\Util\XML;
-use HTMLPurifier;
-use HTMLPurifier_Config;
/**
* This class contain functions to create and send DFRN XML files
$sql_post_table = sprintf(
"INNER JOIN (SELECT `oid` FROM `term` WHERE `term` = '%s' AND `otype` = %d AND `type` = %d AND `uid` = %d ORDER BY `tid` DESC) AS `term` ON `item`.`id` = `term`.`oid` ",
DBA::escape(Strings::protectSprintf($category)),
- intval(TERM_OBJ_POST),
- intval(TERM_CATEGORY),
+ intval(Term::OBJECT_TYPE_POST),
+ intval(Term::CATEGORY),
intval($owner_id)
);
}
use Friendica\Model\ItemDeliveryData;
use Friendica\Model\Mail;
use Friendica\Model\Profile;
+use Friendica\Model\Term;
use Friendica\Model\User;
use Friendica\Network\Probe;
use Friendica\Util\Crypto;
}
// All tags of the current post
- $condition = ['otype' => TERM_OBJ_POST, 'type' => TERM_HASHTAG, 'oid' => $parent['parent']];
+ $condition = ['otype' => Term::OBJECT_TYPE_POST, 'type' => Term::HASHTAG, 'oid' => $parent['parent']];
$tags = DBA::select('term', ['term'], $condition);
$taglist = [];
while ($tag = DBA::fetch($tags)) {
use Friendica\Core\Logger;
use Friendica\Database\DBA;
+use Friendica\Model\Term;
class TagUpdate
{
if ($message['uid'] == 0) {
$global = true;
- DBA::update('term', ['global' => true], ['otype' => TERM_OBJ_POST, 'guid' => $message['guid']]);
+ DBA::update('term', ['global' => true], ['otype' => Term::OBJECT_TYPE_POST, 'guid' => $message['guid']]);
} else {
- $global = (DBA::count('term', ['uid' => 0, 'otype' => TERM_OBJ_POST, 'guid' => $message['guid']]) > 0);
+ $global = (DBA::count('term', ['uid' => 0, 'otype' => Term::OBJECT_TYPE_POST, 'guid' => $message['guid']]) > 0);
}
$fields = ['guid' => $message['guid'], 'created' => $message['created'],
'received' => $message['received'], 'global' => $global];
- DBA::update('term', $fields, ['otype' => TERM_OBJ_POST, 'oid' => $message['oid']]);
+ DBA::update('term', $fields, ['otype' => Term::OBJECT_TYPE_POST, 'oid' => $message['oid']]);
}
DBA::close($messages);