* This is our template processor
*
* @param string|FriendicaSmarty $s the string requiring macro substitution,
- * or an instance of FriendicaSmarty
+ * or an instance of FriendicaSmarty
* @param array $r key value pairs (search => replace)
* @return string substituted string
*/
/**
- * Pull out all #hashtags and @person tags from $string;
+ * @brief Pull out all #hashtags and @person tags from $string.
+ *
* We also get @person@domain.com - which would make
* the regex quite complicated as tags can also
* end a sentence. So we'll run through our results
if((! is_array($a->profile)) || ($a->profile['hide-friends']))
return $o;
$r = q("SELECT COUNT(*) AS `total` FROM `contact`
- WHERE `uid` = %d AND `self` = 0 AND `blocked` = 0 and `pending` = 0
- AND `hidden` = 0 AND `archive` = 0
+ WHERE `uid` = %d AND NOT `self` AND NOT `blocked`
+ AND NOT `hidden` AND NOT `archive`
AND `network` IN ('%s', '%s', '%s')",
intval($a->profile['uid']),
dbesc(NETWORK_DFRN),
} else {
// Splitting the query in two parts makes it much faster
$r = q("SELECT `id` FROM `contact`
- WHERE `uid` = %d AND NOT `self` AND NOT `blocked` AND NOT `pending`
+ WHERE `uid` = %d AND NOT `self` AND NOT `blocked`
AND NOT `hidden` AND NOT `archive`
AND `network` IN ('%s', '%s', '%s') ORDER BY RAND() LIMIT %d",
intval($a->profile['uid']),