コード例 #1
0
ファイル: TCGTagHandlers.cs プロジェクト: wangscript/tcgcms
        private string _webpath = string.Empty; //ҳ��·��

        #endregion Fields

        #region Constructors

        public TCGTagHandlers(HandlerService handlerService)
        {
            base.handlerService = handlerService;
            this._pattern = @"<tcg:([^<>]+)\s([^<>]+)>([\S\s]*?)</tcg:\1>";
            this._tcgsystemtag = "<!--TCG:{0}-->";
            this._pagerinfo = new TCGTagPagerInfo();
        }
コード例 #2
0
        /// <summary>
        /// 处理单篇资讯的标签
        /// </summary>
        private void TagForNewsTopic(ref TCGTagPagerInfo pagerinfo)
        {
            int resourceid = objectHandlers.ToInt(this.GetAttribute("id"));
            if (resourceid==0)
            {
                pagerinfo.Read = false;
                return;
            }

            Resources item = this.handlerService.resourcsService.resourcesHandlers.GetResourcesById(resourceid);
            if (item != null)
            {
                string[] ResourcesPages = item.vcContent.Split(new string[] { "[PageNext]" }, StringSplitOptions.RemoveEmptyEntries);

                if (ResourcesPages.Length > 1)
                {
                    pagerinfo.NeedPager = true;
                    this._pager = true;
                    pagerinfo.PageCount = ResourcesPages.Length;
                    pagerinfo.DoAllPage = true;
                    pagerinfo.TopicCount = ResourcesPages.Length;

                    int i =  pagerinfo.PageSep -1 ;
                    if (i <= 0)
                    {
                        i = 0;
                        pagerinfo.curPage = 1;
                        pagerinfo.Page = 1;
                    }
                    if (i < ResourcesPages.Length)
                    {
                        item.vcContent = ResourcesPages[i];
                    }
                }

                string temp = this._tagtext;
                this.NewslistTagFieldsReplace(ref temp, ref pagerinfo, item);
                this._tagtext = temp;

            }
            else
            {
                throw new Exception("编号为:[" + resourceid + "]的文章找不到!");
                return;
            }

            item = null;
        }
コード例 #3
0
 /// <summary>
 /// 获得标签
 /// </summary>
 /// <param name="pagerinfo"></param>
 private void TagForScriptCss(ref TCGTagPagerInfo pagerinfo)
 {
     pagerinfo.ScriptCss = this.GetAttribute("text");
 }
コード例 #4
0
        /// <summary>
        /// 处理资讯列表,带分页
        /// </summary>
        private void TagForNewsListWithPager(ref TCGTagPagerInfo pagerinfo)
        {
            int nums = objectHandlers.ToInt(this.GetAttribute("num"));
            string categories = this.GetAttribute("categories");
            string Speciality = this.GetAttribute("speciality");
            string orders = this.GetAttribute("orders");
            bool check = this.GetAttribute("check") != "Y" ? false : true;
            bool del = this.GetAttribute("del") != "Y" ? false : true;
            bool create = this.GetAttribute("create") != "Y" ? false : true;
            bool havechilecategorie = this.GetAttribute("havechilecategorie") != "Y" ? false : true;

            int curPage = pagerinfo.Page;
            int pageCount = 0;
            int count = 0;

            string strCondition = base.handlerService.resourcsService.resourcesHandlers.GetTagResourceCondition(categories, Speciality, check, del, create, havechilecategorie);
            Dictionary<string, EntityBase> res = null;

            if (ConfigServiceEx.baseConfig["IndexListType"] == "01")
            {
                orders = pagerinfo.Page == 0 ? "dAddDate DESC" : "dAddDate";
            }
            else
            {
                if (pagerinfo.Page == 0) pagerinfo.Page = 1;
            }

            try
            {
                res = base.handlerService.resourcsService.resourcesHandlers.GetResourcesListPager(ref curPage, ref pageCount, ref count,
                       pagerinfo.Page, nums, orders, strCondition);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message.ToString());
            }

            pagerinfo.NeedPager = true;
            this._pager = true;
            pagerinfo.PageCount = pageCount;
            pagerinfo.curPage = curPage;
            pagerinfo.TopicCount = count;

            if (res != null && res.Count != 0)
            {
                string tempOld = this._tagtext;
                string tempNew = string.Empty;
                int n = 0;
                foreach (KeyValuePair<string, EntityBase> entity in res)
                {
                    Resources tempres = (Resources)entity.Value;
                    string temp = tempOld;
                    temp = temp.Replace("$" + this._tagtype + "_Index$", (n + 1).ToString());
                    this.NewslistTagFieldsReplace(ref temp,ref pagerinfo, tempres);
                    tempNew += temp;
                    n++;
                }

                this._tagtext = tempNew;
            }
        }
コード例 #5
0
        /// <summary>
        /// 处理内签模版的标签
        /// </summary>
        private void TagForNewsTemplate(ref TCGTagPagerInfo pagerinfo)
        {
            string id = this.GetAttribute("id");
            if (string.IsNullOrEmpty(id))
            {
                pagerinfo.Read = false;
                return;
            }

            Template item = this.handlerService.skinService.templateHandlers.GetTemplateByID(id);
            if (item != null)
            {
                this._tagtext = item.Content.Replace("tcg:" + this.TagType, "tcg:" + this.TagType + "Temp" + id.ToString());
                this._tagtext = this._tagtext.Replace("$" + this.TagType, "$" + this.TagType + "Temp" + id.ToString());
            }
            else
            {
                pagerinfo.Read = false;
            }
            item = null;
        }
コード例 #6
0
        /// <summary>
        /// 处理资讯列表
        /// </summary>
        private void TagForNewsList(ref TCGTagPagerInfo pagerinfo)
        {
            bool pager = objectHandlers.ToBoolen(this.GetAttribute("pager"),false);

            if (pager)
            {
                this.TagForNewsListWithPager(ref pagerinfo);
            }
            else
            {
                this.TagForNewsListWithOutPager(ref pagerinfo);
            }
        }
コード例 #7
0
        private void TagForNewsListWithOutPager(ref TCGTagPagerInfo pagerinfo)
        {
            int nums = objectHandlers.ToInt(this.GetAttribute("num"));
            string categories = this.GetAttribute("categories");
            string Speciality = this.GetAttribute("speciality");
            string orders = this.GetAttribute("orders");
            bool check = this.GetAttribute("check") != "Y" ? false : true;
            bool del = this.GetAttribute("del") != "Y" ? false : true;
            bool create = this.GetAttribute("create") != "Y" ? false : true;
            bool havechilecategorie = this.GetAttribute("havechilecategorie") == "Y" ? true : false;

            Dictionary<string, EntityBase> res = this.handlerService.resourcsService.resourcesHandlers.GetResourcesList(
                nums, categories, Speciality, orders, check, del, create, havechilecategorie);

            string tempNew = string.Empty;
            if (res == null)
            {
                this._tagtext = tempNew;
                return;
            }

            if (res.Count != 0)
            {
                string tempOld = this._tagtext;

                int n = 0;
                foreach (KeyValuePair<string, EntityBase> entity in res)
                {
                    Resources tempres = (Resources)entity.Value;
                    string temp = tempOld;
                    temp = temp.Replace("$" + this._tagtype + "_Index$", (n + 1).ToString());
                    this.NewslistTagFieldsReplace(ref temp,ref pagerinfo, tempres);
                    tempNew += temp;
                    n++;
                }

            }
            this._tagtext = tempNew;
        }
コード例 #8
0
        private void TagForNewsClassInfo(ref TCGTagPagerInfo pagerinfo)
        {
            string id = this.GetAttribute("id");
            if (string.IsNullOrEmpty(id))
            {
                pagerinfo.Read = false;
                return;
            }

            Categories item = this.handlerService.skinService.categoriesHandlers.GetCategoriesById(id);
            if (item == null)
            {
                pagerinfo.Read = false;
                return;
            }

            this.CategorieslistTagFieldsRelace(ref this._tagtext, ref pagerinfo,item);

            item = null;
        }
コード例 #9
0
        private void TagForNewsClassList(ref TCGTagPagerInfo pagerinfo)
        {
            string tempNew = string.Empty;
            string parentid = this.GetAttribute("parent");
            string skinid = this.GetAttribute("skin");
            string Speciality = this.GetAttribute("speciality");

            Dictionary<string, EntityBase> categories = this.handlerService.skinService.categoriesHandlers.GetCategoriesEntityByParentIdForIndex(parentid, skinid, Speciality);

            if (categories == null)return;

            if (categories.Count != 0)
            {
                string tempOld = this._tagtext;

                int n = 0;
                foreach (KeyValuePair<string, EntityBase> entity in categories)
                {
                    Categories tempres = (Categories)entity.Value;
                    string temp = tempOld;
                    temp = temp.Replace("$" + this._tagtype + "_Index$", (n + 1).ToString());
                    this.CategorieslistTagFieldsRelace(ref temp,ref pagerinfo ,tempres);
                    tempNew += temp;
                    n++;
                }

                this._tagtext = tempNew;
            }

            this._tagtext = tempNew;
        }
コード例 #10
0
        private void NewslistTagFieldsReplace(ref string temp, ref TCGTagPagerInfo pagerinfo, Resources item)
        {
            bool isintitle = objectHandlers.ToBoolen(this.GetAttribute("intitle"), false);
            if (isintitle) pagerinfo.PageTitle += (string.IsNullOrEmpty(pagerinfo.PageTitle) ? "" : " - ") + item.vcTitle;

            int maxtitlenum = objectHandlers.ToInt(this.GetAttribute("maxtitlenum"));
            string title = item.vcTitle;
            if (maxtitlenum != 0)
            {
                 string text = (title.Length > maxtitlenum) ? "..." : "";
                 title = objectHandlers.Left(title, maxtitlenum) + text;
            }

            if (!string.IsNullOrEmpty(item.vcTitleColor)) title = "<font color=\"" + item.vcTitleColor + "\">"
                + title + "</font>";
            if (item.cStrong == "Y") title = "<strong>" + "<TCG>" + title + "</strong>";
            temp = temp.Replace("$" + this._tagtype + "_vcTitle$", "<TCG>" + title + "</TCG>");
            temp = temp.Replace("$" + this._tagtype + "_vcTitle1$", "<TCG>" + item.vcTitle + "</TCG>");

            //替换正文内容,检查图片
            //try
            //{
            //    string tContent = this.handlerService.fileService.fileHandlers.ImgPatchInit(item, "", adminInfo,
            //        objectHandlers.ToInt(ConfigServiceEx.baseConfig["NewsFileClass"]));
            //    if (tContent != item.vcContent)
            //    {
            //        item.vcContent = tContent;
            //        int outid = 0;
            //        string filepatch = string.Empty;
            //        this.handlerService.resourcsService.resourcesHandlers.UpdateResources(item);
            //    }
            //}
            //catch (Exception ex)
            //{
            //    throw new Exception(ex.Message.ToString());
            //}

            temp = temp.Replace("$" + this._tagtype + "_vcContent$", "<TCG>" + item.vcContent + "</TCG>");
            temp = temp.Replace("$" + this._tagtype + "_iId$", "<TCG>" + item.Id.ToString() + "</TCG>");
            temp = temp.Replace("$" + this._tagtype + "_vcKeyWord$", "<TCG>" + item.vcKeyWord + "</TCG>");
            temp = temp.Replace("$" + this._tagtype + "_dUpdateDate$", "<TCG>" + item.dUpDateDate.ToString("yyyy年MM月dd日") + "</TCG>");
            temp = temp.Replace("$" + this._tagtype + "_dAddDate$", "<TCG>" + item.dAddDate.ToString("yyyy年MM月dd日") + "</TCG>");

            temp = temp.Replace("$" + this._tagtype + "_vcKeyWord$", "<TCG>" + item.vcKeyWord + "</TCG>");
            temp = temp.Replace("$" + this._tagtype + "_vcClassPic$", "<TCG>" + "/skin/"
                + pagerinfo.SkinInfo.Filename + item.Categorie.vcPic + "</TCG>");
            temp = temp.Replace("$" + this._tagtype + "_vcAuthor$", "<TCG>" + item.vcAuthor + "</TCG>");
            temp = temp.Replace("$" + this._tagtype + "_vcShortContent$", "<TCG>" + objectHandlers.HtmlEncode(item.vcShortContent) + "</TCG>");
            temp = temp.Replace("$" + this._tagtype + "_vcClassName$", "<TCG>" + item.Categorie.vcClassName + "</TCG>");
            temp = temp.Replace("$" + this._tagtype + "_iClassId$", "<TCG>" + item.Categorie.Id + "</TCG>");
            temp = temp.Replace("$" + this._tagtype + "_iClassParentId$", "<TCG>" + item.Categorie.Parent + "</TCG>");
            Categories cinfo = this.handlerService.skinService.categoriesHandlers.GetCategoriesParent2(item.Categorie.Id);
            temp = temp.Replace("$" + this._tagtype + "_iClassParentId2$", "<TCG>" + cinfo.Id + "</TCG>");
            temp = temp.Replace("$" + this._tagtype + "_iClassParentvcClassName2$", "<TCG>" + cinfo.vcClassName + "</TCG>");
            temp = temp.Replace("$" + this._tagtype + "_iClassParentvcName2$", "<TCG>" + cinfo.vcName + "</TCG>");
            temp = temp.Replace("$" + this._tagtype + "_TopicClassTitleList$",
                "<TCG>" + this.handlerService.skinService.categoriesHandlers.GetResourcesCategoriesIndex(item.Categorie.Id, " > ") + "</TCG>");

            string url = item.vcUrl.Trim().Length == 0 ? item.vcFilePath : item.vcUrl;
            temp = temp.Replace("$" + this._tagtype + "_vcFilePath$", "<TCG>" + url + "</TCG>");
            temp = temp.Replace("$" + this._tagtype + "_vcUrl$", "<TCG>" + url + "</TCG>");

            temp = temp.Replace("$" + this._tagtype + "_vcSmallImg$", "<TCG>" + item.vcSmallImg + "</TCG>");
            temp = temp.Replace("$" + this._tagtype + "_vcSpeciality$", "<TCG>" + item.vcSpeciality + "</TCG>");
            temp = temp.Replace("$" + this._tagtype + "_vcBigImg$", "<TCG>" + item.vcBigImg + "</TCG>");
            temp = temp.Replace("$" + this._tagtype + "_SheifUrl$", "<TCG>" + item.SheifUrl + "</TCG>");

            temp = temp.Replace("$" + this._tagtype + "_iCount$", "<TCG><script type='text/javascript' src='"
                + ConfigServiceEx.baseConfig["WebSite"] + "/interface/aspx/resources.aspx?w=getresourcecount&rid=" + item.Id + "'></script></TCG>");

            string sssid = this._tagtype + "_nicon_" + item.Id;
            if (item.dAddDate.AddDays(5) >= DateTime.Now)
            {
                temp = temp.Replace("$" + this._tagtype + "_nIcon$", "<TCG><img src='/images/newicon.jpg' style='vertical-align: middle;'/></TCG>");
            }
            else
            {
                temp = temp.Replace("$" + this._tagtype + "_nIcon$", "");
            }

            bool isshowrp = objectHandlers.ToBoolen(this.GetAttribute("inpropertie"), false);
            if (isshowrp)
            {

                Dictionary<string, EntityBase> ress = base.handlerService.resourcsService.resourcesHandlers.GetResourcePropertiesByRIdEntity(item.Id);

                if (ress != null && ress.Count != 0)
                {
                    Match mh = Regex.Match(temp, @"<ResourcePropertiesList([^<>]+)?>([\S\s]*?)</ResourcePropertiesList>", RegexOptions.Singleline | RegexOptions.Multiline);
                    string rplist = string.Empty;
                    if (mh.Success)
                    {
                        string temp1 = mh.Result("$2");
                        string attrs = mh.Result("$1");

                        string hide = this.GetAttribute(attrs, "hide");

                        int num = objectHandlers.ToInt(this.GetAttribute(attrs, "num"));
                        if (num == 0) num = ress.Count;

                        int i = 0;
                        foreach (KeyValuePair<string, EntityBase> entity in ress)
                        {
                            ResourceProperties resourceProperties = (ResourceProperties)entity.Value;
                            //在制定行数是内,并且不在排除字段中
                            if (i <= num - 1 && hide.IndexOf(resourceProperties.PropertieName) == -1)
                            {
                                int maxtlength = objectHandlers.ToInt(this.GetAttribute(attrs, "maxlength"));
                                string temp33 = maxtlength == 0 ? resourceProperties.PropertieValue : objectHandlers.Left(resourceProperties.PropertieValue, maxtlength);
                                temp33 = objectHandlers.HtmlEncode(temp33);
                                string temp2 = temp1;
                                temp2 = temp2.Replace("$PropertieName$", resourceProperties.PropertieName);
                                temp2 = temp2.Replace("$PropertieValue$", temp33);
                                rplist += temp2;
                            }
                            i++;
                        }
                        temp = Regex.Replace(temp, @"<ResourcePropertiesList([^<>]+)?>([\S\s]*?)</ResourcePropertiesList>", rplist, RegexOptions.Singleline | RegexOptions.Multiline);
                    }

                    MatchCollection mhs = Regex.Matches(temp, @"<RPItem>([\S\s]*?)</RPItem>", RegexOptions.Singleline | RegexOptions.Multiline);
                    if (mhs.Count > 0)
                    {
                        foreach (Match m in mhs)
                        {
                            string temp22 = m.Result("$1");
                            foreach (KeyValuePair<string, EntityBase> entity in ress)
                            {
                                ResourceProperties resourceProperties = (ResourceProperties)entity.Value;
                                if (temp22.IndexOf("$" + resourceProperties.PropertieName + "$") > -1)
                                {
                                    temp22 = temp22.Replace("$" + resourceProperties.PropertieName + "$", objectHandlers.HtmlEncode(resourceProperties.PropertieValue));
                                }
                            }

                            if (temp22 == m.Result("$1"))
                            {
                                temp = temp.Replace(@"<RPItem>" + m.Result("$1") + "</RPItem>", @"");
                            }
                            else
                            {
                                temp = temp.Replace( @"<RPItem>" + m.Result("$1") + "</RPItem>", temp22);
                            }
                        }
                    }
                }

            }

            temp = base.tcgTagStringFunHandlers.StringColoumFun(temp, false);
        }
コード例 #11
0
        private void CategorieslistTagFieldsRelace(ref string temp, ref TCGTagPagerInfo pagerinfo,Categories categorie)
        {
            string url = "#";
            if (!string.IsNullOrEmpty(categorie.vcUrl))
            {
                url = (categorie.vcUrl.IndexOf(".") > -1) ? categorie.vcUrl : categorie.vcUrl + ConfigServiceEx.baseConfig["FileExtension"];
            }
            else
            {
                if (categorie.IsSinglePage == "Y")
                {
                    Resources res = base.handlerService.resourcsService.resourcesHandlers.GetNewsResourcesAtCategorie(categorie.Id);
                    if (res != null && categorie.IsSinglePage == "Y" && !string.IsNullOrEmpty(res.vcFilePath))
                    {
                        url = res.vcFilePath;
                    }
                }
                else
                {
                   Dictionary<string,EntityBase> chiledcategorys = base.handlerService.skinService.categoriesHandlers.GetCategoriesEntityByParentId(categorie.Id, categorie.SkinInfo.Id);
                   foreach (KeyValuePair<string, EntityBase> keyvalue in chiledcategorys)
                   {
                       Categories ctgr = keyvalue.Value as Categories;
                       if (ctgr != null)
                       {
                           if (!string.IsNullOrEmpty(ctgr.vcUrl))
                           {
                               url = (ctgr.vcUrl.IndexOf(".") > -1) ? ctgr.vcUrl : ctgr.vcUrl + ConfigServiceEx.baseConfig["FileExtension"];
                           }
                           else
                           {
                               if (ctgr.IsSinglePage == "Y")
                               {
                                   Resources res1 = base.handlerService.resourcsService.resourcesHandlers.GetNewsResourcesAtCategorie(ctgr.Id);
                                   if (res1 != null && ctgr.IsSinglePage == "Y" && !string.IsNullOrEmpty(res1.vcFilePath))
                                   {
                                       url = res1.vcFilePath;
                                   }
                               }
                           }
                       }
                       if (!string.IsNullOrEmpty(url)) break;
                   }
                }
            }

            temp = temp.Replace("$" + this._tagtype + "_vcUrl$", "<TCG>" + url + "</TCG>");

            temp = temp.Replace("$" + this._tagtype + "_iParent$", "<TCG>" + categorie.Parent.ToString() + "</TCG>");
            Categories cinfo = this.handlerService.skinService.categoriesHandlers.GetCategoriesParent2(categorie.Id);
            temp = temp.Replace("$" + this._tagtype + "_iParentId2$", "<TCG>" + cinfo.Id + "</TCG>");
            temp = temp.Replace("$" + this._tagtype + "_iParentvcClassName2$", "<TCG>" + cinfo.vcClassName + "</TCG>");
            temp = temp.Replace("$" + this._tagtype + "_iParentvcName2$", "<TCG>" + cinfo.vcName + "</TCG>");
            temp = temp.Replace("$" + this._tagtype + "_ClassTitleList$",
                    "<TCG>" + this.handlerService.skinService.categoriesHandlers.GetResourcesCategoriesIndex(categorie.Id, " > ") + "</TCG>");

            bool isintitle = objectHandlers.ToBoolen(this.GetAttribute("intitle"), false);
            if (isintitle) pagerinfo.PageTitle += (string.IsNullOrEmpty(pagerinfo.PageTitle) ? "" : " - ") + categorie.vcClassName;

            temp = temp.Replace("$" + this._tagtype + "_Id$", "<TCG>" + categorie.Id + "</TCG>");
            temp = temp.Replace("$" + this._tagtype + "_vcClassName$", "<TCG>" + categorie.vcClassName + "</TCG>");
            temp = temp.Replace("$" + this._tagtype + "_vcName$", "<TCG>" + categorie.vcName + "</TCG>");
            temp = temp.Replace("$" + this._tagtype + "_vcPic$", "<TCG>/skin/"
                + pagerinfo.SkinInfo.Filename + categorie.vcPic + "</TCG>");
            temp = temp.Replace("$" + this._tagtype + "_allchildid$", "<TCG>" + base.handlerService.skinService.categoriesHandlers.GetCategoriesChild(categorie.Id) + "</TCG>");

            temp = base.tcgTagStringFunHandlers.StringColoumFun(temp, false);
        }
コード例 #12
0
 public void ReplaceTagText(ref TCGTagPagerInfo pagerinfo)
 {
     if (this._tagtype == string.Empty || this._attribute == string.Empty || this._tag == string.Empty) return;
     string type = this.GetAttribute("type");
     if (type == "") return;
     switch (type)
     {
         case "Template": //<tcg:id1 type="Template" id=''>dfddfd</tcg:id1>
             this.TagForNewsTemplate(ref pagerinfo);
             break;
         case "Resource": //<tcg:id1 type="Resource" id='topic1'> </tcg:id1>
             this.TagForNewsTopic(ref pagerinfo);
             break;
         case "Categories": //<tcg:id1 type="Categories" id='Categoriesid'>dfddfd</tcg:id1>
             this.TagForNewsClassInfo(ref pagerinfo);
             break;
         case "Resourcelist":
             this.TagForNewsList(ref pagerinfo);
             break;
         case "CategoriesList":
             this.TagForNewsClassList(ref pagerinfo);
             break;
         case "scriptcss": // <tcg:id1 type="scriptcss" text='/sdfsdf.js|ggg.js'>dfddfd</tcg:id1>
             this.TagForScriptCss(ref pagerinfo);
             break;
     }
 }
コード例 #13
0
        /// <summary>
        /// �����ƪ��Ѷ�ı�ǩ
        /// </summary>
        private void TagForNewsTopic(ref TCGTagPagerInfo pagerinfo)
        {
            int resourceid = objectHandlers.ToInt(this.GetAttribute("id"));
            bool isintitle = objectHandlers.ToBoolen(this.GetAttribute("intitle"),false);
            if (resourceid==0)
            {
                pagerinfo.Read = false;
                return;
            }

            Resources item = this.handlerService.resourcsService.resourcesHandlers.GetResourcesById(resourceid);
            if (item != null)
            {
                if (isintitle) pagerinfo.PageTitle += (string.IsNullOrEmpty(pagerinfo.PageTitle)?"":" - ") + item.vcTitle;

                if (!string.IsNullOrEmpty(item.vcTitleColor)) item.vcTitle = "<font color='" + item.vcTitleColor + "'>"
                    + item.vcTitle + "</font>";
                if (item.cStrong == "Y") item.vcTitle = "<strong>" + item.vcTitle + "</strong>";
                this._tagtext = this._tagtext.Replace("$" + this._tagtype + "_vcTitle$", item.vcTitle);

                //�滻�������ݣ����ͼƬ
                try
                {
                    string tContent = this.handlerService.fileService.fileHandlers.ImgPatchInit(item,"", "admin",
                        objectHandlers.ToInt(base.configService.baseConfig["NewsFileClass"]));
                    if (tContent != item.vcContent)
                    {
                        item.vcContent = tContent;
                        int outid = 0;
                        string filepatch = string.Empty;
                        this.handlerService.resourcsService.resourcesHandlers.UpdateResources(item);
                    }
                }
                catch (Exception ex)
                {
                    throw new Exception(ex.Message.ToString());
                }
                this._tagtext = this._tagtext.Replace("$" + this._tagtype + "_vcContent$", item.vcContent);
                this._tagtext = this._tagtext.Replace("$" + this._tagtype + "_iId$", item.Id.ToString());

                this._tagtext = this._tagtext.Replace("$" + this._tagtype + "_vcFilePath$", item.vcFilePath);
                this._tagtext = this._tagtext.Replace("$" + this._tagtype + "_vcKeyWord$", item.vcKeyWord);
                this._tagtext = this._tagtext.Replace("$" + this._tagtype + "_dUpdateDate$", item.dUpDateDate.ToString("yyyy��MM��dd��"));
                this._tagtext = this._tagtext.Replace("$" + this._tagtype + "_dAddDate$", item.dAddDate.ToString("yyyy��MM��dd��"));

                this._tagtext = this._tagtext.Replace("$" + this._tagtype + "_vcKeyWord$", item.vcKeyWord);
                this._tagtext = this._tagtext.Replace("$" + this._tagtype + "_vcAuthor$", item.vcAuthor);
                this._tagtext = this._tagtext.Replace("$" + this._tagtype + "_vcShortContent$", objectHandlers.GetTextWithoutHtml(item.vcShortContent));
                this._tagtext = this._tagtext.Replace("$" + this._tagtype + "_vcClassName$", item.Categorie.vcClassName);
                this._tagtext = this._tagtext.Replace("$" + this._tagtype + "_iClassId$", item.Categorie.Id);
                this._tagtext = this._tagtext.Replace("$" + this._tagtype + "_iClassParentId$", item.Categorie.Parent);
                this._tagtext = this._tagtext.Replace("$" + this._tagtype + "_iClassParentId2$", this.handlerService.skinService.categoriesHandlers.GetCategoriesParent2(item.Categorie.Id).Id);
                this._tagtext = this._tagtext.Replace("$" + this._tagtype + "_TopicClassTitleList$",
                    this.handlerService.skinService.categoriesHandlers.GetResourcesCategoriesIndex(item.Categorie.Id, " > "));
            }
            else
            {

                throw new Exception("���Ϊ:[" + resourceid + "]�������Ҳ�����");
                return;
            }

            item = null;
        }
コード例 #14
0
        private void TagForNewsClassInfo(ref TCGTagPagerInfo pagerinfo)
        {
            string id = this.GetAttribute("id");
            if (string.IsNullOrEmpty(id))
            {
                pagerinfo.Read = false;
                return;
            }

            Categories item = this.handlerService.skinService.categoriesHandlers.GetCategoriesById(id);
            if (item == null)
            {
                pagerinfo.Read = false;
                return;
            }

            this._tagtext = this._tagtext.Replace("$" + this._tagtype + "_Id$", item.Id.ToString());
            this._tagtext = this._tagtext.Replace("$" + this._tagtype + "_vcName$", item.vcName);
            this._tagtext = this._tagtext.Replace("$" + this._tagtype + "_vcClassName$", item.vcClassName);
            this._tagtext = this._tagtext.Replace("$" + this._tagtype + "_iParent$", item.Parent.ToString());
            this._tagtext = this._tagtext.Replace("$" + this._tagtype + "_iParent2$",this.handlerService.skinService.categoriesHandlers.GetCategoriesParent2(item.Id).Id);
            this._tagtext = this._tagtext.Replace("$" + this._tagtype + "_ClassTitleList$",
                    this.handlerService.skinService.categoriesHandlers.GetResourcesCategoriesIndex(item.Id, " > "));

            bool isintitle = objectHandlers.ToBoolen(this.GetAttribute("intitle"), false);
            if (isintitle) pagerinfo.PageTitle += (string.IsNullOrEmpty(pagerinfo.PageTitle)?"":" - ") + item.vcClassName;

            item = null;
        }