include "prepend.inc.php"; $browseperson = 0; // 0 = browse groups (default); 1 = browse people if (($p > 0) and ($searchtype <> SEARCH_GROUP)) { $browseperson = 1; } elseif ($g <= 0) { $g = $DEFAULTGROUPID; $r = query ("select * from groups where groupid=".$g.";"); $g_info = mysql_fetch_array($r, MYSQL_ASSOC) or die ("Error accessing database for default group."); } if ($browseperson) { // ====================================================================================================== // BROWSE PERSON // ====================================================================================================== $editable = (($p_id >0) and (($p == $p_id) or $userinfo["sa"] or ($p_info["sponsorid"]==$p_id))); // data privacy test; $privacylevel = $p_info["privacy"]; $showprivate = TRUE; if ($privacylevel == 0) { $showprivate = $u_id; } elseif ($privacylevel > 0) { // NOT YET IMPLEMENTED: GROUP MEMBERSHIP TEST // where p_id must be a member of (group_id = $privacylevel) } printhtmlheader ('Member Detail'); function masthead_memberinfo () { global $editable, $p, $userinfo, $BGCOLOUR_LIGHT, $BGCOLOUR_DARK; // $availablesearchtypes[SEARCH_PERSON] = 'person'; // $availablesearchtypes[SEARCH_GROUP] = 'group'; // masthead_search($availablesearchtypes,''); masthead_person_or_group_search (); if ($editable) { print '
'; print 'To preserve member privacy, personal contact information is only made available to database members. Please login above to gain access.'; print " |
'; print ''; print "Send a message!
\n"; } } if ($p_info["webpage"]) { print 'Webpage: '; print '' . crunchtext($p_info["webpage"]); print "
\n"; } // MEMBERSHIPS // get list of joined groups & positions $q = 'select groups.groupid as groupid, groupname, positionname from groups'; $q .= ' left join memberships on groups.groupid=memberships.groupid'; $q .= ' left join positions on memberships.positionid=positions.positionid'; $q .= ' where memberships.memberid=' . $p; $q .= ' order by sortlevel desc, groupname;'; $r = query ($q) or die ('Error accessing group members with:
' . $q); if (mysql_num_rows($r)) { print "
\n";
$officers=TRUE;
while ($member = mysql_fetch_array($r, MYSQL_ASSOC)) {
$officer = $member["positionname"];
print '';
print crunchtext($member["groupname"]) . " ";
if ($officer) {
print " - " . crunchtext($member["positionname"]) . "";
}
print " \n"; } print " |
' . $q); $affiliationcount = mysql_num_rows($r); function displayaffiliation ($affiliation) { print ''; print crunchtext($affiliation["groupname"]) . ""; } if ($affiliationcount) { print "(of "; $i = 0; while ($affiliation = mysql_fetch_array($r, MYSQL_ASSOC)) { if ($i++ > 0) { if ($i == $affiliationcount) { print " and "; } else { print ", "; } } displayaffiliation($affiliation); } print ")
\n"; } // PICTURE & DESCRIPTION if ($g_info["picture"]) { print '
'; print ''; print ' |
'; print stripslashes($g_info["description"]); print ' |
' . "\n"; } // DISCUSSION FORUMS if (is_allowed(ACCESS_FORUM_VIEW)) { $r = query ('select * from forums where ownergroupid=' . $g); if ($forumcount = mysql_num_rows($r)) { print '
'; if ($forumcount == 1) { $foruminfo = mysql_fetch_array($r, MYSQL_ASSOC); print crunchtext($foruminfo['title']); } else { print 'Discussion Forums'; } print " |
\n"; } } // BEGIN TWO-COLUMN LAYOUT print '
' . "\n";
// basic info
if ($g_info["mailaddress"]) {
print crunchtext($g_info["mailaddress"]) . " \n"; } $showedphone=FALSE; if ($g_info["phone"]) { print ' Tel: ' . crunchtext($g_info["phone"]) . " \n"; $showedphone=TRUE; } if (($g_info["fax"]) and ($p_id > 0)) { print ' Fax: ' . crunchtext($g_info["fax"]) . " \n"; $showedphone=TRUE; } if ($showedphone) { print " \n"; } if ($g_info["email"]) { if ($u_id) { print "Email: "; print '' . crunchtext($g_info["email"]) . " \n"; } else { print ''; print ''; print "Send email to " . crunchtext($g_info["groupname"]) . " \n"; } } if ($g_info["webpage"]) { print 'Webpage: '; print '' . crunchtext($g_info["webpage"]); print " \n"; } print " \n"; // affiliations $q = 'select * from groups'; $q .= ' left join affiliations on affiliateid=groupid'; $q .= ' where affiliationid=' . $g; $q .= ' order by groupname;'; $r = query ($q) or die ('Error accessing group affiliates with: ' . $q); $affiliatecount = mysql_num_rows($r); function displayaffiliate ($affiliate) { print ' |
'; print ''; print crunchtext($affiliate["groupname"]) . " "; print " |
' . $q);
$oldsortlevel = '';
$membercount = 0;
while ($member = mysql_fetch_array($r, MYSQL_ASSOC)) {
$membercount++;
$sortlevel = $member ["sortlevel"];
$officer = $member["positionname"];
if ($sortlevel <> $oldsortlevel) {
if ($oldsortlevel <> '') {
print "
\n";
}
$oldsortlevel = $sortlevel;
}
print '';
print crunchtext($member["firstname"]) . ' ' . crunchtext($member["lastname"]) . " ";
if ($officer) {
print " " . crunchtext($member["positionname"]) . "";
}
print "
\n";
}
if (($membercount > 1) and (is_allowed(ACCESS_SPAM))) {
print '
'; print ''; print "Send bulk mail to all members shown
\n"; } // END TWO-COLUMN FORMAT print "