示例#1
0
    public List <Pair> ProfileUserFollow(int userID, int profileUserID, bool stopFollowing)
    {
        if (userID > 0)
        {
            SueetieUser   sueetieFollowingUser = SueetieUsers.GetUser(profileUserID);
            string        result        = "You are now following " + sueetieFollowingUser.DisplayName;
            SueetieFollow sueetieFollow = new SueetieFollow
            {
                FollowerUserID    = userID,
                FollowingUserID   = profileUserID,
                ContentIDFollowed = -1
            };

            if (sueetieFollow.FollowerUserID == sueetieFollow.FollowingUserID)
            {
                result = "Sorry, you cannot follow yourself...";
            }
            else
            {
                if (!stopFollowing)
                {
                    int followID = SueetieUsers.FollowUser(sueetieFollow);
                }
                else
                {
                    SueetieUsers.UnFollowUser(sueetieFollow);
                    result = "You are no longer following " + sueetieFollowingUser.DisplayName;
                }
            }
            List <Pair> followResult = new List <Pair>();
            followResult.Add(new Pair(stopFollowing, result));

            return(followResult);
        }
        else
        {
            List <Pair> followResult = new List <Pair>();
            followResult.Add(new Pair(stopFollowing, "Please login or become a member to follow this person."));

            return(followResult);
        }
    }
示例#2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.QueryString["u"] == null)
            {
                Response.Redirect("Message.aspx");
            }
            else
            {
                int userID = DataHelper.GetIntFromQueryString("u", -1);
                if (userID > 0)
                {
                    if (SueetieConfiguration.Get().Core.UseForumProfile)
                    {
                        int    forumUserID = SueetieUsers.GetThinSueetieUser(userID).ForumUserID;
                        string profileUrl  = SueetieUrls.Instance.MasterProfile(forumUserID).Url;
                        Response.Redirect(profileUrl);
                    }
                    UserProfiled = SueetieUsers.GetUser(int.Parse(Request.QueryString["u"].ToString()));
                    if (UserProfiled.IsAnonymous)
                    {
                        Response.Redirect("Message.aspx?msg=1");
                    }
                    else
                    {
                        if (UserProfiled.HasAvatarImage)
                        {
                            AvatarImg.ImageUrl = "/images/avatars/" + UserProfiled.AvatarFilename;
                        }
                        else
                        {
                            AvatarImg.ImageUrl = "/images/avatars/noavatar.jpg";
                        }
                        lblMemberSince.Text = UserProfiled.DisplayName + " has been a member of the Sueetie Community since " + UserProfiled.DateJoined.ToString("y");

                        lblBio.Text = DataHelper.DefaultTextIt(UserProfiled.Bio, UserProfiled.DisplayName + " has not yet created a bio.");
                        Page.Title  = SueetieLocalizer.GetString("memberprofile_title") + UserProfiled.DisplayName;
                    }
                }
            }
        }
示例#3
0
    public string CreateBlogAdmin(string _userIDs)
    {
        string[] userIDs   = _userIDs.Split(',');
        string   newadmins = string.Empty;

        foreach (string userID in userIDs)
        {
            if (!string.IsNullOrEmpty(userID))
            {
                SueetieUser sueetieUser = SueetieUsers.GetUser(Convert.ToInt32(userID));
                SueetieBlogs.CreateBlogAdmin(sueetieUser);
                SueetieBlogUtils.CreateProfile(sueetieUser, "blog");
                if (!sueetieUser.IsBlogAdministrator)
                {
                    Roles.AddUserToRole(sueetieUser.UserName, "BlogAdministrator");
                }
                newadmins += sueetieUser.DisplayName + ",";
            }
        }

        return("The following are now site blog administrators: " + DataHelper.CommaTrim(newadmins));
    }
示例#4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            MembershipUser user;

            string username  = Request.QueryString["uname"];
            string valBinary = Request.QueryString["key"];
            int    userid    = DataHelper.GetIntFromQueryString("uid", -1);

            if (!string.IsNullOrEmpty(username) && !string.IsNullOrEmpty(valBinary) && userid > 0)
            {
                user = Membership.GetUser(username);

                SueetieUser sueetieUser = SueetieUsers.GetUser(username);

                if ((user.IsApproved == false) && (valBinary == user.CreationDate.ToBinary().ToString()) && !sueetieUser.IsBanned)
                {
                    user.IsApproved = true;
                    Membership.UpdateUser(user);
                    SueetieUsers.CreateUpdateUserProfileCookie(sueetieUser);
                    SueetieLogs.LogUserEntry(UserLogCategoryType.JoinedCommunity, -1, userid);

                    phActivated.Visible = true;
                    phNot.Visible       = false;
                }
                else
                {
                    phActivated.Visible = false;
                    phNot.Visible       = true;
                }
            }
            else
            {
                phActivated.Visible = false;
                phNot.Visible       = true;
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            ScriptManager1.RegisterPostBackControl(UpdateUpload);
            ScriptManager1.RegisterPostBackControl(DeleteAvatarButton);
            ScriptManager1.RegisterPostBackControl(btnUpdateBio);
            ScriptManager1.RegisterPostBackControl(ChangePasswordButton);

            if (Request.QueryString["dv"] == "1" || Request.QueryString["av"] == "1" || Request.QueryString["iv"] == "1")
            {
                TabContainer1.ActiveTabIndex = 2;
            }
            else if (Request.QueryString["bio"] == "1")
            {
                TabContainer1.ActiveTabIndex = 2;
            }
            else if (Request.QueryString["pr"] == "1")
            {
                TabContainer1.ActiveTabIndex = 0;
            }
            else
            {
                TabContainer1.ActiveTabIndex = 0;
            }

            if (!Page.IsPostBack)
            {
                if (Page.User.Identity.IsAuthenticated)
                {
                    SueetieUser sueetieUser = SueetieUsers.GetUser(CurrentUserID, false);
                    SetActiveButtonAttributes(CancelButton);
                    SetActiveButtonAttributes(ChangePasswordButton);
                    SetActiveButtonAttributes(btnUpdateProfile);
                    SetActiveButtonAttributes(btnUpdateBio);


                    SueetieUIHelper.PopulateTimeZoneList(ddTimeZones, sueetieUser.TimeZone.ToString());
                    SueetieUserProfile profile = CurrentSueetieUser.Profile;

                    txtCurrentPassword.Text = string.Empty;
                    txtDisplayName.Text     = sueetieUser.DisplayName;
                    txtEmail.Text           = sueetieUser.Email;

                    #region Optional Profile Property Assignments


                    if (chkNewsletter != null)
                    {
                        HasNewsletterCheckBox = true;
                        chkNewsletter.Checked = profile.Newsletter;
                    }

                    #endregion

                    // When using ProfileBase...
                    //ProfileBase profile = HttpContext.Current.Profile;
                    //txtDisplayName.Text = profile["DisplayName"] as string;
                    //ddlGenders.SelectedValue = profile["Gender"] as string;
                    //ddlOccupations.SelectedValue = profile["Occupation"] as string;
                    //txtWebsite.Text = profile["Website"] as string;
                    //txtTwitterName.Text = profile["TwitterName"] as string;
                    //ddlCountries.SelectedValue = profile["Country"] as string;

                    txtBio.Text = sueetieUser.Bio;
                }
            }

            BindData();
        }
示例#6
0
 public string GetDisplayName(int userid)
 {
     return(SueetieUsers.GetUser(userid).DisplayName);
 }