public void Page_Load(object o, EventArgs e) { if (!UsrSpotted) { uiUseAsProfilePictureButton.Attributes["onclick"] = "return confirm('Are you sure you are in this photo?');"; } this.uiDisplayMakeFrontPageOptions.Value = DisplayMakeFrontPageOptions.ToString(); this.uiUsrIsLoggedIn.Value = (Usr.Current != null).ToString(); this.uiDisableBanner.Value = (Prefs.HideBanners).ToString(); this.uiFirstTimeLoading.Value = bool.TrueString; this.uiCompetitionPanel.Style["display"] = Photo != null && Photo.CanEnterCompetition ? "" : "none"; //this.uiPhotoOfWeekUserP.Style["display"] = Photo != null && !Photo.BlockedFromPhotoOfWeekUser && Common.Settings.FrontPagePhotos == Settings.FrontPagePhotosOption.On ? "" : "none"; this.uiPhoto.Style["display"] = IsPhoto ? "" : "none"; this.uiFlashHolder.Style["display"] = IsVideo ? "" : "none"; this.uiPhotoGalleryLinkHolder.Style["display"] = GallerySelected ? "none" : ""; uiPhotoOverlay.Visible = false; uiOverlayEnabled.Value = "false"; if (Photo != null && !ContainerPage.SslPage && Vars.UrlScheme != "https" && Common.Settings.TakeoverStatus == Common.Settings.TakeoverStatusOption.On || (Usr.Current != null && Usr.Current.IsAdmin && Common.Settings.TakeoverStatus == Common.Settings.TakeoverStatusOption.Test)) { if (Common.Settings.TakeoverPhotoOverlayStatus == Settings.TakeoverPhotoOverlayStatusOption.On) { uiPhotoOverlay.Visible = true; uiPhotoOverlay.Style["width"] = Common.Settings.TakeoverPhotoOverlayWidth.ToString() + "px"; uiPhotoOverlay.Style["height"] = Common.Settings.TakeoverPhotoOverlayHeight.ToString() + "px"; uiPhotoOverlay.Style["top"] = "-" + (Common.Settings.TakeoverPhotoOverlayHeight + (Vars.IE ? 2 : 6)).ToString() + "px"; if (Photo.WebWidth < 500 && Photo.WebHeight < 500) uiPhotoOverlay.Style["left"] = (((600 - Photo.WebWidth) / 2)).ToString() + "px"; else uiPhotoOverlay.Style["right"] = (((600 - Photo.WebWidth) / 2)).ToString() + "px"; uiPhotoOverlay.InnerHtml = Common.Settings.TakeoverPhotoOverlayHtml; uiOverlayEnabled.Value = "true"; uiOverlayWidth.Value = Common.Settings.TakeoverPhotoOverlayWidth.ToString(); uiOverlayHeight.Value = Common.Settings.TakeoverPhotoOverlayHeight.ToString(); } } if (Vars.IsCompetitionActive) { Group g = new Group(Vars.CompetitionGroupK); uiCompetitionGroupLink.InnerHtml = g.Name; uiCompetitionGroupLink.HRef = g.Url(); uiAddToCompetitionGroupImg.Width = Common.Settings.CompetitionButtonWidth; uiAddToCompetitionGroupImg.Height = Common.Settings.CompetitionButtonHeight; uiAddToCompetitionGroupImg.Src = Photo != null && Photo.IsInCompetitionGroup ? Common.Settings.CompetitionButtonRemoveUrl : Common.Settings.CompetitionButtonAddUrl; uiAddToCompetitionGroupImgAddButtonUrl.Value = Common.Settings.CompetitionButtonAddUrl; uiAddToCompetitionGroupImgRemoveButtonUrl.Value = Common.Settings.CompetitionButtonRemoveUrl; } }
public void Merge_Click(object o, System.EventArgs e) { Group master = new Group(int.Parse(this.uiMasterGroupAutoComplete.Value)); Group merge = new Group(int.Parse(this.uiMergeGroupAutoComplete.Value)); if (merge.BrandK > 0) throw new DsiUserFriendlyException("can't merge a brand group."); if (master.PrivateChat || master.PrivateGroupPage || master.PrivateMemberList || merge.PrivateChat || merge.PrivateGroupPage || merge.PrivateMemberList) throw new DsiUserFriendlyException("Can't merge private groups. Make sure both groups are FULLY public before merging."); master.MergeAndDelete(merge); Cambro.Web.Helpers.WriteAlertFooter(master.Url()); }
protected void Caption_Click(object sender, EventArgs eventArgs) { #region Add a new thread in a group Bobs.Group g = new Bobs.Group(Vars.CompetitionGroupK); GroupUsr gu = g.GetGroupUsr(Usr.Current); if (gu == null || !g.IsMember(gu)) { //join the group try { g.Join(Usr.Current, gu); } catch { CaptionErrorP.Visible = true; CaptionErrorP.InnerHtml = "Sorry, you can't post a caption here. Maybe you're not a member of the <a href=\"" + g.Url() + "\">Bacardi B Live</a> group?"; return; } } string captionStart = "";// "<img src=\"http://www.dontstayin.com/gfx/caption-start.gif\" width=\"26\" height=\"20\" /><span style=\"font-size: 20px;\"> "; string captionEnd = "";// " </span><img src=\"http://www.dontstayin.com/gfx/caption-end.gif\" width=\"26\" height=\"20\" />"; string caption = Cambro.Web.Helpers.StripHtmlDoubleSpacesLineFeeds(CaptionTextBox.Text.Trim()); if (caption.Trim().Length == 0) { CaptionErrorP.Visible = true; CaptionErrorP.InnerHtml = "Please enter a caption. Remember you can't enter HTML tags in your caption."; return; }
private void Page_Load(object sender, System.EventArgs e) { if (this.Visible) { if (Personalise) Usr.KickUserIfNotLoggedIn("You must be logged in to use the My Calendar or Buddy Calendar pages."); if (BuddyDisplay) selectTab(BuddyCalendarTab); else if (Personalise) selectTab(MyCalendarTab); //else //CalendarTab.Visible=true; HotTicketsIntroPanel.Visible = HotTickets; NotHotTicketsIntroPanel.Visible = !HotTickets; if (Personalise && !BuddyDisplay) { if (Usr.Current.MusicTypesFavouriteCount == 0) Response.Redirect("/pages/mymusic"); if (Usr.Current.PlacesVisitCount == 0) Response.Redirect("/pages/placesivisit"); } MusicTypeDropDownPanel.Visible = !Personalise && !(eventsForDisplay.FilterByVenue || eventsForDisplay.FilterByBrand || eventsForDisplay.FilterByGroup); MusicFilterLabel1.Visible = MusicTypeDropDownPanel.Visible; MusicFilterLabel2.Visible = MusicTypeDropDownPanel.Visible; if (eventsForDisplay.FilterByVenue || eventsForDisplay.FilterByBrand || eventsForDisplay.FilterByGroup) eventsForDisplay.IgnoreMusicType = true; #region //Set up intro panel if (HotTickets) { TopIcon.Src = "/gfx/icon-hottickets.png"; EventFinderTab.InnerText = "Hot tickets"; HotTicketsIntroPanelWorldwideP.Visible = eventsForDisplay.FilterWorldwide; HotTicketsIntroPanelBrandP.Visible = eventsForDisplay.FilterByBrand; HotTicketsIntroPanelNonBrandP.Visible = eventsForDisplay.FilterByVenue || eventsForDisplay.FilterByPlace || eventsForDisplay.FilterByCountry || eventsForDisplay.FilterByGroup; if (eventsForDisplay.FilterWorldwide) { HotTicketsIntroPanelWorldwideHomeCountryLink.InnerText = HotTicketsIntroPanelWorldwideHomeCountryLink.InnerText.Replace("???", Country.Current.FriendlyName); HotTicketsIntroPanelWorldwideHomeCountryLink.HRef = Country.Current.UrlApp("hottickets"); } } else { AllEventsIntroPanel.Visible = eventsForDisplay.FilterWorldwide; ObjectCalendarIntroPanel.Visible = eventsForDisplay.FilterByVenue || eventsForDisplay.FilterByPlace || eventsForDisplay.FilterByCountry || eventsForDisplay.FilterByBrand || eventsForDisplay.FilterByGroup; MyCalendarIntroPanel.Visible = Personalise && !Tickets && !BuddyDisplay; BuddyCalendarIntroPanel.Visible = BuddyDisplay; TicketsCalendarIntroPanel.Visible = Personalise && Tickets; if (Tickets) TopIcon.Src = "/gfx/icon-tickets.png"; else if (FreeGuestlist) TopIcon.Src = "/gfx/icon-freeguestlist.png"; if (Tickets) EventFinderTab.InnerText = "Tickets"; else if (FreeGuestlist) EventFinderTab.InnerText = "Free Guestlist"; if (Tickets) { AllEventsIntroPanelEventsLabel1.Text = "events with tickets available"; AllEventsIntroPanelEventsLabel2.Text = "events with tickets available"; AllEventsIntroPanelEventsLabel3.Text = "events with tickets available"; } else if (FreeGuestlist) { AllEventsIntroPanelEventsLabel1.Text = "Free Guestlist events"; AllEventsIntroPanelEventsLabel2.Text = "Free Guestlist events"; AllEventsIntroPanelEventsLabel3.Text = "Free Guestlist events"; } else { AllEventsIntroPanelEventsLabel1.Text = "events"; AllEventsIntroPanelEventsLabel2.Text = "events"; AllEventsIntroPanelEventsLabel3.Text = "events"; } AllEventsIntroPanelHomeCountryLink.InnerText = AllEventsIntroPanelHomeCountryLink.InnerText.Replace("???", Country.Current.FriendlyName); if (DateTime.Now.Month == Month && DateTime.Now.Year == Year && Day == 0) AllEventsIntroPanelHomeCountryLink.HRef = Country.Current.UrlCalendar(Tickets, FreeGuestlist); else AllEventsIntroPanelHomeCountryLink.HRef = Country.Current.UrlCalendarDay(Tickets, FreeGuestlist, Year, Month, Day); } #endregion string dateFilterString = ""; if (HotTickets) { MonthViewPanel.Visible = false; DayViewPanel.Visible = false; HotTicketsEventListPanel.Visible = true; EventSet es = eventsForDisplay.GetTopHotTicketEvents(); HotTicketsEventListNoEventsP.Visible = es.Count == 0; HotTicketsEventListEventsDiv.Visible = es.Count > 0; if (es.Count > 0) { HotTicketsEventList.DataSource = es; HotTicketsEventList.ItemTemplate = this.LoadTemplate("/Templates/Events/EventList0.ascx"); HotTicketsEventList.DataBind(); } } else if (Day == 0) { MonthViewPanel.Visible = true; DayViewPanel.Visible = false; HotTicketsEventListPanel.Visible = false; #region firstCellDate, lastCellDate DateTime firstOfMonth = new DateTime(Year, Month, 1); DateTime firstCellDate = firstOfMonth.Previous(DayOfWeek.Monday, true); DateTime lastOfMonth = firstOfMonth.AddDays(DateTime.DaysInMonth(Year, Month) - 1); DateTime lastCellDate = lastOfMonth.Next(DayOfWeek.Sunday, true); #endregion dateFilterString = firstOfMonth.ToString("MMMM yyyy"); #region get event set EventSet es = eventsForDisplay.GetEventsBetweenDates(firstCellDate, lastCellDate); #endregion #region bind to calendar CustomControls.DsiCalendar uiCal = this.BuddyDisplay ? new CustomControls.BuddyCalendar() : new CustomControls.DsiCalendar(); uiCalPlaceHolder.Controls.Add(uiCal); uiCal.ShowCountryFriendlyName = !(eventsForDisplay.FilterByCountry || eventsForDisplay.FilterByPlace || eventsForDisplay.FilterByVenue); uiCal.ShowPlace = !(eventsForDisplay.FilterByPlace || eventsForDisplay.FilterByVenue); uiCal.ShowVenue = !eventsForDisplay.FilterByVenue; uiCal.Tickets = Tickets; uiCal.Month = Month; uiCal.AllEvents = es; uiCal.StartDate = firstCellDate; uiCal.EndDate = lastCellDate; #endregion #region set up next / prev month links string nextMonthUrl = ChangeMonthUrl(lastOfMonth.AddDays(1).Month, lastOfMonth.AddDays(1).Year); string prevMonthUrl = ChangeMonthUrl(firstOfMonth.AddDays(-1).Month, firstOfMonth.AddDays(-1).Year); #region set up links uiCal.NextMonthUrl = nextMonthUrl; uiCal.PrevMonthUrl = prevMonthUrl; MonthNameLabel.Text = firstOfMonth.ToString("MMMM") + " " + Year.ToString(); MonthNameLabel1.Text = firstOfMonth.ToString("MMMM") + " " + Year.ToString(); BackLink.InnerHtml = "< " + firstOfMonth.AddDays(-1).ToString("MMMM"); BackLink1.InnerHtml = "< " + firstOfMonth.AddDays(-1).ToString("MMMM"); BackLink.HRef = prevMonthUrl; BackLink1.HRef = prevMonthUrl; NextLink.InnerHtml = lastOfMonth.AddDays(1).ToString("MMMM") + " >"; NextLink1.InnerHtml = lastOfMonth.AddDays(1).ToString("MMMM") + " >"; NextLink.HRef = nextMonthUrl; NextLink1.HRef = nextMonthUrl; #endregion if (uiCal.AllEvents.Count == 0) { Event latestPastEvent = eventsForDisplay.GetLatestPastEvent(firstOfMonth); if (latestPastEvent == null) { #region disable the back link if we have no past events BackLink.HRef = ""; BackLink1.HRef = ""; BackLink.Disabled = true; BackLink1.Disabled = true; #endregion } else { #region set up the back link with the month of the latest past event BackLink.HRef = ChangeMonthUrl(latestPastEvent.DateTime.Month, latestPastEvent.DateTime.Year); BackLink1.HRef = ChangeMonthUrl(latestPastEvent.DateTime.Month, latestPastEvent.DateTime.Year); BackLink.InnerHtml = "< " + latestPastEvent.DateTime.ToString("MMMM"); BackLink1.InnerHtml = "< " + latestPastEvent.DateTime.ToString("MMMM"); if (latestPastEvent.DateTime.Year != Year) { BackLink.InnerHtml = "< " + latestPastEvent.DateTime.ToString("MMMM") + " " + latestPastEvent.DateTime.Year.ToString(); BackLink1.InnerHtml = "< " + latestPastEvent.DateTime.ToString("MMMM") + " " + latestPastEvent.DateTime.Year.ToString(); } #endregion } Event nextFutureEvent = eventsForDisplay.GetNextFutureEvent(lastOfMonth); if (nextFutureEvent == null) { #region disable the forward link if we have no future events NextLink.HRef = ""; NextLink1.HRef = ""; NextLink.Disabled = true; NextLink1.Disabled = true; #endregion } else { #region set up the back link with the month of the first future event NextLink.HRef = ChangeMonthUrl(nextFutureEvent.DateTime.Month, nextFutureEvent.DateTime.Year); NextLink1.HRef = ChangeMonthUrl(nextFutureEvent.DateTime.Month, nextFutureEvent.DateTime.Year); NextLink.InnerHtml = nextFutureEvent.DateTime.ToString("MMMM") + " >"; NextLink1.InnerHtml = nextFutureEvent.DateTime.ToString("MMMM") + " >"; if (nextFutureEvent.DateTime.Year != Year) { NextLink.InnerHtml = nextFutureEvent.DateTime.ToString("MMMM") + " " + nextFutureEvent.DateTime.Year.ToString() + " >"; NextLink1.InnerHtml = nextFutureEvent.DateTime.ToString("MMMM") + " " + nextFutureEvent.DateTime.Year.ToString() + " >"; } #endregion } #region ensure links are fully disabled if (BackLink.Disabled) BackLink.Attributes["class"] = "DisabledAnchor"; if (BackLink1.Disabled) BackLink1.Attributes["class"] = "DisabledAnchor"; if (NextLink.Disabled) NextLink.Attributes["class"] = "DisabledAnchor"; if (NextLink1.Disabled) NextLink1.Attributes["class"] = "DisabledAnchor"; #endregion } #endregion } else { MonthViewPanel.Visible = false; DayViewPanel.Visible = true; HotTicketsEventListPanel.Visible = false; DateTime day = new DateTime(Year, Month, Day); dateFilterString = day.ToString("dddd dd MMMM yyyy"); #region get event set EventSet es = eventsForDisplay.GetEventsForDay(day); #endregion DayViewNoEventsP.Visible = es.Count == 0; DayViewEventsDiv.Visible = es.Count > 0; if (es.Count > 0) { DayViewDataList.DataSource = es; if (es.Count < 20) DayViewDataList.ItemTemplate = this.LoadTemplate("/Templates/Events/EventList0.ascx"); else if (es.Count < 50) DayViewDataList.ItemTemplate = this.LoadTemplate("/Templates/Events/EventList1.ascx"); else DayViewDataList.ItemTemplate = this.LoadTemplate("/Templates/Events/EventList2.ascx"); //DayViewDataList.ItemTemplate = this.LoadTemplate("/Templates/Events/EventList2.ascx"); DayViewDataList.DataBind(); } #region set up next / prev day links DayMonthLink.InnerText = "Show calendar for " + day.ToString("MMMM yyyy"); DayMonthLink1.InnerText = "Show calendar for " + day.ToString("MMMM yyyy"); DayMonthLink.HRef = ChangeMonthUrl(day.Month, day.Year); DayMonthLink1.HRef = ChangeMonthUrl(day.Month, day.Year); string nextDayUrl = ChangeDayUrl(day.AddDays(1).Month, day.AddDays(1).Year, day.AddDays(1).Day); string prevDayUrl = ChangeDayUrl(day.AddDays(-1).Month, day.AddDays(-1).Year, day.AddDays(-1).Day); #region set up links DayNameLabel.Text = dateFilterString; DayNameLabel1.Text = dateFilterString; DayBackLink.InnerHtml = "< " + day.AddDays(-1).ToString("dddd dd"); DayBackLink1.InnerHtml = "< " + day.AddDays(-1).ToString("dddd dd"); DayBackLink.HRef = prevDayUrl; DayBackLink1.HRef = prevDayUrl; DayNextLink.InnerHtml = day.AddDays(1).ToString("dddd dd") + " >"; DayNextLink1.InnerHtml = day.AddDays(1).ToString("dddd dd") + " >"; DayNextLink.HRef = nextDayUrl; DayNextLink1.HRef = nextDayUrl; #endregion if (es.Count == 0) { Event latestPastEvent = eventsForDisplay.GetLatestPastEvent(day); if (latestPastEvent == null) { #region disable the back link if we have no past events DayBackLink.HRef = ""; DayBackLink1.HRef = ""; DayBackLink.Disabled = true; DayBackLink1.Disabled = true; #endregion } else { #region set up the back link with the month of the latest past event DayBackLink.HRef = ChangeDayUrl(latestPastEvent.DateTime.Month, latestPastEvent.DateTime.Year, latestPastEvent.DateTime.Day); DayBackLink1.HRef = ChangeDayUrl(latestPastEvent.DateTime.Month, latestPastEvent.DateTime.Year, latestPastEvent.DateTime.Day); if (latestPastEvent.DateTime.Year != Year) { DayBackLink.InnerHtml = "< " + latestPastEvent.DateTime.ToString("dddd dd MMMM yyyy"); DayBackLink1.InnerHtml = "< " + latestPastEvent.DateTime.ToString("dddd dd MMMM yyyy"); } else if (latestPastEvent.DateTime.Month != Month) { DayBackLink.InnerHtml = "< " + latestPastEvent.DateTime.ToString("dddd dd MMMM"); DayBackLink1.InnerHtml = "< " + latestPastEvent.DateTime.ToString("dddd dd MMMM"); } else { DayBackLink.InnerHtml = "< " + latestPastEvent.DateTime.ToString("dddd dd"); DayBackLink1.InnerHtml = "< " + latestPastEvent.DateTime.ToString("dddd dd"); } #endregion } Event nextFutureEvent = eventsForDisplay.GetNextFutureEvent(day); if (nextFutureEvent == null) { #region disable the forward link if we have no future events DayNextLink.HRef = ""; DayNextLink1.HRef = ""; DayNextLink.Disabled = true; DayNextLink1.Disabled = true; #endregion } else { #region set up the back link with the month of the first future event DayNextLink.HRef = ChangeDayUrl(nextFutureEvent.DateTime.Month, nextFutureEvent.DateTime.Year, nextFutureEvent.DateTime.Day); DayNextLink1.HRef = ChangeDayUrl(nextFutureEvent.DateTime.Month, nextFutureEvent.DateTime.Year, nextFutureEvent.DateTime.Day); if (nextFutureEvent.DateTime.Year != Year) { DayNextLink.InnerHtml = nextFutureEvent.DateTime.ToString("dddd dd MMMM yyyy") + " >"; DayNextLink1.InnerHtml = nextFutureEvent.DateTime.ToString("dddd dd MMMM yyyy") + " >"; } if (nextFutureEvent.DateTime.Month != Month) { DayNextLink.InnerHtml = nextFutureEvent.DateTime.ToString("dddd dd MMMM") + " >"; DayNextLink1.InnerHtml = nextFutureEvent.DateTime.ToString("dddd dd MMMM") + " >"; } else { DayNextLink.InnerHtml = nextFutureEvent.DateTime.ToString("dddd dd") + " >"; DayNextLink1.InnerHtml = nextFutureEvent.DateTime.ToString("dddd dd") + " >"; } #endregion } #region ensure links are fully disabled if (DayBackLink.Disabled) DayBackLink.Attributes["class"] = "DisabledAnchor"; if (DayBackLink1.Disabled) DayBackLink1.Attributes["class"] = "DisabledAnchor"; if (DayNextLink.Disabled) DayNextLink.Attributes["class"] = "DisabledAnchor"; if (DayNextLink1.Disabled) DayNextLink1.Attributes["class"] = "DisabledAnchor"; #endregion } #endregion } #region Set up intro text and page title if (HotTickets) { if (eventsForDisplay.FilterByBrand) { Brand b = new Brand(BrandK); HotTicketsIntroPanelBrandLink.HRef = b.Url(); HotTicketsIntroPanelBrandLink.InnerText = b.Name; ((Spotted.Master.DsiPage)this.Page).SetPageTitle("Hot tickets for " + b.FriendlyName + " events", b.FriendlyName); HotTicketsIntroPanelTicketsCalendarLink.HRef = b.UrlCalendar(true, false); } else if (eventsForDisplay.FilterByGroup) { Group g = new Group(GroupK); HotTicketsIntroPanelNonBrandInAtLabel.Text = "recommended by"; HotTicketsIntroPanelNonBrandObjectLink.HRef = g.Url(); HotTicketsIntroPanelNonBrandObjectLink.InnerText = g.FriendlyName; ((Spotted.Master.DsiPage)this.Page).SetPageTitle("Hot tickets recommended by " + g.FriendlyName, g.FriendlyName); HotTicketsIntroPanelTicketsCalendarLink.HRef = g.UrlCalendar(true, false); } else if (eventsForDisplay.FilterByVenue) { HotTicketsIntroPanelNonBrandInAtLabel.Text = "at"; Venue v = new Venue(VenueK); HotTicketsIntroPanelNonBrandObjectLink.InnerText = v.FriendlyName; HotTicketsIntroPanelNonBrandObjectLink.HRef = v.Url(); ((Spotted.Master.DsiPage)this.Page).SetPageTitle("Hot tickets for events at " + v.FriendlyName, v.Name); HotTicketsIntroPanelTicketsCalendarLink.HRef = v.UrlCalendar(true, false); } else if (eventsForDisplay.FilterByPlace) { HotTicketsIntroPanelNonBrandInAtLabel.Text = "in"; Place p = new Place(PlaceK); HotTicketsIntroPanelNonBrandObjectLink.InnerText = p.FriendlyName; HotTicketsIntroPanelNonBrandObjectLink.HRef = p.Url(); ((Spotted.Master.DsiPage)this.Page).SetPageTitle("Hot tickets for events in " + p.FriendlyName, p.Name); HotTicketsIntroPanelTicketsCalendarLink.HRef = p.UrlCalendar(true, false); } else if (eventsForDisplay.FilterByCountry) { HotTicketsIntroPanelNonBrandInAtLabel.Text = "in"; HotTicketsIntroPanelNonBrandObjectLink.InnerText = FilterCountry.FriendlyName; HotTicketsIntroPanelNonBrandObjectLink.HRef = FilterCountry.Url(); ((Spotted.Master.DsiPage)this.Page).SetPageTitle("Hot tickets for events in " + FilterCountry.FriendlyName, FilterCountry.Name); HotTicketsIntroPanelTicketsCalendarLink.HRef = FilterCountry.UrlCalendar(true, false); } else if (eventsForDisplay.FilterWorldwide) { ((Spotted.Master.DsiPage)this.Page).SetPageTitle("Hot tickets worldwide"); HotTicketsIntroPanelTicketsCalendarLink.HRef = Calendar.UrlCalendar(true, false); } } else { ObjectCalendarIntroBrand.Visible = eventsForDisplay.FilterByBrand; ObjectCalendarIntroNonBrand.Visible = !eventsForDisplay.FilterByBrand; if (eventsForDisplay.FilterByBrand) { Brand b = new Brand(BrandK); ObjectCalendarIntroBrandAnchor.HRef = b.Url(); ObjectCalendarIntroBrandAnchor.InnerText = b.Name; ((Spotted.Master.DsiPage)this.Page).SetPageTitle(b.FriendlyName + (FreeGuestlist ? " Free Guestlist" : "") + " calendar for " + dateFilterString, b.FriendlyName); } else if (eventsForDisplay.FilterByGroup) { Group g = new Group(GroupK); ObjectCalendarIntroInAtLabel.Text = "recommended by"; ObjectCalendarIntroObjectLink.HRef = g.Url(); ObjectCalendarIntroObjectLink.InnerText = g.FriendlyName; ((Spotted.Master.DsiPage)this.Page).SetPageTitle(g.FriendlyName + (FreeGuestlist ? " Free Guestlist" : "") + " calendar for " + dateFilterString, g.FriendlyName); } else if (eventsForDisplay.FilterByVenue) { ObjectCalendarIntroInAtLabel.Text = "at"; Venue v = new Venue(VenueK); ObjectCalendarIntroObjectLink.InnerText = v.FriendlyName; ObjectCalendarIntroObjectLink.HRef = v.Url(); ((Spotted.Master.DsiPage)this.Page).SetPageTitle(v.FriendlyName + (FreeGuestlist ? " Free Guestlist" : "") + " events calendar for " + dateFilterString, v.Name); } else if (eventsForDisplay.FilterByPlace) { ObjectCalendarIntroInAtLabel.Text = "in"; Place p = new Place(PlaceK); ObjectCalendarIntroObjectLink.InnerText = p.FriendlyName; ObjectCalendarIntroObjectLink.HRef = p.Url(); ((Spotted.Master.DsiPage)this.Page).SetPageTitle(p.FriendlyName + (FreeGuestlist ? " Free Guestlist" : "") + " events calendar for " + dateFilterString, p.Name); } else if (eventsForDisplay.FilterByCountry) { ObjectCalendarIntroInAtLabel.Text = "in"; ObjectCalendarIntroObjectLink.InnerText = FilterCountry.FriendlyName; ObjectCalendarIntroObjectLink.HRef = FilterCountry.Url(); ((Spotted.Master.DsiPage)this.Page).SetPageTitle((FreeGuestlist ? "Free Guestlist calendar" : " Calendar") + " for " + FilterCountry.FriendlyName + ", " + dateFilterString, FilterCountry.Name); } else if (eventsForDisplay.FilterWorldwide) { ((Spotted.Master.DsiPage)this.Page).SetPageTitle((FreeGuestlist ? "Free Guestlist calendar" : " Calendar") + " for " + dateFilterString); } if (Personalise && !BuddyDisplay) ((Spotted.Master.DsiPage)this.Page).SetPageTitle("My calendar"); else if (BuddyDisplay) ((Spotted.Master.DsiPage)this.Page).SetPageTitle("Buddy calendar"); } #endregion } }
public bool SendWelcomeEmail(Usr invitingUsr, Group invitingGroup, string inviteMessage) { if (this.EmailHold) return false; Mailer sm = new Mailer(); sm.UsrRecipient = this; if (invitingGroup == null) { if (invitingUsr == null) { sm.Subject = "We've created you a Don't Stay In account!"; sm.Body = @" <p> Don't Stay In is <i>the</i> place to plan your clubbing calendar. Our team of spotters are busy taking photos of clubbers at the hottest parties in your area and throughout the world. </p> <p> If you've had your photo taken, you can look through our galleries to find it. You can chat live with other clubbers and catch up with the latest gossip. </p> <p align=""center"" style=""margin:10px 0px 8px 0px;""> <a href=""[LOGIN]"" style=""font-size:18px;font-weight:bold;"">Click here to go to DontStayIn</a> </p> "; } else { sm.Subject = invitingUsr.NickName + " has invited you to DontStayIn!"; sm.Body = "<p><b>" + invitingUsr.NickName + @" has invited you to DontStayIn!</b></p> <p> DontStayIn is <i>the</i> place to plan your clubbing calendar. Our team of spotters are busy taking photos of clubbers at the hottest parties in your area and throughout the world. </p> <p> If you've had your photo taken, you can look through our galleries to find it. You can chat live with other clubbers and catch up with the latest gossip. </p> <p align=""center"" style=""margin:10px 0px 8px 0px;""> <a href=""[LOGIN]"" style=""font-size:18px;font-weight:bold;"">Click here to go to DontStayIn</a> </p> "; } } else { GroupUsr invitingGroupUsr = invitingGroup.GetGroupUsr(invitingUsr); sm.RedirectUrl = invitingGroup.Url(); sm.Subject = invitingUsr.NickName + @" has invited you to " + (invitingGroupUsr != null && invitingGroupUsr.Moderator ? invitingUsr.HisString(false) : "a") + @" DontStayIn group: " + invitingGroup.FriendlyName; string pic = @"<table cellspacing=""0"" cellpadding=""0"" border=""0"" style=""margin:10px 5px 5px 1px;""><tr><td valign=""top"">"; string picEnd = "</td></tr></table>"; if (invitingUsr.HasPic) { pic = @"<table cellspacing=""0"" cellpadding=""0"" border=""0"" style=""margin:10px 5px 5px 1px;""><tr><td valign=""top"" style=""padding:0px 10px 0px 0px;"">"; pic += "<a href=\"[LOGIN]\"><img src=\"" + invitingUsr.PicPath + "\" class=\"BorderBlack All\" width=\"100\" height=\"100\" vspace=\"3\" border=\"0\"></a></td><td valign=\"top\">"; picEnd = "</td></tr></table>"; } string members = ""; if (invitingGroup.TotalMembers > 5) { Query q = new Query(); q.TableElement = Usr.GroupJoin; q.QueryCondition = new And(new Q(Group.Columns.K, invitingGroup.K), new Q(Usr.Columns.Pic, QueryOperator.NotEqualTo, Guid.Empty)); q.TopRecords = 5; q.OrderBy = new OrderBy(OrderBy.OrderDirection.Random); q.Columns = Usr.LinkColumns; UsrSet us = new UsrSet(q); if (us.Count == 5) { members = @"<p><b>" + invitingGroup.FriendlyName + @"</b> has " + invitingGroup.TotalMembers.ToString("#,##0") + @" members. Here's a few of them:</p>"; members += @"<table cellspacing=""4"" cellpadding=""4"" border=""0"" width=""100%""><tr>"; foreach (Usr uPic in us) { members += "<td width=\"20%\" valign=\"top\"><center><a href=\"[LOGIN(" + uPic.Url() + ")]\"><img src=\"" + uPic.PicPath + "\" width=\"75\" height=\"75\" style=\"margin:0px 0px 5px 0px;\" class=\"BorderBlack All\"><br>" + Cambro.Misc.Utility.Snip(uPic.NickName, 12) + "</a></center></td>"; } members += @"</tr></table>"; } } sm.Body = @" " + pic + @" <i style=""font-size:18px;""><b>""</b>" + Cambro.Web.Helpers.Strip(inviteMessage, true, true, false, true).Replace("\n", "<br>") + @"<b>""</b></i> " + picEnd + @" <p>" + invitingUsr.LinkEmail() + @" (" + invitingUsr.FirstName + @") has invited you to " + (invitingGroupUsr != null && invitingGroupUsr.Moderator ? invitingUsr.HisString(false) : "a") + @" DontStayIn group! You can use this to keep in contact with your friends. Here's a quick description of <b>" + invitingGroup.FriendlyName + @"</b>:</p> <p> <i>" + invitingGroup.Description + @"</i> </p> " + members + @" "; } sm.Send(); return true; }
public void AddToPromotersGroup(GroupUsr gu, Group g) { if (gu == null || !(gu.Status.Equals(GroupUsr.StatusEnum.Member) || gu.Status.Equals(GroupUsr.StatusEnum.Exited) || gu.Status.Equals(GroupUsr.StatusEnum.Barred))) { GroupUsr gu1 = g.ChangeUsr(false, this.K, false, false, false, false, Bobs.GroupUsr.StatusEnum.Member, DateTime.Now, false); gu1.Favourite = true; gu1.Update(); CommentAlert.Enable(this, g.K, Model.Entities.ObjectType.Group); Mailer m = new Mailer(); m.UsrRecipient = this; m.Subject = "We've added you to the private promoters group"; m.RedirectUrl = g.Url(); m.Body = @" <p> Congratulations on activating your promoter account. We've now given you access to the private promoter group, where you can chat with event organisers from all around the world. </p> <p> What we are trying to do with this forum is allow people a space to ask questions, seek advice and share knowledge about promoting events across the world. </p> <p> <b>Please do:</b> </p> <p> * Ask questions <br> * Give answers <br> </p> <p> <b>Please do not: </b> </p> <p> * Spam this forum with promotional messages <br> * Post about your upcoming events, <b>this includes 'industry invites'</b> </p> <p> If you break these rules you will be removed from the group without warning. </p> "; m.Send(); } }
protected void Caption_Click(object sender, EventArgs eventArgs) { #region Add a new thread in a group Bobs.Group g = new Bobs.Group(Vars.CompetitionGroupK); GroupUsr gu = g.GetGroupUsr(Usr.Current); if (gu == null || !g.IsMember(gu)) { //join the group try { g.Join(Usr.Current, gu); } catch { CaptionErrorP.Visible = true; CaptionErrorP.InnerHtml = "Sorry, you can't post a caption here. Maybe you're not a member of the <a href=\"" + g.Url() + "\">Bacardi B Live</a> group?"; return; } } string captionStart = "";// "<img src=\"http://www.dontstayin.com/gfx/caption-start.gif\" width=\"26\" height=\"20\" /><span style=\"font-size: 20px;\"> "; string captionEnd = "";// " </span><img src=\"http://www.dontstayin.com/gfx/caption-end.gif\" width=\"26\" height=\"20\" />"; string caption = Cambro.Web.Helpers.StripHtmlDoubleSpacesLineFeeds(CaptionTextBox.Text.Trim()); if (caption.Trim().Length == 0) { CaptionErrorP.Visible = true; CaptionErrorP.InnerHtml = "Please enter a caption. Remember you can't enter HTML tags in your caption."; return; } if (caption.StartsWith("\"") || caption.StartsWith("“")) caption = captionStart + caption.Substring(1); else caption = captionStart + caption; if (caption.EndsWith("\"") || caption.EndsWith("”")) caption = caption.Substring(0, caption.Length - 1) + captionEnd; else caption = caption + captionEnd; //add comment to current thread Comment.Maker m = CurrentThread.GetCommentMaker(); m.PostingUsr = Usr.Current; m.Body = caption; m.DuplicateGuid = this.ViewState["CaptionDuplicateGuid"]; if (CurrentThread.GroupK > 0) m.CurrentGroupUsr = CurrentThread.Group.GetGroupUsr(Usr.Current); m.CurrentThreadUsr = CurrentThreadUsr; Comment.MakerReturn r = m.Post(null); if (r.Success || r.Duplicate) { if (!r.Duplicate) Log.Increment(Log.Items.CaptionsAdded); Response.Redirect(r.Comment.Url()); } else { CaptionErrorP.Visible = true; CaptionErrorP.InnerText = "Sorry, you can't post a caption here. Maybe you've been banned from the Bacardi B Live group?"; return; } #endregion }
public UrlInfo(string path, HttpBrowserCapabilities browser, bool disableRedirects, bool isMixmagVote, bool isMixmagGreatest) { this.IsMobile = browser.IsMobileDevice; this.ScreenWidth = browser.ScreenPixelsWidth; this.ScreenHeight = browser.ScreenPixelsHeight; this.DisableAllActions = disableRedirects; this.IsMixmagVote = isMixmagVote; this.IsMixmagGreatest = isMixmagGreatest; if (Usr.Current != null && Usr.Current.Banned) { PageType = PageTypes.Blank; PageName = "Banned"; return; } innerHash = new Hashtable(); innerIndex = new Hashtable(); #region strip / from start and end of path if (path.StartsWith("/")) path = path.Substring(1); if (path.EndsWith("/")) path = path.Substring(0, path.Length - 1); #endregion string[] urlParts = path.Split('/'); #region If there's a dot in the last part, handle this file with the default HttpHandler if (urlParts[urlParts.Length - 1].Contains(".")) { if (urlParts[urlParts.Length - 1].EndsWith(".rss")) { IsRss = true; urlParts[urlParts.Length - 1] = urlParts[urlParts.Length - 1].Substring(0, urlParts[urlParts.Length - 1].IndexOf(".")); } else { OverrideHttpHandler = true; return; } } #endregion #region custom redirects if (!DisableAllActions) { if (urlParts.Length == 1 && urlParts[0] == "facebook") { Log.Increment(Log.Items.FacebookUrlShortcut); HttpContext.Current.Response.Redirect("http://www.facebook.com/pages/dontstayincom/95813938222"); } if (urlParts.Length == 1 && urlParts[0] == "twitter") { Log.Increment(Log.Items.TwitterUrlShortcut); HttpContext.Current.Response.Redirect("http://twitter.com/dontstayin_com"); } if (urlParts.Length == 1 && urlParts[0] == "comps") { Log.Increment(Log.Items.CompsUrlShortcut); string[] par = { }; HttpContext.Current.Response.Redirect(Vars.GetArchiveUrl(DateTime.Today.Year, DateTime.Today.Month, 0, Model.Entities.ArchiveObjectType.Comp, par, null)); } if (urlParts.Length == 1 && urlParts[0] == "ibizarocks") { Log.Increment(Log.Items.IbizaRocksUrlShortcut); try { Group ibizaRocksGroup = new Group(10992); HttpContext.Current.Response.Redirect(ibizaRocksGroup.Url()); } catch { } } if (urlParts.Length == 1 && urlParts[0] == "schmucks") { Log.Increment(Log.Items.SchmucksUrlShortcut); try { Group schmucksGroup = new Group(36543); HttpContext.Current.Response.Redirect(schmucksGroup.Url()); } catch { } } if (urlParts.Length == 1 && urlParts[0] == "tickets") { try { Banner b = new Banner(12965); b.RegisterClick(); HttpContext.Current.Response.Redirect(b.LinkTargetUrl); } catch { } } if (urlParts.Length == 1 && urlParts[0] == "free") { try { Banner b = new Banner(13287); b.RegisterClick(); HttpContext.Current.Response.Redirect(b.LinkTargetUrl); } catch { } } if (urlParts.Length == 1 && urlParts[0] == "mixmag") { try { Banner b = new Banner(12966); b.RegisterClick(); HttpContext.Current.Response.Redirect(b.LinkTargetUrl); } catch { } } if (urlParts.Length == 1 && urlParts[0] == "tick-em-off") { try { Group g = new Group(33961); HttpContext.Current.Response.Redirect(g.Url()); } catch { } } if (urlParts.Length == 1 && urlParts[0] == "cream-tickets") { try { Banner b = new Banner(13150); b.RegisterClick(); HttpContext.Current.Response.Redirect(b.LinkTargetUrl); } catch { } } if (urlParts.Length == 1 && urlParts[0] == "ibizaholiday") { try { Banner b = new Banner(13902); b.RegisterClick(); HttpContext.Current.Response.Redirect(b.LinkTargetUrl); } catch { } } //13921 north if (urlParts.Length == 1 && urlParts[0] == "mixmagfreenorth") { try { Banner b = new Banner(13921); b.RegisterClick(); HttpContext.Current.Response.Redirect(b.LinkTargetUrl); } catch { } } //13922 south if (urlParts.Length == 1 && urlParts[0] == "mixmagfreesouth") { try { Banner b = new Banner(13922); b.RegisterClick(); HttpContext.Current.Response.Redirect(b.LinkTargetUrl); } catch { } } } #endregion IsAjaxRequest = (HttpContext.Current.Request.Headers["x-microsoftajax"] != null); int currentIndex = 0; if (IsMixmagVote) { if (urlParts.Length > 0 && urlParts[0].Length > 0) { PageType = PageTypes.MixmagVote; if (urlParts[currentIndex].IsNumeric()) { PageName = "Vote"; ProcessParamParts(urlParts, currentIndex); } else { PageName = urlParts[currentIndex]; ProcessParamParts(urlParts, currentIndex + 1); } } else { PageType = PageTypes.MixmagVote; PageName = "Home"; } } else if (IsMixmagGreatest) { if (urlParts.Length > 0 && urlParts[0].Length > 0) { bool fbPage = false; PageType = PageTypes.MixmagGreatest; string name = urlParts[currentIndex]; if (name == "fb") { fbPage = true; currentIndex++; name = urlParts[currentIndex]; } MixmagGreatestDjSet djs = new MixmagGreatestDjSet(new Query(new Q(MixmagGreatestDj.Columns.UrlName, name))); if (djs.Count > 0) { MixmagGreatestDjK = djs[0].K; PageName = fbPage ? "Fb" : "Home"; ProcessParamParts(urlParts, currentIndex); } else { PageName = urlParts[currentIndex]; ProcessParamParts(urlParts, currentIndex + 1); } } else { PageType = PageTypes.MixmagGreatest; PageName = "Home"; } } else if (Vars.DevEnv && ((IsMobile && Prefs.Current["ForceMobile"] != "full") || Prefs.Current["ForceMobile"] == "mobile")) { PageType = PageTypes.Mobile; PageName = "Home"; } else { if (ProcessLoginPart(ref currentIndex, urlParts)) return; if (ProcessCustomPage(currentIndex, urlParts)) return; bool searchMore = true; int count = 0; while (currentIndex < urlParts.Length && searchMore && count < 50) { count++; UrlPartTypes thisType = ProcessFilterPart(ref currentIndex, urlParts); if (thisType.Equals(UrlPartTypes.Application)) searchMore = false; } ProcessParamParts(urlParts, currentIndex); if (PageName == null || PageName.Length == 0) { PageType = PageTypes.Pages; PageName = "Home"; } } }
public static void CreateJoinGroup(Usr u, Group g) { Query q = new Query(); q.QueryCondition = new And( new Q(FacebookPost.Columns.DateTime, QueryOperator.GreaterThan, System.DateTime.Now.AddDays(-1)), new Q(FacebookPost.Columns.FacebookUid, u.Facebook.Uid), new Q(FacebookPost.Columns.Type, TypeEnum.JoinGroup)); FacebookPostSet fps = new FacebookPostSet(q); if (fps.Count < 10) { Query q1 = new Query(); q1.QueryCondition = new And( new Q(FacebookPost.Columns.FacebookUid, u.Facebook.Uid), new Q(FacebookPost.Columns.DataInt, g.K), new Q(FacebookPost.Columns.Type, TypeEnum.JoinGroup)); FacebookPostSet fps1 = new FacebookPostSet(q1); if (fps1.Count == 0) { FacebookPost fp = new FacebookPost(); fp.Hits = 0; fp.FacebookUid = u.Facebook.Uid; fp.DateTime = System.DateTime.Now; fp.Type = TypeEnum.JoinGroup; fp.Content = "GroupK=" + g.K.ToString(); fp.DataInt = g.K; fp.UsrK = u.K; fp.Update(); //send facebook message //http://developers.facebook.com/docs/reference/api/post Dictionary<string, object> par = new Dictionary<string, object>(); if (g.HasPic) { par["picture"] = g.PicPath; } par["link"] = "http://" + Vars.DomainName + g.Url() + "?fbpk=" + fp.K.ToString(); par["name"] = g.Name; par["caption"] = "Don't Stay In"; par["description"] = g.Description; u.Facebook.PutWallPost("I just joined: " + g.Name, par); } } }