diff options
author | Mario <mario@mariovavti.com> | 2025-04-25 12:46:30 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2025-04-25 12:46:30 +0000 |
commit | ba9637e129b13e85b360b8914a2c876dceb72362 (patch) | |
tree | 34859509631e54bb2e449b9bddaf08264e4ca8bd /Zotlabs/Module | |
parent | a48a72d1cd76fd5c8e343f3f8f73a27a0e920f81 (diff) | |
download | volse-hubzilla-ba9637e129b13e85b360b8914a2c876dceb72362.tar.gz volse-hubzilla-ba9637e129b13e85b360b8914a2c876dceb72362.tar.bz2 volse-hubzilla-ba9637e129b13e85b360b8914a2c876dceb72362.zip |
lazy load - initial commit
Diffstat (limited to 'Zotlabs/Module')
-rw-r--r-- | Zotlabs/Module/Channel.php | 12 | ||||
-rw-r--r-- | Zotlabs/Module/Display.php | 8 | ||||
-rw-r--r-- | Zotlabs/Module/Hq.php | 6 | ||||
-rw-r--r-- | Zotlabs/Module/Network.php | 11 | ||||
-rw-r--r-- | Zotlabs/Module/Pubstream.php | 8 |
5 files changed, 11 insertions, 34 deletions
diff --git a/Zotlabs/Module/Channel.php b/Zotlabs/Module/Channel.php index f3855b7e8..d8b503b37 100644 --- a/Zotlabs/Module/Channel.php +++ b/Zotlabs/Module/Channel.php @@ -410,14 +410,7 @@ class Channel extends Controller { if ($r) { $parents_str = ids_to_querystr($r, 'item_id'); - $r = q("SELECT item.*, item.id AS item_id - FROM item - WHERE item.uid = %d $item_normal - AND item.parent IN ( %s ) - $sql_extra ", - intval(App::$profile['profile_uid']), - dbesc($parents_str) - ); + $r = items_by_parent_ids($parents_str, $sql_extra); xchan_query($r); $items = fetch_post_tags($r, true); @@ -434,11 +427,8 @@ class Channel extends Controller { $items = []; } - - $mode = (($search) ? 'search' : 'channel'); - if ((!$update) && (!$load)) { // This is ugly, but we can't pass the profile_uid through the session to the ajax updater, diff --git a/Zotlabs/Module/Display.php b/Zotlabs/Module/Display.php index 090e0c92e..227e47e64 100644 --- a/Zotlabs/Module/Display.php +++ b/Zotlabs/Module/Display.php @@ -290,11 +290,9 @@ class Display extends Controller { if($r) { $parents_str = ids_to_querystr($r,'item_id'); if($parents_str) { - $items = q("SELECT item.*, item.id AS item_id - FROM item - WHERE parent in ( %s ) $sql_extra $item_normal ", - dbesc($parents_str) - ); + + $items = items_by_parent_ids($parents_str, $sql_extra); + xchan_query($items); $items = fetch_post_tags($items,true); $items = conv_sort($items,'created'); diff --git a/Zotlabs/Module/Hq.php b/Zotlabs/Module/Hq.php index 3a6eb7e69..235ff28d7 100644 --- a/Zotlabs/Module/Hq.php +++ b/Zotlabs/Module/Hq.php @@ -199,11 +199,7 @@ class Hq extends \Zotlabs\Web\Controller { } if($r) { - $items = q("SELECT item.*, item.id AS item_id - FROM item - WHERE parent = '%s' $item_normal $sql_extra", - dbesc($r[0]['item_id']) - ); + $items = items_by_parent_ids($r[0]['item_id'], $sql_extra); xchan_query($items,true,(($sys_item) ? local_channel() : 0)); $items = fetch_post_tags($items,true); diff --git a/Zotlabs/Module/Network.php b/Zotlabs/Module/Network.php index a311dea3a..f32a85068 100644 --- a/Zotlabs/Module/Network.php +++ b/Zotlabs/Module/Network.php @@ -375,10 +375,10 @@ class Network extends \Zotlabs\Web\Controller { } if ($dm) { - $sql_extra .= ' AND item_private = 2 '; + $sql_extra .= ' AND item.item_private = 2 '; } else { - $sql_extra .= ' AND item_private IN (0, 1) '; + $sql_extra .= ' AND item.item_private IN (0, 1) '; } @@ -510,11 +510,8 @@ class Network extends \Zotlabs\Web\Controller { if($r) { $parents_str = ids_to_querystr($r, 'item_id'); - $items = dbq("SELECT item.*, item.id AS item_id FROM item - WHERE true $uids $item_normal - AND item.parent IN ( $parents_str ) - $sql_extra " - ); + + $items = items_by_parent_ids($parents_str, $sql_extra); xchan_query($items, true); $items = fetch_post_tags($items, true); diff --git a/Zotlabs/Module/Pubstream.php b/Zotlabs/Module/Pubstream.php index 234e73792..1f349ae1c 100644 --- a/Zotlabs/Module/Pubstream.php +++ b/Zotlabs/Module/Pubstream.php @@ -183,6 +183,7 @@ class Pubstream extends \Zotlabs\Web\Controller { $sql_extra .= protect_sprintf(term_query('item', $hashtags, TERM_HASHTAG, TERM_COMMUNITYTAG)); $sql_extra_order = " ORDER BY item.created DESC "; $thread_top = ''; + } $net_query2 = (($net) ? " and xchan_network = '" . protect_sprintf(dbesc($net)) . "' " : ''); @@ -253,12 +254,7 @@ class Pubstream extends \Zotlabs\Web\Controller { $parents_str = ids_to_querystr($r,'item_id'); - $items = dbq("SELECT item.*, item.id AS item_id FROM item - WHERE true $uids $item_normal - AND item.parent IN ( $parents_str ) - $sql_extra $sql_extra_order" - ); - + $items = items_by_parent_ids($parents_str, $sql_extra); // use effective_uid param of xchan_query to help sort out comment permission // for sys_channel owned items. |