예제 #1
0
        protected void BeginNetworkPage()
        {
            networkNetwork = core.Http["nn"];

            try
            {
                primitive = new Network(core, networkNetwork);
            }
            catch (InvalidNetworkException)
            {
                core.Functions.Generate404();
                return;
            }

            Core.PagePath = Core.PagePath.Substring(Network.NetworkNetwork.Length + 1 + 8);
            if (core.PagePath.Trim(new char[] { '/' }) == "")
            {
                core.PagePath = "/profile";
            }

            BoxSocial.Internals.Application.LoadApplications(core, AppPrimitives.Network, core.PagePath, BoxSocial.Internals.Application.GetApplications(Core, Network));

            PageTitle = Network.DisplayName;

            if (loggedInMember != null && core.Http.Query["mode"] == "activate")
            {
                try
                {
                    if (loggedInMember.UserId == long.Parse(core.Http.Query["id"]))
                    {
                        if (Network.Activate(this, loggedInMember, core.Http.Query["key"]))
                        {
                            template.Parse("REDIRECT_URI", Network.Uri);
                            core.Display.ShowMessage("Joined Network", "You have successfully joined the network.");
                            return;
                        }
                    }
                    else
                    {
                        // not the logged in user, ignore
                    }
                }
                catch
                {
                    // ignore
                }
            }
        }
예제 #2
0
 public static string Uri(Core core, Network theNetwork)
 {
     return core.Hyperlink.AppendSid(string.Format("{0}comments",
         theNetwork.UriStub));
 }
예제 #3
0
        public NetworkMember(Core core, Network theNetwork, User member)
            : base(core)
        {
            SelectQuery query = GetSelectQueryStub(core, UserLoadOptions.All);
            query.AddCondition("user_keys.user_id", member.UserId);
            query.AddCondition("network_members.network_id", theNetwork.Id);

            DataTable memberTable = db.Query(query);

            if (memberTable.Rows.Count == 1)
            {
                loadItemInfo(memberTable.Rows[0]);
            }
            else
            {
                throw new InvalidUserException();
            }

            loadUserFromUser(member);
        }
예제 #4
0
 /// <summary>
 /// Generates a URI pointing to the gallery photo upload form
 /// </summary>
 /// <param name="theNetwork">Network to upload photo to</param>
 /// <returns>URI pointing to the upload form</returns>
 public static string BuildGalleryUpload(Core core, Network theNetwork)
 {
     return core.Hyperlink.AppendSid(string.Format("/network/gallery/{0}/?mode=upload",
         theNetwork.NetworkNetwork));
 }