Merge pull request #4398 from annando/search-posts
Only show posts in the search
This commit is contained in:
commit
544e11b134
1 changed files with 3 additions and 2 deletions
|
@ -200,11 +200,12 @@ function search_content(App $a) {
|
||||||
$r = q("SELECT %s
|
$r = q("SELECT %s
|
||||||
FROM `term`
|
FROM `term`
|
||||||
STRAIGHT_JOIN `item` ON `item`.`id`=`term`.`oid` %s
|
STRAIGHT_JOIN `item` ON `item`.`id`=`term`.`oid` %s
|
||||||
WHERE %s AND (`term`.`uid` = 0 OR (`term`.`uid` = %d AND NOT `term`.`global`)) AND `term`.`otype` = %d AND `term`.`type` = %d AND `term`.`term` = '%s'
|
WHERE %s AND (`term`.`uid` = 0 OR (`term`.`uid` = %d AND NOT `term`.`global`))
|
||||||
|
AND `term`.`otype` = %d AND `term`.`type` = %d AND `term`.`term` = '%s' AND `item`.`verb` = '%s'
|
||||||
ORDER BY term.created DESC LIMIT %d , %d ",
|
ORDER BY term.created DESC LIMIT %d , %d ",
|
||||||
item_fieldlists(), item_joins(), item_condition(),
|
item_fieldlists(), item_joins(), item_condition(),
|
||||||
intval(local_user()),
|
intval(local_user()),
|
||||||
intval(TERM_OBJ_POST), intval(TERM_HASHTAG), dbesc(protect_sprintf($search)),
|
intval(TERM_OBJ_POST), intval(TERM_HASHTAG), dbesc(protect_sprintf($search)), dbesc(ACTIVITY_POST),
|
||||||
intval($a->pager['start']), intval($a->pager['itemspage']));
|
intval($a->pager['start']), intval($a->pager['itemspage']));
|
||||||
} else {
|
} else {
|
||||||
logger("Start fulltext search for '".$search."'", LOGGER_DEBUG);
|
logger("Start fulltext search for '".$search."'", LOGGER_DEBUG);
|
||||||
|
|
Loading…
Reference in a new issue