X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FContent%2FWidget.php;h=b5ccd6f14db7640fa1561cccd3b0d6118f15b280;hb=c376081d0d00218ea494991de1d4a05c3b4c1567;hp=3f97e9f259e50a4c37d6fcef472f755884cfce64;hpb=41dc6cea2b05971c63de7fe870d115667ccc081d;p=friendica.git diff --git a/src/Content/Widget.php b/src/Content/Widget.php index 3f97e9f259..b5ccd6f14d 100644 --- a/src/Content/Widget.php +++ b/src/Content/Widget.php @@ -1,6 +1,6 @@ get('system', 'invitation_only')) { $x = intval(DI::pConfig()->get(local_user(), 'system', 'invites_remaining')); - if ($x || is_site_admin()) { + if ($x || DI::app()->isSiteAdmin()) { DI::page()['aside'] .= '
'; @@ -259,12 +259,10 @@ class Widget } $networks = self::unavailableNetworks(); - $extra_sql = " AND NOT `network` IN (" . substr(str_repeat("?, ", count($networks)), 0, -2) . ")"; - $sql_values = array_merge([local_user()], $networks); + $query = "`uid` = ? AND NOT `deleted` AND `network` != '' AND NOT `network` IN (" . substr(str_repeat("?, ", count($networks)), 0, -2) . ")"; + $condition = array_merge([$query], array_merge([local_user()], $networks)); - $r = DBA::p("SELECT `network` FROM `contact` WHERE `uid` = ? AND NOT `deleted` AND `network` != '' $extra_sql GROUP BY `network` ORDER BY `network`", - $sql_values - ); + $r = DBA::select('contact', ['network'], $condition, ['group_by' => ['network'], 'order' => ['network']]); $nets = array(); while ($rr = DBA::fetch($r)) {