X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Ftags.php;h=6c45a4aee21c4fe63ae07c5660036848892741d4;hb=28eb5d57a72aae22428061b26b90195f7feacadf;hp=6067f3f4b93c58b2c41308412fbf18b4f9a264c2;hpb=1f58bcc114928a5a3cd97bd0de34a5aa7d585931;p=friendica.git diff --git a/include/tags.php b/include/tags.php index 6067f3f4b9..6c45a4aee2 100644 --- a/include/tags.php +++ b/include/tags.php @@ -31,7 +31,7 @@ function create_tags_from_item($itemid) { $tags = ""; foreach ($taglist as $tag) - if ((substr(trim($tag), 0, 1) == "#") OR (substr(trim($tag), 0, 1) == "@")) + if ((substr(trim($tag), 0, 1) == "#") || (substr(trim($tag), 0, 1) == "@")) $tags .= " ".trim($tag); else $tags .= " #".trim($tag); @@ -58,10 +58,10 @@ function create_tags_from_item($itemid) { if (substr(trim($tag), 0, 1) == "#") { // try to ignore #039 or #1 or anything like that - if(ctype_digit(substr(trim($tag),1))) + if (ctype_digit(substr(trim($tag),1))) continue; // try to ignore html hex escapes, e.g. #x2317 - if((substr(trim($tag),1,1) == 'x' || substr(trim($tag),1,1) == 'X') && ctype_digit(substr(trim($tag),2))) + if ((substr(trim($tag),1,1) == 'x' || substr(trim($tag),1,1) == 'X') && ctype_digit(substr(trim($tag),2))) continue; $type = TERM_HASHTAG; $term = substr($tag, 1); @@ -91,7 +91,7 @@ function create_tags_from_item($itemid) { dbesc($link), dbesc($message["guid"]), dbesc($message["created"]), dbesc($message["received"]), intval($global)); // Search for mentions - if ((substr($tag, 0, 1) == '@') AND (strpos($link, $profile_base_friendica) OR strpos($link, $profile_base_diaspora))) { + if ((substr($tag, 0, 1) == '@') && (strpos($link, $profile_base_friendica) || strpos($link, $profile_base_diaspora))) { $users = q("SELECT `uid` FROM `contact` WHERE self AND (`url` = '%s' OR `nurl` = '%s')", $link, $link); foreach ($users AS $user) { if ($user["uid"] == $message["uid"]) { @@ -107,9 +107,10 @@ function create_tags_from_item($itemid) { function create_tags_from_itemuri($itemuri, $uid) { $messages = q("SELECT `id` FROM `item` WHERE uri ='%s' AND uid=%d", dbesc($itemuri), intval($uid)); - if(count($messages)) { - foreach ($messages as $message) + if (count($messages)) { + foreach ($messages as $message) { create_tags_from_item($message["id"]); + } } }