示例#1
0
 private static string AutoCategoryLink(Match match)
 {
     if (match.Groups["term"].Success)
     {
         return("<a href=\"" + CategoryUrlConfig.PrepareUrl(match.Groups["term"].Value, "blogs/") + "\" title=\"" + match.Groups["term"].Value.ToString().Trim() + "\">" + match.Groups["term"].Value.ToString() + "</a>");
     }
     else
     {
         // no match
         return(match.Groups["hrefurl"].Value);
     }
 }
示例#2
0
        public async Task <ActionResult> getinfo()
        {
            var json   = new StreamReader(Request.Body).ReadToEnd();
            var data   = JsonConvert.DeserializeObject <List <CategoryEntity> >(json);
            var _posts = await CategoryBLL.LoadItems(_context, data[0]);

            if (_posts.Count > 0)
            {
                _posts[0].img_url = CategoryUrlConfig.PrepareImageUrl(_posts[0]);
                return(Ok(new { status = "success", post = _posts[0] }));
            }
            else
            {
                return(Ok(new { status = "error", message = SiteConfig.generalLocalizer["_no_records"].Value }));
            }
        }
示例#3
0
        public static async Task <string> Bing_CategorySitemap(ApplicationDbContext context, CategoryEntity Entity)
        {
            var str = new StringBuilder();

            str.AppendLine("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
            str.AppendLine("<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">");
            var _lst = await CategoryBLL.LoadItems(context, Entity);

            string path = "videos/";

            foreach (var Item in _lst)
            {
                str.AppendLine("<url>");
                str.AppendLine("<loc>" + CategoryUrlConfig.PrepareUrl(Item, path) + "</loc>");
                str.Append("</url>");
            }
            str.AppendLine("</urlset>");

            return(str.ToString());
        }