- // No items will be shown if the member has a blocked profile wall.
-
- if(! get_pconfig(local_user(),'system','alt_pager')) {
- $r = q("SELECT distinct(`item`.`uri`) as `total`
- FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id` LEFT JOIN `user` ON `user`.`uid` = `item`.`uid`
- WHERE `item`.`visible` = 1 AND `item`.`deleted` = 0 and `item`.`moderated` = 0
- AND (( `item`.`allow_cid` = '' AND `item`.`allow_gid` = '' AND `item`.`deny_cid` = '' AND `item`.`deny_gid` = '' AND `item`.`private` = 0 AND `user`.`hidewall` = 0)
- OR `item`.`uid` = %d )
- AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
- $sql_extra group by `item`.`uri` ",
- intval(local_user())
- );
-
- if(count($r))
- $a->set_pager_total(count($r));
-
- if(! count($r)) {
- info( t('No results.') . EOL);
- return $o;
- }
- }
+ // No items will be shown if the member has a blocked profile wall.
+
+ if($tag) {
+ logger("Start tag search for '".$search."'", LOGGER_DEBUG);
+
+ $r = q("SELECT STRAIGHT_JOIN `item`.`uri`, `item`.*, `item`.`id` AS `item_id`,
+ `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`alias`, `contact`.`rel`,
+ `contact`.`network`, `contact`.`thumb`, `contact`.`self`, `contact`.`writable`,
+ `contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid`
+ FROM `term`
+ INNER JOIN `item` ON `item`.`id`=`term`.`oid`
+ INNER JOIN `contact` ON `contact`.`id` = `item`.`contact-id` AND NOT `contact`.`blocked` AND NOT `contact`.`pending`
+ WHERE `item`.`visible` AND NOT `item`.`deleted` AND NOT `item`.`moderated`
+ AND (`term`.`uid` = 0 OR (`term`.`uid` = %d AND NOT `term`.`global`)) AND `term`.`otype` = %d AND `term`.`type` = %d AND `term`.`term` = '%s'
+ ORDER BY term.created DESC LIMIT %d , %d ",
+ intval(local_user()), intval(TERM_OBJ_POST), intval(TERM_HASHTAG), dbesc(protect_sprintf($search)),
+ intval($a->pager['start']), intval($a->pager['itemspage']));
+ } else {
+ logger("Start fulltext search for '".$search."'", LOGGER_DEBUG);