protected void Page_LoadComplete(object sender, EventArgs e) { UpdateUserList(); if (Request.QueryString["id"] != null && Request.QueryString["id"].ToString() != "") { new LogEntry(Log.Debug) { text = "Manage_Media userId = " + Request.QueryString["id"].ToString() }; selectedUserId = Convert.ToInt16(Request.QueryString["id"]); SelectUser.SelectedValue = selectedUserId.ToString(); foreach (MediaControl temp in MediaControl.GetUserMediaAsMediaControls(selectedUserId, myUser.Id)) { DisplayPhotosDiv.Controls.Add(temp); } } else { if (Request.QueryString["id"] == null) { Response.Redirect("manage_media?id=0"); } } }
protected void Page_Load(object sender, EventArgs e) { MOTD_div.InnerHtml = ConfigurationManager.AppSettings["MOTD"]; myUser = ParsnipData.Accounts.User.LogIn(); if (string.IsNullOrEmpty(Data.DeviceType)) { Response.Redirect("get_device_info?url=home"); } if (myUser == null) { PleaseLogin.Visible = true; } else { MyMediaTitle.Visible = true; WelcomeLabel.Text = string.Format($"Hiya {myUser.Forename}, welcome back!"); UploadMediaControl.Initialise(myUser, this); foreach (MediaControl mediaControl in MediaControl.GetUserMediaAsMediaControls(myUser.Id, myUser.Id)) { DynamicMediaDiv.Controls.Add(mediaControl); } } new LogEntry(Log.Debug) { text = string.Format("The home page was accessed by {0} from {1} {2} device.", myUser == null ? "someone who was not logged in" : myUser.Forename, myUser == null ? "their" : myUser.PosessivePronoun, Data.DeviceType) }; }
protected void Page_Load(object sender, EventArgs e) { Page httpHandler = (Page)HttpContext.Current.Handler; myUser = Account.SecurePage(this, Data.DeviceType); NewMenu.LoggedInUser = myUser; NewMenu.Upload = true; NewMenu.HighlightButtonsForPage(PageIndex.MyUploads, "My Uploads"); UploadMediaControl.Initialise(myUser, this); if (myUser.AccountType == "admin" || myUser.AccountType == "member" || myUser.AccountType == "media") { uploadForm.Visible = true; } var mediaControls = MediaControl.GetUserMediaAsMediaControls(myUser.Id, myUser.Id); if (mediaControls.Count != default) { UploadPrompt.Visible = false; } foreach (MediaControl mc in mediaControls) { MyMediaContainer.Controls.Add(mc); } if (string.IsNullOrEmpty(Data.DeviceType)) { Response.Redirect("get_device_info?url=home"); } new LogEntry(Log.Debug) { Text = string.Format("The home page was accessed by {0} from {1} {2} device.", myUser == null ? "someone who was not logged in" : myUser.Forename, myUser == null ? "their" : myUser.PosessivePronoun, Data.DeviceType) }; //WelcomeLabel.Text = // string.Format("Hiya {0} to the parsnip website!", myUser == null ? // "stranger, welcome" : myUser.Forename + ", welcome back"); var myImage = new ParsnipData.Media.Image(); myImage.Id = MediaId.NewMediaId(); myImage.Compressed = "Resources/Media/Images/Local/Dirt_On_You.jpg"; myImage.Placeholder = "Resources/Media/Images/Local/Dirt_On_You.jpg"; if (myUser != null) { myImage.Title = $"Hey {myUser.Forename}, what DIRT do we have on YOU? 😜"; } else { myImage.Title = $"What DIRT do we have on YOU? 😜"; } var MySeeYourselfControl = (MediaControl)Page.LoadControl("~/Custom_Controls/Media/MediaControl.ascx"); MySeeYourselfControl.MyMedia = myImage; MySeeYourselfControl.AnchorLink = $"{Request.Url.GetLeftPart(UriPartial.Authority)}/me"; //seeYourself.Controls.Add(MySeeYourselfControl); //seeYourself.Visible = true; int userId = myUser == null ? 0 : myUser.Id; Media latestVideo = Media.SelectLatestVideo(userId); if (latestVideo != null) { var MyVideoControl = (MediaControl)Page.LoadControl("~/Custom_Controls/Media/MediaControl.ascx"); latestVideo.Title = "LATEST VIDEO: " + latestVideo.Title; MyVideoControl.MyMedia = latestVideo; //LatestVideo.Controls.Add(MyVideoControl); } }