visual display of group members

This commit is contained in:
Friendika 2011-04-11 22:47:16 -07:00
parent 98712bce76
commit 6da84027af
4 changed files with 58 additions and 18 deletions

View File

@ -2045,18 +2045,7 @@ function contact_block() {
if(count($r)) { if(count($r)) {
$o .= '<h4 class="contact-h4">' . sprintf( tt('%d Contact','%d Contacts', $total),$total) . '</h4><div id="contact-block">'; $o .= '<h4 class="contact-h4">' . sprintf( tt('%d Contact','%d Contacts', $total),$total) . '</h4><div id="contact-block">';
foreach($r as $rr) { foreach($r as $rr) {
$redirect_url = $a->get_baseurl() . '/redir/' . $rr['id']; $o .= micropro($rr,true,'mpfriend');
if(local_user() && ($rr['uid'] == local_user())
&& ($rr['network'] === 'dfrn')) {
$url = $redirect_url;
$sparkle = ' sparkle';
}
else {
$url = $rr['url'];
$sparkle = '';
}
$o .= '<div class="contact-block-div"><a class="contact-block-link' . $sparkle . '" href="' . $url . '" ><img class="contact-block-img' . $sparkle . '" src="' . $rr['micro'] . '" title="' . $rr['name'] . ' [' . $rr['url'] . ']" alt="' . $rr['name'] . '" /></a></div>' . "\r\n";
} }
$o .= '</div><div id="contact-block-end"></div>'; $o .= '</div><div id="contact-block-end"></div>';
$o .= '<div id="viewcontacts"><a id="viewcontacts-link" href="viewcontacts/' . $a->profile['nickname'] . '">' . t('View Contacts') . '</a></div>'; $o .= '<div id="viewcontacts"><a id="viewcontacts-link" href="viewcontacts/' . $a->profile['nickname'] . '">' . t('View Contacts') . '</a></div>';
@ -2070,6 +2059,31 @@ function contact_block() {
}} }}
if(! function_exists('micropro')) {
function micropro($contact, $redirect = false, $class = '') {
if($class)
$class = ' ' . $class;
$url = $contact['url'];
$sparkle = '';
if($redirect) {
$a = get_app();
$redirect_url = $a->get_baseurl() . '/redir/' . $contact['id'];
if(local_user() && ($contact['uid'] == local_user()) && ($contact['network'] === 'dfrn')) {
$url = $redirect_url;
$sparkle = ' sparkle';
}
}
return '<div class="contact-block-div' . $class . '"><a class="contact-block-link' . $class . $sparkle
. '" href="' . $url . '" ><img class="contact-block-img' . $class . $sparkle . '" src="' . $contact['micro']
. '" title="' . $contact['name'] . ' [' . $contact['url'] . ']" alt="' . $contact['name'] . '" /></a></div>' . "\r\n";
}}
if(! function_exists('search')) { if(! function_exists('search')) {
function search($s) { function search($s) {
$a = get_app(); $a = get_app();

View File

@ -128,11 +128,11 @@ function group_content(&$a) {
goaway($a->get_baseurl() . '/contacts'); goaway($a->get_baseurl() . '/contacts');
} }
$group = $r[0]; $group = $r[0];
$ret = group_get_members($group['id']); $members = group_get_members($group['id']);
$preselected = array(); $preselected = array();
if(count($ret)) { if(count($members)) {
foreach($ret as $p) foreach($members as $member)
$preselected[] = $p['id']; $preselected[] = $member['id'];
} }
$drop_tpl = load_view_file('view/group_drop.tpl'); $drop_tpl = load_view_file('view/group_drop.tpl');
@ -156,6 +156,13 @@ function group_content(&$a) {
)); ));
} }
$o .= '<div id="group-members">';
foreach($members as $member) {
$o .= micropro($member,true,'mpgroup');
}
$o .= '</div><div id="group-members-end"></div>';
return $o; return $o;
} }

View File

@ -2225,4 +2225,13 @@ a.mail-list-link {
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
) }
#group-members {
margin-top: 20px;
}
#group-members-end {
clear: both;
}

View File

@ -2248,4 +2248,14 @@ a.mail-list-link {
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
) }
#group-members {
margin-top: 20px;
}
#group-members-end {
clear: both;
}