本文整理汇总了C#中ContentPost.GetImgThumb方法的典型用法代码示例。如果您正苦于以下问题:C# ContentPost.GetImgThumb方法的具体用法?C# ContentPost.GetImgThumb怎么用?C# ContentPost.GetImgThumb使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ContentPost
的用法示例。
在下文中一共展示了ContentPost.GetImgThumb方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: bindSectionShow
private void bindSectionShow( long sectionId, int postcat, int imgcat, List<ContentPost> posts, ContentPost img ) {
set( "postAddUrl", to( new Common.PostController().Add, sectionId ) + "?categoryId=" + postcat );
set( "postListUrl", to( new ListController().AdminList, sectionId ) + "?categoryId=" + postcat );
set( "imgAddUrl", to( new Common.PostController().Add, sectionId ) + "?categoryId=" + imgcat );
set( "imgListUrl", to( new ListController().AdminList, sectionId ) + "?categoryId=" + imgcat );
IBlock block = getBlock( "list" );
foreach (ContentPost post in posts) {
block.Set( "post.TitleCss", post.Style );
block.Set( "post.TitleFull", post.Title );
if (strUtil.HasText( post.TitleHome ))
block.Set( "post.Title", post.TitleHome );
else
block.Set( "post.Title", post.Title );
block.Set( "post.Url", to( new Common.PostController().Edit, post.Id ) );
block.Set( "post.Created", post.Created.ToShortTimeString() );
block.Next();
}
IBlock imgBlock = getBlock( "img" );
if (img != null) {
imgBlock.Set( "ipost.ImgUrl", img.GetImgThumb() );
imgBlock.Set( "ipost.TitleCss", img.Style );
imgBlock.Set( "ipost.TitleFull", img.Title );
if (strUtil.HasText( img.TitleHome ))
imgBlock.Set( "ipost.Title", img.TitleHome );
else
imgBlock.Set( "ipost.Title", img.Title );
String content = strUtil.HasText( img.Summary ) ? img.Summary : strUtil.ParseHtml( img.Content, 50 );
imgBlock.Set( "ipost.Content", content );
imgBlock.Set( "ipost.Width", img.Width );
imgBlock.Set( "ipost.Height", img.Height );
imgBlock.Set( "ipost.EditLink", to( new Common.PostController().EditImg, img.Id ) );
imgBlock.Next();
}
}
示例2: bindSectionShow
private void bindSectionShow( List<ContentPost> posts, ContentPost img )
{
IBlock block = getBlock( "list" );
foreach (ContentPost post in posts) {
BinderUtils.bindPostSingle( block, post );
block.Next();
}
IBlock imgBlock = getBlock( "img" );
if (img != null) {
imgBlock.Set( "ipost.TitleCss", img.Style );
imgBlock.Set( "ipost.TitleFull", img.Title );
if (strUtil.HasText( img.TitleHome ))
block.Set( "ipost.Title", img.TitleHome );
else
block.Set( "ipost.Title", img.Title );
if (img.ImgLink.StartsWith( "/" ) || img.ImgLink.StartsWith( "http://" ))
imgBlock.Set( "ipost.ImgUrl", img.ImgLink );
else
imgBlock.Set( "ipost.ImgUrl", img.GetImgThumb() );
String content = strUtil.HasText( img.Summary ) ? img.Summary : strUtil.ParseHtml( img.Content, 50 );
imgBlock.Set( "ipost.Content", content );
int width = img.Width <= 0 ? 120 : img.Width;
int height = img.Height <= 0 ? 90 : img.Height;
imgBlock.Set( "ipost.Width", width );
imgBlock.Set( "ipost.Height", height );
imgBlock.Set( "ipost.Url", alink.ToAppData( img ) );
imgBlock.Bind( "ipost", img );
imgBlock.Next();
}
}
示例3: bindTopImg
private void bindTopImg( ContentPost img ) {
IBlock imgBlock = getBlock( "img" );
if (img != null) {
imgBlock.Set( "ipost.ImgUrl", img.GetImgThumb() );
imgBlock.Set( "ipost.TitleCss", img.Style );
imgBlock.Set( "ipost.TitleFull", img.Title );
if (strUtil.HasText( img.TitleHome ))
imgBlock.Set( "ipost.Title", img.TitleHome );
else
imgBlock.Set( "ipost.Title", img.Title );
String content = strUtil.HasText( img.Summary ) ? img.Summary : strUtil.ParseHtml( img.Content, 100 );
imgBlock.Set( "ipost.Content", content );
imgBlock.Set( "ipost.Width", img.Width );
imgBlock.Set( "ipost.Height", img.Height );
imgBlock.Set( "ipost.Url", alink.ToAppData( img, ctx ) );
imgBlock.Next();
}
}
示例4: bindEditInfo
private void bindEditInfo( ContentPost post )
{
if (post.PageSection == null) return;
set( "post.DeleteUrl", to( Delete, post.Id ) );
set( "post.Author", post.Author );
set( "post.Title", post.Title );
set( "post.TitleHome", strUtil.EncodeTextarea( post.TitleHome ) );
set( "post.Width", post.Width );
set( "post.Height", post.Height );
editor( "Content", strUtil.Edit( post.Content ), "250px" );
set( "post.Created", post.Created );
set( "post.Hits", post.Hits );
set( "post.OrderId", post.OrderId );
set( "post.RedirectUrl", post.RedirectUrl );
set( "post.MetaKeywords", post.MetaKeywords );
set( "post.MetaDescription", post.MetaDescription );
set( "post.Summary", post.Summary );
set( "post.SourceLink", post.SourceLink );
set( "post.Style", post.Style );
set( "post.ImgLink", post.GetImgUrl() );
set( "post.ImgThumbLink", post.GetImgThumb() );
set( "post.ImgDeleteLink", to( DeletePostPic, post.Id ) );
set( "post.TagList", post.Tag.TextString );
String val = AccessStatusUtil.GetRadioList( post.AccessStatus );
set( "post.AccessStatus", val );
set( "post.IsCloseComment", Html.CheckBox( "IsCloseComment", lang( "closeComment" ), "1", cvt.ToBool( post.CommentCondition ) ) );
radioList( "PickStatus", PickStatus.GetPickStatus(), post.PickStatus.ToString() );
set( "attachmentAdminLink", to( new AttachmentController().AdminList, post.Id ) );
}
示例5: bindTopImg
private void bindTopImg( ContentPost img )
{
IBlock imgBlock = getBlock( "img" );
if (img != null) {
imgBlock.Set( "ipost.ImgUrl", img.GetImgThumb() );
imgBlock.Set( "ipost.TitleCss", img.Style );
imgBlock.Set( "ipost.TitleFull", img.Title );
if (strUtil.HasText( img.TitleHome ))
imgBlock.Set( "ipost.Title", img.TitleHome );
else
imgBlock.Set( "ipost.Title", img.Title );
String content = strUtil.HasText( img.Summary ) ? img.Summary : strUtil.ParseHtml( img.Content, 50 );
imgBlock.Set( "ipost.Content", content );
imgBlock.Set( "ipost.Width", img.Width );
imgBlock.Set( "ipost.Height", img.Height );
imgBlock.Set( "ipost.EditLink", to( new Common.PostController().EditImg, img.Id ) );
imgBlock.Next();
}
}