protected function BeforeContent() { parent::BeforeContent(); $tbsCommunity = new TabStrip("tbsCommunity"); $tbsCommunity->TabPosition = TabContainerTabPosition::Top; $tbsCommunity->Tabs[] = new TabStripTab("tabMembers", "<i class=\"fa fa-users\"></i> <span class=\"Text\">Members (" . User::Count() . ")</span>", "~/community/members", null, $this->Name == "members"); if (System::GetConfigurationValue("Groups.Enabled", false)) { $tbsCommunity->Tabs[] = new TabStripTab("tabGroups", "<i class=\"fa fa-comments\"></i> <span class=\"Text\">Groups (" . Group::Count() . ")</span>", "~/community/groups", null, $this->Name == "groups"); } if (System::GetConfigurationValue("Pages.Enabled", false)) { $tbsCommunity->Tabs[] = new TabStripTab("tabPages", "<i class=\"fa fa-flag\"></i> <span class=\"Text\">Pages (" . Page::Count() . ")</span>", "~/community/pages", null, $this->Name == "pages"); } $tbsCommunity->Render(); /* ?> <table style="width: 100%"> <tr> <td style="width: 128px; vertical-align: top;"> <?php // $actionList = new PsychaticaActionList(); // $actionList->Items = array // ( // new PsychaticaActionListItem("~/community/members", "Members (" . User::Count() . ")"), // new PsychaticaActionListItem("~/community/groups", "Groups (" . User::Count() . ")"), // new PsychaticaActionListItem("~/community/pages", "Pages (" . User::Count() . ")") // ); // $actionList->Items[1]->Selected = true; ?> <div class="ActionList"> <?php // if (System::$Configuration["Members.Enabled"]) { if ($pagename == "members") { if ($outline) { ?> <a class="Selected" href="<?php echo(System::ExpandRelativePath("~/community/members")); ?>"> <?php } else { ?> <span class="Selected"> <?php } } else { ?><a href="<?php echo(System::ExpandRelativePath("~/community/members")); ?>"> <?php } ?> Members (<?php echo(User::Count()); ?>) <?php if ($pagename == "members" && !$outline) { ?> </span> <?php } else { ?> </a> <?php } // } if (System::$Configuration["Groups.Enabled"]) { if ($pagename == "groups") { if ($outline) { ?> <a class="Selected" href="<?php echo(System::ExpandRelativePath("~/community/groups")); ?>"> <?php } else { ?> <span class="Selected"> <?php } } else { ?><a href="<?php echo(System::ExpandRelativePath("~/community/groups")); ?>"> <?php } ?> Groups (<?php echo(Group::Count()); ?>) <?php if ($pagename == "groups" && !$outline) { ?> </span> <?php } else { ?> </a> <?php } } if (System::$Configuration["Pages.Enabled"]) { if ($pagename == "pages") { if ($outline) { ?> <a class="Selected" href="<?php echo(System::ExpandRelativePath("~/community/pages")); ?>"> <?php } else { ?> <span class="Selected"> <?php } } else { ?><a href="<?php echo(System::ExpandRelativePath("~/community/pages")); ?>"> <?php } ?> Pages (<?php echo(Page::Count()); ?>) <?php if ($pagename == "pages" && !$outline) { ?> </span> <?php } else { ?> </a> <?php } } if (System::$Configuration["Forums.Enabled"]) { if ($pagename == "forums") { if ($outline) { ?> <a class="Selected" href="<?php echo(System::ExpandRelativePath("~/community/forums")); ?>"> <?php } else { ?> <span class="Selected"> <?php } } else { ?><a href="<?php echo(System::ExpandRelativePath("~/community/forums")); ?>"> <?php } ?> Forums (<?php echo(Forum::Count()); ?>) <?php if ($pagename == "forums" && !$outline) { ?> </span> <?php } else { ?> </a> <?php } } ?> </div> </td> <td> <?php */ }
<?php namespace PhoenixSNS\Modules\Community; use WebFX\System; use WebFX\Controls\ButtonGroup; use WebFX\Controls\ButtonGroupButton; use WebFX\Controls\BreadcrumbItem; use WebFX\Controls\Panel; use PhoenixSNS\Objects\Group; use PhoenixSNS\Objects\User; use PhoenixSNS\Pages\ErrorPage; $thisgroup = Group::GetByIDOrName($path[1]); if ($thisgroup == null) { $page = new ErrorPage("Group not found"); $page->Message = "That group does not exist in the system. It may have been deleted, or you may have typed the name incorrectly."; $page->ReturnButtonURL = "~/community/groups"; $page->ReturnButtonText = "Return to Group List"; $page->Render(); return; } class GroupDetailPage extends CommunityPage { public $Group; public $Path; public function __construct($group) { parent::__construct(); $this->Title = $group->Title; $this->Group = $group; }
$item = $items[$i]; echo "{ \"Category\": \"Members\", \"Item\": "; echo $item->ToJSON(); echo " }"; if ($i + $previousCount < $totalCount - 1) { echo ", "; } } }); } if ($availableTables["Groups"]) { $lookupTables[] = new LookupTable("Groups", "group_Name", function ($table, $totalCount, $previousCount) { $result = $table->Result; for ($i = 0; $i < $result->num_rows; $i++) { $values = $result->fetch_assoc(); $item = Group::GetByAssoc($values); echo "{ \"Category\": \"Groups\", \"Item\": "; echo $item->ToJSON(); echo " }"; if ($i + $previousCount < $totalCount - 1) { echo ", "; } } }); } if ($availableTables["Places"]) { $lookupTables[] = new LookupTable("Places", "place_Name", function ($table, $totalCount, $previousCount) { $result = $table->Result; for ($i = 0; $i < $result->num_rows; $i++) { $values = $result->fetch_assoc(); $item = Place::GetByAssoc($values);
protected function RenderContent() { ?> <div class="Panel"> <?php $groups = Group::Get(); $count = count($groups); ?> <h3 class="PanelTitle">Groups (<?php echo $count; ?> )</h3> <div class="PanelContent"> <div class="ProfilePage"> <div class="ProfileTitle"> <script type="text/javascript"> function RefreshList() { $.ajax( { type: "GET", url: "<?php echo System::$Configuration["Application.BasePath"]; ?> /ajax/search.php?type=group&query=" + txtFilter.value + "&order=" + orderByColumnName + "&all=0", dataType: "json", success: function(data) { if (data.result == "success") { var html = ""; for (var i = 0; i < data.content.length; i++) { var group = data.content[i]; html += "<a target=\"_blank\" href=\"/community/groups/" + group.name + "\" class=\"ButtonGroupButton\">"; html += "<img class=\"ButtonGroupButtonImage\" src=\"/community/members/" + group.name + "/images/avatar/thumbnail.png\" />"; html += "<span class=\"ButtonGroupButtonText\">" + group.title + "</span>"; html += "</a>"; } btngGroupList.innerHTML = html; } else { // dlgError.ShowDialog(); } } }); } var orderByColumnName = 'member_longname'; function OrderBy(columnName) { orderByColumnName = columnName; var lnkOrderBy_member_longname = document.getElementById("lnkOrderBy_member_longname"); var lnkOrderBy_member_date_registered = document.getElementById("lnkOrderBy_member_date_registered"); if (orderByColumnName == "member_longname") { lnkOrderBy_member_longname.className = "Selected"; lnkOrderBy_member_date_registered.className = ""; } else if (orderByColumnName == "member_date_registered") { lnkOrderBy_member_longname.className = ""; lnkOrderBy_member_date_registered.className = "Selected"; } RefreshList(); } var txtFilter = document.getElementById("txtFilter"); var timeout = null; txtFilter.onkeyup = function() { if (timeout != null) { window.clearTimeout(timeout); } timeout = window.setTimeout(function() { var btngGroupList = document.getElementById("btngGroupList"); RefreshList(); }, 50); }; </script> <span class="ProfileControlBox"> <a href="<?php echo System::ExpandRelativePath("~/community/groups/create.mmo"); ?> " onclick="DisplayCreateGroupDialog();">Create Group</a> </span> </div> <div class="ProfileContent"> <?php $grpMembers = new ButtonGroup("grpMembers"); foreach ($groups as $group) { $grpMembers->Items[] = new ButtonGroupButton(null, $group->Title, null, "~/community/groups/" . $group->Name . "/images/avatar/thumbnail.png", "~/community/groups/" . $group->Name, "GroupInformationDialog.ShowDialog(" . $group->ID . ");"); } $grpMembers->Render(); ?> </div> </div> </div> </div> <?php }
public static function GetByUser($user = null, $max = null) { if ($user == null) { return array(); } global $MySQL; $query = "SELECT * FROM " . System::$Configuration["Database.TablePrefix"] . "Groups, " . System::$Configuration["Database.TablePrefix"] . "GroupMembers WHERE " . System::$Configuration["Database.TablePrefix"] . "Groups.group_ID = " . System::$Configuration["Database.TablePrefix"] . "GroupMembers.groupmember_GroupID AND " . System::$Configuration["Database.TablePrefix"] . "GroupMembers.groupmember_UserID = " . $user->ID . " ORDER BY group_Title"; if ($max != null && is_numeric($max)) { $query .= " LIMIT " . $max; } $result = $MySQL->query($query); $count = $result->num_rows; $retval = array(); for ($i = 0; $i < $count; $i++) { $values = $result->fetch_assoc(); $retval[] = Group::GetByAssoc($values); } return $retval; }