public static void Show(Core core, NPage page) { core.Template.SetTemplate("Networks", "viewnetwork"); page.Signature = PageSignature.viewnetwork; if (core.Session.IsLoggedIn) { if (page.Network.IsNetworkMember(core.Session.LoggedInMember.ItemKey)) { core.Template.Parse("U_LEAVE", page.Network.BuildLeaveUri()); } else { core.Template.Parse("U_JOIN", page.Network.BuildJoinUri()); } } core.Template.Parse("NETWORK_DISPLAY_NAME", page.Network.DisplayName); core.Display.ParseBbcode("DESCRIPTION", page.Network.Description); string langMembers = (page.Network.Members != 1) ? "members" : "member"; string langIsAre = (page.Network.Members != 1) ? "are" : "is"; core.Template.Parse("MEMBERS", page.Network.Members.ToString()); core.Template.Parse("L_MEMBERS", langMembers); core.Template.Parse("L_IS_ARE", langIsAre); core.Template.Parse("U_MEMBERLIST", page.Network.BuildMemberListUri()); List<NetworkMember> members = page.Network.GetMembers(1, 8); foreach (NetworkMember member in members) { Dictionary<string, string> membersLoopVars = new Dictionary<string, string>(); VariableCollection membersVariableCollection = core.Template.CreateChild("member_list"); membersVariableCollection.Parse("USER_DISPLAY_NAME", member.DisplayName); membersVariableCollection.Parse("U_PROFILE", member.Uri); membersVariableCollection.Parse("ICON", member.Icon); } core.InvokeHooks(new HookEventArgs(core, AppPrimitives.Network, page.Network)); }
public static void ShowMemberlist(Core core, NPage page) { core.Template.SetTemplate("Networks", "viewnetworkmemberlist"); core.Template.Parse("MEMBERS_TITLE", "Member list for " + page.Network.DisplayName); core.Template.Parse("MEMBERS", ((ulong)page.Network.Members).ToString()); foreach (NetworkMember member in page.Network.GetMembers(page.TopLevelPageNumber, 18)) { VariableCollection memberVariableCollection = core.Template.CreateChild("member_list"); string age; int ageInt = member.Profile.Age; if (ageInt == 0) { age = "FALSE"; } else { age = ageInt.ToString() + " years old"; } memberVariableCollection.Parse("USER_DISPLAY_NAME", member.DisplayName); memberVariableCollection.Parse("JOIN_DATE", page.tz.DateTimeToString(member.GetNetworkMemberJoinDate(page.tz))); memberVariableCollection.Parse("USER_AGE", age); memberVariableCollection.Parse("USER_COUNTRY", member.Profile.Country); memberVariableCollection.Parse("USER_CAPTION", ""); memberVariableCollection.Parse("U_PROFILE", member.Uri); memberVariableCollection.Parse("ICON", member.Icon); } string pageUri = page.Network.MemberlistUri; core.Display.ParsePagination(pageUri, 18, page.Network.Members); List<string[]> breadCrumbParts = new List<string[]>(); breadCrumbParts.Add(new string[] { "members", core.Prose.GetString("MEMBERS") }); page.Network.GenerateBreadCrumbs(breadCrumbParts); }
public static void Show(Core core, NPage page) { core.Template.SetTemplate("GuestBook", "viewguestbook"); if (core.Session.IsLoggedIn) { if (page.Network.IsNetworkMember(core.Session.LoggedInMember.ItemKey)) { core.Template.Parse("CAN_COMMENT", "TRUE"); } } core.Template.Parse("PAGE_TITLE", string.Format(core.Prose.GetString("USERS_GUEST_BOOK"), page.Owner.DisplayNameOwnership)); core.Display.DisplayComments(core.Template, page.Network, page.Network); core.Display.ParsePagination("COMMENT_PAGINATION", GuestBook.Uri(core, page.Network), 10,page.Network.Comments); List<string[]> breadCrumbParts = new List<string[]>(); breadCrumbParts.Add(new string[] { "comments", core.Prose.GetString("GUEST_BOOK") }); page.Network.ParseBreadCrumbs(breadCrumbParts); }