\r\n"; $r = q("SELECT * FROM `group` WHERE `uid` = %d ORDER BY `name` ASC", $_SESSION['uid'] ); if(count($r)) { foreach($r as $rr) { if((is_array($preselected)) && in_array($rr['id'], $preselected)) $selected = " selected=\"selected\" "; else $selected = ''; $o .= "\r\n"; } } $o .= "\r\n"; return $o; } function contact_select($selname, $selclass, $preselected = false, $size = 4, $privmail = false) { $o = ''; // When used for private messages, we limit correspondence to mutual friends and the selector // to one recipient. By default our selector allows multiple selects amongst all contacts. if($privmail) { $sql_extra = " AND `issued-id` != '' AND `dfrn-id` != '' "; $o .= "\r\n"; } else { $sql_extra = ''; $o .= "\r\n"; } $r = q("SELECT `id`, `name` FROM `contact` WHERE `uid` = %d AND `self` = 0 AND `blocked` = 0 AND `pending` = 0 $sql_extra ORDER BY `name` ASC ", $_SESSION['uid'] ); if(count($r)) { foreach($r as $rr) { if((is_array($preselected)) && in_array($rr['id'], $preselected)) $selected = " selected=\"selected\" "; else $selected = ''; $o .= "\r\n"; } } $o .= "\r\n"; return $o; } function populate_acl() { $o = ''; $o .= '