// 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)) {
$global = (count($isglobal) > 0);
}
- $r = q("INSERT INTO `term` (`uid`, `oid`, `otype`, `type`, `term`, `url`, `guid`, `created`, `received`, `global`)
+ q("INSERT INTO `term` (`uid`, `oid`, `otype`, `type`, `term`, `url`, `guid`, `created`, `received`, `global`)
VALUES (%d, %d, %d, %d, '%s', '%s', '%s', '%s', '%s', %d)",
intval($message['uid']), intval($itemid), intval(TERM_OBJ_POST), intval($type), dbesc($term),
dbesc($link), dbesc($message['guid']), dbesc($message['created']), dbesc($message['received']), intval($global));
TERM_OBJ_POST
);
if (!DBM::is_result($r)) {
- return array();
+ return [];
}
return tag_calc($r);
$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) {
}
$tpl = get_markup_template('tagblock_widget.tpl');
- $o = replace_macros($tpl, array(
+ $o = replace_macros($tpl, [
'$title' => t('Tags'),
'$tags' => $tags
- ));
+ ]);
}
return $o;
}
*/
function tag_calc($arr)
{
- $tags = array();
+ $tags = [];
$min = 1e9;
$max = -1e9;
$x = 0;
if (!$arr) {
- return array();
+ return [];
}
foreach ($arr as $rr) {