本文整理汇总了C#中ContentPost类的典型用法代码示例。如果您正苦于以下问题:C# ContentPost类的具体用法?C# ContentPost怎么用?C# ContentPost使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ContentPost类属于命名空间,在下文中一共展示了ContentPost类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: bindAttachments
private void bindAttachments( ContentPost post ) {
set( "addLink", to( new AttachmentController().Add, post.Id ) );
set( "sortAction", to( new AttachmentController().SaveSort, post.Id ) );
ContentPost topic = postService.GetById( post.Id, ctx.owner.Id );
List<ContentAttachment> attachList = attachService.GetAttachmentsByPost( post.Id );
String cmd;
if (topic.IsAttachmentLogin == 1) {
String lockImg = strUtil.Join( sys.Path.Img, "edit.gif" );
cmd = alang( "currentDownloadPermission" );
cmd += string.Format( "<img src=\"{1}\" /> <a href=\"{0}\" class=\"frmBox\">", to( new AttachmentController().SetPermission, post.Id ), lockImg );
cmd += lang( "edit" ) + "</a>";
}
else {
String lockImg = strUtil.Join( sys.Path.Img, "lock.gif" );
cmd = string.Format( "<img src=\"{1}\" /> <a href=\"{0}\" class=\"frmBox\">" + alang( "setDownloadPermission" ) + "</a>", to( new AttachmentController().SetPermission, post.Id ), lockImg );
}
set( "cmd", cmd );
bindAttachments( attachList );
}
示例2: BeforeAction
public override bool BeforeAction( MvcContext ctx )
{
ContentPost post = postService.GetById( ctx.route.id, ctx.owner.Id );
_contentPost = post;
return base.BeforeAction( ctx );
}
示例3: bindSectionShow
private void bindSectionShow( int sectionId, int imgcat, List<ContentPost> posts, ContentPost first )
{
set( "sectionId", sectionId );
set( "addUrl", Link.To( new PostController().Add, sectionId ) + "?categoryId=" + imgcat );
set( "listUrl", Link.To( new ListController().AdminList, sectionId ) + "?categoryId=" + imgcat );
int slideWidth = first == null ? 300 : first.Width;
int slideHeight = first == null ? 220 : first.Height;
set( "slideWidth", slideWidth );
set( "slideHeight", slideHeight );
IBlock block = getBlock( "nav" );
foreach (ContentPost photo in posts) {
block.Set( "photo.TitleFull", photo.Title );
if (strUtil.HasText( photo.TitleHome ))
block.Set( "photo.Title", photo.TitleHome );
else
block.Set( "photo.Title", photo.Title );
block.Set( "photo.ImgUrl", photo.GetImgMedium() );
String lnk = photo.HasImg() ? Link.To( new PostController().EditImg, photo.Id ) : "#";
block.Set( "photo.Link", lnk );
block.Next();
}
}
示例4: bindFocus
private void bindFocus( IBlock fblock, ContentPost article )
{
fblock.Set( "article.Title", strUtil.SubString( article.Title, 19 ) );
fblock.Set( "article.SummaryInfo", strUtil.CutString( article.Summary, 100 ) );
fblock.Set( "article.Url", alink.ToAppData( article, ctx ) );
fblock.Next();
}
示例5: bindSectionShow
private void bindSectionShow( int sectionId, List<ContentPost> posts, ContentPost first )
{
IBlock block = getBlock( "nav" );
int width = first.Width - 20;
int height = first.Height;
set( "first.Width", width );
set( "first.Height", height );
foreach (ContentPost photo in posts) {
block.Set( "photo.Width", width );
block.Set( "photo.Height", height );
block.Set( "photo.TitleFull", photo.Title );
if (strUtil.HasText( photo.TitleHome ))
block.Set( "photo.Title", photo.TitleHome );
else
block.Set( "photo.Title", photo.Title );
block.Set( "photo.ImgUrl", photo.GetImgMedium() );
block.Set( "photo.Link", alink.ToAppData( photo ) );
block.Bind( "photo", photo );
block.Next();
}
}
示例6: bindShow
private void bindShow( ContentPost post, DataPage<ContentImg> imgPage )
{
ctx.SetItem( "ContentPost", post );
set( "post.Title", post.Title );
set( "post.Content", post.Content );
set( "post.CreateTime", post.Created );
set( "post.ReplyCount", post.Replies );
set( "post.Hits", post.Hits );
set( "post.Source", post.SourceLink );
if (post.Creator != null) {
set( "post.Submitter", string.Format( "<a href=\"{0}\" target=\"_blank\">{1}</a>", Link.ToMember( post.Creator ), post.Creator.Name ) );
}
else {
set( "post.Submitter", "нч" );
}
IBlock block = getBlock( "list" );
foreach (ContentImg img in imgPage.Results) {
block.Set( "img.Url", img.GetImgUrl() );
block.Set( "img.Description", img.Description );
block.Next();
}
String postLink = alink.ToAppData( post );
String pageBar = ObjectPage.GetPageBarByLink( postLink, imgPage.PageCount, imgPage.Current );
set( "page", pageBar );
}
示例7: getStatus
private String getStatus( ContentPost post ) {
if (post.HasImg()==false) return "";
return "<img src=\""+strUtil.Join( sys.Path.Img, "img.gif" )+"\" />";
}
示例8: bindSectionShow
private void bindSectionShow( List<ContentPost> posts, ContentPost img ) {
IBlock block = getBlock( "list" );
foreach (ContentPost post in posts) {
BinderUtils.bindPostSingle( block, post, ctx );
block.Next();
}
IBlock imgBlock = getBlock( "img" );
if (img != null) {
imgBlock.Set( "ipost.TitleCss", img.Style );
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, ctx ) );
imgBlock.Bind( "ipost", img );
imgBlock.Next();
}
}
示例9: transSectionOne
private void transSectionOne( ContentPost x )
{
if (x.PageSection == null || x.PageSection.Id <= 0) return;
int sectionId = x.PageSection.Id;
ContentPostSection ps = hasTrans( x, sectionId );
if (ps != null) {
ps.SaveStatus = x.SaveStatus;
ps.update();
}
else {
ContentPostSection newPs = new ContentPostSection();
newPs.Post = x;
newPs.Section = x.PageSection;
newPs.SaveStatus = x.SaveStatus;
newPs.insert();
logger.Info( "transSectionOne=> postId=" + x.Id + ", sectionId=" + x.PageSection.Id );
}
}
示例10: getPickedIcon
public static String getPickedIcon( ContentPost post ) {
if (post.PickStatus == PickStatus.Picked) return iconPicked;
if (post.PickStatus == PickStatus.Focus) return iconFocus;
return "";
}
示例11: bindAddList
private void bindAddList( int postId, ContentPost post, List<ContentImg> imgList )
{
set( "section.Name", post.PageSection.Title );
set( "post.EditListInfo", to( EditListInfo, postId ) );
IBlock block = getBlock( "list" );
foreach (ContentImg img in imgList) {
block.Set( "img.Url", img.GetImgUrl() );
block.Set( "img.Thumb", img.GetThumb() );
block.Set( "img.Description", strUtil.CutString( img.Description, 8 ) );
block.Set( "img.DeleteUrl", to( DeleteImg, img.Id ) );
String setLogoCmd = string.Empty;
if (img.ImgUrl.Equals( post.ImgLink )) {
setLogoCmd = "<span style='font-weight:bold;color:red;'>" + alang( "currentCover" ) + "</span>";
}
else {
setLogoCmd = string.Format( "<a href='{0}' class=\"putCmd cmd\">" + alang( "setCover" ) + "</a>", to( SetLogo, img.Id ) );
}
block.Set( "img.SetLogo", setLogoCmd );
block.Next();
}
int upCounts = 3;
IBlock upblock = getBlock( "upList" );
for (int i = 1; i < (upCounts + 1); i++) {
upblock.Set( "photoIndex", i );
upblock.Next();
}
}
示例12: bindListItem
public static void bindListItem( IBlock block, ContentPost post, MvcContext ctx )
{
block.Set( "post.SectionName", post.PageSection.Title );
block.Set( "post.SectionUrl", ctx.to( new SectionController().Show, post.PageSection.Id ) );
String typeIcon = BinderUtils.getTypeIcon( post );
block.Set( "post.ImgIcon", typeIcon );
String att = post.Attachments > 0 ? "<img src=\"" + strUtil.Join( sys.Path.Img, "attachment.gif" ) + "\"/>" : "";
block.Set( "post.AttachmentIcon", att );
block.Set( "post.TitleCss", post.Style );
block.Set( "post.Title", strUtil.SubString( post.GetTitle(), 50 ) );
block.Set( "post.Created", post.Created );
block.Set( "post.Hits", post.Hits );
block.Set( "post.Url", alink.ToAppData( post ) );
if (post.Creator != null) {
block.Set( "post.Submitter", string.Format( "<a href=\"{0}\" target=\"_blank\">{1}</a>", Link.ToMember( post.Creator ), post.Creator.Name ) );
}
else {
block.Set( "post.Submitter", "" );
}
}
示例13: bindEditCmd
private void bindEditCmd( IBlock block, ContentPost post ) {
String lnkEdit = "";
lnkEdit = to( AddImgList, post.Id );
block.Set( "post.EditUrl", lnkEdit );
}
示例14: bindSectionShow
private void bindSectionShow( ContentSection section, ContentPost video )
{
set( "m.Title", section.Title );
if (video == null) {
set( "video.Content", "" );
set( "video.TitleFull", "" );
set( "video.Title", "" );
set( "video.Url", "" );
}
else {
String content = WebHelper.GetFlash( video.SourceLink, video.Width, video.Height );
set( "video.Content", content );
set( "video.TitleFull", video.Title );
if (strUtil.HasText( video.TitleHome ))
set( "video.Title", video.TitleHome );
else
set( "video.Title", video.Title );
set( "video.Url", alink.ToAppData( video ) );
}
}
示例15: bindEditInfo
private void bindEditInfo( long postId, ContentPost post ) {
set( "section.Name", post.SectionName );
set( "section.Id", post.SectionId );
set( "post.Author", post.Author );
set( "post.SourceLink", post.SourceLink );
set( "post.Style", post.Style );
set( "post.OrderId", post.OrderId );
set( "post.Content", post.Content );
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.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 ) ) );
}