public ActionResult Index() { Entity.blog_tb_article article = Utility.ArticleBll.GetEntity(this.articleID); if (article == null) { return(Content("文章不存在")); } if (article.articleIsDelete) { return(Content("文章被删除到回收站")); } bool isDisabled = Utility.ArticleBll.IsArticleDisabled(this.articleID); if (isDisabled) { return(Content("文章、分类或博客被暂时关闭或禁用")); } if ((!String.IsNullOrEmpty(article.articlePassword)) && (Session["Autharticle"] == null || !Session["Autharticle"].ToString().Contains(this.articleID))) { return(new RedirectResult("/ArticlePassword?articleID=" + articleID + "&BackUrl=" + Server.UrlEncode("http://" + base.Domain + "/artic-" + articleID + ".html"))); } //更新最后打开时间 Utility.ArticleBll.UpdateExtend(articleID, Utility.GetClientIP(this.HttpContext), Utility.UserID); string theme = Utility.ArticleBll.GetArticleThemeID(this.articleID); if (!String.IsNullOrEmpty(Request.QueryString["ver"])) { theme = Request.QueryString["ver"]; } ShowViewModel viewmodel = GetModel(article); if (theme.Equals("SimpleShow", StringComparison.CurrentCultureIgnoreCase)) { return(View("~/Views/Blog/Common/SimpleShow.cshtml", viewmodel)); } return(View("~/Views/Blog/Themes/" + theme + "/Show.cshtml", viewmodel)); }
public override int Update(Entity.blog_tb_article entity) { throw new NotImplementedException(); }
public ActionResult ArtilePhotoShow() { string articleID = Request["articleID"]; PhotoShowViewModel model = new PhotoShowViewModel(); model.SiteID = BlogID; model.PhotoCollection = new List <Entity.blog_tb_Photo>(); Entity.blog_tb_article article = Utility.ArticleBll.GetEntity(articleID); model.Title = article.articleTitle + "- 查看图片 -" + base.Info.blogTitle; List <blog_attachment> list = Utility.ArticleBll.GetArticlePhotos(articleID); if (list.Count == 0) { return(Content("没有查询到该文章的图片")); } //是否远程IP地址 2015-6-16 bool isRemote = Utility.IsRemote; foreach (var v in list) { Entity.blog_tb_Photo entity = new Entity.blog_tb_Photo(); entity.ID = v.fileID; entity.Display = v.fileName; string thumbUrl = v.fileThumbUrl; if (isRemote) { thumbUrl = Utility.ReplaceImgOrFileSrc(thumbUrl); } string url = v.fileUrl; if (isRemote) { url = Utility.ReplaceImgOrFileSrc(url); } if (String.IsNullOrEmpty(thumbUrl)) { thumbUrl = url; } entity.ThumbUrl = thumbUrl; entity.Url = url; if (String.IsNullOrEmpty(entity.Display)) { entity.Display = System.IO.Path.GetFileName(entity.Url); } if (!String.IsNullOrEmpty(v.Exif)) { entity.Exif = "文件名:" + entity.Display + "<br/>" + v.Exif.Replace("\n", "<br/>"); } model.PhotoCollection.Add(entity); string currentUri = Server.UrlDecode(Request["uri"]); if (entity.ThumbUrl == currentUri || entity.Url == currentUri) { model.CurrentThumbUrl = thumbUrl; model.CurrentUrl = url; } } if (String.IsNullOrEmpty(model.CurrentThumbUrl)) { model.CurrentThumbUrl = model.PhotoCollection.First().ThumbUrl; } if (String.IsNullOrEmpty(model.CurrentUrl)) { model.CurrentUrl = model.PhotoCollection.First().Url; } return(View("~/Views/Album/" + GetVersion() + "/PhotoShow.cshtml", model)); }