protected void Page_Load(object sender, EventArgs e) { { StringBuilder sbDjs = new StringBuilder(); Query q1 = new Query(); q1.OrderBy = new OrderBy(OrderBy.OrderDirection.Random); MixmagGreatestDjSet djs = new MixmagGreatestDjSet(q1); HtmlRenderer h = new HtmlRenderer(); h.RenderFlashTagsRaw = true; foreach (MixmagGreatestDj dj in djs) { sbDjs.Append("<h2 style=\"margin-top: 35px; margin-bottom: -5px;\">" + dj.Name + "</h2>"); sbDjs.Append("<div style=\"height: 100px; clear:both; margin-bottom: 20px;\">"); { sbDjs.Append("<div style=\"height: 100px; width: 100px; float: left; margin-right: 10px;\"><a href=\"/" + dj.UrlName + "\"><img src=\"" + dj.ImageUrl + "\" width=\"100\" height=\"100\" /></a></div>"); //sbDjs.Append("<div style=\"height: 100px; width: 150px; float: right; margin-left: 10px; \">" + h.GetFlash("djvid" + dj.K.ToString(), 100, 150, false, "load", "http://www.youtube.com/v/" + dj.YoutubeId + "&rel=1") + "</div>"); sbDjs.Append("<p>" + dj.Description + "<br /><a href=\"/" + dj.UrlName + "\"><b>Vote for " + dj.Name + "</b></a></p>"); } sbDjs.Append("</div>"); //sbDjs.Append("<div style=\"clear: both;\"></div>"); } DjsPh.Controls.Add(new LiteralControl(sbDjs.ToString())); } }
protected void Page_Load(object sender, EventArgs e) { { StringBuilder sbDjs = new StringBuilder(); Query q1 = new Query(); q1.OrderBy = new OrderBy(OrderBy.OrderDirection.Random); MixmagGreatestDjSet djs = new MixmagGreatestDjSet(q1); HtmlRenderer h = new HtmlRenderer(); h.RenderFlashTagsRaw = true; foreach (MixmagGreatestDj dj in djs) { string link = ""; sbDjs.Append(@" <p> <div class=""Spacer""/> </p> <p class=""Header""> " + dj.Name.ToUpper() + @" </p> <p> <div class=""SpacerDotted""/> </p> <div style=""height:100px; width:100px; float:left;""> " + "<a href=\"http://" + url + "/" + dj.UrlName + auth + "\"" + (newWindow ? " target=\"_blank\"" : "") + " class=\"NoStyle\">" + @"<img src=""" + dj.Image100Url + @""" width=""100"" height=""100"" /></a> </div> <div style=""min-height:100px; width:405px; padding-right:0px; padding-left:15px; float:left;""> <div class=""TextQuote""> " + dj.ShortDescription + @" </div> <div style=""margin-top:5px; text-align:right;"" class=""Text"">" + "<a href=\"http://" + url + "/" + dj.UrlName + auth + "\"" + (newWindow ? " target=\"_blank\"" : "") + ">" + @"More details, watch the video and vote</a></div> </div> <div style=""clear: both;""></div> "); //sbDjs.Append("<h2 style=\"margin-top: 35px; margin-bottom: -5px;\">" + dj.Name + "</h2>"); //sbDjs.Append("<div style=\"height: 100px; clear:both; margin-bottom: 20px;\">"); //{ // sbDjs.Append("<div style=\"height: 100px; width: 100px; float: left; margin-right: 10px;\"><a href=\"http://" + url + "/" + dj.UrlName + auth + "\"" + (newWindow ? " target=\"_blank\"" : "") + "><img src=\"" + dj.ImageUrl + "\" width=\"100\" height=\"100\" /></a></div>"); // //sbDjs.Append("<div style=\"height: 100px; width: 150px; float: right; margin-left: 10px; \">" + h.GetFlash("djvid" + dj.K.ToString(), 100, 150, false, "load", "http://www.youtube.com/v/" + dj.YoutubeId + "&rel=1") + "</div>"); // sbDjs.Append("<p>" + dj.Description + "<br /><a href=\"http://" + url + "/" + dj.UrlName + auth + "\"" + (newWindow ? " target=\"_blank\"" : "") + "><b>More info about " + dj.Name + "</b></a></p>"); //} //sbDjs.Append("</div>"); ////sbDjs.Append("<div style=\"clear: both;\"></div>"); } DjsPh.Controls.Add(new LiteralControl(sbDjs.ToString())); } }
void BindPersonalStatement() { if (!doneBindPersonalStatement) { doneBindPersonalStatement = true; if (ThisUsr.PersonalStatement.Length > 0) { PersonalStatementPanel.Visible = true; HtmlRenderer r = new HtmlRenderer(); r.LoadHtml(ThisUsr.PersonalStatement); if (r.Container) { PersonalStatementPlainPh.Visible = false; PersonalStatementPh.Visible = true; PersonalStatementPh.Controls.Clear(); PersonalStatementPh.Controls.Add(new LiteralControl(r.Render(PersonalStatementPh))); } else { PersonalStatementPh.Visible = false; PersonalStatementPlainPh.Visible = true; PersonalStatementPlainPh.Controls.Clear(); PersonalStatementPlainPh.Controls.Add(new LiteralControl("<div style=\"width:634px; overflow:hidden;\">" + r.Render(PersonalStatementPlainPh) + "</div>")); } } else PersonalStatementPh.Visible = false; } }
private void MiscInfo_Load(object sender, System.EventArgs e) { if (PageMode.Equals(PageModes.Group) && CurrentGroup.CanViewHomePage(Usr.Current, CurrentGroupUsr)) { if (CurrentGroup.Brand != null) { ContainerPage.SetPageTitle(CurrentGroup.Brand.Name + " group"); GroupName.Text = CurrentGroup.Brand.Name; GroupName1.Text = CurrentGroup.Brand.Name; } else { ContainerPage.SetPageTitle(CurrentGroup.FriendlyName + " group"); GroupName.Text = CurrentGroup.FriendlyName + " group"; GroupName1.Text = CurrentGroup.FriendlyName; } if (CurrentGroup.Brand != null && CurrentGroup.Brand.HasPic) GroupPicImg.Src = CurrentGroup.Brand.PicPath; else if (CurrentGroup.HasPic) GroupPicImg.Src = CurrentGroup.PicPath; else GroupPicCell.Visible = false; if (CurrentGroup.LongDescriptionHtml.Length > 0) { HtmlRenderer r = new HtmlRenderer(); r.Formatting = !CurrentGroup.LongDescriptionPlain; r.Container = !CurrentGroup.LongDescriptionPlain; r.LoadHtml(CurrentGroup.LongDescriptionHtml); if (r.Container) { HtmlPlaceHolder.Controls.Clear(); HtmlPlaceHolder.Controls.Add(new LiteralControl(r.Render(HtmlPlaceHolder))); } else { HtmlPanel.Visible = false; if (Vars.IsCompetitionGroupActive(CurrentGroup.K)) { CaptionHtmlPlaceHolder.Controls.Clear(); CaptionHtmlPlaceHolder.Controls.Add(new LiteralControl("<div style=\"width:634px; overflow:hidden;\">" + r.Render(CaptionHtmlPlaceHolder) + "</div>")); } else { PlainHtmlPlaceHolder.Controls.Clear(); PlainHtmlPlaceHolder.Controls.Add(new LiteralControl("<div style=\"width:634px; overflow:hidden;\">" + r.Render(PlainHtmlPlaceHolder) + "</div>")); } } } else HtmlPanel.Visible = false; if (CurrentGroup.Brand != null) { PublicChatLink.HRef = CurrentGroup.Brand.UrlDiscussion(); PublicChatLinkLabel.Text = "Public chat - " + CurrentGroup.Brand.TotalComments.ToString("#,##0") + " comment" + (CurrentGroup.Brand.TotalComments == 1 ? "" : "s"); GroupChatLink.HRef = CurrentGroup.UrlDiscussion(); GroupChatLinkLabel.Text = "Regulars chat - " + CurrentGroup.TotalComments.ToString("#,##0") + " comment" + (CurrentGroup.TotalComments == 1 ? "" : "s"); } else { PublicChatP.Visible = false; GroupChatLink.HRef = CurrentGroup.UrlDiscussion(); GroupChatLinkLabel.Text = CurrentGroup.FriendlyName + " chat - " + CurrentGroup.TotalComments.ToString("#,##0") + " comment" + (CurrentGroup.TotalComments == 1 ? "" : "s"); } GroupChatP.Visible = CurrentGroup.IsRead(Usr.Current, CurrentGroupUsr); if (CurrentGroup.Brand != null) { CalendarLink.HRef = CurrentGroup.Brand.UrlCalendar(); CalendarLinkLabel.Text = CurrentGroup.Brand.Name; //TicketsLink.HRef = CurrentGroup.Brand.UrlCalendar(true, false); //TicketsLinkLabel.Text = CurrentGroup.Brand.Name; //FreeGuestlistLink.HRef = CurrentGroup.Brand.UrlCalendar(false, true); //FreeGuestlistLinkLabel.Text = CurrentGroup.Brand.Name; //HotTicketsLink.HRef = CurrentGroup.Brand.UrlApp("hottickets"); //HotTicketsLinkLabel.Text = CurrentGroup.Brand.Name; } else if (CurrentGroup.HasEvents) { CalendarLink.HRef = CurrentGroup.UrlCalendar(); CalendarLinkLabel.Text = CurrentGroup.FriendlyName; //TicketsLink.HRef = CurrentGroup.UrlCalendar(true, false); //TicketsLinkLabel.Text = CurrentGroup.FriendlyName; //FreeGuestlistLink.HRef = CurrentGroup.UrlCalendar(false, true); //FreeGuestlistLinkLabel.Text = CurrentGroup.FriendlyName; //HotTicketsLink.HRef = CurrentGroup.UrlApp("hottickets"); //HotTicketsLinkLabel.Text = CurrentGroup.FriendlyName; } else { CalendarP.Visible = false; //TicketsP.Visible = false; //HotTicketsP.Visible = false; } if (CurrentGroup.HasEvents && CurrentGroup.NextEventSet.Count > 0) { NextEventCell.Visible = true; NextEventDataList.DataSource = CurrentGroup.NextEventSet; NextEventDataList.ItemTemplate = this.LoadTemplate("/Templates/Events/NextEventBoxLarge.ascx"); NextEventDataList.DataBind(); } else if (CurrentGroup.Brand != null && CurrentGroup.Brand.NextEventSet.Count > 0) { NextEventCell.Visible = true; NextEventDataList.DataSource = CurrentGroup.Brand.NextEventSet; NextEventDataList.ItemTemplate = this.LoadTemplate("/Templates/Events/NextEventBoxLarge.ascx"); NextEventDataList.DataBind(); } else NextEventCell.Visible = false; } }
public void CurrentComp_PreRender(object o, System.EventArgs e) { if (DateTime.Now > CurrentComp.DateTimeStart) { HtmlRenderer r = new HtmlRenderer(); r.LoadHtml(CurrentComp.SponsorDetails); PromoterDetailsPh.Controls.Clear(); PromoterDetailsPh.Controls.Add(new LiteralControl(r.Render(PromoterDetailsPh))); QuestionLabel.Text = CurrentComp.Question; if (Usr.Current != null && Usr.Current.HasEntered(CompK)) { CompEntry entry = Usr.Current.CompEntry(CompK); SelectedAnswerLabel.Text = entry.AnswerText; DateTimeCloseLabel.Text = Cambro.Misc.Utility.FriendlyDate(CurrentComp.DateTimeClose, false); EnteredPanel.Visible = true; } else EnteredPanel.Visible = false; if ((Usr.Current == null || !Usr.Current.HasEntered(CompK)) && CurrentComp.Running) { EnterLinkButton1.Text = CurrentComp.Answer1; EnterLinkButton2.Text = CurrentComp.Answer2; EnterLinkButton3.Text = CurrentComp.Answer3; DateTimeCloseLabel1.Text = Cambro.Misc.Utility.FriendlyDate(CurrentComp.DateTimeClose, false); EntryPanel.Visible = true; } else EntryPanel.Visible = false; if (!CurrentComp.Running) { CorrentAnswerLabel.Text = CurrentComp.CorrectAnswerText; FinishedPanel.Visible = true; WinnersPanel.Visible = CurrentComp.WinnersPicked; NoWinnersPanel.Visible = !CurrentComp.WinnersPicked; if (CurrentComp.WinnersPicked) { WinnersPh.Controls.Clear(); UsrSet winners = CurrentComp.UsrWinners; bool currentUsrWinner = false; for (int prize = 1; prize <= 3; prize++) { CompEntrySet ces = new CompEntrySet( new Query( new And( new Q(CompEntry.Columns.CompK, CurrentComp.K), new Q(CompEntry.Columns.Winner, true), new Q(CompEntry.Columns.Prize, prize) ) ) ); if (ces.Count > 0) { bool first = true; string prizeString = "1st prize - " + CurrentComp.Prize; if (prize == 2) prizeString = "2nd prize - " + CurrentComp.Prize2; else if (prize == 3) prizeString = "Runners up prize - " + CurrentComp.Prize3; WinnersPh.Controls.Add(new LiteralControl("<p>" + prizeString + ":</p><p>")); foreach (CompEntry ce in ces) { if (Usr.Current != null && ce.Usr.K == Usr.Current.K) currentUsrWinner = true; if (!first && (Usr.Current == null || Usr.Current.K != CurrentComp.Owner.K)) WinnersPh.Controls.Add(new LiteralControl(", ")); HtmlAnchor a = new HtmlAnchor(); a.InnerText = ce.Usr.NickName; if (Usr.Current != null && Usr.Current.K == CurrentComp.Owner.K) { if (ce.WinnerThreadK > 0) a.HRef = ce.WinnerThread.Url(); else { ce.Usr.MakeRollover(a); a.HRef = ce.Usr.Url(); } } else { ce.Usr.MakeRollover(a); a.HRef = ce.Usr.Url(); } WinnersPh.Controls.Add(a); if (Usr.Current != null && Usr.Current.K == CurrentComp.Owner.K) { WinnersPh.Controls.Add(new LiteralControl(" (" + ce.Usr.FirstName + " " + ce.Usr.LastName + ")<br>")); } first = false; } WinnersPh.Controls.Add(new LiteralControl("</p>")); } } if (currentUsrWinner) { CurrentComp.Owner.MakeRollover(OwnerAnchor); OwnerAnchor.InnerText = CurrentComp.Owner.NickName; OwnerAnchor.HRef = CurrentComp.Owner.Url(); YouAreAWinnerPanel.Visible = true; } else { YouAreAWinnerPanel.Visible = false; } } } else FinishedPanel.Visible = false; } }
private void Page_Load(object sender, System.EventArgs e) { if (CurrentPara.Type.Equals(Para.TypeEnum.Title)) { ParaDiv.Visible = false; ArticleTitle.Visible = true; ArticleTitle.InnerText = CurrentPara.Text; } else { if (CurrentPara.Type.Equals(Para.TypeEnum.Para)) { ParaDiv.Style["text-align"] = "justify"; HtmlRenderer r = new HtmlRenderer(); r.LoadHtml(CurrentPara.Text); if (DisableParagraphTagsRoundContent) r.AddPTagsWhenRenderingFormattedHtmlInContainer = false; if (RenderAllFlashTags) r.RenderAllFlashTags = true; if (RenderFlashTagsRaw) r.RenderFlashTagsRaw = true; ParaText.Controls.Clear(); ParaText.Controls.Add(new LiteralControl(r.Render(ParaText, InlineScript))); } } }
public void LoadHtml(string html) { Bobs.HtmlRenderer r = new Bobs.HtmlRenderer(); r.LoadHtml(html); Formatting = r.Formatting; if (!DisableContainer) Container = r.Container; HtmlTextBox.Text = r.GetHtmlForEditorControl(); }
private string getPreviewHtml(HtmlRenderer r, Spotted.Controls.Html.PreviewTypes previewType) { if (previewType == Spotted.Controls.Html.PreviewTypes.Competition) { return "<h1 style=\"width:295px;\"><span class=\"Inner\">Prize donated by...</span></h1><div class=\"ContentBorder\" style=\"width:295px; overflow:hidden; \">" + r.Html + "</div>"; //<p class="ArticlePara" runat="server" id="ParaP"> } else if (previewType == Spotted.Controls.Html.PreviewTypes.Article) { return "<div class=\"ContentBorder\" style=\"width:634px; overflow:hidden; margin-top:15px;\">" + r.Html + "</div>"; //<p class="ArticlePara" runat="server" id="ParaP"> } else if (previewType == Spotted.Controls.Html.PreviewTypes.Comment) { r.AddPTagsWhenRenderingFormattedHtmlInContainer = false; #region html string html = @"<div class=""CommentOuter ClearAfter""> <div class=""CommentLeft""> <a href=""" + Usr.Current.Url() + @""" " + Usr.Current.RolloverNoPic + @"><img src=""" + Usr.Current.AnyPicPath + @""" border=""0"" width=""100"" height=""100"" style=""margin-bottom:2px;margin-top:0px;"" class=""BorderBlack All Block""></a> <a href=""" + Usr.Current.Url() + @""">" + Usr.Current.NickName + @"</a> </div> <div class=""CommentBody""> " + r.Html + @" </div> </div>"; #endregion return "<h1><span class=\"Inner\">Header</span></h1><div class=\"ContentBorder\" style=\"width:634px; overflow:hidden;\">" + html + "</div>"; } else if (r.Container) return "<h1><span class=\"Inner\">Header</span></h1><div class=\"ContentBorder\" style=\"width:634px; overflow:hidden;\">" + r.Html + "</div>"; else return "<div style=\"width:634px; overflow:hidden;\">" + r.Html + "</div>"; }
public string[] GetPreviewHtml(int previewType, string rawCommentHtml, bool formatting) { HtmlRenderer r = new HtmlRenderer(); r.LoadHtml(Comment.ParseCommentHtml(rawCommentHtml, formatting, true)); return new[] { getPreviewHtml(r, (Spotted.Controls.Html.PreviewTypes)previewType), r.Script }; }
void renderRoadblock(string html) { TopPhotoHolder.Visible = false; HtmlRenderer r = new HtmlRenderer(); r.LoadHtml(html); r.Container = false; r.Formatting = false; RoadblockPh.Controls.Clear(); RoadblockPh.Controls.Add(new LiteralControl(r.Render(RoadblockPh))); }
public void Info_Load(object o, System.EventArgs e) { VenueBody.Controls.Clear(); HtmlRenderer r = new HtmlRenderer(); r.Formatting = !CurrentVenue.DetailsPlain; r.Container = !CurrentVenue.DetailsPlain; r.LoadHtml(CurrentVenue.DetailsHtml); if (r.Container) { InfoPanel.Visible = true; VenueBody.Controls.Add(new LiteralControl(r.Render(VenueBody))); } else { InfoPanel.Visible = false; VenueDetailsPlainPh.Controls.Add(new LiteralControl("<div style=\"width:634px; overflow:hidden;\">" + r.Render(VenueDetailsPlainPh) + "</div>")); } if (CurrentVenue.TotalComments > 0) DiscussionLinkCommentsLabel.Text = " - " + CurrentVenue.TotalComments.ToString("#,##0") + " comment" + (CurrentVenue.TotalComments == 1 ? "" : "s"); Latest.Parent= CurrentVenue; }
protected void Page_Load(object sender, EventArgs e) { JObject req = DecodeFacebookRequest(HttpContext.Current.Request["signed_request"]); /* { "algorithm": "HMAC-SHA256", "expires": 1312902000, "issued_at": 1312897172, "oauth_token": "217063325011494|2.AQBQXYMXowmqEDC4.3600.1312902000.0-513584417|H4gnYUMiuQm9FmttzwxZRjxhdtU", "page": { "id": "247863881900953", "liked": false, "admin": true }, "user": { "country": "gb", "locale": "en_US", "age": { "min": 21 } }, "user_id": "513584417" } */ bool liked = ((JObject)req["page"])["liked"].Value<bool>(); TestPh.Controls.Add(new LiteralControl("<p>Liked: " + liked.ToString() + "</p>")); //if (Request.Cookies["MixmagGreatestAuth"] != null && Request.Cookies["MixmagGreatestAuth"].Value != null && Request.Cookies["MixmagGreatestAuth"].Value.Length > 0)//has cookie //{ // HttpCookie cookie = Request.Cookies["MixmagGreatestAuth"]; // if (cookie.Value != "1") // { // redirectNow(); // } //} //else //{ // redirectNow(); //} { StringBuilder sbDjs = new StringBuilder(); Query q1 = new Query(); q1.OrderBy = new OrderBy(OrderBy.OrderDirection.Random); MixmagGreatestDjSet djs = new MixmagGreatestDjSet(q1); HtmlRenderer h = new HtmlRenderer(); h.RenderFlashTagsRaw = true; foreach (MixmagGreatestDj dj in djs) { string link = ""; sbDjs.Append(@" <p> <div class=""Spacer""></div> </p> <p class=""Header""> " + dj.Name.ToUpper() + @" </p> <p> <div class=""SpacerDotted""></div> </p> <div style=""height:100px; width:100px; float:left;""> " + "<a href=\"http://" + url + "/" + dj.UrlName + auth + "\"" + (newWindow ? " target=\"_blank\"" : "") + " class=\"NoStyle\">" + @"<img src=""" + dj.Image100Url + @""" width=""100"" height=""100"" /></a> </div> <div style=""min-height:100px; width:405px; padding-right:0px; padding-left:15px; float:left;""> <div class=""TextQuote""> " + dj.ShortDescription + @" </div> <div style=""margin-top:5px; text-align:right;"" class=""Text"">" + "<a href=\"http://" + url + "/" + dj.UrlName + auth + "\"" + (newWindow ? " target=\"_blank\"" : "") + ">" + @"More details, watch the video and vote</a></div> </div> <div style=""clear: both;""></div> "); //sbDjs.Append(dj.Name); //sbDjs.Append("<BR />"); //sbDjs.Append(dj.ShortDescription); //sbDjs.Append("<BR />"); } DjsPh.Controls.Add(new LiteralControl(sbDjs.ToString())); } }