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; } }
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); }
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)); }
//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)); }
public void ViewCount(int storyID) { StoryBR.IncrementViewCount(storyID); }
public void ModeratorUnMarkAsSpam(int storyID) { DemandModeratorRole(); StoryBR.UnMarkAsSpam(storyID, HostProfile.HostID, KickUserProfile); }
public void ReportAsSpam(int storyID) { DemandUserAuthentication(); StoryBR.IncrementSpamCount(storyID); }
protected void RunStoryPublisher_Click(object sender, EventArgs e) { StoryBR.PublishStoryProcess(); }
static void Main(string[] args) { Trace.Write("Atweb.Kick.Publisher Begin"); StoryBR.PublishStoryProcess(); Trace.Write("Atweb.Kick.Publisher End"); }