function getTopBar($args = null) { global $forgroup; global $group_name; global $group; global $access_isGroupMember, $access_isGroupAdmin; global $allow_chat; global $service_host; if ($args == null) { $args = func_get_args(); } // we'll return this one $html = ""; $html .= "<div id=\"topbar\">"; // First member status $html .= "<div id=\"memberstatus\">"; if (isset($_SESSION['valid_user'])) { $ue = _usernameToEmail($_SESSION['valid_user']); if ($forgroup) { if ($ue[0]) { $html .= $ue[1] . " | <a href=\"{$service_host}?function=dashboard\">My Account</a> ·"; } else { $html .= $_SESSION['valid_user'] . " | <a href=\"{$service_host}?function=dashboard\">My Account</a> ·"; } if ($allow_chat) { $html .= " <a href=\"javascript:void()\" onclick=\"switchChatVisibility()\">" . topbarTranslate("Chat On/Off") . "</a> ·"; } if ($access_isGroupAdmin) { $html .= " <a href=\"{$service_host}?function=admin\">" . topbarTranslate("Group Admin Panel") . "</a> ·"; } elseif (!$access_isGroupMember) { if (!$group->membershipApplied(_getMemberID($_SESSION['valid_user']))) { $html .= " <a href=\"{$service_host}?function=join\">" . topbarTranslate("Join This Group") . "</a> ·"; } else { $html .= " <i>" . topbarTranslate("Waiting Membership Authorization") . "</i> ·"; } } $html .= " <a href=\"{$service_host}?function=signout\">" . topbarTranslate("Sign Out") . "</a>"; } } else { if ($forgroup) { $html .= "<a href=\"{$service_host}?function=signin\">" . topbarTranslate("Sign In") . "</a> or <a href=\"{$service_host}?function=join\">" . topbarTranslate("Join") . "</a>"; } } $html .= " | "; // problematic // $im = sizeof($args)-1; foreach ($args as $i => $a) { // $html .= " > <a href=\"{$a[0]}\">".topbarTranslate($a[1])."</a>"; $html .= "<a href=\"{$a[0]}\">" . topbarTranslate($a[1]) . "</a> > "; // if($i!=$im) { // $html .= ""; // } } $html = substr($html, 0, -6); $html .= "</div>"; $html .= "</div>"; return $html; }
/** * uses addMembershipRequest and acceptMembershipRequest * functions but this is nonsense * This is the same as the constructor of this class * TODO: We can directly add the user as well * If we make an update to this function, we should change * the constructor also then */ function addNewMember($membername) { global $app_base; /** and now let's add the admin user * into the group */ $uid = _getMemberID($membername); $s1 = $this->addMembershipRequest("", null, '', $membername); //if(!$s1) // return false; $s2 = $this->acceptMembershipRequest($uid, true); if (!$s2) { return false; } return true; }
$people_allow_zodiac = $group->moduleOptions_getPeopleAllowZodiac(); $people_allow_website = $group->moduleOptions_getPeopleAllowWebsite(); $people_allow_nation = $group->moduleOptions_getPeopleAllowNation(); $person = ""; if ($_GET['obj1'] == "person") { $person = $_GET['obj2']; } else { $person = $_GET['obj1']; } $zz = array(); $pg->setLayout($pg->EqualColumns); // from GeneralFunctions.php $zz = $peoplepage->getDefaultMembershipID($person); $membershipid = $zz['id']; $member_username = $zz['username']; $pg->addBlock($pg->RightColumn, $treng->_('Wall', "modulepeople"), $peoplepage->getWall(_getMemberID($member_username)), ""); $pg->addBlock($pg->LeftColumn, $treng->_('Profile', "modulepeople"), peopleGetProfileX($membershipid), $treng->_('An overview of this person', "modulepeople")); //if((isset($_SESSION['valid_user'])&&$member_username==$_SESSION['valid_user'])||$peoplepage->canShowTags($member_username)) if ($people_allow_tags) { $pg->addBlock($pg->LeftColumn, $treng->_('My Tags', "modulepeople"), substr(peopleGetTags($membershipid, $member_username), 2), $treng->_('These are the tags describing this person. Bigger a tags is, more it defines this person.', "modulepeople")); } // will be used as Love Stuff //else // $pg->addBlock($pg->MainColumn, $treng->_('My Tags',"modulepeople"), substr(peopleGetTags($membershipid,$member_username),2), $treng->_('These are the tags describing this person. Bigger a tags is, more it defines this person.',"modulepeople"), true); // to store input stuff //if((isset($_SESSION['valid_user'])&&$member_username==$_SESSION['valid_user'])||$peoplepage->canShowFavourites($member_username)) if ($people_allow_favorites) { $pg->addBlock($pg->LeftColumn, $treng->_('Favourites', "modulepeople"), $peoplepage->getFavourites($member_username), $treng->_('Favourites of this person. Shown by a book/CD cover for aesthetic purposes. Point your mouse over it to see more information in a popup box.', "modulepeople"), false); } // will be used as Love Stuff //else // $pg->addBlock($pg->MainColumn, $treng->_('Favourites',"modulepeople"), $peoplepage->getFavourites($member_username), $treng->_('Favourites of this person. Shown by a book/CD cover for aesthetic purposes. Point your mouse over it to see more information in a popup box.',"modulepeople"), true); // to store input stuff
function getPeopleOptions($uname) { global $access_isGroupMember; _filter_var($uname); $res = ""; if (isset($_SESSION['valid_user']) && $access_isGroupMember) { if ($uname != $_SESSION['valid_user']) { $u = new User($_SESSION['valid_user']); $uid = _getMemberID($uname); if (!$u->isWatching($uid)) { $res .= "<img align=\"absbottom\" src=\"http://grou.ps/images/eye.gif\" alt=\"" . $this->_("Add to Your Watchlist") . "\" width=\"16\" height=\"16\" border=\"0\" /> "; $res .= "<a href=\"javascript:void(add_watchlist('{$uname}'))\">" . $this->_("Add to Your Watchlist") . "</a>"; } else { $res .= "<img align=\"absbottom\" src=\"http://grou.ps/images/bell.gif\" alt=\"" . $this->_("In Your Watchlist") . "\" width=\"16\" height=\"16\" border=\"0\" /> "; $res .= $this->_("In Your Watchlist"); } } } return $res; }
function _getMembershipID($gname) { if (!isAuthenticated() || !isset($_SESSION['valid_user'])) { die("Error No 3034"); } else { $member_id = _getMemberID($_SESSION['valid_user']); $db = AccessDB(); $q = $db->getOne("SELECT membership_id FROM memberships WHERE member_id='{$member_id}' LIMIT 0 , 1"); if (PEAR::isError($q)) { die($q->getMessage()); } return $q; } }
function getMembershipID() { if ($this->MembershipID != null) { return $this->MembershipID; } else { $member_id = _getMemberID($this->Username); $res =& $this->Database->getOne("SELECT membership_id FROM memberships WHERE member_id = '{$member_id}'"); if (PEAR::isError($res)) { die($res->getMessage()); } $this->MembershipID = $res; return $res; } }