Пример #1
0
        protected void SubmitStory_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                if (!KickPage.KickUserProfile.IsVetted)
                {
                    throw new SecurityException("This user can't submit stories");
                }

                short  categoryID      = short.Parse(Category.SelectedValue);
                string storyIdentifier =
                    StoryBR.AddStory(KickPage.HostProfile.HostID, Title.Text, Description.Text, Url.Text, categoryID,
                                     KickPage.KickUserProfile, KickPage.IPAddress);

                NewStoryPanel.Visible = false;
                SuccessPanel.Visible  = true;

                string categoryName = CategoryCache.GetCategory(categoryID, KickPage.HostProfile.HostID).CategoryIdentifier;
                UpcomingStoryQueue.NavigateUrl = UrlFactory.CreateUrl(UrlFactory.PageName.NewStories);
                UpcomingStoryQueue.Text        = "upcoming queue";
                StoryLink.NavigateUrl          = UrlFactory.CreateUrl(UrlFactory.PageName.ViewStory, storyIdentifier, categoryName);

                // Bind the story original url to the image customization user control
                KickItImagePersonalization.StoryUrl = Url.Text;
            }
        }
Пример #2
0
        public static int CreateComment(int hostID, int storyID, User user, string comment)
        {
            if (user.IsBanned)
            {
                throw new SecurityException("A banned user can not post a comment");
            }

            if (comment.Length > 4000)
            {
                comment = comment.Substring(0, 4000);
            }

            Comment newComment = new Comment();

            newComment.HostID  = hostID;
            newComment.StoryID = storyID;
            newComment.UserID  = user.UserID;
            //TODO: GJ: rename comment as it is the same as the table name
            newComment.CommentX = comment;
            newComment.Save();

            StoryBR.IncrementStoryCommentCount(storyID);
            UserAction.RecordComment(hostID, user, Story.FetchByID(storyID), newComment.CommentID);
            return(newComment.CommentID);
        }
Пример #3
0
        public static int UnKickStory(int storyID, int userID, int hostID)
        {
            // If the user has already unkicked the story return the current number of kicks
            // This may happen if the user has two browser windows opened on the same story and
            // tries to unkick on both pages
            if (StoryBR.DoesStoryKickNotExist(storyID, userID, hostID))
            {
                return(Story.FetchByID(storyID).KickCount);
            }

            StoryBR.DeleteStoryKick(storyID, userID, hostID);
            RemoveStoryKick(storyID, userID, hostID);
            UserAction.RecordUnKick(hostID, GetUser(userID), Story.FetchByID(storyID));
            return(StoryBR.DecrementKickCount(storyID));
        }
Пример #4
0
        //TODO: GJ: some improvements are needed here - a sproc would be better
        //TODO: simone.busoli: no more sps, right?
        public static int KickStory(int storyID, int userID, int hostID, string ipAddress)
        {
            // If the user has already kicked the story return the current number of kicks
            // This may happen if the user has two browser windows opened on the same story and
            // tries to kick on both pages
            if (StoryBR.DoesStoryKickExist(storyID, userID, hostID))
            {
                return(Story.FetchByID(storyID).KickCount);
            }

            StoryKick storyKick = StoryBR.AddStoryKick(storyID, userID, hostID, ipAddress);

            GetUserStoryKicks(userID).Add(storyKick);
            UserAction.RecordKick(hostID, GetUser(userID), Story.FetchByID(storyID));

            return(StoryBR.IncrementKickCount(storyID));
        }
Пример #5
0
 public void ViewCount(int storyID)
 {
     StoryBR.IncrementViewCount(storyID);
 }
Пример #6
0
 public void ModeratorUnMarkAsSpam(int storyID)
 {
     DemandModeratorRole();
     StoryBR.UnMarkAsSpam(storyID, HostProfile.HostID, KickUserProfile);
 }
Пример #7
0
 public void ReportAsSpam(int storyID)
 {
     DemandUserAuthentication();
     StoryBR.IncrementSpamCount(storyID);
 }
Пример #8
0
 protected void RunStoryPublisher_Click(object sender, EventArgs e)
 {
     StoryBR.PublishStoryProcess();
 }
Пример #9
0
 static void Main(string[] args)
 {
     Trace.Write("Atweb.Kick.Publisher Begin");
     StoryBR.PublishStoryProcess();
     Trace.Write("Atweb.Kick.Publisher End");
 }