X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Ftags.php;h=4b45510b200d1a45c2d8b840e221e03bdd79eb30;hb=491a1373e07ac356eac8f0c40f7841416ef5c2a4;hp=50fe1e49096b5c0687eedd703f510a13c9e0666f;hpb=390d5706f46ce58cbed24b292d5c1f1b9789a8a8;p=friendica.git diff --git a/include/tags.php b/include/tags.php index 50fe1e4909..4b45510b20 100644 --- a/include/tags.php +++ b/include/tags.php @@ -51,7 +51,7 @@ function create_tags_from_item($itemid) // ignore anything in a code block $data = preg_replace('/\[code\](.*?)\[\/code\]/sm', '', $data); - $tags = array(); + $tags = []; $pattern = '/\W\#([^\[].*?)[\s\'".,:;\?!\[\]\/]/ism'; if (preg_match_all($pattern, $data, $matches)) { @@ -204,7 +204,7 @@ function tagadelic($uid, $count = 0, $owner_id = 0, $flags = '', $type = TERM_HA TERM_OBJ_POST ); if (!DBM::is_result($r)) { - return array(); + return []; } return tag_calc($r); @@ -226,12 +226,7 @@ function wtagblock($uid, $count = 0, $owner_id = 0, $flags = '', $type = TERM_HA $o = ''; $r = tagadelic($uid, $count, $owner_id, $flags, $type); if (count($r)) { - $contact = dba::select( - 'contact', - array('url'), - array('id' => $uid), - array('limit' => 1) - ); + $contact = dba::selectFirst('contact', ['url'], ['id' => $uid]); $url = System::removedBaseUrl($contact['url']); foreach ($r as $rr) { @@ -243,10 +238,10 @@ function wtagblock($uid, $count = 0, $owner_id = 0, $flags = '', $type = TERM_HA } $tpl = get_markup_template('tagblock_widget.tpl'); - $o = replace_macros($tpl, array( + $o = replace_macros($tpl, [ '$title' => t('Tags'), '$tags' => $tags - )); + ]); } return $o; } @@ -259,13 +254,13 @@ function wtagblock($uid, $count = 0, $owner_id = 0, $flags = '', $type = TERM_HA */ function tag_calc($arr) { - $tags = array(); + $tags = []; $min = 1e9; $max = -1e9; $x = 0; if (!$arr) { - return array(); + return []; } foreach ($arr as $rr) {