X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Flockview.php;h=5134bfdb6bf1dbbb3ea64f98deb029e5ad1060b4;hb=56c3b3f653bfe2d789470c9bb8434845d3387745;hp=82f93f498566e7be8b8fb5ef9cfdeb93483bb0d1;hpb=0c67c89715df801e0c887be50c9739db3bae7ca3;p=friendica.git diff --git a/mod/lockview.php b/mod/lockview.php index 82f93f4985..5134bfdb6b 100644 --- a/mod/lockview.php +++ b/mod/lockview.php @@ -1,7 +1,13 @@ argc > 1) ? $a->argv[1] : 0); if (is_numeric($type)) { @@ -14,21 +20,22 @@ function lockview_content(&$a) { if(! $item_id) killme(); - if (!in_array($type, array('item','photo','event'))) + if (!in_array($type, ['item','photo','event'])) killme(); $r = q("SELECT * FROM `%s` WHERE `id` = %d LIMIT 1", dbesc($type), intval($item_id) ); - if(! count($r)) + if (! DBM::is_result($r)) { killme(); + } $item = $r[0]; - call_hooks('lockview_content', $item); + Addon::callHooks('lockview_content', $item); if($item['uid'] != local_user()) { - echo t('Remote privacy information not available.') . '
'; + echo L10n::t('Remote privacy information not available.') . '
'; killme(); } @@ -36,7 +43,7 @@ function lockview_content(&$a) { if(($item['private'] == 1) && (! strlen($item['allow_cid'])) && (! strlen($item['allow_gid'])) && (! strlen($item['deny_cid'])) && (! strlen($item['deny_gid']))) { - echo t('Remote privacy information not available.') . '
'; + echo L10n::t('Remote privacy information not available.') . '
'; killme(); } @@ -45,14 +52,14 @@ function lockview_content(&$a) { $deny_users = expand_acl($item['deny_cid']); $deny_groups = expand_acl($item['deny_gid']); - $o = t('Visible to:') . '
'; - $l = array(); + $o = L10n::t('Visible to:') . '
'; + $l = []; if(count($allowed_groups)) { $r = q("SELECT `name` FROM `group` WHERE `id` IN ( %s )", dbesc(implode(', ', $allowed_groups)) ); - if(count($r)) + if (DBM::is_result($r)) foreach($r as $rr) $l[] = '' . $rr['name'] . ''; } @@ -60,7 +67,7 @@ function lockview_content(&$a) { $r = q("SELECT `name` FROM `contact` WHERE `id` IN ( %s )", dbesc(implode(', ',$allowed_users)) ); - if(count($r)) + if (DBM::is_result($r)) foreach($r as $rr) $l[] = $rr['name']; @@ -70,7 +77,7 @@ function lockview_content(&$a) { $r = q("SELECT `name` FROM `group` WHERE `id` IN ( %s )", dbesc(implode(', ', $deny_groups)) ); - if(count($r)) + if (DBM::is_result($r)) foreach($r as $rr) $l[] = '' . $rr['name'] . ''; } @@ -78,7 +85,7 @@ function lockview_content(&$a) { $r = q("SELECT `name` FROM `contact` WHERE `id` IN ( %s )", dbesc(implode(', ',$deny_users)) ); - if(count($r)) + if (DBM::is_result($r)) foreach($r as $rr) $l[] = '' . $rr['name'] . ''; @@ -86,5 +93,5 @@ function lockview_content(&$a) { echo $o . implode(', ', $l); killme(); -} + }