\r\n";
	$r = q("SELECT * FROM groups WHERE deleted = 0 AND uid = %d ORDER BY gname ASC",
		intval(local_channel())
	);
	$arr = array('group' => $r, 'entry' => $o);
	// e.g. 'network_pre_group_deny', 'profile_pre_group_allow'
	call_hooks(App::$module . '_pre_' . $selname, $arr);
	if($r) {
		foreach($r as $rr) {
			if((is_array($preselected)) && in_array($rr['id'], $preselected))
				$selected = " selected=\"selected\" ";
			else
				$selected = '';
			$trimmed = mb_substr($rr['gname'],0,12);
			$o .= "\r\n";
		}
	}
	$o .= "\r\n";
	call_hooks(App::$module . '_post_' . $selname, $o);
	return $o;
}
function contact_select($selname, $selclass, $preselected = false, $size = 4, $privmail = false, $celeb = false, $privatenet = false, $tabindex = null) {
	$o = '';
	// When used for private messages, we limit correspondence to mutual DFRN/Friendica friends and the selector
	// to one recipient. By default our selector allows multiple selects amongst all contacts.
	$sql_extra = '';
	$tabindex = ($tabindex > 0 ? 'tabindex="$tabindex"' : '');
	if($privmail)
		$o .= "