예제 #1
0
        //----------------------------------------------------------------------------
        #endregion

        #region --------------------------SetMetaTags----------------------------
        //----------------------------------------------------------------------------
        //SetMetaTags
        //----------------------------------------------------------------------------
        public static void SetMetaTags(MessagesEntity msg)
        {
            DCMetaBuilder metaBuilder = DCMetaBuilder.Instance;
            string        siteName    = SiteTextsManager.Instance.SiteName.Trim();

            //------------------------------------------------------------
            metaBuilder.Title = msg.Title;
            //------------------------------------------------------------
            if (!string.IsNullOrEmpty(msg.KeyWords))
            {
                metaBuilder.Keywords = msg.KeyWords;
            }
            //------------------------------------------------------------
            if (!string.IsNullOrEmpty(msg.ShortDescription))
            {
                metaBuilder.Description = msg.ShortDescription;
            }
            //------------------------------------------------------------
            if (!string.IsNullOrEmpty(msg.Name))
            {
                metaBuilder.Author = msg.Name + " , " + siteName;
            }
            //------------------------------------------------------------
            metaBuilder.PubDate = msg.Date_Added.ToUniversalTime().ToString();
            //------------------------------------------------------------
            metaBuilder.LastModification = msg.LastModification.ToUniversalTime().ToString();
            //------------------------------------------------------------
            metaBuilder.Source = siteName;
            //------------------------------------------------------------
        }
예제 #2
0
        //----------------------------------------------------------------------------
        #endregion

        #region --------------------------SetMetaTags----------------------------
        //----------------------------------------------------------------------------
        //SetMetaTags
        //----------------------------------------------------------------------------
        public static void SetMetaTags(SiteDeparmentsEntity siteDepartment)
        {
            DCMetaBuilder metaBuilder = DCMetaBuilder.Instance;
            string        siteName    = SiteTextsManager.Instance.SiteName.Trim();

            //------------------------------------------------------------
            metaBuilder.Title = siteDepartment.Title;
            //------------------------------------------------------------
            if (!string.IsNullOrEmpty(siteDepartment.KeyWords))
            {
                metaBuilder.Keywords = siteDepartment.KeyWords;
            }
            //------------------------------------------------------------
            if (!string.IsNullOrEmpty(siteDepartment.ShortDescription))
            {
                metaBuilder.Description = siteDepartment.ShortDescription;
            }
            //------------------------------------------------------------
            metaBuilder.Author = siteName;
            //------------------------------------------------------------
            metaBuilder.PubDate = siteDepartment.Date_Added.ToUniversalTime().ToString();
            //------------------------------------------------------------
            metaBuilder.LastModification = siteDepartment.LastModification.ToUniversalTime().ToString();
            //------------------------------------------------------------
            metaBuilder.Source = siteName;
            //------------------------------------------------------------
        }
예제 #3
0
        //---------------------------------------
        public void ProcessRequest(HttpContext context)
        {
            /*
             * // Check to see if the specified HTML file actual exists and serve it if so..
             * String strReqPath = context.Server.MapPath(context.Request.AppRelativeCurrentExecutionFilePath);
             * if (File.Exists(strReqPath))
             * {
             *  context.Response.WriteFile(strReqPath);
             *  context.Response.End();
             *  return;
             * }
             *
             * // Record the original request PathInfo and QueryString information to handle graceful postbacks
             * context.Items[ORIGINAL_PATHINFO] = context.Request.PathInfo;
             * context.Items[ORIGINAL_QUERIES] = context.Request.QueryString.ToString();
             *
             * // Map the friendly URL to the back-end one..
             * String strVirtualPath = "";
             * String strQueryString = "";
             * MapFriendlyUrl(context, out strVirtualPath, out strQueryString);
             * if (strVirtualPath.Length > 0)
             * {
             *  foreach (string strOriginalQuery in context.Request.QueryString.Keys)
             *  {
             *      // To ensure that any query strings passed in the original request are preserved, we append these
             *      // to the new query string now, taking care not to add any keys which have been rewritten during the handler..
             *      if (strQueryString.ToLower().IndexOf(strOriginalQuery.ToLower() + "=") < 0)
             *      {
             *          strQueryString += string.Format("{0}{1}={2}", ((strQueryString.Length > 0) ? "&" : ""), strOriginalQuery, context.Request.QueryString[strOriginalQuery]);
             *      }
             *  }
             *
             *  // Apply the required query strings to the request
             *  context.RewritePath(context.Request.Path, string.Empty, strQueryString);
             *  // Now get a page handler for the ASPX page required, using this context.
             *  Page aspxHandler = (Page)PageParser.GetCompiledPageInstance(strVirtualPath, context.Server.MapPath(strVirtualPath), context);
             *  // Execute the handler..
             *  aspxHandler.PreRenderComplete += new EventHandler(AspxPage_PreRenderComplete);
             *  aspxHandler.ProcessRequest(context);
             * }
             * else
             * {
             *  // No mapping was found - emit a 404 response.
             *  context.Response.StatusCode = 404;
             *  context.Response.ContentType = "text/plain";
             *  context.Response.Write("Page Not Found");
             *  context.Response.End();
             * }*/
            string newPath = Context.Request.RawUrl;

            HandleCurrentLanguage();
            DCMetaBuilder.InisializeMetaTags();
            DCSiteUrls urls = DCSiteUrls.Instance;

            urls.ReWriteUrl();
        }
예제 #4
0
        //----------------------------------------------------------------------------
        #endregion

        #region --------------------------InisializeMetaTags----------------------------
        //----------------------------------------------------------------------------
        //InisializeMetaTags
        //----------------------------------------------------------------------------
        public static void InisializeMetaTags()
        {
            //------------------------------------------------------
            DCMetaBuilder metaBuilder = DCMetaBuilder.Instance;

            metaBuilder.GlobalLastModification = SiteSettings.Site_LastModification;
            metaBuilder.Keywords    = SiteTextsManager.Instance.KeyWords.Trim();
            metaBuilder.Description = SiteTextsManager.Instance.SiteDescription.Trim();
            //------------------------------------------------------
        }
예제 #5
0
        //----------------------------------------------------------------------------
        #endregion



        #region --------------------------InisializeUsersDataModuleMetaTags----------------------------
        //----------------------------------------------------------------------------
        //InisializeUsersDataModuleMetaTags
        //----------------------------------------------------------------------------
        public static void InisializeUsersDataModuleMetaTags(UsersDataGlobalOptions currentModule)
        {
            DCMetaBuilder metaBuilder = DCMetaBuilder.Instance;
            string        moduleTitle = currentModule.GetModuleTitle();

            metaBuilder.Title                  = moduleTitle;
            metaBuilder.Section                = currentModule.GetModuleTitle();
            metaBuilder.Keywords               = currentModule.ModuleMetaKeyWords;
            metaBuilder.Description            = currentModule.ModuleMetaDescription;
            metaBuilder.GlobalLastModification = SiteSettings.Site_LastModification;
        }
예제 #6
0
        void context_BeginRequest(object sender, EventArgs e)
        {
            string newPath = Context.Request.RawUrl;

            HandleCurrentLanguage();
            DCMetaBuilder.InisializeMetaTags();
            DCSiteUrls urls = DCSiteUrls.Instance;

            urls.ReWriteUrl();
            //DCCMSNameSpace.SubSiteHandler.IncreaseSubSiteVisites();

            //RewriteUrl();
        }
예제 #7
0
        //----------------------------------------------------------------------------
        #endregion



        #region --------------------------SetMetaTags----------------------------
        //----------------------------------------------------------------------------
        //SetMetaTags
        //----------------------------------------------------------------------------
        public static void SetMetaTags(ItemCategoriesEntity category)
        {
            DCMetaBuilder metaBuilder = DCMetaBuilder.Instance;

            //------------------------------------------------------------
            metaBuilder.Title = category.Title;
            //------------------------------------------------------------
            if (!string.IsNullOrEmpty(category.KeyWords))
            {
                metaBuilder.Keywords = category.KeyWords;
            }
            //------------------------------------------------------------
            if (!string.IsNullOrEmpty(category.ShortDescription))
            {
                metaBuilder.Description = category.ShortDescription;
            }
            //------------------------------------------------------------
            metaBuilder.SubSection = category.Title;
            //------------------------------------------------------------
            metaBuilder.LastModification = category.LastModification.ToUniversalTime().ToString();
            //------------------------------------------------------------
        }
예제 #8
0
        //---------------------------------------------------------
        //BuildDepartmentsPathLinks
        //---------------------------------------------------------
        public bool BuildDepartmentsPathLinks(int moduleDepartment, bool lastLink, bool setTags)
        {
            bool hasLinks = false;

            if (moduleDepartment > 0)
            {
                List <SiteDeparmentsEntity> sdp = SiteDeparmentsFactory.GetFullPath(moduleDepartment);
                if (sdp.Count > 0)
                {
                    hasLinks = true;
                    SiteDeparmentsEntity lastDep = null;
                    SiteDeparmentsEntity tempdep = null;
                    string url = "";
                    for (int i = 0; i < sdp.Count; i++)
                    {
                        tempdep = sdp[i];
                        if (lastLink && i == sdp.Count - 1)
                        {
                            lastDep = tempdep;
                            _PathControl.AddLink(tempdep.Title, null);
                            if (setTags)
                            {
                                DCMetaBuilder metaBuilder = DCMetaBuilder.Instance;
                                metaBuilder.Section = tempdep.Title;
                                metaBuilder.Title   = tempdep.Title;
                            }
                        }
                        else
                        {
                            url = GetSiteDepartmentsURl(tempdep.Url, tempdep.RelatedModuleTypeID, tempdep.RelatedPageID, tempdep.DepartmentID);
                            _PathControl.AddLink(tempdep.Title, url);
                        }
                    }
                }
            }
            return(hasLinks);
        }
예제 #9
0
        //---------------------------------------------------------
        //BuildCategoriesPathLinksInSubFolder
        //---------------------------------------------------------
        public bool BuildCategoriesPathLinksInSubFolder(int categoryID, bool lastLink, bool setTags)
        {
            bool hasLinks = false;

            if (categoryID > 0)
            {
                List <ItemCategoriesEntity> cdp = ItemCategoriesFactory.GetFullPath(categoryID);
                if (cdp.Count > 0)
                {
                    hasLinks = true;
                    ItemCategoriesEntity lastCat       = null;
                    ItemsModulesOptions  currentModule = ItemsModulesOptions.GetType(cdp[0].ModuleTypeID);
                    string url = "";
                    for (int i = 0; i < cdp.Count; i++)
                    {
                        if (lastLink && i == cdp.Count - 1)
                        {
                            lastCat = cdp[i];
                            _PathControl.AddLink(lastCat.Title, null);
                            if (setTags)
                            {
                                DCMetaBuilder metaBuilder = DCMetaBuilder.Instance;
                                metaBuilder.SubSection = lastCat.Title;
                                metaBuilder.Title      = lastCat.Title;
                            }
                        }
                        else
                        {
                            //url = "../default.aspx?id=" + cdp[i].CategoryID;
                            DCSiteUrls.Instance.BuildItemCategoriesLink(cdp[i].CategoryID, cdp[i].Title, currentModule);
                            _PathControl.AddLink(cdp[i].Title, url);
                        }
                    }
                }
            }
            return(hasLinks);
        }