Ejemplo n.º 1
0
        /// <summary>
        /// 初始化
        /// </summary>
        /// <param name="e"></param>
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            Links = new List <Link>();
            LinkHelper LinkHelper = HelperFactory.GetHelper <LinkHelper>();

            if (tag.Contains(","))
            {
                tag = tag.Substring(0, tag.IndexOf(","));
            }
            if (DesignHelper.IsDesigning)
            {
                List <Link> links;
                DesignHelper.FillItems <Link>(out links, PageSize);
                foreach (Link link in links)
                {
                    link.Thumbnail = DesignHelper.GetTagThumbnail("small");
                }
                Links = links;
            }
            else
            {
                Links = LinkHelper.GetPagedAllLinks(0, PageSize, "", tag);
            }
            if (ColumnCount <= 0)
            {
                columnCount = PageSize;
            }
        }
Ejemplo n.º 2
0
 public string GetBanner()
 {
     if (DesignHelper.IsDesigning)
     {
         return(DesignHelper.GetTagThumbnail("banner"));
     }
     else
     {
         return("/_data/Channels/banners/banner_" + GetChannelName(Level) + ".jpg");
     }
 }
Ejemplo n.º 3
0
 /// <summary>
 /// 根据栏目名称取Banner
 /// </summary>
 /// <returns></returns>
 protected string GetBannerByName()
 {
     if (DesignHelper.IsDesigning)
     {
         return(DesignHelper.GetTagThumbnail("class"));
     }
     else
     {
         return("/_data/Channels/banners/banner_" + GetChannelName(Level) + ".jpg");
     }
 }
Ejemplo n.º 4
0
        /// <summary>
        /// 取得小图路径
        /// </summary>
        /// <param name="urlSource">大图的路径字符串</param>
        /// <returns>小图地址</returns>
        public string GetSmallPhoto(string urlSource)
        {
            string photoName = null;

            if (DesignHelper.IsDesigning)
            {
                photoName = DesignHelper.GetTagThumbnail(ThumbnailTagSmall);
            }
            else
            {
                photoName = ThisArticle.GetTagThumbnail(ThumbnailTagSmall);
            }
            return(photoName);
        }
Ejemplo n.º 5
0
 public string GetTagThumbnail(Article article, string tag)
 {
     if (DesignHelper.IsDesigning)
     {
         return(DesignHelper.GetTagThumbnail(tag));
     }
     else
     {
         if (!String.IsNullOrEmpty(article.Thumbnail))
         {
             return(article != null?article.GetTagThumbnail(tag) : String.Empty);
         }
     }
     return(String.Empty);
 }