Пример #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            DisplayAds     = false;
            DisplaySideAds = false;
            Title          = HostProfile.SiteTitle + " : Kick Spy!";
            PageName       = UrlFactory.PageName.KickSpy;

            UserOnlineList.DataBind(UserCache.GetOnlineUsers(30, HostProfile.HostID, KickUserProfile));

            Shoutbox.DataBind((ShoutCache.GetLatestShouts(HostProfile.HostID)));
        }
Пример #2
0
        public DeltaShoutsHtml GetDeltaShouts(string toUsername, int chatID, int lastReceivedShoutID)
        {
            ShoutCollection shouts          = ShoutCache.GetDeltaShouts(HostProfile.HostID, toUsername, ToNullable(chatID), lastReceivedShoutID);
            DeltaShoutsHtml deltaShoutsHtml = new DeltaShoutsHtml();

            if (shouts.Count > 0)
            {
                ShoutList shoutList = new ShoutList(shouts);
                shoutList.ShowTime          = false;
                deltaShoutsHtml.Html        = ControlHelper.RenderControl(shoutList);
                deltaShoutsHtml.LatestShout = shouts[0].ToApi(this.HostProfile);
            }
            return(deltaShoutsHtml);
        }
Пример #3
0
        public static void AddShout(User fromUser, int hostID, string message, string toUsername, int?chatID)
        {
            if (!String.IsNullOrEmpty(message) && (!fromUser.IsBanned))
            {
                Shout shout = new Shout();
                shout.HostID     = hostID;
                shout.Message    = TextHelper.EncodeAndReplaceComment(message);
                shout.FromUserID = fromUser.UserID;

                User toUser = null;
                if (!string.IsNullOrEmpty(toUsername))
                {
                    toUser         = UserCache.GetUserByUsername(toUsername);
                    shout.ToUserID = toUser.UserID;

                    //record the event as an alert
                    UserBR.AddUserAlertMessage(toUser.UserID,
                                               Incremental.Kick.Common.Enums.AlertMessageEnum.ProfileShoutComment);
                }

                if (chatID.HasValue)
                {
                    shout.ChatID = chatID;
                }

                shout.Save();

                if (!chatID.HasValue)
                {
                    if (toUser == null)
                    {
                        UserAction.RecordShout(hostID, fromUser);
                    }
                    else
                    {
                        UserAction.RecordShout(hostID, fromUser, toUser);
                    }
                }

                ShoutCache.Remove(hostID, shout.ToUserID, chatID);
            }
        }
Пример #4
0
        protected void Page_Init(object sender, EventArgs e)
        {
            this.PageName = UrlFactory.PageName.UserProfile;
            this.Profile1.DataBind(this.UserProfile);
            this.UserProfileHeader.User = this.UserProfile;

            this.FriendList.DataBind(this.UserProfile.Friends);
            this.FriendByList.DataBind(this.UserProfile.FriendsBy);
            this.UserAdmin.DataBind(this.UserProfile);
            this.Shoutbox.DataBind((ShoutCache.GetLatestShouts(this.HostProfile.HostID, this.UrlParameters.UserIdentifier)));
            this.UserActionList.DataBind(UserActionCache.GetLatestUserActions(this.HostProfile.HostID, 1, 50, UserCache.GetUserID(this.UrlParameters.UserIdentifier), null, null, null));

            //don't show user controls if banned
            if (this.UserProfile.IsBanned && !(this.KickUserProfile.IsAdministrator || this.KickUserProfile.IsModerator))
            {
                this.FriendList.Visible     = false;
                this.FriendByList.Visible   = false;
                this.UserAdmin.Visible      = false;
                this.Shoutbox.Visible       = false;
                this.UserActionList.Visible = false;
            }
        }
Пример #5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     Shoutbox.DataBind((ShoutCache.GetLatestShouts(HostProfile.HostID, this.UrlParameters.ChatID.Value)));
 }