call_hooks($a->module . '_pre_' . $selname, $arr);
- if(count($r)) {
+ if (dbm::is_result($r)) {
foreach($r as $rr) {
if((is_array($preselected)) && in_array($rr['id'], $preselected))
$selected = " selected=\"selected\" ";
call_hooks($a->module . '_pre_' . $selname, $arr);
- if(count($r)) {
+ if (dbm::is_result($r)) {
foreach($r as $rr) {
if((is_array($preselected)) && in_array($rr['id'], $preselected))
$selected = " selected=\"selected\" ";
$receiverlist = array();
- if(count($r)) {
+ if (dbm::is_result($r)) {
foreach($r as $rr) {
if((is_array($preselected)) && in_array($rr['id'], $preselected))
$selected = " selected=\"selected\" ";
$r = q("SELECT `pubmail` FROM `mailacct` WHERE `uid` = %d AND `server` != '' LIMIT 1",
intval(local_user())
);
- if(count($r)) {
+ if (dbm::is_result($r)) {
$mail_enabled = true;
if(intval($r[0]['pubmail']))
$pubmail_enabled = true;
function acl_lookup(&$a, $out_type = 'json') {
- if(!local_user())
- return "";
+ if (!local_user()) {
+ return '';
+ }
$start = (x($_REQUEST,'start') ? $_REQUEST['start'] : 0);
$count = (x($_REQUEST,'count') ? $_REQUEST['count'] : 100);
if ($type=='' || $type=='g'){
$r = q("SELECT `group`.`id`, `group`.`name`, GROUP_CONCAT(DISTINCT `group_member`.`contact-id` SEPARATOR ',') AS uids
- FROM `group`,`group_member`
- WHERE `group`.`deleted` = 0 AND `group`.`uid` = %d
- AND `group_member`.`gid`=`group`.`id`
+ FROM `group`
+ INNER JOIN `group_member` ON `group_member`.`gid`=`group`.`id` AND `group_member`.`uid` = `group`.`uid`
+ WHERE NOT `group`.`deleted` AND `group`.`uid` = %d
$sql_extra
- GROUP BY `group`.`id`
+ GROUP BY `group`.`name`
ORDER BY `group`.`name`
LIMIT %d,%d",
intval(local_user()),
$r = array();
- if(count($r)) {
+ if (dbm::is_result($r)) {
foreach($r as $g){
$contacts[] = array(
"type" => "c",
dbesc($search),
implode("','", $known_contacts)
);
- if (is_array($r) && count($r)){
+ if (dbm::is_result($r)){
foreach($r as $row) {
// nickname..
$up = parse_url($row['author-link']);
* @param App $a
* @return array with the search results
*/
-function navbar_complete(&$a) {
+function navbar_complete(App &$a) {
// logger('navbar_complete');