예제 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Dal.Story story = StoryCache.GetStory(UrlParameters.StoryIdentifier, HostProfile.HostID);

            if (story == null || story.IsSpam && !this.KickUserProfile.IsModerator)
            {
                Response.Redirect("/missingstory");
            }


            Title   = story.Title;
            Caption = "";
            UsersWhoKicked.DataBind(story.UsersWhoKicked);
            StorySummary.DataBind(story);
            StorySummary.ShowMoreLink             = false;
            StorySummary.ShowGetKickImageCodeLink = true;
            CommentList.DataBind(StoryCache.GetComments(story.StoryID));
            AddComment.DataBind(story.StoryID);
            DisplayAds = true;

            KickMenu.DisplayAds        = true;
            KickMenu.DisplayCategories = false;
            KickMenu.DisplayWhatElse   = false;

            KickItImagePersonalization.StoryUrl = story.Url;

            if (!String.IsNullOrEmpty(story.AdsenseID))
            {
                if (KickUserProfile.UserID != story.UserID)
                {
                    //flick a coin
                    if (ThreadSafeRandom.FlickCoin())
                    {
                        System.Diagnostics.Debug.WriteLine("Showing author ads " + story.AdsenseID);
                        AdSenseID = story.AdsenseID;
                    }
                }
            }


            //related stories control
            RelatedStories.DataBind(SimilarStoriesCache.GetSimilarStoryCollection(this.HostProfile.HostID, story.StoryID));
        }
예제 #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     Incremental.Kick.Dal.Story story = StoryCache.GetStory(this.UrlParameters.StoryIdentifier, this.HostProfile.HostID);
     System.Diagnostics.Trace.WriteLine("Redirecting to " + story.Url);
     this.Response.Redirect(story.Url);
 }