Пример #1
0
		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;
			}
		}
Пример #2
0
		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;

			}
		}
Пример #3
0
		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;

			}

		}
Пример #4
0
		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)));

				}
				
			}
		}
Пример #5
0
		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)));
		}
Пример #6
0
		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;


		}