]> git.mxchange.org Git - friendica.git/blobdiff - mod/profile.php
Replace old database queries with the new ones
[friendica.git] / mod / profile.php
index 2fb947a8365df885435447d14822f2c69e2dde79..49d6fe261d2b2ca761ca1406c7c958c7de2c8970 100644 (file)
@@ -337,16 +337,9 @@ function profile_content(App $a, $update = 0)
                        $parents_arr[] = $rr['item_id'];
                }
 
-               $parents_str = implode(', ', $parents_arr);
-
-               $items = q(item_query($a->profile['profile_uid']) . " AND `item`.`uid` = %d
-                       AND `item`.`parent` IN (%s)
-                       $sql_extra ",
-                       intval($a->profile['profile_uid']),
-                       dbesc($parents_str)
-               );
-
-               $items = conv_sort($items, 'created');
+               $condition = ['uid' => $a->profile['profile_uid'], 'parent' => $parents_arr];
+               $result = Item::selectForUser($a->profile['profile_uid'], [], $condition);
+               $items = conv_sort(dba::inArray($result), 'created');
        } else {
                $items = [];
        }