public void GetSeoValues(string _town, string _year) { try { if (_year.ToString().Length > 0) { DotNetNuke.Framework.CDefault GIBSpage = (DotNetNuke.Framework.CDefault) this.Page; GIBSpage.Title = _taxyear.ToString() + " " + _town.ToString() + " Cape Cod Tax Rates"; GIBSpage.KeyWords = _town.ToString() + ", " + _taxyear.ToString() + ", " + _town.ToString() + " Tax Rate, " + GIBSpage.KeyWords.ToString(); GIBSpage.Description = _taxyear.ToString() + " " + _town.ToString() + " tax rates. " + GIBSpage.Description.ToString(); // +" " + Settings["PageTitle"].ToString() + ". " + Settings["PageDescription"].ToString(); GIBSpage.Author = "Joseph M Aucoin, GIBS"; } else { DotNetNuke.Framework.CDefault GIBSpage = (DotNetNuke.Framework.CDefault) this.Page; GIBSpage.Title = _town.ToString() + " Real Estate Tax Rates"; GIBSpage.KeyWords = _town.ToString() + ", " + _taxyear.ToString() + ", " + _town.ToString() + " Tax Rate, " + GIBSpage.KeyWords.ToString(); GIBSpage.Description = _taxyear.ToString() + " " + _town.ToString() + " tax rates. " + GIBSpage.Description.ToString(); // +" " + Settings["PageTitle"].ToString() + ". " + Settings["PageDescription"].ToString(); GIBSpage.Author = "Joseph M Aucoin, GIBS"; } } catch (Exception ex) { Exceptions.ProcessModuleLoadException(this, ex); } }
public void LoadSettings() { try { DistributorLocatorSettings settingsData = new DistributorLocatorSettings(this.TabModuleId); if (settingsData.NumPerPage != null) { PageSize = Int32.Parse(settingsData.NumPerPage.ToString()); } if (settingsData.ShowDataList != null) { if (Convert.ToBoolean(settingsData.ShowDataList) == true) { _ShowDataList = true; } else { _ShowDataList = false; } } if (settingsData.ShowDataGrid != null) { if (Convert.ToBoolean(settingsData.ShowDataGrid) == true) { _ShowDataGrid = true; } else { _ShowDataGrid = false; } } if (settingsData.PageTitleList != null) { DotNetNuke.Framework.CDefault GIBSpage1 = (DotNetNuke.Framework.CDefault) this.Page; _pageTitle = settingsData.PageTitleList.ToString(); if (Request.QueryString["State"] != null) { string _vState = ConvertState(Request.QueryString["State"].ToString()); GIBSpage1.Title = _pageTitle.ToString().Replace("[State]", _vState.ToString()).ToString(); } if (Request.QueryString["Radius"] != null && Request.QueryString["ZipCode"] != null) { GIBSpage1.Title = _pageTitle.ToString().Replace("[State]", Request.QueryString["ZipCode"].ToString()); } } } catch (Exception ex) { Exceptions.ProcessModuleLoadException(this, ex); } }
public void GetSeoValues(string _town, string _complex) { try { if (_complex.ToString().Length > 0) { DotNetNuke.Framework.CDefault GIBSpage = (DotNetNuke.Framework.CDefault) this.Page; GIBSpage.Title = _complex.ToString() + " " + _town.ToString() + " Cape Cod Condos"; GIBSpage.KeyWords = _town.ToString() + ", " + _complex.ToString() + ", " + _town.ToString() + " Condos, " + GIBSpage.KeyWords.ToString(); GIBSpage.Description = _complex.ToString() + " " + _town.ToString() + " condos. " + GIBSpage.Description.ToString(); GIBSpage.Author = "Joseph M Aucoin, GIBS"; } else { DotNetNuke.Framework.CDefault GIBSpage = (DotNetNuke.Framework.CDefault) this.Page; GIBSpage.Title = _town.ToString() + " Condos"; GIBSpage.KeyWords = _town.ToString() + ", " + _complex.ToString() + ", " + _town.ToString() + " Condos, " + GIBSpage.KeyWords.ToString(); GIBSpage.Description = _complex.ToString() + " " + _town.ToString() + " condos. " + GIBSpage.Description.ToString(); GIBSpage.Author = "Joseph M Aucoin, GIBS"; } } catch (Exception ex) { Exceptions.ProcessModuleLoadException(this, ex); } }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); /* #if !SKU_LITE * try * { * Social social = new Social(); * if (MainSettings.ProfileType == ProfileTypes.Social) * { * int memberTabId = social.GetMemberTabId(PortalId); * if (memberTabId > -1) * { * Response.Redirect(Utilities.NavigateUrl(memberTabId)); * } * } * } * catch (Exception ex) * { * * } * #endif */ lblHeader.Text = Utilities.GetSharedResource("[RESX:MemberDirectory]"); bool bCanLoad = false; string sMode = MainSettings.MemberListMode; if (!UserInfo.IsSuperUser) { if (sMode == "DISABLED") { Response.Redirect(NavigateUrl(TabId)); } if (!Request.IsAuthenticated & (sMode == "ENABLEDREG" || sMode == "ENABLEDMOD")) { Response.Redirect(NavigateUrl(TabId)); } else if (Request.IsAuthenticated && sMode == "ENABLEDMOD" && !UserIsMod) { Response.Redirect(NavigateUrl(TabId)); } } SettingsBase ctl = null; ctl = (SettingsBase)(new DotNetNuke.Modules.ActiveForums.Controls.Members()); ctl.ModuleConfiguration = this.ModuleConfiguration; if (!(this.Params == string.Empty)) { ctl.Params = this.Params; } DotNetNuke.Framework.CDefault tempVar = this.BasePage; Environment.UpdateMeta(ref tempVar, "[VALUE] - " + lblHeader.Text, "[VALUE]", "[VALUE]"); plhMembers.Controls.Add(ctl); }
public void SetPageName(string ClientName) { try { DotNetNuke.Framework.CDefault CustomPageName = (DotNetNuke.Framework.CDefault) this.Page; CustomPageName.Title = ClientName.ToString(); // CustomPageName.KeyWords = vTitle.ToString() + "," + Settings["Keywords"].ToString(); // CustomPageName.Description = vTitle.ToString() + " " + Settings["PageTitle"].ToString() + ". " + Settings["PageDescription"].ToString(); } catch (Exception ex) { Exceptions.ProcessModuleLoadException(this, ex); } }
public void GetSeoValues(string _pagetitle, string _keywords) { try { DotNetNuke.Framework.CDefault GIBSpage = (DotNetNuke.Framework.CDefault) this.Page; GIBSpage.Title = _pagetitle.ToString(); GIBSpage.KeyWords = _pagetitle.ToString() + ", " + _keywords.ToString() + ", " + GIBSpage.KeyWords.ToString(); GIBSpage.Description = _pagetitle.ToString() + ". " + GIBSpage.Description.ToString(); GIBSpage.Author = "Joseph M Aucoin, GIBS"; } catch (Exception ex) { Exceptions.ProcessModuleLoadException(this, ex); } }
public void GetSeoValues() { try { DotNetNuke.Framework.CDefault GIBSpage = (DotNetNuke.Framework.CDefault) this.Page; GIBSpage.Title = lblListingAddress.Text.ToString() + " MLS " + mlNumber.ToString(); GIBSpage.KeyWords = lblListingAddress.Text.ToString() + ", " + GIBSpage.KeyWords.ToString(); GIBSpage.Description = lblListingAddress.Text.ToString() + ", MLS " + mlNumber.ToString() + ". " + lblMarketingRemarks.Text.ToString(); // +" " + Settings["PageTitle"].ToString() + ". " + Settings["PageDescription"].ToString(); GIBSpage.Author = "Joseph M Aucoin, GIBS"; } catch (Exception ex) { Exceptions.ProcessModuleLoadException(this, ex); } }
private void RenderLocalizedMetaData() { DotNetNuke.Framework.CDefault basePage = (DotNetNuke.Framework.CDefault)Page; if (page != null) { basePage.Title = !string.IsNullOrEmpty(page.Title) ? page.Title : basePage.Title; basePage.Description = !string.IsNullOrEmpty(page.Description) ? page.Description : basePage.Description; } // Set Default Description if page description empty or not given if (string.IsNullOrEmpty(basePage.Description)) { string Vanjaro_Description = DotNetNuke.Services.Localization.Localization.GetString("Vanjaro_Description", DotNetNuke.Services.Localization.Localization.GlobalResourceFile); basePage.Description = !string.IsNullOrEmpty(Vanjaro_Description) ? Vanjaro_Description : "Vanjaro is built on DNN Platform"; } }
public void GetSeoValues(string _town) { try { if (_town.ToString().Length > 0) { DotNetNuke.Framework.CDefault GIBSpage = (DotNetNuke.Framework.CDefault) this.Page; GIBSpage.Title = _town.ToString() + " Open House Schedule"; GIBSpage.KeyWords = _town.ToString() + ", " + _town.ToString() + " Open House, " + GIBSpage.KeyWords.ToString(); GIBSpage.Description = _town.ToString() + " open house tour schedule. " + GIBSpage.Description.ToString(); GIBSpage.Author = "Joseph M Aucoin, GIBS"; } } catch (Exception ex) { Exceptions.ProcessModuleLoadException(this, ex); } }
/// <summary> /// Displays the topic. /// </summary> private void DisplayTopic() { this.lblPageContent.Visible = true; string topicContent = ReadTopic(); this.lblPageContent.Text = HttpUtility.HtmlDecode(topicContent).ToString(); this.ratingTbl.Visible = CurrentTopic.AllowRatings && WikiSettings.AllowRatings; this.RatingSec.Visible = CurrentTopic.AllowRatings && WikiSettings.AllowRatings; this.m_pageRating.Visible = CurrentTopic.AllowRatings && WikiSettings.AllowRatings; this.m_ratings.Visible = CurrentTopic.AllowRatings; this.AddCommentCommand.Visible = CurrentTopic.AllowDiscussions && WikiSettings.AllowDiscussions; this.CommentCount1.Visible = false; this.Comments2.Visible = CurrentTopic.AllowDiscussions && WikiSettings.AllowDiscussions; this.CommentsSec.Visible = CurrentTopic.AllowDiscussions && WikiSettings.AllowDiscussions; this.CommentsTbl.Visible = CurrentTopic.AllowDiscussions && WikiSettings.AllowDiscussions; DotNetNuke.Framework.CDefault p = default(DotNetNuke.Framework.CDefault); p = (DotNetNuke.Framework.CDefault) this.Page; // Set the page title, check for the Topic.Title, Topic.Name, then use PageTopic // parameter if all else fails. if (!string.IsNullOrWhiteSpace(CurrentTopic.Title)) { p.Title = p.Title + " > " + CurrentTopic.Title; } else if (!string.IsNullOrWhiteSpace(CurrentTopic.Name)) { p.Title = p.Title + " > " + CurrentTopic.Name; } else { p.Title = p.Title + " > " + this.PageTopic; } if ((CurrentTopic.Description != null) & !string.IsNullOrWhiteSpace(CurrentTopic.Description)) { p.Description = CurrentTopic.Description + " " + p.Description; } if ((CurrentTopic.Keywords != null) & !string.IsNullOrWhiteSpace(CurrentTopic.Keywords)) { p.KeyWords = CurrentTopic.Keywords + " " + p.KeyWords; } }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); string sDisplayName = string.Empty; int tUid = -1; if (Request.Params["UID"] != null) { if (SimulateIsNumeric.IsNumeric(Request.Params["UID"])) { tUid = Convert.ToInt32(Request.Params["UID"]); DotNetNuke.Entities.Users.UserController uc = new DotNetNuke.Entities.Users.UserController(); DotNetNuke.Entities.Users.UserInfo ui = uc.GetUser(PortalId, tUid); if (ui != null) { sDisplayName = UserProfiles.GetDisplayName(ModuleId, ui.UserID, ui.Username, ui.FirstName, ui.LastName, ui.DisplayName); } } } else { tUid = UserId; sDisplayName = UserProfiles.GetDisplayName(ModuleId, UserId, UserInfo.Username, UserInfo.FirstName, UserInfo.LastName, UserInfo.DisplayName); } lblHeader.Text = string.Format(Utilities.GetSharedResource("[RESX:ProfileForUser]"), sDisplayName); if (MainSettings.UseSkinBreadCrumb) { Environment.UpdateBreadCrumb(Page.Controls, "<a href=\"" + Utilities.NavigateUrl(TabId, "", new string[] { "afv=profile", "uid=" + tUid.ToString() }) + "\">" + lblHeader.Text + "</a>"); } DotNetNuke.Framework.CDefault tempVar = this.BasePage; Environment.UpdateMeta(ref tempVar, "[VALUE] - " + lblHeader.Text, "[VALUE]", "[VALUE]"); SettingsBase ctl = null; ctl = (SettingsBase)(new DotNetNuke.Modules.ActiveForums.Controls.UserProfile()); ctl.ModuleConfiguration = this.ModuleConfiguration; if (!(this.Params == string.Empty)) { ctl.Params = this.Params; } plhProfile.Controls.Add(ctl); }
public static bool UpdateMeta(ref DotNetNuke.Framework.CDefault bp, string Title, string Description, string Keywords) { if (bp == null) { return(false); } try { if (!(string.IsNullOrEmpty(Title))) { if (!(string.IsNullOrEmpty(bp.Title))) { bp.Title = Title.Replace("[VALUE]", bp.Title); } else { bp.Title = Title.Replace("[VALUE]", string.Empty); } } if (!(string.IsNullOrEmpty(Description))) { Description = Description.Replace(System.Environment.NewLine, " "); if (!(string.IsNullOrEmpty(bp.Description))) { bp.Description = Description.Replace("[VALUE]", bp.Description); } else { bp.Description = Description.Replace("[VALUE]", string.Empty); } } if (!(string.IsNullOrEmpty(Keywords))) { if (!(string.IsNullOrEmpty(bp.KeyWords))) { string cKey = bp.KeyWords.Trim(); if (cKey.StartsWith(",")) { cKey = cKey.Substring(1); } else if (cKey.EndsWith(",")) { cKey = cKey.Substring(0, cKey.Length - 1); } if (Keywords.StartsWith("[VALUE]")) { cKey += ","; } else if (Keywords.EndsWith("[VALUE]")) { cKey = "," + cKey; } bp.KeyWords = Keywords.Replace("[VALUE]", cKey); } else { bp.KeyWords = Keywords.Replace("[VALUE]", string.Empty); } } } catch (Exception ex) { if (ex != null) { Logger.Error(ex.Message, ex); if (ex.InnerException != null) { Logger.Error(ex.InnerException.Message, ex.InnerException); } } return(false); } return(false); }
void Page_Load(object sender, EventArgs e) { try { if (ModuleContext.PortalSettings.UserId == -1 && Settings.ForceCaptchaForAnonymous && Settings.PreferReCaptcha) { cmdUpdate.Attributes["disabled"] = "disabled"; cmdUpdate.CssClass += " disabled"; DotNetNuke.Framework.CDefault page = (DotNetNuke.Framework.CDefault) this.Page; StringBuilder sb = new StringBuilder(); sb.AppendLine(@"<script type=""text/javascript"">"); sb.AppendLine("var onSubmit = function(token) {"); sb.AppendLine("$('#" + cmdUpdate.ClientID + "').removeAttr('disabled');"); sb.AppendLine("$('#" + cmdUpdate.ClientID + "').removeClass('disabled');"); sb.AppendLine("};"); sb.AppendLine("var onloadCallback = function() {"); sb.AppendLine("grecaptcha.render('" + gRecaptcha.ClientID + "', {"); sb.AppendLine("'sitekey' : '" + Settings.ReCaptchaSiteKey + "',"); sb.AppendLine("'callback' : onSubmit"); sb.AppendLine("});"); sb.AppendLine("};"); sb.AppendLine("</script>"); page.Header.Controls.Add(new LiteralControl(sb.ToString())); string languageCode = CultureInfo.CurrentUICulture.TwoLetterISOLanguageName; page.Header.Controls.Add(new LiteralControl(@"<script src=""https://www.google.com/recaptcha/api.js?onload=onloadCallback&render=explicit&hl=" + languageCode + @""" async defer ></script>")); } if (Page.IsPostBack == false) { EnsureActionButton(); ClientAPI.AddButtonConfirm(cmdDelete, Localization.GetString("DeleteItem", LocalResourceFile)); } if (!IsNewRow) { if (!Page.IsPostBack) { //Clear all default values foreach (var edit in _editControls.Values) { edit.Value = ""; } } foreach (DataRow field in Data.Tables[DataSetTableName.Fields].Rows) { var dataTypeName = field[FieldsTableColumn.Type].AsString(); var dataType = DataType.ByName(dataTypeName); var value = CurrentRow[field[FieldsTableColumn.Title].ToString()].ToString(); if (!dataType.IsSeparator) { if (!Page.IsPostBack) { _editControls[field[FieldsTableColumn.Title].ToString()].Value = value; } if (field[FieldsTableColumn.Type].ToString() == "CreatedBy") { CheckPermission(value); } } } } else //New Entry { //Default Values already have been set in BuildEditForms cmdDelete.Visible = false; CheckPermission(); if (!Page.IsPostBack && Request.QueryString["OnSubmit"].AsInt() == ModuleContext.ModuleId) { ShowUponSubmit(); } } } catch (Exception exc) //Module failed to load { Exceptions.ProcessModuleLoadException(this, exc); CheckPermission(false); } }
public void GetDistributor() { try { DistributorLocatorController controller = new DistributorLocatorController(); DistributorLocatorInfo item = controller.Distributor_GetDistributor(Int32.Parse(Request.QueryString["Distributor"].ToString())); if (item != null) { lblDistributor.Text = item.Distributor.ToString(); lblAddress.Text = item.FullAddress.ToString(); lblPhone.Text = "Phone: " + item.Phone.ToString(); lblFax.Text = "Fax: " + item.Fax.ToString(); if (item.Contact.ToString().Length > 3) { lblContact.Text = "Contact: " + item.Contact.ToString(); } //WebSite Link if (item.Website.ToString().Length > 6) { hyperlinkWebSite.NavigateUrl = "http://" + item.Website.ToString(); hyperlinkWebSite.Target = "_blank"; } else { hyperlinkWebSite.Visible = false; } // EMAIL LINK if (item.Email.ToString().Length > 6) { HyperLinkEmail.NavigateUrl = "mailto:" + item.Email.ToString() + "?subject=Product%20Inquiry"; } else { HyperLinkEmail.Visible = false; } ModuleConfiguration.ModuleTitle = item.Distributor.ToString() + " in " + item.City.ToString() + ", " + item.State.ToString(); DotNetNuke.Framework.CDefault GIBSpage = (DotNetNuke.Framework.CDefault) this.Page; GIBSpage.Title = _pageTitle.ToString().Replace("[Distributor]", item.Distributor.ToString()).Replace("[City]", item.City.ToString()).Replace("[State]", item.State.ToString()).ToString(); // GIBSpage.Title = "Lab-metal Distributor " + item.Distributor.ToString() + " in " + item.City.ToString() + ", " + item.State.ToString(); string _Address = item.Address.ToString() + ", " + item.City.ToString() + ", " + item.State.ToString() + " " + item.ZipCode.ToString(); _AddressToMap = _Address.ToString().Replace(" ", "+").Replace("&", "%26").ToString(); //BuildGoogleMap(_Address.ToString()); } else { Response.Redirect(Globals.NavigateURL(this.TabId, "", "ErrorMessage=Distributor+Removed"), true); // _AddressToMap = "10001"; // lblDistributor.Text = "Distributor Removed"; } } catch (Exception ex) { Exceptions.ProcessModuleLoadException(this, ex); } }
public void MakeSEO() { try { string vTitle = ""; DotNetNuke.Framework.CDefault GIBSpage = (DotNetNuke.Framework.CDefault) this.Page; if (Request.QueryString[_QueryStringKey.ToString()] != null) { vTitle = Request.QueryString[_QueryStringKey.ToString()].ToString(); _QueryStringKeyValue = vTitle.ToString().Replace("_", " ").ToString(); } else { _QueryStringKeyValue = _QueryStringKeyDefaultText.ToString(); } // ADD NEW STUFF if (Request.QueryString[_QueryStringKey2.ToString()] != null) { vTitle += " " + Request.QueryString[_QueryStringKey2.ToString()].ToString().Replace("_", " ").ToString(); _QueryStringKey2Value = Request.QueryString[_QueryStringKey2.ToString()].ToString().Replace("_", " ").ToString(); } else { _QueryStringKey2Value = _QueryStringKey2DefaultText.ToString(); } if (Request.QueryString[_QueryStringKey3.ToString()] != null) { vTitle += " " + Request.QueryString[_QueryStringKey3.ToString()].ToString().Replace("_", " ").ToString(); _QueryStringKey3Value = Request.QueryString[_QueryStringKey3.ToString()].ToString().Replace("_", " ").ToString(); } else { _QueryStringKey3Value = _QueryStringKey3DefaultText.ToString(); } if (_QueryStringKey.ToString().Length > 0) { GIBSpage.Title = _QueryStringKeyValue.ToString() + " " + _PageTitle.ToString(); GIBSpage.KeyWords = _QueryStringKeyValue.ToString() + "," + _Keywords.ToString(); GIBSpage.Description = _QueryStringKeyValue.ToString() + " " + _PageTitle.ToString() + ". " + _PageDescription.ToString(); ModuleConfiguration.ModuleTitle = _QueryStringKeyValue.ToString() + " " + _PageTitle.ToString(); //Control ctl = Globals.FindControlRecursiveDown(this.ContainerControl, "lblTitle"); //if ((ctl != null)) //{ // ((Label)ctl).Text = vTitle.ToString(); //} //if (_QueryStringKey.ToString().Length > 0) //{ //} //else //{ // lblTitle.Text = _PageTitle.ToString(); // GIBSpage.Title = _PageTitle.ToString(); // GIBSpage.KeyWords = _Keywords.ToString(); // GIBSpage.Description = _PageTitle.ToString() + ". " + _PageDescription.ToString(); //} //if (_QueryStringKey2.ToString().Length > 0) //{ // vTitle += ", " + Request.QueryString[_QueryStringKey2.ToString()]; // lblTitle.Text = vTitle.ToString() + " " + _PageTitle.ToString(); // GIBSpage.Title = vTitle.ToString() + " " + _PageTitle.ToString(); // GIBSpage.KeyWords = vTitle.ToString() + "," + _Keywords.ToString(); // GIBSpage.Description = vTitle.ToString() + " " + _PageTitle.ToString() + ". " + _PageDescription.ToString(); //} //if (_QueryStringKey3.ToString().Length > 0) //{ // vTitle += ", " + Request.QueryString[_QueryStringKey3.ToString()]; // lblTitle.Text = vTitle.ToString() + " " + _PageTitle.ToString(); // GIBSpage.Title = vTitle.ToString() + " " + _PageTitle.ToString(); // GIBSpage.KeyWords = vTitle.ToString() + "," + _Keywords.ToString(); // GIBSpage.Description = vTitle.ToString() + " " + _PageTitle.ToString() + ". " + _PageDescription.ToString(); //} // Control ctl = DotNetNuke.Common.Globals.FindControlRecursiveDown(this.ContainerControl, "lblTitle"); // if ((ctl != null)) // { // ((System.Web.UI.WebControls.Label)ctl).Text = lblTitle.Text.ToString(); // } //Control. //if (this.PortalSettings.UserMode == DotNetNuke.Entities.Portals.PortalSettings.Mode.Edit) //{ // Label1.Visible = true; //} //else //{ // // Label1.Visible = false; // ((Label)ctl).Visible = false; //} } else { lblPageTitle.Text = "Log in and click settings to configure module."; } // PlaceHolder1. } catch (Exception exc) //Module failed to load { Exceptions.ProcessModuleLoadException(this, exc); } }