fix the contorted update logic on the network page
This commit is contained in:
parent
e208e07e35
commit
70b6f989dd
@ -347,9 +347,12 @@ function zot_gethub($arr) {
|
||||
dbesc($arr['url']),
|
||||
dbesc($arr['url_sig'])
|
||||
);
|
||||
if($r && count($r))
|
||||
if($r && count($r)) {
|
||||
logger('zot_gethub: found', LOGGER_DEBUG);
|
||||
return $r[0];
|
||||
}
|
||||
}
|
||||
logger('zot_gethub: not found', LOGGER_DEBUG);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -611,29 +611,18 @@ function network_content(&$a, $update = 0, $load = false) {
|
||||
|
||||
$items = fetch_post_tags($items);
|
||||
}
|
||||
elseif($load) {
|
||||
elseif($update) {
|
||||
|
||||
// Normal conversation view
|
||||
|
||||
|
||||
if($order === 'post')
|
||||
$ordering = "`created`";
|
||||
else
|
||||
$ordering = "`commented`";
|
||||
|
||||
// Fetch a page full of parent items for this page
|
||||
if($load) {
|
||||
|
||||
if($update && (! $load)) {
|
||||
$r = q("SELECT item.parent AS item_id FROM item
|
||||
left join abook on item.author_xchan = abook.abook_xchan
|
||||
WHERE item.uid = %d AND item.item_restrict = 0
|
||||
and ((abook.abook_flags & %d) = 0 or abook.abook_flags is null)
|
||||
$sql_extra3 $sql_extra $sql_nets ",
|
||||
intval(local_user()),
|
||||
intval(ABOOK_FLAG_BLOCKED)
|
||||
);
|
||||
}
|
||||
else {
|
||||
// Fetch a page full of parent items for this page
|
||||
|
||||
$r = q("SELECT item.id AS item_id FROM item
|
||||
left join abook on item.author_xchan = abook.abook_xchan
|
||||
@ -645,12 +634,23 @@ function network_content(&$a, $update = 0, $load = false) {
|
||||
intval(local_user()),
|
||||
intval(ABOOK_FLAG_BLOCKED)
|
||||
);
|
||||
|
||||
}
|
||||
else {
|
||||
// update
|
||||
$r = q("SELECT item.parent AS item_id FROM item
|
||||
left join abook on item.author_xchan = abook.abook_xchan
|
||||
WHERE item.uid = %d AND item.item_restrict = 0 $simple_update
|
||||
and ((abook.abook_flags & %d) = 0 or abook.abook_flags is null)
|
||||
$sql_extra3 $sql_extra $sql_nets ",
|
||||
intval(local_user()),
|
||||
intval(ABOOK_FLAG_BLOCKED)
|
||||
);
|
||||
}
|
||||
else {
|
||||
|
||||
// Then fetch all the children of the parents that are on this page
|
||||
|
||||
if($r && count($r)) {
|
||||
if($r) {
|
||||
|
||||
$parents_str = ids_to_querystr($r,'item_id');
|
||||
|
||||
@ -662,7 +662,6 @@ function network_content(&$a, $update = 0, $load = false) {
|
||||
dbesc($parents_str)
|
||||
);
|
||||
|
||||
|
||||
xchan_query($items);
|
||||
|
||||
$items = fetch_post_tags($items);
|
||||
@ -671,7 +670,8 @@ function network_content(&$a, $update = 0, $load = false) {
|
||||
|
||||
//logger('items: ' . print_r($items,true));
|
||||
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$items = array();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user