} else { if ($strOrderBy == "formatted_time") { $btnDateJoin = "orderButtonSelected"; } else { $btnPriv = "orderButtonSelected"; } } } else { $btnUsername = "******"; $strOrderBy = "name"; } $user = new User(); $username = $user->getUsername(); // Check if manager joined include 'includes/groups_functions.php'; $partOf = checkIfManager($group_id, $username); $isMember = checkIfMember($group_id, $username); /* Retrieve the name of the group */ $rec_name = returnGroupName($group_id); echo "<b>" . T_("Members of group") . " " . $rec_name . "</b><br><br>\n"; if (!$partOf && !$isMember) { echo "<p class=\"error\">" . T_("You must be the manager of this group") . ".</p>"; } else { if (isset($_POST['aname'])) { //Change the user's priv $aname = $_POST['aname']; $newPriv = $_POST['newPriv']; changeMemberPriv($aname, $newPriv); } //Retrieve the list of members $Query = "select name, date_join AS formatted_time, priv from " . TABLE_PREFIX . "gsubscriptions where (group_id = '{$group_id}') order by " . $strOrderBy;
$rec_id = "{$row["group_id"]}"; $rec_description = "{$row["description"]}"; $rec_password = "******"password"]}"; //Check if the group is already displayed to avoid repeating it more than once if (!in_array($rec_id, $results)) { $results[$resultsCount++] = $rec_id; echo "- <b>{$rec_name}</b> : {$rec_description}<br><i>"; if ($rec_password != "") { echo T_("Private group"); } else { echo T_("Public group"); } echo "</i><table><tr><td valign=\"top\"><form action=\"gdetails.php\" method=\"post\"><input type=\"hidden\" name=\"group_id\" value=\"{$rec_id}\"><input type=\"submit\" class=\"submitLinkGroups\" value=\"" . T_("Details") . "\"></form></td>"; // Show the join button if the user is not subscribed to this group yet, // else display the button to view or unsubscribe from this group // Check if the user is already part of the group $partOf = checkIfManager($rec_id, $username) || checkIfMember($rec_id, $username); $onlyMember = checkIfMember($rec_id, $username); if (!$partOf) { echo "<td valign=\"top\"><form action=\"gjoin.php\" method=\"post\"><input type=\"hidden\" name=\"group_id\" value=\"{$rec_id}\"><input type=\"submit\" class=\"submitLinkGroups\" value=\"" . T_("Join") . "\"></form></td></tr></table>"; } elseif ($onlyMember) { echo "<td valign=\"top\"><form action=\"gunsubs.php\" method=\"post\"><input type=\"hidden\" name=\"group_id\" value=\"{$rec_id}\"><input type=\"submit\" class=\"submitLinkGroups\" value=\"" . T_("Unsubscribe") . "\"></form></td></tr></table>"; } else { echo "</tr></table>"; } } } } echo "</div>"; } require_once 'footer.php';