public string RendHtml()
        {
            XmlNode       node    = TagsHelper.FindCommentNode(this.CommentId, "keyword");
            StringBuilder builder = new StringBuilder();

            if (node != null)
            {
                int categoryId = 0;
                int result     = 0;
                int num3       = 0;
                int.TryParse(node.Attributes["CategoryId"].Value, out result);
                int.TryParse(node.Attributes["MaxNum"].Value, out num3);
                CategoryInfo category = CategoryBrowser.GetCategory(result);
                if (category != null)
                {
                    categoryId = category.TopCategoryId;
                }
                DataTable hotKeywords = CommentBrowser.GetHotKeywords(categoryId, num3);
                builder.AppendFormat("<ul class=\"keyword cssEdite\" type=\"keyword\" id=\"comments_{0}\" >", this.CommentId).AppendLine();
                if ((hotKeywords != null) && (hotKeywords.Rows.Count > 0))
                {
                    foreach (DataRow row in hotKeywords.Rows)
                    {
                        builder.AppendFormat("<li><a target=\"_blank\" href=\"{0}\">{1}</a></li>", Globals.GetSiteUrls().SubCategory((int)row["CategoryId"], null) + "?keywords=" + Globals.UrlEncode((string)row["Keywords"]), row["Keywords"]).AppendLine();
                    }
                }
                builder.AppendLine("</ul>");
            }
            return(builder.ToString());
        }
        public string RendHtml()
        {
            XmlNode       xmlNode       = TagsHelper.FindCommentNode(this.CommentId, "keyword");
            StringBuilder stringBuilder = new StringBuilder();

            if (xmlNode != null)
            {
                int categoryId     = 0;
                int categoryId2    = 0;
                int hotKeywordsNum = 0;
                int.TryParse(xmlNode.Attributes["CategoryId"].Value, out categoryId2);
                int.TryParse(xmlNode.Attributes["MaxNum"].Value, out hotKeywordsNum);
                CategoryInfo category = CatalogHelper.GetCategory(categoryId2);
                if (category != null)
                {
                    categoryId = category.TopCategoryId;
                }
                List <HotkeywordInfo> hotKeywords = CommentBrowser.GetHotKeywords(categoryId, hotKeywordsNum);
                stringBuilder.AppendFormat("<ul class=\"keyword cssEdite\" type=\"keyword\" id=\"comments_{0}\" >", this.CommentId).AppendLine();
                if (hotKeywords != null && hotKeywords.Count > 0)
                {
                    foreach (HotkeywordInfo item in hotKeywords)
                    {
                        stringBuilder.AppendFormat("<li><a target=\"_blank\" href=\"{0}\">{1}</a></li>", base.GetRouteUrl("subCategory", new
                        {
                            categoryId = item.CategoryId
                        }) + "?keywords=" + Globals.UrlEncode(item.Keywords), item.Keywords).AppendLine();
                    }
                }
                stringBuilder.AppendLine("</ul>");
            }
            return(stringBuilder.ToString());
        }
Beispiel #3
0
        public string RendHtml()
        {
            XmlNode       xmlNode       = TagsHelper.FindCommentNode(this.CommentId, "category");
            StringBuilder stringBuilder = new StringBuilder();

            if (xmlNode != null)
            {
                stringBuilder.AppendFormat("<div class=\"category cssEdite\" type=\"category\" id=\"comments_{0}\" >", this.CommentId).AppendLine();
                int parentCategoryId = 0;
                int maxNum           = 0;
                int.TryParse(xmlNode.Attributes["CategoryId"].Value, out parentCategoryId);
                int.TryParse(xmlNode.Attributes["MaxNum"].Value, out maxNum);
                IList <CategoryInfo> maxSubCategories = CategoryBrowser.GetMaxSubCategories(parentCategoryId, maxNum);
                if (maxSubCategories != null && maxSubCategories.Count > 0)
                {
                    stringBuilder.AppendLine("<ul>");
                    foreach (CategoryInfo current in maxSubCategories)
                    {
                        stringBuilder.AppendFormat("<li><a target=\"_blank\" href=\"{0}\">{1}</a></li>", Globals.GetSiteUrls().SubCategory(current.CategoryId, current.RewriteName), current.Name).AppendLine();
                    }
                    stringBuilder.AppendLine("</ul>");
                }
                stringBuilder.AppendLine("</div>");
            }
            return(stringBuilder.ToString());
        }
        public string RendHtml()
        {
            XmlNode       xmlNode       = TagsHelper.FindCommentNode(this.CommentId, "category");
            StringBuilder stringBuilder = new StringBuilder();

            if (xmlNode != null)
            {
                stringBuilder.AppendFormat("<div class=\"category cssEdite\" type=\"category\" id=\"comments_{0}\" >", this.CommentId).AppendLine();
                int parentCategoryId = 0;
                int count            = 0;
                int.TryParse(xmlNode.Attributes["CategoryId"].Value, out parentCategoryId);
                int.TryParse(xmlNode.Attributes["MaxNum"].Value, out count);
                IEnumerable <CategoryInfo> subCategories = CatalogHelper.GetSubCategories(parentCategoryId);
                if (subCategories != null)
                {
                    stringBuilder.AppendLine("<ul>");
                    IEnumerable <CategoryInfo> enumerable = subCategories.Take(count);
                    foreach (CategoryInfo item in enumerable)
                    {
                        string arg = (!string.IsNullOrEmpty(item.RewriteName)) ? base.GetRouteUrl("subCategory_Rewrite", new
                        {
                            rewrite    = item.RewriteName,
                            categoryId = item.CategoryId
                        }) : base.GetRouteUrl("subCategory", new
                        {
                            categoryId = item.CategoryId
                        });
                        stringBuilder.AppendFormat("<li><a target=\"_blank\" href=\"{0}\">{1}</a></li>", arg, item.Name).AppendLine();
                    }
                    stringBuilder.AppendLine("</ul>");
                }
                stringBuilder.AppendLine("</div>");
            }
            return(stringBuilder.ToString());
        }
Beispiel #5
0
        public string RendHtml()
        {
            XmlNode       node = TagsHelper.FindCommentNode(this.CommentId, "article");
            StringBuilder sb   = new StringBuilder();

            if (node != null)
            {
                sb.AppendFormat("<div class=\"article cssEdite\" type=\"article\" id=\"comments_{0}\" >", this.CommentId).AppendLine();
                this.RenderHeader(node, sb);
                sb.AppendLine("<div class=\"article_bd\">");
                if (!string.IsNullOrEmpty(node.Attributes["AdImage"].Value))
                {
                    sb.AppendFormat("<div class=\"article_ad\"><img src=\"{0}\" /></div>", node.Attributes["AdImage"].Value).AppendLine();
                }
                int result = 0;
                int num2   = 0;
                int.TryParse(node.Attributes["CategoryId"].Value, out result);
                int.TryParse(node.Attributes["MaxNum"].Value, out num2);
                IList <ArticleInfo> articleList = CommentBrowser.GetArticleList(result, num2);
                if ((articleList != null) && (articleList.Count > 0))
                {
                    sb.AppendLine("<div class=\"article_list\">");
                    sb.AppendLine("<ul>");
                    foreach (ArticleInfo info in articleList)
                    {
                        sb.AppendFormat("<li><a target=\"_blank\" href=\"{0}\">{1}</a></li>", Globals.GetSiteUrls().UrlData.FormatUrl("ArticleDetails", new object[] { info.ArticleId }), info.Title).AppendLine();
                    }
                    sb.AppendLine("</ul>");
                    sb.AppendLine("</div>");
                }
                sb.AppendLine("</div>");
                sb.AppendLine("</div>");
            }
            return(sb.ToString());
        }
Beispiel #6
0
        public string RendHtml()
        {
            XmlNode       node    = TagsHelper.FindCommentNode(this.CommentId, "category");
            StringBuilder builder = new StringBuilder();

            if (node != null)
            {
                builder.AppendFormat("<div class=\"category cssEdite\" type=\"category\" id=\"comments_{0}\" >", this.CommentId).AppendLine();
                int result = 0;
                int num2   = 0;
                int.TryParse(node.Attributes["CategoryId"].Value, out result);
                int.TryParse(node.Attributes["MaxNum"].Value, out num2);
                IList <CategoryInfo> maxSubCategories = CategoryBrowser.GetMaxSubCategories(result, num2);
                if ((maxSubCategories != null) && (maxSubCategories.Count > 0))
                {
                    builder.AppendLine("<ul>");
                    foreach (CategoryInfo info in maxSubCategories)
                    {
                        builder.AppendFormat("<li><a target=\"_blank\" href=\"{0}\">{1}</a></li>", Globals.GetSiteUrls().SubCategory(info.CategoryId, info.RewriteName), info.Name).AppendLine();
                    }
                    builder.AppendLine("</ul>");
                }
                builder.AppendLine("</div>");
            }
            return(builder.ToString());
        }
Beispiel #7
0
        public string RendHtml()
        {
            StringBuilder stringBuilder = new StringBuilder();
            XmlNode       xmlNode       = TagsHelper.FindCommentNode(this.CommentId, "attribute");

            if (xmlNode != null)
            {
                stringBuilder.AppendFormat("<div class=\"attribute_bd cssEdite\" type=\"attribute\" id=\"comments_{0}\" >", this.CommentId).AppendLine();
                int categoryId = 0;
                int num        = 0;
                int.TryParse(xmlNode.Attributes["CategoryId"].Value, out categoryId);
                int.TryParse(xmlNode.Attributes["MaxNum"].Value, out num);
                string       text     = null;
                CategoryInfo category = CatalogHelper.GetCategory(categoryId);
                if (category != null)
                {
                    text = category.RewriteName;
                }
                IList <AttributeInfo> attributeInfoByCategoryId = ProductTypeHelper.GetAttributeInfoByCategoryId(categoryId, 1000);
                string text2 = (!string.IsNullOrWhiteSpace(text)) ? base.GetRouteUrl("subCategory_Rewrite", new
                {
                    rewrite    = text,
                    categoryId = categoryId
                }) : base.GetRouteUrl("subCategory", new
                {
                    categoryId
                });
                if (attributeInfoByCategoryId != null && attributeInfoByCategoryId.Count > 0)
                {
                    foreach (AttributeInfo item in attributeInfoByCategoryId)
                    {
                        stringBuilder.AppendLine("<dl class=\"attribute_dl\">");
                        stringBuilder.AppendFormat("<dt class=\"attribute_name\">{0}:</dt>", item.AttributeName).AppendLine();
                        stringBuilder.AppendLine("<dd class=\"attribute_val\">");
                        stringBuilder.AppendLine("<div class=\"h_chooselist\">");
                        foreach (AttributeValueInfo attributeValue in item.AttributeValues)
                        {
                            stringBuilder.AppendFormat("<a href=\"{0}\" >{1}</a>", text2 + "?valueStr=" + attributeValue.AttributeId + "_" + attributeValue.ValueId, attributeValue.ValueStr).AppendLine();
                        }
                        stringBuilder.AppendLine("</div>");
                        stringBuilder.AppendLine("</dd>");
                        stringBuilder.AppendLine("</dl>");
                    }
                }
                stringBuilder.AppendLine("</div>");
            }
            return(stringBuilder.ToString());
        }
        public string RendHtml()
        {
            StringBuilder stringBuilder = new StringBuilder();
            XmlNode       xmlNode       = TagsHelper.FindCommentNode(this.CommentId, "attribute");

            if (xmlNode != null)
            {
                stringBuilder.AppendFormat("<div class=\"attribute_bd cssEdite\" type=\"attribute\" id=\"comments_{0}\" >", this.CommentId).AppendLine();
                int categoryId = 0;
                int num        = 0;
                int.TryParse(xmlNode.Attributes["CategoryId"].Value, out categoryId);
                int.TryParse(xmlNode.Attributes["MaxNum"].Value, out num);
                string       rewriteName = null;
                CategoryInfo category    = CategoryBrowser.GetCategory(categoryId);
                if (category != null)
                {
                    rewriteName = category.RewriteName;
                }
                IList <AttributeInfo> attributeInfoByCategoryId = CategoryBrowser.GetAttributeInfoByCategoryId(categoryId, 1000);
                if (attributeInfoByCategoryId != null && attributeInfoByCategoryId.Count > 0)
                {
                    foreach (AttributeInfo current in attributeInfoByCategoryId)
                    {
                        stringBuilder.AppendLine("<dl class=\"attribute_dl\">");
                        stringBuilder.AppendFormat("<dt class=\"attribute_name\">{0}:</dt>", current.AttributeName).AppendLine();
                        stringBuilder.AppendLine("<dd class=\"attribute_val\">");
                        stringBuilder.AppendLine("<div class=\"h_chooselist\">");
                        foreach (AttributeValueInfo current2 in current.AttributeValues)
                        {
                            stringBuilder.AppendFormat("<a href=\"{0}\" >{1}</a>", string.Concat(new object[]
                            {
                                Globals.GetSiteUrls().SubCategory(categoryId, rewriteName),
                                "?valueStr=",
                                current2.AttributeId,
                                "_",
                                current2.ValueId
                            }), current2.ValueStr).AppendLine();
                        }
                        stringBuilder.AppendLine("</div>");
                        stringBuilder.AppendLine("</dd>");
                        stringBuilder.AppendLine("</dl>");
                    }
                }
                stringBuilder.AppendLine("</div>");
            }
            return(stringBuilder.ToString());
        }
        public string RendHtml()
        {
            XmlNode       xmlNode       = TagsHelper.FindCommentNode(this.CommentId, "brand");
            StringBuilder stringBuilder = new StringBuilder();

            if (xmlNode != null)
            {
                stringBuilder.AppendFormat("<div class=\"brand cssEdite\" type=\"brand\" id=\"comments_{0}\" >", this.CommentId).AppendLine();
                int  categoryId = 0;
                int  maxNum     = 0;
                bool flag       = true;
                bool flag2      = true;
                int.TryParse(xmlNode.Attributes["CategoryId"].Value, out categoryId);
                int.TryParse(xmlNode.Attributes["MaxNum"].Value, out maxNum);
                bool.TryParse(xmlNode.Attributes["IsShowLogo"].Value, out flag);
                bool.TryParse(xmlNode.Attributes["IsShowTitle"].Value, out flag2);
                string    value           = xmlNode.Attributes["ImageSize"].Value;
                DataTable brandCategories = CategoryBrowser.GetBrandCategories(categoryId, maxNum);
                if (brandCategories != null && brandCategories.Rows.Count > 0)
                {
                    stringBuilder.AppendLine("<ul>");
                    foreach (DataRow dataRow in brandCategories.Rows)
                    {
                        stringBuilder.AppendLine("<li>");
                        if (flag)
                        {
                            stringBuilder.AppendFormat("<div class=\"pic\"><a target=\"_blank\" href=\"{0}\"><img src=\"{1}\" width=\"{2}\"></a></div>", Globals.GetSiteUrls().SubBrandDetails((int)dataRow["BrandId"], dataRow["RewriteName"]), dataRow["Logo"], value.Split(new char[]
                            {
                                '*'
                            })[0]).AppendLine();
                        }
                        if (flag2)
                        {
                            stringBuilder.AppendFormat("<div class=\"name\"><a target=\"_blank\" href=\"{0}\">{1}</a></div>", Globals.GetSiteUrls().SubBrandDetails((int)dataRow["BrandId"], dataRow["RewriteName"]), dataRow["BrandName"]).AppendLine();
                        }
                        stringBuilder.AppendLine("</li>");
                    }
                    stringBuilder.AppendLine("</ul>");
                }
                stringBuilder.AppendLine("</div>");
            }
            return(stringBuilder.ToString());
        }
        public string RendHtml()
        {
            string        text          = this.IsDelayedLoading ? "data-url" : "src";
            XmlNode       xmlNode       = TagsHelper.FindCommentNode(this.CommentId, "brand");
            StringBuilder stringBuilder = new StringBuilder();

            if (xmlNode != null)
            {
                stringBuilder.AppendFormat("<div class=\"brand cssEdite\" type=\"brand\" id=\"comments_{0}\" >", this.CommentId).AppendLine();
                int    categoryId = 0;
                int    maxNum     = 0;
                bool   flag       = true;
                bool   flag2      = true;
                string text2      = "";
                int.TryParse(xmlNode.Attributes["CategoryId"].Value, out categoryId);
                int.TryParse(xmlNode.Attributes["MaxNum"].Value, out maxNum);
                bool.TryParse(xmlNode.Attributes["IsShowLogo"].Value, out flag);
                bool.TryParse(xmlNode.Attributes["IsShowTitle"].Value, out flag2);
                text2 = xmlNode.Attributes["ImageSize"].Value;
                IEnumerable <BrandMode> brandCategories = CatalogHelper.GetBrandCategories(categoryId, maxNum);
                if (brandCategories != null)
                {
                    stringBuilder.AppendLine("<ul>");
                    foreach (BrandMode item in brandCategories)
                    {
                        stringBuilder.AppendLine("<li>");
                        if (flag)
                        {
                            stringBuilder.AppendFormat("<div class=\"pic\"><a target=\"_blank\" href=\"{0}\"><img {3}=\"{1}\" width=\"{2}\"></a></div>", RouteConfig.SubBrandDetails(item.BrandId, item.RewriteName), Globals.GetImageServerUrl("http://", item.Logo), text2.Split('*')[0], text).AppendLine();
                        }
                        if (flag2)
                        {
                            stringBuilder.AppendFormat("<div class=\"name\"><a target=\"_blank\" href=\"{0}\">{1}</a></div>", RouteConfig.SubBrandDetails(item.BrandId, item.RewriteName), item.BrandName).AppendLine();
                        }
                        stringBuilder.AppendLine("</li>");
                    }
                    stringBuilder.AppendLine("</ul>");
                }
                stringBuilder.AppendLine("</div>");
            }
            return(stringBuilder.ToString());
        }
        public string RendHtml()
        {
            XmlNode       node    = TagsHelper.FindCommentNode(this.CommentId, "morelink");
            StringBuilder builder = new StringBuilder();

            if (node != null)
            {
                builder.AppendFormat("<div class=\"morelink cssEdite\" type=\"morelink\" id=\"comments_{0}\" >", this.CommentId).AppendLine();
                int result = 0;
                if (int.TryParse(node.Attributes["CategoryId"].Value, out result))
                {
                    builder.AppendFormat("<em><a href=\"{0}\">{1}</a></em>", Globals.GetSiteUrls().SubCategory(result, null), node.Attributes["Title"].Value).AppendLine();
                }
                else
                {
                    builder.AppendFormat("<em><a href=\"{0}/SubCategory.aspx\">{1}</a></em>", Globals.ApplicationPath, node.Attributes["Title"].Value).AppendLine();
                }
                builder.AppendLine("</div>");
            }
            return(builder.ToString());
        }
Beispiel #12
0
        public string RendHtml()
        {
            StringBuilder builder = new StringBuilder();
            XmlNode       node    = TagsHelper.FindCommentNode(this.CommentId, "attribute");

            if (node != null)
            {
                builder.AppendFormat("<div class=\"attribute_bd cssEdite\" type=\"attribute\" id=\"comments_{0}\" >", this.CommentId).AppendLine();
                int result = 0;
                int num2   = 0;
                int.TryParse(node.Attributes["CategoryId"].Value, out result);
                int.TryParse(node.Attributes["MaxNum"].Value, out num2);
                string       rewriteName = null;
                CategoryInfo category    = CategoryBrowser.GetCategory(result);
                if (category != null)
                {
                    rewriteName = category.RewriteName;
                }
                IList <AttributeInfo> attributeInfoByCategoryId = CategoryBrowser.GetAttributeInfoByCategoryId(result, 0x3e8);
                if ((attributeInfoByCategoryId != null) && (attributeInfoByCategoryId.Count > 0))
                {
                    foreach (AttributeInfo info2 in attributeInfoByCategoryId)
                    {
                        builder.AppendLine("<dl class=\"attribute_dl\">");
                        builder.AppendFormat("<dt class=\"attribute_name\">{0}:</dt>", info2.AttributeName).AppendLine();
                        builder.AppendLine("<dd class=\"attribute_val\">");
                        builder.AppendLine("<div class=\"h_chooselist\">");
                        foreach (AttributeValueInfo info3 in info2.AttributeValues)
                        {
                            builder.AppendFormat("<a href=\"{0}\" >{1}</a>", string.Concat(new object[] { Globals.GetSiteUrls().SubCategory(result, rewriteName), "?valueStr=", info3.AttributeId, "_", info3.ValueId }), info3.ValueStr).AppendLine();
                        }
                        builder.AppendLine("</div>");
                        builder.AppendLine("</dd>");
                        builder.AppendLine("</dl>");
                    }
                }
                builder.AppendLine("</div>");
            }
            return(builder.ToString());
        }
Beispiel #13
0
        public string RendHtml()
        {
            XmlNode       xmlNode       = TagsHelper.FindCommentNode(this.CommentId, "title");
            StringBuilder stringBuilder = new StringBuilder();

            if (xmlNode != null)
            {
                stringBuilder.AppendFormat("<div class=\"title cssEdite\" type=\"title\" id=\"comments_{0}\" >", this.CommentId).AppendLine();
                stringBuilder.AppendLine("<div>");
                if (!string.IsNullOrEmpty(xmlNode.Attributes["ImageTitle"].Value))
                {
                    stringBuilder.AppendFormat("<span class=\"icon\"><img src=\"{0}\" /></span>", Globals.ApplicationPath + xmlNode.Attributes["ImageTitle"].Value);
                }
                if (!string.IsNullOrEmpty(xmlNode.Attributes["Title"].Value))
                {
                    stringBuilder.AppendFormat("<span class=\"title\">{0}</span>", xmlNode.Attributes["Title"].Value);
                }
                stringBuilder.AppendLine("</div>");
                stringBuilder.AppendLine("</div>");
            }
            return(stringBuilder.ToString());
        }
Beispiel #14
0
        public string RendHtml()
        {
            string        arg           = this.IsDelayedLoading ? "data-url" : "src";
            XmlNode       xmlNode       = TagsHelper.FindCommentNode(this.CommentId, "article");
            StringBuilder stringBuilder = new StringBuilder();

            if (xmlNode != null)
            {
                stringBuilder.AppendFormat("<div class=\"article cssEdite\" type=\"article\" id=\"comments_{0}\" >", this.CommentId).AppendLine();
                this.RenderHeader(xmlNode, stringBuilder);
                stringBuilder.AppendLine("<div class=\"article_bd\">");
                if (!string.IsNullOrEmpty(xmlNode.Attributes["AdImage"].Value))
                {
                    stringBuilder.AppendFormat("<div class=\"article_ad\"><img {1}=\"{0}\" /></div>", Globals.GetImageServerUrl("http://", xmlNode.Attributes["AdImage"].Value), arg).AppendLine();
                }
                int categoryId = 0;
                int maxNum     = 0;
                int.TryParse(xmlNode.Attributes["CategoryId"].Value, out categoryId);
                int.TryParse(xmlNode.Attributes["MaxNum"].Value, out maxNum);
                IList <ArticleInfo> articleList = CommentBrowser.GetArticleList(categoryId, maxNum);
                if (articleList != null && articleList.Count > 0)
                {
                    stringBuilder.AppendLine("<div class=\"article_list\">");
                    stringBuilder.AppendLine("<ul>");
                    foreach (ArticleInfo item in articleList)
                    {
                        stringBuilder.AppendFormat("<li><a target=\"_blank\" href=\"{0}\">{1}</a></li>", base.GetRouteUrl("ArticleDetails", new
                        {
                            articleId = item.ArticleId
                        }), item.Title).AppendLine();
                    }
                    stringBuilder.AppendLine("</ul>");
                    stringBuilder.AppendLine("</div>");
                }
                stringBuilder.AppendLine("</div>");
                stringBuilder.AppendLine("</div>");
            }
            return(stringBuilder.ToString());
        }
Beispiel #15
0
        public string RendHtml()
        {
            XmlNode       xmlNode       = TagsHelper.FindCommentNode(this.CommentId, "keyword");
            StringBuilder stringBuilder = new StringBuilder();

            if (xmlNode != null)
            {
                int categoryId     = 0;
                int categoryId2    = 0;
                int hotKeywordsNum = 0;
                int.TryParse(xmlNode.Attributes["CategoryId"].Value, out categoryId2);
                int.TryParse(xmlNode.Attributes["MaxNum"].Value, out hotKeywordsNum);
                CategoryInfo category = CategoryBrowser.GetCategory(categoryId2);
                if (category != null)
                {
                    categoryId = category.TopCategoryId;
                }
                //DataTable hotKeywords = CommentBrowser.GetHotKeywords(categoryId, hotKeywordsNum);

                DataTable hotKeywords = CommentBrowser.GetHotKeywords(categoryId, hotKeywordsNum, ClientType.PC);
                stringBuilder.AppendFormat("<ul class=\"keyword cssEdite\" type=\"keyword\" id=\"comments_{0}\" >", this.CommentId).AppendLine();
                if (hotKeywords != null && hotKeywords.Rows.Count > 0)
                {
                    foreach (DataRow dataRow in hotKeywords.Rows)
                    {
                        if (dataRow["CategoryId"] != DBNull.Value)
                        {
                            stringBuilder.AppendFormat("<li><a target=\"_blank\" href=\"{0}\">{1}</a></li>", Globals.GetSiteUrls().SubCategory((int)dataRow["CategoryId"], null) + "?keywords=" + Globals.UrlEncode((string)dataRow["Keywords"]), dataRow["Keywords"]).AppendLine();
                        }
                        else
                        {
                            stringBuilder.AppendFormat("<li><a target=\"_blank\" href=\"{0}\">{1}</a></li>", "/SubCategory.aspx?keywords=" + Globals.UrlEncode((string)dataRow["Keywords"]), dataRow["Keywords"]).AppendLine();
                        }
                    }
                }
                stringBuilder.AppendLine("</ul>");
            }
            return(stringBuilder.ToString());
        }
Beispiel #16
0
        public string RendHtml()
        {
            XmlNode       xmlNode       = TagsHelper.FindCommentNode(this.CommentId, "article");
            StringBuilder stringBuilder = new StringBuilder();

            if (xmlNode != null)
            {
                stringBuilder.AppendFormat("<div class=\"article cssEdite\" type=\"article\" id=\"comments_{0}\" >", this.CommentId).AppendLine();
                this.RenderHeader(xmlNode, stringBuilder);
                stringBuilder.AppendLine("<div class=\"article_bd\">");
                if (!string.IsNullOrEmpty(xmlNode.Attributes["AdImage"].Value))
                {
                    stringBuilder.AppendFormat("<div class=\"article_ad\"><img src=\"{0}\" /></div>", xmlNode.Attributes["AdImage"].Value).AppendLine();
                }
                int categoryId = 0;
                int maxNum     = 0;
                int.TryParse(xmlNode.Attributes["CategoryId"].Value, out categoryId);
                int.TryParse(xmlNode.Attributes["MaxNum"].Value, out maxNum);
                IList <ArticleInfo> articleList = CommentBrowser.GetArticleList(categoryId, maxNum);
                if (articleList != null && articleList.Count > 0)
                {
                    stringBuilder.AppendLine("<div class=\"article_list\">");
                    stringBuilder.AppendLine("<ul>");
                    foreach (ArticleInfo current in articleList)
                    {
                        stringBuilder.AppendFormat("<li><a target=\"_blank\" href=\"{0}\">{1}</a></li>", Globals.GetSiteUrls().UrlData.FormatUrl("ArticleDetails", new object[]
                        {
                            current.ArticleId
                        }), current.Title).AppendLine();
                    }
                    stringBuilder.AppendLine("</ul>");
                    stringBuilder.AppendLine("</div>");
                }
                stringBuilder.AppendLine("</div>");
                stringBuilder.AppendLine("</div>");
            }
            return(stringBuilder.ToString());
        }
Beispiel #17
0
        public string RendHtml()
        {
            string        arg           = this.IsDelayedLoading ? "data-url" : "src";
            XmlNode       xmlNode       = TagsHelper.FindCommentNode(this.CommentId, "title");
            StringBuilder stringBuilder = new StringBuilder();

            if (xmlNode != null)
            {
                stringBuilder.AppendFormat("<div class=\"title cssEdite\" type=\"title\" id=\"comments_{0}\" >", this.CommentId).AppendLine();
                stringBuilder.AppendLine("<div>");
                if (!string.IsNullOrEmpty(xmlNode.Attributes["ImageTitle"].Value))
                {
                    stringBuilder.AppendFormat("<span class=\"icon\"><img {1}=\"{0}\" /></span>", Globals.GetImageServerUrl("http://", xmlNode.Attributes["ImageTitle"].Value), arg);
                }
                if (!string.IsNullOrEmpty(xmlNode.Attributes["Title"].Value))
                {
                    stringBuilder.AppendFormat("<span class=\"title\">{0}</span>", xmlNode.Attributes["Title"].Value);
                }
                stringBuilder.AppendLine("</div>");
                stringBuilder.AppendLine("</div>");
            }
            return(stringBuilder.ToString());
        }
Beispiel #18
0
        public string RendHtml()
        {
            XmlNode       xmlNode       = TagsHelper.FindCommentNode(this.CommentId, "morelink");
            StringBuilder stringBuilder = new StringBuilder();

            if (xmlNode != null)
            {
                stringBuilder.AppendFormat("<div class=\"morelink cssEdite\" type=\"morelink\" id=\"comments_{0}\" >", this.CommentId).AppendLine();
                int categoryId = 0;
                if (int.TryParse(xmlNode.Attributes["CategoryId"].Value, out categoryId))
                {
                    stringBuilder.AppendFormat("<em><a href=\"{0}\">{1}</a></em>", base.GetRouteUrl("subCategory", new
                    {
                        categoryId
                    }), xmlNode.Attributes["Title"].Value).AppendLine();
                }
                else
                {
                    stringBuilder.AppendFormat("<em><a href=\"/SubCategory.aspx\">{0}</a></em>", Globals.HtmlDecode(xmlNode.Attributes["Title"].Value)).AppendLine();
                }
                stringBuilder.AppendLine("</div>");
            }
            return(stringBuilder.ToString());
        }