another temporary fix to mod/search to only return one of each post.
This commit is contained in:
parent
b841f825b5
commit
d093981d68
@ -189,7 +189,7 @@ function search_content(&$a,$update = 0, $load = false) {
|
|||||||
$pager_sql = sprintf(" LIMIT %d, %d ",intval($a->pager['start']), intval($a->pager['itemspage']));
|
$pager_sql = sprintf(" LIMIT %d, %d ",intval($a->pager['start']), intval($a->pager['itemspage']));
|
||||||
dbg(1);
|
dbg(1);
|
||||||
if($load) {
|
if($load) {
|
||||||
$r = q("SELECT distinct(mid), item.* from item
|
$r = q("SELECT distinct mid, id as item_id from item
|
||||||
WHERE item_restrict = 0
|
WHERE item_restrict = 0
|
||||||
AND (( `item`.`allow_cid` = '' AND `item`.`allow_gid` = '' AND `item`.`deny_cid` = '' AND `item`.`deny_gid` = '' AND item_private = 0 )
|
AND (( `item`.`allow_cid` = '' AND `item`.`allow_gid` = '' AND `item`.`deny_cid` = '' AND `item`.`deny_gid` = '' AND item_private = 0 )
|
||||||
OR ( `item`.`uid` = %d ))
|
OR ( `item`.`uid` = %d ))
|
||||||
@ -209,15 +209,15 @@ dbg(0);
|
|||||||
if($r) {
|
if($r) {
|
||||||
|
|
||||||
$parents_str = ids_to_querystr($r,'item_id');
|
$parents_str = ids_to_querystr($r,'item_id');
|
||||||
|
dbg(1);
|
||||||
$items = q("SELECT `item`.*, `item`.`id` AS `item_id`
|
$items = q("SELECT `item`.*, `item`.`id` AS `item_id`
|
||||||
FROM `item`
|
FROM `item`
|
||||||
WHERE item_restrict = 0
|
WHERE item_restrict = 0
|
||||||
$sql_extra ",
|
$sql_extra and parent in ( $parents_str ) "
|
||||||
intval($a->profile['profile_uid']),
|
// intval($a->profile['profile_uid']),
|
||||||
dbesc($parents_str)
|
// dbesc($parents_str)
|
||||||
);
|
);
|
||||||
|
dbg(0);
|
||||||
xchan_query($items);
|
xchan_query($items);
|
||||||
$items = fetch_post_tags($items,true);
|
$items = fetch_post_tags($items,true);
|
||||||
$items = conv_sort($items,'created');
|
$items = conv_sort($items,'created');
|
||||||
|
@ -1 +1 @@
|
|||||||
2013-06-21.351
|
2013-06-23.353
|
||||||
|
Reference in New Issue
Block a user