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 ''; if ($userinfo["sa"]) { print ' '; print 'New member |'; // if (($p>1) and ($p <> $p_id)) { // print ' Delete |'; // } } print ' '; print 'Edit information |'; print ""; } } printmasthead ('Member Detail','masthead_memberinfo'); print '

' . crunchtext($p_info["firstname"] . ' ' . $p_info["lastname"]) . "

\n"; if ($showprivate) { if ($p_info["mailaddress"]) { print crunchtext($p_info["mailaddress"]) . "
\n"; } $showedphone=FALSE; if ($p_info["homephone"]) { print '  Home: ' . $p_info["homephone"] . "
\n"; $showedphone=TRUE; } if ($p_info["workphone"]) { print '  Work: ' . $p_info["workphone"] . "
\n"; $showedphone=TRUE; } if ($p_info["fax"]) { print "  Fax: " . $p_info["fax"] . "
\n"; $showedphone=TRUE; } if ($p_info["celphone"]) { print "  Cel: " . $p_info["celphone"] . "
\n"; $showedphone=TRUE; } if ($showedphone) { print "
\n"; } if ($p_info["email"]) { print "Email: "; print '' . crunchtext($p_info["email"]) . "
\n"; } } else { print '
'; print 'To preserve member privacy, personal contact information is only made available to database members. Please login above to gain access.'; print "
"; // link to send-email form if ($p_info["email"]) { 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 "

Member of:

\n"; 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 "
\n"; } // ====================================================================================================== // BROWSE GROUPS // ====================================================================================================== } else { $editable = is_allowed (ACCESS_DATAENTRY); printhtmlheader ($ORGANIZATIONNAME); function masthead_groupinfo () { global $editable, $g, $userinfo, $BGCOLOUR_LIGHT, $BGCOLOUR_DARK, $searchtype; // $availablesearchtypes[SEARCH_PERSON] = 'person'; // $availablesearchtypes[SEARCH_GROUP] = 'group'; // masthead_search($availablesearchtypes,''); masthead_person_or_group_search (); if ($editable) { print ''; if ($userinfo["sa"]) { print ' '; print 'New group |'; // if ($g > 1) { // print ' '; // print 'Delete | '; // } } print ' '; print 'Edit |'; print ' '; print 'Change members |'; if (is_allowed (ACCESS_ADMIN)) { print ' '; print 'Change subgroups |'; print ' '; print 'Edit forums |'; print ' '; print 'Security |'; } print ""; } } printmasthead ($ORGANIZATIONNAME,'masthead_groupinfo'); print '

' . crunchtext($g_info["groupname"]) . "

\n"; // AFFILIATE-OF: $q = 'select * from groups'; $q .= ' left join affiliations on affiliationid=groupid'; $q .= ' where affiliateid=' . $g; $q .= ' order by groupname;'; $r = query ($q) or die ('Error accessing affiliations with:

' . $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 ''; print '
' . "\n"; } if ($g_info["description"]) { 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 ''; // COLUMN 1: BASIC INFO & SUBGROUPS print '\n"; } if ($affiliatecount) { 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 "
\n"; while ($affiliate = mysql_fetch_array($r, MYSQL_ASSOC)) { displayaffiliate($affiliate); } print "
\n"; } // COLUMN 2: MEMBERS print "\n"; // get list of position names for this group $q = 'select * from positions where groupid=' . $g . ' order by sortlevel desc, positionid;'; $r = query ($q) or die ('Error accessing position information.'); while ($position = mysql_fetch_array($r, MYSQL_ASSOC)) { $positions[$position["positionid"]] = $position["positionname"]; } $positions[0] = ''; // get current members & their positions $q = 'select * from persons'; $q .= ' left join memberships on memberid=personid'; $q .= ' left join positions on memberships.positionid=positions.positionid'; $q .= ' where memberships.groupid=' . $g; $q .= ' order by sortlevel desc, lastname, firstname;'; $r = query ($q) or die ('Error accessing group members with:

' . $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 "\n"; } ?>