private void createAndUpdateSection(ContentSection s) { // 创建一个template ContentCustomTemplate ct = new ContentCustomTemplate(); ct.Creator = (User)ctx.viewer.obj; ct.OwnerId = ctx.owner.Id; ct.OwnerType = ctx.owner.obj.GetType().FullName; ct.OwnerUrl = ctx.owner.obj.Url; String name = ctx.Post("Name"); if (strUtil.IsNullOrEmpty(name)) { name = string.Format("section{0}({1})", s.Id, s.Title); } ct.Name = strUtil.SubString(name, 50); ct.Description = strUtil.SubString(ctx.Post("Description"), 250); ct.Content = ctx.PostHtml("Content"); ctService.Insert(ct); // 更新section的模板 s.CustomTemplateId = ct.Id; sectionService.Update(s); }
private void updateTemplate(ContentSection s) { ContentCustomTemplate ct = ctService.GetById(s.CustomTemplateId, ctx.owner.Id); ct.Content = ctx.PostHtml("Content"); ctService.Update(ct); }
public virtual ContentCustomTemplate GetById(long id, long ownerId) { ContentCustomTemplate ct = ContentCustomTemplate.findById(id); if (ct == null) { return(null); } if (ct.OwnerId != ownerId) { return(null); } return(ct); }
protected ContentCustomTemplate createTemplate(String templateBody) { ContentCustomTemplate cs = new ContentCustomTemplate(); cs.Content = templateBody; cs.OwnerId = this.app.OwnerId; cs.OwnerType = this.app.OwnerType; cs.OwnerUrl = this.app.OwnerUrl; cs.Name = "" + DateTime.Now.ToShortDateString(); cs.Creator = this.user; tplService.Insert(cs); return(cs); }
public ContentCustomTemplate GetById(int id, int ownerId) { ContentCustomTemplate ct = ContentCustomTemplate.findById(id); if (ct == null) { return(null); } if (ct.OwnerId != ownerId) { return(null); } return(ct); }
public static void loadTemplate(ControllerBase controller, ContentSection s, IContentCustomTemplateService ctService) { if (s.CustomTemplateId <= 0) { return; } ContentCustomTemplate ct = ctService.GetById(s.CustomTemplateId, controller.ctx.owner.Id); if (ct == null) { return; } controller.viewContent(ct.Content); }
private static string getCustomTemplateBody(ContentSection section, MvcContext ctx) { if (section.CustomTemplateId <= 0) { return(null); } IContentCustomTemplateService ctService = ObjectContext.Create <IContentCustomTemplateService>(typeof(ContentCustomTemplateService)); ContentCustomTemplate ct = ctService.GetById(section.CustomTemplateId, ctx.owner.Id); if (ct == null) { return(null); } return(ct.Content); }
private String getTemplateContent(ContentSection s) { if (s.CustomTemplateId > 0) { ContentCustomTemplate ct = ctService.GetById(s.CustomTemplateId, ctx.owner.Id); if (ct != null) { return(ct.Content); } } String tpath = getTemplatePath(s); String absPath = base.utils.getTemplatePathByFile(tpath); String templateContent = file.Read(absPath); return(templateContent); }
private String getJsonResult(ContentSection section, IList data) { String jsonStr = Json.ToString(data); String scriptData = string.Format(" <script>var sectionData{0} = {1};</script>", section.Id, jsonStr); if (section.CustomTemplateId <= 0) { return(scriptData); } ContentCustomTemplate ct = ctService.GetById(section.CustomTemplateId, ctx.owner.Id); if (ct == null) { return(scriptData); } return(scriptData + ct.Content); }
protected ContentCustomTemplate createTemplate( String templateBody ) { ContentCustomTemplate cs = new ContentCustomTemplate(); cs.Content = templateBody; cs.OwnerId = this.app.OwnerId; cs.OwnerType = this.app.OwnerType; cs.OwnerUrl = this.app.OwnerUrl; cs.Name = "" + DateTime.Now.ToShortDateString(); cs.Creator = this.user; tplService.Insert( cs ); return cs; }
protected ContentSection createSection( String name, Type sectionType, String layoutStr, ContentCustomTemplate ct ) { return createSection( name, sectionType.FullName, layoutStr, ct ); }
/// <summary> /// 创建手动添加区块 /// </summary> /// <param name="name">区块的名称</param> /// <param name="sectionType">区块的类型</param> /// <param name="layoutStr">所属行和所属列</param> /// <param name="ct">自定义模板</param> /// <returns></returns> protected ContentSection createSection( String name, String sectionType, String layoutStr, ContentCustomTemplate ct ) { ContentSection section = new ContentSection(); int rowId = cvt.ToInt( layoutStr.Substring( 0, layoutStr.Length - 1 ) ); int columnId = cvt.ToInt( layoutStr.Substring( layoutStr.Length - 1, 1 ) ); section.AppId = this.app.Id; section.RowId = rowId; section.ColumnId = columnId; section.SectionType = sectionType; section.Title = name; if (ct != null) section.CustomTemplateId = ct.Id; sectionService.Insert( section ); return section; }
protected override IMemberApp createPortalApp() { StringBuilder css = new StringBuilder(); IMemberApp app = createApp(); createLayout(); ContentSection s = createSection( "焦点图片", typeof( SlideController ), "11" ); createImgBig( s, "嫦娥二号整流罩坠落江西", "http://img2.cache.netease.com/cnews/2010/10/2/201010021526102b7fa.jpg" ); createImgBig( s, "重庆特警开装甲车巡逻维稳", "http://img2.cache.netease.com/cnews/2010/10/2/201010020837190e40a.jpg" ); createImgBig( s, "香港举行国庆烟花汇演", "http://img1.cache.netease.com/cnews/2010/10/2/20101002081623541f8.jpg" ); css.AppendLine( "#section" + s.Id + " { border-width:0px; }" ); css.AppendLine( "#sectionTitle" + s.Id + " { display:none; }" ); css.AppendLine( "#sectionContent" + s.Id + " { padding-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; }" ); s = createSection( "娱乐专题", typeof( NormalController ), "11" ); createImgS( s, "敢死队致敬老派动作重现热血场面", "一代报业宗师张季鸾的墓地近年失修荒废,曾占地40亩的陵园仅剩一亩见方的土坡。如今在废旧的墓陵旁边还建起了臭气熏天的养猪场。据悉,张季鸾病逝时,国共两党最高层都在第一时间发来唁电,蒋介石、周恩来更是亲自前往吊", "http://img3.cache.netease.com/ent/2010/10/18/2010101809310948fd9.png" ); createPost( s, "张柏芝借博客与谢霆锋传情" ); createPost( s, "张家辉:拍激情戏不用向太太报批" ); createPost( s, "金鹰节孙红雷摘三奖成最大赢家" ); createPost( s, "钟楚红台湾出席剪彩活动" ); createPost( s, "陈冠希被曝在香港秘密录唱" ); createPost( s, "浙版西游记白骨精成为爱自尽美女" ); s = createSection( "新闻头条", typeof( TextController ), "12" ); createText( s, @"<div style=""font-size:12px;""><h2 style=""font-size:18px;font-family: 黑体;""><a href=""http://www.wojilu.com/space/author/Blog1/Post/22"">门户+论坛+SNS整合系统源码</a></h2><div><a href=""http://www.wojilu.com/Content396/Post/415"">闪电击中自由女神像瞬间</a><span> </span>|<span> </span><a href=""http://www.wojilu.com/Content396/Post/424"">2010年胡润百富榜发布</a><span> </span><br></div><h3 style=""margin-top:10px;font-size:18px;font-family: 黑体;""><a href=""http://www.wojilu.com/Content396/Post/399"">MIT技术评论:2010十大新兴技术</a></h3><div><a href=""http://www.wojilu.com/Content396/Post/379"">SNS的多栖“钱”景</a><span> </span>|<span> </span><a href=""http://www.wojilu.com/Content396/Post/394"">创业板估值体系面临考验</a><span> </span><br></div><h3 style=""margin-top:10px;font-size:18px;font-family: 黑体;""><a href=""http://www.wojilu.com/help"">我记录网站综合系统使用指南</a></h3><div><a href=""http://www.wojilu.com/Content396/Post/280"">Google的十大核心技术</a><span> </span>|<span> </span><a href=""http://www.wojilu.com/Content396/Post/273"">最令人讨厌11种应用程序</a><span> </span></div></div>" ); s = createSection( "要闻列表", typeof( ListController ), "12" ); s.ListCount = 20; s.update( "ListCount" ); createPost( s, "西安市一在建民房倒塌造成8人死亡" ); createPost( s, "国税总局反驳中国税负痛苦指数世界第二传闻" ); createPost( s, "香港货轮与日本渔船昨日在日本海域发生碰撞" ); createPost( s, "菅直人继续宣称钓鱼岛是日本领土 中方回应" ); createPost( s, "温家宝离京访问欧亚四国 中国掀秋季外交高潮 " ); createPost( s, "2010年诺贝尔奖公布日期全部确定" ); createPost( s, "上海眼科假药事件部分涉案人员被刑拘" ); createPost( s, "日本神户将就熊猫死亡赔偿中方50万美元" ); createPost( s, "菲总统称下周在网上公开人质事件完整报告" ); createPost( s, "美性病实验曾致700危地马拉人染病 奥巴马道歉" ); createPost( s, "俄罗斯主张与北约签署军事限制协议" ); createPost( s, "巴西今日大选有望产生首位女总统" ); createPost( s, "法国月内三度爆发反对退休改革全国性示威" ); createPost( s, "东京电影节公布竞赛片 秦海璐角逐金麒麟" ); createPost( s, "香港货轮与日本渔船昨日在日本海域发生碰撞" ); // 创建自定义模板 ContentCustomTemplate cs = new ContentCustomTemplate(); cs.Content = @"<table style=""width:100%;table-layout: fixed;"" cellspacing=""0"" cellpadding=""0""> <!-- BEGIN list --> <tr><td style=""width:310px;""><div style=""font-size:14px;text-overflow:ellipsis;overflow: hidden;white-space:nowrap;""><a href=""#{post.Url}"" style=""color:#f54100"">[#{post.Author}]</a> <a href=""#{post.Url}"" style=""#{post.TitleCss}"" title=""#{post.TitleFull}"" style=""#{post.TitleCss}"">#{post.Title}</a></div> </td><td style=""text-align:right; color:#666;"">#{post.CreatedDay}</td></tr> <!-- END list --> </table>"; cs.OwnerId = this.app.OwnerId; cs.OwnerType = this.app.OwnerType; cs.OwnerUrl = this.app.OwnerUrl; cs.Name = "" + DateTime.Now.ToShortDateString(); cs.Creator = ctx.viewer.obj as User; tplService.Insert( cs ); s.CustomTemplateId = cs.Id; s.update( "CustomTemplateId" ); s = createSection( "信息发布", typeof( TextController ), "13" ); createText( s, "<div><a href=\"\" class=\"cmd1\"><span>我要发布</span></a><a href=\"\" class=\"cmd2\"><span>新手起步</span></a><a href=\"\" class=\"cmd3\"><span>美食天地</span></a><a href=\"\" class=\"cmd4\"><span>谈天说地</span></a></div><div class=\"clear\"></div>" ); s = createSection( "公告", typeof( TextController ), "13" ); createText( s, "<div style=\"font-size:12px;\"><div><a href=\"http://www.wojilu.com\">· 我记录网站综合系统1.5.5正式发布</a></div><div><a href=\"http://news.163.com/10/1018/15/6J9NSJI100014JB6.html\">· 时速1600公里超音速汽车英国问世</a></div><div><a href=\"http://news.sina.com.cn/c/2010-10-18/205321300806.shtml\">· 影著协回应网吧等放电影缴版权费质疑</a></div></div>" ); s = createSection( "▍财经专栏", typeof( NormalController ), "13" ); createImgS( s, "房产税成为开发商提价的借口", "浙江绍兴县家印染企业出资万余元,购买一条快艇送给镇政府监督辖区内企业的排污。这是为了动员全社会的力量来整治环境污染,府不会对捐赠企业手下留情", "http://img1.cache.netease.com/cnews/2010/10/1/20101001074938966c6.jpg" ); createPost( s, "高明骏回应涉毒事件 向家人及公众致歉" ); createPost( s, "商天娥办婚宴 刘嘉玲吴君如到贺(组图)" ); createPost( s, "利智被曝曾遭周润发羞辱 悄悄躲后台哭泣" ); createPost( s, "巴黎看秀丢行李 林志玲买内衣应急(图)" ); createPost( s, "姜昆:“海派清口”是好表演 但不适合上春晚" ); // 第二行 s = createSection( "通栏广告", typeof( TextController ), "21" ); createText( s, @"<img src=""/static/img/big/ad1.gif""/>" ); css.AppendLine( "#section" + s.Id + " { border-width:0px; }" ); css.AppendLine( "#sectionTitle" + s.Id + " { display:none; }" ); css.AppendLine( "#sectionContent" + s.Id + " { padding-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; }" ); // 第三行 s = createSection( "综合图文", typeof( PostImgController ), "31" ); StringBuilder sb = new StringBuilder(); sb.AppendLine( "#section" + s.Id + ".sectionPanel {border:0px;}" ); sb.AppendLine( "#sectionTitle" + s.Id + " {background:url(/static/img/big/rowBg1.jpg);}" ); sb.AppendLine( "#sectionTitle" + s.Id + " .sectionTitleText a{color:#fff;}" ); createImgPost( s, "丛林里的特雷莎修女", "谢欣燕填写问卷时,发现不对,计算机屏幕居然出现她和男友庄胜杰出游以及“嫁给我吧”的画面,被蒙在鼓里的谢女,一脸狐疑,此时,庄胜杰和几名友人,拿着“宝贝嫁给我吧”的海报,突然出现在她的眼前,让她又惊又喜。庄胜杰以颤抖音调说,“我们南北奔波那么久,可以不要再那么累,欣燕你可以嫁给我吗?”,说完送上捧花及定情戒指,旁边的友人起哄“嫁给他!嫁给他!”,谢女事先完全不知道有此场面,内心好感动,终于说出“我愿意”,立即一阵欢呼。", "http://img1.cache.netease.com/cnews/2010/10/11/201010110432204a6d3.jpg" ); createPostC( s, "印度首富入住27层新居 造价66.5亿创全球最贵", "环球资讯" ); createPostC( s, "美国汇率报告或推迟到11月G20峰会后发布", "股市金融" ); createPostC( s, "北京周边县市出台政策限制外地人购房", "法律政策" ); createPostC( s, "中国新车年销量将达1700万 逼近美国最高水平", "汽车销售" ); createPostC( s, "河南教育厅发文组织数万学生到富士康实习", "教育政策" ); createPostC( s, "印度首富入住27层新居 造价66.5亿创全球最贵", "环球资讯" ); createImgHome( s, "湖南女特级教师驾车撞六学生", "女特级教师", 110, 80, "http://img4.cache.netease.com/club/2010/10/11/20101011082942d4f3e.jpg" ); createImgHome( s, "明星与新欢旧爱间的情事纠葛", "明星与新欢", 110, 80, "http://img3.cache.netease.com/club/2010/10/11/20101011083326c2df5.jpg" ); createImgHome( s, "陶寺遗址证 尧舜非传说", "陶寺遗址", 110, 80, "http://img1.cache.netease.com/cnews/2010/10/8/2010100812172846800.jpg" ); createImgHome( s, "恋人搭高铁约会3年花36万", "恋人搭高铁", 110, 80, "http://img1.cache.netease.com/cnews/2010/10/3/20101003101238aa436.jpg" ); s = createSection( "▍明星追踪", typeof( NormalController ), "32" ); createImgS( s, "高明骏吸毒被抓满文军告密", "该片讲述了三个女人之间的情感故事,叶璇片中饰演一位寂寞的妻子", "http://img4.cache.netease.com/ent/2010/9/30/20100930191809ff7c0.png" ); //createPost( s, "美国实验室创造4万亿摄氏度纪录" ); createPost( s, "华航被曝无视油箱漏油冒险载客飞行" ); createPost( s, "直击最疯狂的摩托车飙车秀无视" ); createPost( s, "图说娱乐圈那些花瓶女星无视" ); createPost( s, "大义灭亲可减刑是在亵渎法律无视" ); createPost( s, "彭帅受困体能制约惨遭逆转无视" ); // 第四行 s = createSection( "通栏广告", typeof( TextController ), "41" ); createText( s, @"<img src=""/static/img/big/ad2.gif""/>" ); css.AppendLine( "#section" + s.Id + " { border-width:0px; }" ); css.AppendLine( "#sectionTitle" + s.Id + " { display:none; }" ); css.AppendLine( "#sectionContent" + s.Id + " { padding-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; }" ); // 第五行 s = createSection( "娱乐资讯", typeof( PostImgController ), "51" ); sb.AppendLine( "#section" + s.Id + ".sectionPanel {border:0px;}" ); sb.AppendLine( "#sectionTitle" + s.Id + " {background:url(/static/img/big/rowBg2.jpg);}" ); sb.AppendLine( "#sectionTitle" + s.Id + " .sectionTitleText a{color:#fff;}" ); createImgPost( s, "林志颖生日曝儿子照片", "今天是林志颖36岁的生日,身在珠海赛车场拍戏的他发布微博曝光了小小志的照片,称儿子是今生最美好的事,还表示看著小小志用弯弯的眼睛对他笑感觉天使大概就是这样子,儿子是他的骄傲,儿子天使的笑容是最好的礼物", "http://img4.cache.netease.com/ent/2010/10/15/20101015132315ec733.png" ); createPostC( s, "法国支持建立欧洲反导系统并称将保持核威慑", "环球军事" ); createPostC( s, "深圳野生动物园承认失误 按工伤赔被虎咬死者", "社会新闻" ); createPostC( s, "国家公务员考试昨日开始报名 网络一度堵塞", "天方夜谭" ); createPostC( s, "住建部:违反限购房规定买卖住房有重大风险", "法律政策" ); createPostC( s, "美国2010财年联邦财政赤字近1.3万亿美元", "财政要闻" ); createPostC( s, "法国支持建立欧洲反导系统并称将保持核威慑", "环球军事" ); createImgHome( s, "学历丢人成绩骄人的娱乐明星", "学历丢人明星", 110, 80, "http://img4.cache.netease.com/ent/2010/10/15/201010151038520fc9e.png?froment" ); createImgHome( s, "摩登天空音乐节 世界城市音乐节", "摩登天空", 110, 80, "http://img3.cache.netease.com/ent/2010/9/13/201009131616576ab3c.jpg" ); createImgHome( s, "第15届釜山电影节闭幕 中国两位新人导演获奖", "釜山电影节", 110, 80, "http://img4.cache.netease.com/ent/2010/10/11/201010111457590abb1.jpg" ); createImgHome( s, "“东方风云榜”季选音乐营即将席卷热浪", "东方风云榜", 110, 80, "http://img4.cache.netease.com/ent/2010/10/11/201010111843492d214.jpg" ); s = createSection( "▍上市公司", typeof( NormalController ), "52" ); createImgS( s, "《时代》眼中的伊战", "该片讲述了三个女人之间的情感故事,叶璇片中饰演一位寂寞的妻子", "http://img2.cache.netease.com/cnews/2010/9/3/2010090308452932084.jpg" ); createPost( s, "云南保山山体滑坡已致24人死亡24人失踪" ); createPost( s, "广东政协委员调研称全省225万户仍住茅草房" ); createPost( s, "徐州多家医院药品采购二次议价 不按中标价买" ); createPost( s, "官员称供求关系变化系生姜价格上涨主因" ); createPost( s, "舟曲上报重建规划 防洪标准升至50年一遇" ); createPost( s, "发改委官员称国家将坚决抑制汽车产能过剩" ); // 第六行 s = createSection( "通栏广告", typeof( TextController ), "61" ); createText( s, @"<img src=""/static/img/big/ad3.gif""/>" ); css.AppendLine( "#section" + s.Id + " { border-width:0px; }" ); css.AppendLine( "#sectionTitle" + s.Id + " { display:none; }" ); css.AppendLine( "#sectionContent" + s.Id + " { padding-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; }" ); s = createSection( "综合图文", typeof( PostImgController ), "71" ); sb.AppendLine( "#section" + s.Id + ".sectionPanel {border:0px;}" ); sb.AppendLine( "#sectionTitle" + s.Id + " {background:url(/static/img/big/rowBg3.jpg);}" ); sb.AppendLine( "#sectionTitle" + s.Id + " .sectionTitleText a{color:#fff;}" ); createImgPost( s, "丛林里的特雷莎修女", "谢欣燕填写问卷时,发现不对,计算机屏幕居然出现她和男友庄胜杰出游以及“嫁给我吧”的画面,被蒙在鼓里的谢女,一脸狐疑,此时,庄胜杰和几名友人,拿着“宝贝嫁给我吧”的海报,突然出现在她的眼前,让她又惊又喜。庄胜杰以颤抖音调说,“我们南北奔波那么久,可以不要再那么累,欣燕你可以嫁给我吗?”,说完送上捧花及定情戒指,旁边的友人起哄“嫁给他!嫁给他!”,谢女事先完全不知道有此场面,内心好感动,终于说出“我愿意”,立即一阵欢呼。", "http://img1.cache.netease.com/cnews/2010/10/11/201010110432204a6d3.jpg" ); createPostC( s, "印度首富入住27层新居 造价66.5亿创全球最贵", "环球资讯" ); createPostC( s, "美国汇率报告或推迟到11月G20峰会后发布", "股市金融" ); createPostC( s, "北京周边县市出台政策限制外地人购房", "法律政策" ); createPostC( s, "中国新车年销量将达1700万 逼近美国最高水平", "汽车销售" ); createPostC( s, "河南教育厅发文组织数万学生到富士康实习", "教育政策" ); createPostC( s, "印度首富入住27层新居 造价66.5亿创全球最贵", "环球资讯" ); createImgHome( s, "湖南女特级教师驾车撞六学生", "女特级教师", 110, 80, "http://img4.cache.netease.com/club/2010/10/11/20101011082942d4f3e.jpg" ); createImgHome( s, "明星与新欢旧爱间的情事纠葛", "明星与新欢", 110, 80, "http://img3.cache.netease.com/club/2010/10/11/20101011083326c2df5.jpg" ); createImgHome( s, "陶寺遗址证 尧舜非传说", "陶寺遗址", 110, 80, "http://img1.cache.netease.com/cnews/2010/10/8/2010100812172846800.jpg" ); createImgHome( s, "恋人搭高铁约会3年花36万", "恋人搭高铁", 110, 80, "http://img1.cache.netease.com/cnews/2010/10/3/20101003101238aa436.jpg" ); s = createSection( "▍明星追踪", typeof( NormalController ), "72" ); createImgS( s, "高明骏吸毒被抓满文军告密", "该片讲述了三个女人之间的情感故事,叶璇片中饰演一位寂寞的妻子", "http://img4.cache.netease.com/ent/2010/9/30/20100930191809ff7c0.png" ); //createPost( s, "美国实验室创造4万亿摄氏度纪录" ); createPost( s, "华航被曝无视油箱漏油冒险载客飞行" ); createPost( s, "直击最疯狂的摩托车飙车秀无视" ); createPost( s, "图说娱乐圈那些花瓶女星无视" ); createPost( s, "大义灭亲可减刑是在亵渎法律无视" ); createPost( s, "彭帅受困体能制约惨遭逆转无视" ); this.app.Style = this.app.Style + Environment.NewLine + css.ToString(); css = new StringBuilder(); css.AppendLine( "#portalContainer {color:#333333;}" ); css.AppendLine( "#portalContainer a {color:}" ); css.AppendLine( "#portalContainer .sectionPanel {border:1px #e6e6e6 solid;}" ); css.AppendLine( ".sectionTitle {background:url(/static/skin/apps/content/1/sectionTitleBg.jpg);}" ); css.AppendLine( "#portalContainer .sectionTitleText a {color:#839300;}" ); css.AppendLine( "#portalContainer .sectionMore a {color:#666;}" ); css.AppendLine( "#row1_column3 li{font-size:12px;}" ); css.AppendLine( "#row3_column2 li{font-size:12px;}" ); css.AppendLine( "#row5_column2 li{font-size:12px;}" ); css.AppendLine( "#row7_column2 li{font-size:12px;}" ); this.app.SkinStyle = css.ToString() + sb.ToString(); this.app.update(); return app; }
protected override IMemberApp createPortalApp() { StringBuilder css = new StringBuilder(); IMemberApp app = createApp(); createLayout(); ContentCustomTemplate ct = base.createTemplate(base.getListViewWithTime()); ContentCustomTemplate ctn = base.createTemplate(base.getNormalViewWithTime()); ContentSection s = null; // 第一行 s = createSectionMashup("用户登录", 19, 18, "11"); s = createSection("最新动态", typeof(ListController), "11"); createPost(s, "西安市一在建民房倒塌造成8人死亡"); createPost(s, "国税总局反驳中国税负痛苦指数世界第二传闻"); createPost(s, "香港货轮与日本渔船昨日在日本海域发生碰撞"); createPost(s, "菅直人继续宣称钓鱼岛是日本领土 中方回应"); createPost(s, "温家宝离京访问欧亚四国 中国掀秋季外交高潮 "); createPost(s, "2010年诺贝尔奖公布日期全部确定"); createPost(s, "上海眼科假药事件部分涉案人员被刑拘"); s = createSection("焦点图片", typeof(SlideController), "12"); createImgBig(s, "嫦娥二号整流罩坠落江西", "http://img2.cache.netease.com/cnews/2010/10/2/201010021526102b7fa.jpg"); createImgBig(s, "重庆特警开装甲车巡逻维稳", "http://img2.cache.netease.com/cnews/2010/10/2/201010020837190e40a.jpg"); createImgBig(s, "香港举行国庆烟花汇演", "http://img1.cache.netease.com/cnews/2010/10/2/20101002081623541f8.jpg"); css.AppendLine("#section" + s.Id + " { border-width:0px; }"); css.AppendLine("#sectionTitle" + s.Id + " { display:none; }"); css.AppendLine("#sectionContent" + s.Id + " { padding-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; }"); s = createSection("新闻头条", typeof(TextController), "13"); createText(s, @"<div style=""font-size:12px;""><h2 style=""font-size:22px;font-weight:bold;""><a href=""http://www.wojilu.com/space/author/Blog1/Post/22"">门户+论坛+SNS整合系统源码</a></h2><div><a href=""http://www.wojilu.com/Content396/Post/415"">闪电击中自由女神像瞬间</a><span> </span>|<span> </span><a href=""http://www.wojilu.com/Content396/Post/424"">2010年胡润百富榜发布</a><span> </span><br></div>" + @"<h3 style=""margin-top:10px;font-size:16px;font-weight:bold;""><a href=""http://www.wojilu.com/Content396/Post/399"">MIT技术评论:2010十大新兴技术</a></h3><div><a href=""http://www.wojilu.com/Content396/Post/379"">SNS的多栖“钱”景</a><span> </span>|<span> </span><a href=""http://www.wojilu.com/Content396/Post/394"">创业板估值体系面临考验</a><span> </span><br></div>" + @"<h3 style=""margin-top:10px;font-size:16px;font-weight:bold;""><a href=""http://www.wojilu.com/help"">我记录网站综合系统使用指南</a></h3><div><a href=""http://www.wojilu.com/Content396/Post/280"">Google的十大核心技术</a><span> </span>|<span> </span><a href=""http://www.wojilu.com/Content396/Post/273"">最令人讨厌11种应用程序</a><span> </span></div>" + @"<h3 style=""margin-top:10px;font-size:16px;font-weight:bold;""><a href=""http://www.wojilu.com/Content396/Post/399"">MIT技术评论:2010十大新兴技术</a></h3><div><a href=""http://www.wojilu.com/Content396/Post/379"">SNS的多栖“钱”景</a><span> </span>|<span> </span><a href=""http://www.wojilu.com/Content396/Post/394"">创业板估值体系面临考验</a><span> </span><br></div>" + "</div>"); // 第二行 // TODO 图片列表 或 用户聚合 s = createSection("精彩图片", typeof(ImgController), "21"); createImgS(s, "a1", "http://img5.cache.netease.com/cnews/2011/12/21/20111221103323f115d.jpg"); createImgS(s, "a2", "http://img6.cache.netease.com/cnews/2011/12/16/20111216092426e71f2.jpg"); createImgS(s, "a3", "http://img6.cache.netease.com/ent/2011/12/16/2011121600352318942.jpg"); createImgS(s, "a4", "http://img2.cache.netease.com/cnews/2011/12/22/20111222111147f85fe.jpg"); createImgS(s, "a5", "http://img6.cache.netease.com/cnews/2011/12/19/2011121917334512da7.jpg"); createImgS(s, "a6", "http://img1.cache.netease.com/cnews/2011/12/20/20111220193736c2d59.jpg"); createImgS(s, "a7", "http://img6.cache.netease.com/cnews/2011/12/16/20111216092426e71f2.jpg"); createImgS(s, "a8", "http://img3.cache.netease.com/cnews/2011/12/11/20111211093436a1c2b.jpg"); createImgS(s, "a9", "http://img3.cache.netease.com/auto/2011/12/22/20111222105517febf7.jpg"); s = createSection("娱乐专题", typeof(NormalController), "22", ctn); createImgS(s, "敢死队致敬老派动作重现热血场面", "一代报业宗师张季鸾的墓地近年失修荒废,曾占地40亩的陵园仅剩一亩见方的土坡。如今在废旧的墓陵旁边还建起了臭气熏天的养猪场。据悉,张季鸾病逝时,国共两党最高层都在第一时间发来唁电,蒋介石、周恩来更是亲自前往吊", "http://img4.cache.netease.com/ent/2010/8/19/2010081908251234713.jpg"); createPost(s, "张柏芝借博客与谢霆锋传情张柏芝借博"); createPost(s, "张家辉:拍激情戏不用向太太报批张柏芝借博"); createPost(s, "金鹰节孙红雷摘三奖成最大赢家张柏芝借博"); createPost(s, "钟楚红台湾出席剪彩活动张柏芝借博出席剪彩活"); createPost(s, "陈冠希被曝在香港秘密录唱张柏芝借博"); createPost(s, "浙版西游记白骨精成为爱自尽美女张柏芝借博"); s = createSection("财经访谈", typeof(NormalController), "23", ctn); createImgS(s, "吴敬琏:中国模式祸福未定", "行政干预没有解决权力监督问题,行政干预和某些问题上有所加剧,行政干预没有解决权力监督问题。", "http://img1.cache.netease.com/cnews/2010/3/9/2010030914340556b2e.jpg"); createPost(s, "王杰批前女友方文琳骗钱骗婚将就熊友方文猫死亡"); createPost(s, "陈楚生成都开唱众多粉丝集合将友方文就熊猫死"); createPost(s, "凤凰传奇玲花母女同台(图集)将就友方文熊猫死亡"); createPost(s, "杨千嬅狂减14磅称老公不介意友方文将就熊猫死"); createPost(s, "菲总统称下周在网上公开人质事件完整报告"); createPost(s, "美性病实验曾致700危地马拉人染病 奥巴马道歉"); // 第三行 s = createSection("投票", typeof(PollController), "31"); List <String> polls = new List <String>(); polls.Add("天气很好"); polls.Add("寒潮来临"); polls.Add("雨季要到"); polls.Add("七月流火"); createPoll(s, "你对将来天气的预测", polls); s = createSection("国际资讯", typeof(ListController), "32", ct); createPost(s, "日本神户将就熊猫死亡赔偿中方50万美元三度爆发"); createPost(s, "菲总统称下周在网上公开人质事件完整报告"); createPost(s, "美性病实验曾致700危地马拉人染病 奥巴马道歉"); createPost(s, "俄罗斯主张与北约签署军事限制协议网上公"); createPost(s, "巴西今日大选有望产生首位女总统村民身家"); createPost(s, "法国月内三度爆发反对退休改革全国性示威"); createPost(s, "东京电影节公布竞赛片 秦海璐角逐金麒麟"); s = createSection("社会要闻", typeof(ListController), "33", ct); createPost(s, "辽宁抚顺境内失事飞机或为朝鲜飞机村民身家"); createPost(s, "中国廉价药缺口超300种 医生吃回扣成主因"); createPost(s, "杭州64位市民联名申请罢免下城区人大代表"); createPost(s, "广州天河拆迁村民身家均将过百万村民身家"); createPost(s, "最后一批美军作战部队开始从伊拉克撤离"); createPost(s, "四川资阳原交通局长自曝被调查时遭刑讯逼供"); createPost(s, "美性病实验曾致700危地马拉人染病 奥巴马道歉"); // 第四行 s = createSection("专家访谈", typeof(TextController), "41"); createText(s, @"<div style=""text-align:center;""><div><img src=""http://img6.cache.netease.com/lady/2011/12/27/201112271052516c656.jpg"" /></div><div style=""margin:5px;font-size:12px;""><a href=""""中国税改应伴随财产保护</a></div></div>"); s = createSection("娱乐地带", typeof(ListController), "42", ct); createPost(s, "齐秦老狼助阵世界城市音乐节辉:拍激情戏不用向太"); createPost(s, "梁咏琪亮相“国庆文艺晚会”志封面 称“狄仁杰”是"); createPost(s, "张柏芝借博客与谢霆锋传情结众女星 汤唯苍井"); createPost(s, "张家辉:拍激情戏不用向太太报批结众女星 汤唯苍井"); createPost(s, "金鹰节孙红雷摘三奖成最大赢家志封面 称“狄仁杰”是"); createPost(s, "钟楚红台湾出席剪彩活动辉:拍激情戏不用向太"); createPost(s, "陈冠希被曝在香港秘密录唱婚宴 刘嘉玲吴君如到"); s = createSection("电影空间", typeof(ListController), "43", ct); createPost(s, "“金狮奖”得主索菲亚·科波拉:好导演烂演员"); createPost(s, "彼得·杰克逊工作室被烧《霍比特人》拍摄受阻"); createPost(s, "刘德华登时尚杂志封面 称“狄仁杰”是人不是神"); createPost(s, "周杰伦见过蔡依林新男友 称应给他们空间恋爱"); createPost(s, "张柏芝接 楚成新片 与汤唯《赛车》迁村民身"); createPost(s, "釜山电影节集结众女星 汤唯苍井优等将齐聚"); createPost(s, "彼得·杰克逊工作室被烧《霍比特人》拍摄受阻"); // 第五行 s = createSection("友情链接", typeof(TextController), "51"); createText(s, "<div style=\"margin:5px 10px;\"><div><a href=\"\">中国文化研究网</a></div>" + "<div><a href=\"\">电子商品网络交易</a></div>" + "<div><a href=\"\">二手图书</a></div>" + "<div><a href=\"\">极客视频基地</a></div>" + "<div><a href=\"\">新浪微博</a></div>" + "<div><a href=\"\">软件开发指南</a></div>" + "<div><a href=\"\">驴友攻略</a></div></div>" ); s = createSection("音乐世界", typeof(ListController), "52", ct); createPost(s, "高明骏回应涉毒事件 向家人及公众致歉"); createPost(s, "利智被曝曾遭周润发羞辱 悄悄躲后台哭泣"); createPost(s, "巴黎看秀丢行李 林志玲买内衣应急(图)"); createPost(s, "姜昆:“海派清口”是好表演 但不适合上春晚"); createPost(s, "应采儿透露确有淫媒 称朋友曾被唆使陪客”"); createPost(s, "利智被曝曾遭周润发羞辱 悄悄躲后台哭泣"); createPost(s, "维多利亚上节目打瞌睡被逮 韩国网友盛赞超可爱"); s = createSection("企业资讯", typeof(ListController), "53", ct); createPost(s, "辽宁抚顺境内失事飞机或为朝鲜飞机东京电影节"); createPost(s, "中国廉价药缺口超300种 医生吃回扣成主因"); createPost(s, "杭州64位市民联名申请罢免下城区人大代表"); createPost(s, "广州天河拆迁村民身家均将过百万曝曾遭周润发"); createPost(s, "最后一批美军作战部队开始从伊拉克撤离"); createPost(s, "四川资阳原交通局长自曝被调查时遭刑讯逼供"); createPost(s, "张柏芝借博客与谢霆锋传情遭周润发羞辱 悄悄躲"); //--------------------------------------------------- // 第六行 s = createSection("网站链接", typeof(TextController), "61"); createText(s, @"<div>友情链接:<a href="""">网站abc</a> <a href="""">网站abc</a> <a href="""">网站abc</a> <a href="""">网站abc</a> <a href="""">网站abc</a> <a href="""">网站abc</a> <a href="""">网站abc</a> <a href="""">网站abc</a> <a href="""">网站abc</a> <a href="""">网站abc</a> <a href="""">网站abc</a> <a href="""">网站abc</a> <a href="""">网站abc</a> <a href="""">新闻kwg</a> <a href="""">新闻kwg</a></div>" + @"<div>网站导航:<a href="""">新闻kwg</a> <a href="""">新闻kwg</a> <a href="""">新闻kwg</a> <a href="""">新闻kwg</a> <a href="""">新闻kwg</a> <a href="""">新闻kwg</a> <a href="""">新闻kwg</a> <a href="""">新闻kwg</a> <a href="""">新闻kwg</a> <a href="""">新闻kwg</a> <a href="""">网站abc</a> <a href="""">网站abc</a> <a href="""">网站abc</a> </div>" ); css.AppendLine("#section" + s.Id + " { border-width:0px; height:}"); css.AppendLine("#sectionTitle" + s.Id + " { display:none; }"); css.AppendLine("#sectionContent" + s.Id + " { padding-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; }"); this.app.Style = this.app.Style + Environment.NewLine + css.ToString(); css = new StringBuilder(); css.Append(@" #pageWrap {background:url('/static/img/patterns/pbg.jpg');} #pageWrapInner {background:#fff;padding:0px 10px;} #portalContainer {color:#333333;} #portalContainer a {color:} #portalContainer .sectionPanel {border:1px #e6e6e6 solid;} .sectionTitle {} #portalContainer .sectionTitleText a {color:#839300;} #portalContainer .sectionMore a {color:#666;} .column1 .sectionTitle {background:url('/static/img/admin/menu-bg.gif');} .column1 {background:#f8f8f8;height:215px;} #row6_column1 {height:90px;} #row1_column1 {height:305px;} #row2_column1 {height:300px;} "); this.app.SkinStyle = css.ToString(); this.app.update( ); return(app); }
protected override IMemberApp createPortalApp() { // 1、创建app IMemberApp ret = base.createApp(); // 2、创建section foreach (XSection section in xapp.SectionList) { ContentSection s; // 聚合区块 if (section.ServiceId > 0) { s = createSectionMashup(section.Name, section.ServiceId, section.TemplateId, section.LayoutStr); s.CssClass = section.CssClass; s.ListCount = section.ListCount; s.ServiceParams = section.ServiceParams; s.update(); // 添加内容区块 } else { s = createSection(section.Name, section.TypeFullName, section.LayoutStr); s.CssClass = section.CssClass; s.ListCount = section.ListCount; s.update(); for (int i = section.PostList.Count - 1; i >= 0; i--) { XPost post = section.PostList[i]; ContentPost newPost = createPost(s, post.Title, post.TitleHome, post.Content, post.Pic, post.SourceLink, post.CategoryId, post.Width, post.Height); if (strUtil.HasText(post.Summary)) { newPost.Summary = post.Summary; } if (post.PickStatus > 0) { newPost.PickStatus = post.PickStatus; } if (strUtil.HasText(post.Summary) || post.PickStatus > 0) { newPost.update(); } } } // 自定义模板 if (strUtil.HasText(section.TemplateCustom)) { ContentCustomTemplate cs = new ContentCustomTemplate(); cs.Content = section.TemplateCustom; cs.OwnerId = this.app.OwnerId; cs.OwnerType = this.app.OwnerType; cs.OwnerUrl = this.app.OwnerUrl; cs.Name = "" + DateTime.Now.ToShortDateString(); cs.Creator = ctx.viewer.obj as User; tplService.Insert(cs); s.CustomTemplateId = cs.Id; s.update("CustomTemplateId"); } } return(ret); }
public virtual void Insert(ContentCustomTemplate ct) { ct.insert(); }
/// <summary> /// 创建手动添加区块 /// </summary> /// <param name="name">区块的名称</param> /// <param name="sectionType">区块的类型</param> /// <param name="layoutStr">所属行和所属列</param> /// <param name="ct">自定义模板</param> /// <returns></returns> protected ContentSection createSection(String name, String sectionType, String layoutStr, ContentCustomTemplate ct) { ContentSection section = new ContentSection(); int rowId = cvt.ToInt(layoutStr.Substring(0, layoutStr.Length - 1)); int columnId = cvt.ToInt(layoutStr.Substring(layoutStr.Length - 1, 1)); section.AppId = this.app.Id; section.RowId = rowId; section.ColumnId = columnId; section.SectionType = sectionType; section.Title = name; if (ct != null) { section.CustomTemplateId = ct.Id; } sectionService.Insert(section); return(section); }
private string getCustomTemplateBody(long id) { ContentCustomTemplate x = ContentCustomTemplate.findById(id); return(x == null ? "" : x.Content); }
protected override IMemberApp createPortalApp() { // 1、创建app IMemberApp ret = base.createApp(); // 2、创建section foreach (XSection section in xapp.SectionList) { ContentSection s; // 聚合区块 if (section.ServiceId > 0) { s = createSectionMashup( section.Name, section.ServiceId, section.TemplateId, section.LayoutStr ); s.CssClass = section.CssClass; s.ListCount = section.ListCount; s.ServiceParams = section.ServiceParams; s.update(); // 添加内容区块 } else { s = createSection( section.Name, section.TypeFullName, section.LayoutStr ); s.CssClass = section.CssClass; s.ListCount = section.ListCount; s.update(); for (int i = section.PostList.Count - 1; i >= 0; i--) { XPost post = section.PostList[i]; ContentPost newPost = createPost( s, post.Title, post.TitleHome, post.Content, post.Pic, post.SourceLink, post.CategoryId, post.Width, post.Height ); if (strUtil.HasText( post.Summary )) { newPost.Summary = post.Summary; } if (post.PickStatus > 0) { newPost.PickStatus = post.PickStatus; } if (strUtil.HasText( post.Summary ) || post.PickStatus > 0) { newPost.update(); } } } // 自定义模板 if (strUtil.HasText( section.TemplateCustom )) { ContentCustomTemplate cs = new ContentCustomTemplate(); cs.Content = section.TemplateCustom; cs.OwnerId = this.app.OwnerId; cs.OwnerType = this.app.OwnerType; cs.OwnerUrl = this.app.OwnerUrl; cs.Name = "" + DateTime.Now.ToShortDateString(); cs.Creator = ctx.viewer.obj as User; tplService.Insert( cs ); s.CustomTemplateId = cs.Id; s.update( "CustomTemplateId" ); } } return ret; }
protected ContentSection createSection(String name, Type sectionType, String layoutStr, ContentCustomTemplate ct) { return(createSection(name, sectionType.FullName, layoutStr, ct)); }
protected override IMemberApp createPortalApp() { StringBuilder designCss = new StringBuilder(); IMemberApp app = createApp(); createLayout(); ContentSection s = createSection( "焦点图片", typeof( SlideController ), "11" ); createImgBig( s, "嫦娥二号整流罩坠落江西", "http://img2.cache.netease.com/cnews/2010/10/2/201010021526102b7fa.jpg" ); createImgBig( s, "重庆特警开装甲车巡逻维稳", "http://img2.cache.netease.com/cnews/2010/10/2/201010020837190e40a.jpg" ); createImgBig( s, "香港举行国庆烟花汇演", "http://img1.cache.netease.com/cnews/2010/10/2/20101002081623541f8.jpg" ); designCss.AppendLine( "#portalContainer #section" + s.Id + " { border:0px; }" ); designCss.AppendLine( "#sectionTitle" + s.Id + " { display:none; }" ); designCss.AppendLine( "#sectionContent" + s.Id + " { padding-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; }" ); s = createSection( "娱乐专题", typeof( NormalController ), "11" ); String desc = "<p>“我记录综合系统”是.net 领域领先的网站系统。集成了“SNS、门户、CMS、论坛、博客、相册、微博、群组、瀑布流、下载、WIKI”等APP,为您提供一站式解决方案。</p><p>功能强大、开放源代码、多语言支持,并带有丰富的二次开发教程和示例代码,扩展方便灵活。</p><p>我记录下载网址:<a href=\"http://www.wojilu.com\" title=\"我记录\">http://www.wojilu.com</a></p>"; String summary = "“我记录综合系统”是.net 领域领先的网站系统。集成了“SNS、门户、CMS、论坛、博客、相册、微博、群组、瀑布流、下载、WIKI”等APP,为您提供一站式解决方案。"; ContentPost post = createImgS( s, "我记录网站综合系统1.9发布", desc, "http://img3.cache.netease.com/ent/2010/10/18/2010101809310948fd9.png" ); post.PickStatus = PickStatus.Focus; post.Summary = summary; post.update(); designCss.AppendLine( "#sectionContent" + s.Id + " { font-size:12px; }" ); createPost( s, "张柏芝借博客与谢霆锋传情" ); createPost( s, "张家辉:拍激情戏不用向太太报批" ); createPost( s, "金鹰节孙红雷摘三奖成最大赢家" ); createPost( s, "钟楚红台湾出席剪彩活动" ); createPost( s, "陈冠希被曝在香港秘密录唱" ); createPost( s, "浙版西游记白骨精成为爱自尽美女" ); s = createSectionMashup( "资讯头条", 38, 21, "12" ); s.CssClass = "focusSection"; s.ServiceParams = "param0=" + this.app.Id + ";param1=8"; s.update(); designCss.AppendLine( "#sectionContent" + s.Id + " { padding-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; }" ); s = createSection( "要闻列表", typeof( ListController ), "12" ); s.ListCount = 9; s.update( "ListCount" ); createPost( s, "西安市一在建民房倒塌造成8人死亡" ); createPost( s, "国税总局反驳中国税负痛苦指数世界第二传闻" ); createPost( s, "香港货轮与日本渔船昨日在日本海域发生碰撞" ); createPost( s, "菅直人继续宣称钓鱼岛是日本领土 中方回应" ); createPost( s, "温家宝离京访问欧亚四国 中国掀秋季外交高潮 " ); createPost( s, "2010年诺贝尔奖公布日期全部确定" ); createPost( s, "上海眼科假药事件部分涉案人员被刑拘" ); createPost( s, "日本神户将就熊猫死亡赔偿中方50万美元" ); createPost( s, "菲总统称下周在网上公开人质事件完整报告" ); createPost( s, "美性病实验曾致700危地马拉人染病 奥巴马道歉" ); // 创建自定义模板 ContentCustomTemplate cs = new ContentCustomTemplate(); cs.Content = @"<ul class=""dot2 ulLR unstyled""> <!-- BEGIN list --> <li style=""height:20px;""><div class=""left-title"" style=""width:310px;font-size:14px;""> <a href=""#{post.Url}"" style=""#{post.TitleCss}"" title=""#{post.TitleFull}"" style=""#{post.TitleCss}"">#{post.Title}</a></div> <div class=""right-info"">#{post.CreatedDay}</div> <div class=""clear""></div> </li> <!-- END list --> </ul>"; cs.OwnerId = this.app.OwnerId; cs.OwnerType = this.app.OwnerType; cs.OwnerUrl = this.app.OwnerUrl; cs.Name = "" + DateTime.Now.ToShortDateString(); cs.Creator = ctx.viewer.obj as User; tplService.Insert( cs ); s.CustomTemplateId = cs.Id; s.update( "CustomTemplateId" ); s = createSection( "信息发布", typeof( TextController ), "13" ); createText( s, "<div style=\"margin:10px 0px 10px 10px;\">" + "<div><a href=\"" + Link.To( Site.Instance, new wojilu.Web.Controller.Content.Submit.PostController().Index, base.app.Id ) + "\" class=\"btn btn-danger right10\"><i class=\"icon-plus icon-white\"></i> 投递资讯</a>" + "<a href=\"" + Link.To( new LinkController().MyProfile ) + "\" class=\"btn btn-primary\"><i class=\"icon-plus icon-white\"></i> 我的资料</a></div>" + "<div><a href=\"#\" class=\"btn btn-info top10 right10\"><i class=\"icon-plus icon-white\"></i> 线下活动</a>" + "<a href=\"#\" class=\"btn btn-success top10\"><i class=\"icon-plus icon-white\"></i> 谈天说地</a></div>" + "</div><div class=\"clear\"></div>" ); designCss.AppendLine( "#sectionContentText" + s.Id + " a{ color:#fff;}" ); s = createSection( "公告", typeof( TextController ), "13" ); createText( s, "<div style=\"font-size:12px;\"><div><a href=\"http://www.wojilu.com\">我记录网站综合系统1.9正式发布</a></div><div><a href=\"http://news.163.com/10/1018/15/6J9NSJI100014JB6.html\">时速1600公里超音速汽车英国问世</a></div><div><a href=\"http://news.sina.com.cn/c/2010-10-18/205321300806.shtml\">影著协回应网吧等放电影缴版权费质疑</a></div></div>" ); s = createSection( "财经专栏", typeof( NormalController ), "13" ); createImgS( s, "房产税成为开发商提价的借口", "浙江绍兴县家印染企业出资万余元,购买一条快艇送给镇政府监督辖区内企业的排污。这是为了动员", "http://img1.cache.netease.com/cnews/2010/10/1/20101001074938966c6.jpg" ); createPost( s, "高明骏回应涉毒事件 向家人及公众致歉" ); createPost( s, "商天娥办婚宴 刘嘉玲吴君如到贺(组图)" ); createPost( s, "利智被曝曾遭周润发羞辱 悄悄躲后台哭泣" ); createPost( s, "巴黎看秀丢行李 林志玲买内衣应急(图)" ); createPost( s, "姜昆:“海派清口”是好表演 但不适合上春晚" ); // 第二行 s = createSection( "通栏广告", typeof( TextController ), "21" ); createText( s, @"<img src=""/static/img/big/ad1.gif""/>" ); designCss.AppendLine( "#portalContainer #section" + s.Id + " { border:0px; }" ); designCss.AppendLine( "#sectionTitle" + s.Id + " { display:none; }" ); designCss.AppendLine( "#sectionContent" + s.Id + " { padding-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; margin-right:10px;}" ); // 第三行 s = createSection( "综合图文", typeof( PostImgController ), "31" ); StringBuilder customCss = new StringBuilder(); customCss.AppendLine( "#portalContainer #section" + s.Id + " {border:0px;}" ); customCss.AppendLine( "#sectionTitle" + s.Id + " {background:url(/static/img/big/rowBg1.jpg) no-repeat;height:31px; border-bottom:0px;}" ); customCss.AppendLine( "#sectionTitle" + s.Id + " .sectionTitleText a{color:#fff;}" ); customCss.AppendLine( "#sectionTitle" + s.Id + " .sectionMore {margin-right:15px;}" ); createImgPost( s, "丛林里的特雷莎修女", "谢欣燕填写问卷时,发现不对,计算机屏幕居然出现她和男友庄胜杰出游以及“嫁给我吧”的画面,被蒙在鼓里的谢女,一脸狐疑,此时,庄胜杰和几名友人,拿着“宝贝嫁给我吧”的海报,突然出现在她的眼前,让她又惊又喜。庄胜杰以颤抖音调说,“我们南北奔波那么久,可以不要再那么累,欣燕你可以嫁给我吗?”,说完送上捧花及定情戒指,旁边的友人起哄“嫁给他!嫁给他!”,谢女事先完全不知道有此场面,内心好感动,终于说出“我愿意”,立即一阵欢呼。", "http://img1.cache.netease.com/cnews/2010/10/11/201010110432204a6d3.jpg" ); createPostC( s, "印度首富入住27层新居 造价66.5亿创全球最贵", "环球资讯" ); createPostC( s, "美国汇率报告或推迟到11月G20峰会后发布", "股市金融" ); createPostC( s, "北京周边县市出台政策限制外地人购房", "法律政策" ); createPostC( s, "中国新车年销量将达1700万 逼近美国最高水平", "汽车销售" ); createPostC( s, "河南教育厅发文组织数万学生到富士康实习", "教育政策" ); createPostC( s, "印度首富入住27层新居 造价66.5亿创全球最贵", "环球资讯" ); createImgHome( s, "湖南女特级教师驾车撞六学生", "女特级教师", 110, 80, "http://img4.cache.netease.com/club/2010/10/11/20101011082942d4f3e.jpg" ); createImgHome( s, "明星与新欢旧爱间的情事纠葛", "明星与新欢", 110, 80, "http://img3.cache.netease.com/club/2010/10/11/20101011083326c2df5.jpg" ); createImgHome( s, "陶寺遗址证 尧舜非传说", "陶寺遗址", 110, 80, "http://img1.cache.netease.com/cnews/2010/10/8/2010100812172846800.jpg" ); createImgHome( s, "恋人搭高铁约会3年花36万", "恋人搭高铁", 110, 80, "http://img1.cache.netease.com/cnews/2010/10/3/20101003101238aa436.jpg" ); s = createSection( "明星追踪", typeof( NormalController ), "32" ); createImgS( s, "高明骏吸毒被抓满文军告密", "该片讲述了三个女人之间的情感故事,叶璇片中饰演一位寂寞的妻子", "http://img4.cache.netease.com/ent/2010/9/30/20100930191809ff7c0.png" ); //createPost( s, "美国实验室创造4万亿摄氏度纪录" ); createPost( s, "华航被曝无视油箱漏油冒险载客飞行" ); createPost( s, "直击最疯狂的摩托车飙车秀无视" ); createPost( s, "图说娱乐圈那些花瓶女星无视" ); createPost( s, "大义灭亲可减刑是在亵渎法律无视" ); createPost( s, "彭帅受困体能制约惨遭逆转无视" ); // 第四行 s = createSection( "通栏广告", typeof( TextController ), "41" ); createText( s, @"<img src=""/static/img/big/ad2.gif""/>" ); designCss.AppendLine( "#portalContainer #section" + s.Id + " { border:0px; }" ); designCss.AppendLine( "#sectionTitle" + s.Id + " { display:none; }" ); designCss.AppendLine( "#sectionContent" + s.Id + " { padding-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; margin-right:10px;}" ); // 第五行 s = createSection( "娱乐资讯", typeof( PostImgController ), "51" ); customCss.AppendLine( "#portalContainer #section" + s.Id + " {border:0px;}" ); customCss.AppendLine( "#sectionTitle" + s.Id + " {background:url(/static/img/big/rowBg2.jpg) no-repeat;height:31px;border-bottom:0px;}" ); customCss.AppendLine( "#sectionTitle" + s.Id + " .sectionTitleText a{color:#fff;}" ); customCss.AppendLine( "#sectionTitle" + s.Id + " .sectionMore {margin-right:15px;}" ); createImgPost( s, "林志颖生日曝儿子照片", "今天是林志颖36岁的生日,身在珠海赛车场拍戏的他发布微博曝光了小小志的照片,称儿子是今生最美好的事,还表示看著小小志用弯弯的眼睛对他笑感觉天使大概就是这样子,儿子是他的骄傲,儿子天使的笑容是最好的礼物", "http://img4.cache.netease.com/ent/2010/10/15/20101015132315ec733.png" ); createPostC( s, "法国支持建立欧洲反导系统并称将保持核威慑", "环球军事" ); createPostC( s, "深圳野生动物园承认失误 按工伤赔被虎咬死者", "社会新闻" ); createPostC( s, "国家公务员考试昨日开始报名 网络一度堵塞", "天方夜谭" ); createPostC( s, "住建部:违反限购房规定买卖住房有重大风险", "法律政策" ); createPostC( s, "美国2010财年联邦财政赤字近1.3万亿美元", "财政要闻" ); createPostC( s, "法国支持建立欧洲反导系统并称将保持核威慑", "环球军事" ); createImgHome( s, "学历丢人成绩骄人的娱乐明星", "学历丢人明星", 110, 80, "http://img4.cache.netease.com/ent/2010/10/15/201010151038520fc9e.png?froment" ); createImgHome( s, "摩登天空音乐节 世界城市音乐节", "摩登天空", 110, 80, "http://img3.cache.netease.com/ent/2010/9/13/201009131616576ab3c.jpg" ); createImgHome( s, "第15届釜山电影节闭幕 中国两位新人导演获奖", "釜山电影节", 110, 80, "http://img4.cache.netease.com/ent/2010/10/11/201010111457590abb1.jpg" ); createImgHome( s, "“东方风云榜”季选音乐营即将席卷热浪", "东方风云榜", 110, 80, "http://img4.cache.netease.com/ent/2010/10/11/201010111843492d214.jpg" ); s = createSection( "上市公司", typeof( NormalController ), "52" ); createImgS( s, "《时代》眼中的伊战", "该片讲述了三个女人之间的情感故事,叶璇片中饰演一位寂寞的妻子", "http://img2.cache.netease.com/cnews/2010/9/3/2010090308452932084.jpg" ); createPost( s, "云南保山山体滑坡已致24人死亡24人失踪" ); createPost( s, "广东政协委员调研称全省225万户仍住茅草房" ); createPost( s, "徐州多家医院药品采购二次议价 不按中标价买" ); createPost( s, "官员称供求关系变化系生姜价格上涨主因" ); createPost( s, "舟曲上报重建规划 防洪标准升至50年一遇" ); createPost( s, "发改委官员称国家将坚决抑制汽车产能过剩" ); // 第六行 s = createSection( "通栏广告", typeof( TextController ), "61" ); createText( s, @"<img src=""/static/img/big/ad3.gif""/>" ); designCss.AppendLine( "#portalContainer #section" + s.Id + " { border:0px; }" ); designCss.AppendLine( "#sectionTitle" + s.Id + " { display:none; }" ); designCss.AppendLine( "#sectionContent" + s.Id + " { padding-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; margin-right:10px;}" ); s = createSection( "综合图文", typeof( PostImgController ), "71" ); customCss.AppendLine( "#portalContainer #section" + s.Id + "{border:0px;}" ); customCss.AppendLine( "#sectionTitle" + s.Id + " {background:url(/static/img/big/rowBg3.jpg) no-repeat;height:31px;border-bottom:0px;}" ); customCss.AppendLine( "#sectionTitle" + s.Id + " .sectionTitleText a{color:#fff;}" ); customCss.AppendLine( "#sectionTitle" + s.Id + " .sectionMore {margin-right:15px;}" ); createImgPost( s, "丛林里的特雷莎修女", "谢欣燕填写问卷时,发现不对,计算机屏幕居然出现她和男友庄胜杰出游以及“嫁给我吧”的画面,被蒙在鼓里的谢女,一脸狐疑,此时,庄胜杰和几名友人,拿着“宝贝嫁给我吧”的海报,突然出现在她的眼前,让她又惊又喜。庄胜杰以颤抖音调说,“我们南北奔波那么久,可以不要再那么累,欣燕你可以嫁给我吗?”,说完送上捧花及定情戒指,旁边的友人起哄“嫁给他!嫁给他!”,谢女事先完全不知道有此场面,内心好感动,终于说出“我愿意”,立即一阵欢呼。", "http://img1.cache.netease.com/cnews/2010/10/11/201010110432204a6d3.jpg" ); createPostC( s, "印度首富入住27层新居 造价66.5亿创全球最贵", "环球资讯" ); createPostC( s, "美国汇率报告或推迟到11月G20峰会后发布", "股市金融" ); createPostC( s, "北京周边县市出台政策限制外地人购房", "法律政策" ); createPostC( s, "中国新车年销量将达1700万 逼近美国最高水平", "汽车销售" ); createPostC( s, "河南教育厅发文组织数万学生到富士康实习", "教育政策" ); createPostC( s, "印度首富入住27层新居 造价66.5亿创全球最贵", "环球资讯" ); createImgHome( s, "湖南女特级教师驾车撞六学生", "女特级教师", 110, 80, "http://img4.cache.netease.com/club/2010/10/11/20101011082942d4f3e.jpg" ); createImgHome( s, "明星与新欢旧爱间的情事纠葛", "明星与新欢", 110, 80, "http://img3.cache.netease.com/club/2010/10/11/20101011083326c2df5.jpg" ); createImgHome( s, "陶寺遗址证 尧舜非传说国内互联网业限时特卖", "陶寺遗址", 110, 80, "http://img1.cache.netease.com/cnews/2010/10/8/2010100812172846800.jpg" ); createImgHome( s, "超强视觉冲击力恋人搭高铁约会3年花36万", "恋人搭高铁", 110, 80, "http://img1.cache.netease.com/cnews/2010/10/3/20101003101238aa436.jpg" ); s = createSection( "明星追踪", typeof( NormalController ), "72" ); createImgS( s, "任正非退休前打破神秘:为华为站出来中移动", "该片讲述了三个女人之间的情感故事,叶璇片中饰演一位寂寞的妻子", "http://img4.cache.netease.com/ent/2010/9/30/20100930191809ff7c0.png" ); createPost( s, "91家网站华航被曝无视油箱漏油冒险载客飞行" ); createPost( s, "微软回应直击最疯狂的摩托车飙车秀无视" ); createPost( s, "图说娱乐圈那些花瓶女星无视图说娱乐圈" ); createPost( s, "周末要闻回顾:苹果售后政策今秋起调整" ); createPost( s, "美国政府叫停3D打印枪设计图下载美国政府" ); setCss( designCss, customCss ); return app; }
public virtual void Insert( ContentCustomTemplate ct ) { ct.insert(); }
protected override IMemberApp createPortalApp() { StringBuilder css = new StringBuilder(); IMemberApp app = createApp(); createLayout(); ContentSection s = createSection("焦点图片", typeof(SlideController), "11"); createImgBig(s, "嫦娥二号整流罩坠落江西", "http://img2.cache.netease.com/cnews/2010/10/2/201010021526102b7fa.jpg"); createImgBig(s, "重庆特警开装甲车巡逻维稳", "http://img2.cache.netease.com/cnews/2010/10/2/201010020837190e40a.jpg"); createImgBig(s, "香港举行国庆烟花汇演", "http://img1.cache.netease.com/cnews/2010/10/2/20101002081623541f8.jpg"); css.AppendLine("#section" + s.Id + " { border-width:0px; }"); css.AppendLine("#sectionTitle" + s.Id + " { display:none; }"); css.AppendLine("#sectionContent" + s.Id + " { padding-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; }"); s = createSection("娱乐专题", typeof(NormalController), "11"); createImgS(s, "敢死队致敬老派动作重现热血场面", "一代报业宗师张季鸾的墓地近年失修荒废,曾占地40亩的陵园仅剩一亩见方的土坡。如今在废旧的墓陵旁边还建起了臭气熏天的养猪场。据悉,张季鸾病逝时,国共两党最高层都在第一时间发来唁电,蒋介石、周恩来更是亲自前往吊", "http://img3.cache.netease.com/ent/2010/10/18/2010101809310948fd9.png"); createPost(s, "张柏芝借博客与谢霆锋传情"); createPost(s, "张家辉:拍激情戏不用向太太报批"); createPost(s, "金鹰节孙红雷摘三奖成最大赢家"); createPost(s, "钟楚红台湾出席剪彩活动"); createPost(s, "陈冠希被曝在香港秘密录唱"); createPost(s, "浙版西游记白骨精成为爱自尽美女"); s = createSection("新闻头条", typeof(TextController), "12"); createText(s, @"<div style=""font-size:12px;""><h2 style=""font-size:18px;font-family: 黑体;""><a href=""http://www.wojilu.com/space/author/Blog1/Post/22"">门户+论坛+SNS整合系统源码</a></h2><div><a href=""http://www.wojilu.com/Content396/Post/415"">闪电击中自由女神像瞬间</a><span> </span>|<span> </span><a href=""http://www.wojilu.com/Content396/Post/424"">2010年胡润百富榜发布</a><span> </span><br></div><h3 style=""margin-top:10px;font-size:18px;font-family: 黑体;""><a href=""http://www.wojilu.com/Content396/Post/399"">MIT技术评论:2010十大新兴技术</a></h3><div><a href=""http://www.wojilu.com/Content396/Post/379"">SNS的多栖“钱”景</a><span> </span>|<span> </span><a href=""http://www.wojilu.com/Content396/Post/394"">创业板估值体系面临考验</a><span> </span><br></div><h3 style=""margin-top:10px;font-size:18px;font-family: 黑体;""><a href=""http://www.wojilu.com/help"">我记录网站综合系统使用指南</a></h3><div><a href=""http://www.wojilu.com/Content396/Post/280"">Google的十大核心技术</a><span> </span>|<span> </span><a href=""http://www.wojilu.com/Content396/Post/273"">最令人讨厌11种应用程序</a><span> </span></div></div>"); s = createSection("要闻列表", typeof(ListController), "12"); s.ListCount = 20; s.update("ListCount"); createPost(s, "西安市一在建民房倒塌造成8人死亡"); createPost(s, "国税总局反驳中国税负痛苦指数世界第二传闻"); createPost(s, "香港货轮与日本渔船昨日在日本海域发生碰撞"); createPost(s, "菅直人继续宣称钓鱼岛是日本领土 中方回应"); createPost(s, "温家宝离京访问欧亚四国 中国掀秋季外交高潮 "); createPost(s, "2010年诺贝尔奖公布日期全部确定"); createPost(s, "上海眼科假药事件部分涉案人员被刑拘"); createPost(s, "日本神户将就熊猫死亡赔偿中方50万美元"); createPost(s, "菲总统称下周在网上公开人质事件完整报告"); createPost(s, "美性病实验曾致700危地马拉人染病 奥巴马道歉"); createPost(s, "俄罗斯主张与北约签署军事限制协议"); createPost(s, "巴西今日大选有望产生首位女总统"); createPost(s, "法国月内三度爆发反对退休改革全国性示威"); createPost(s, "东京电影节公布竞赛片 秦海璐角逐金麒麟"); createPost(s, "香港货轮与日本渔船昨日在日本海域发生碰撞"); // 创建自定义模板 ContentCustomTemplate cs = new ContentCustomTemplate(); cs.Content = @"<table style=""width:100%;table-layout: fixed;"" cellspacing=""0"" cellpadding=""0""> <!-- BEGIN list --> <tr><td style=""width:310px;""><div style=""font-size:14px;text-overflow:ellipsis;overflow: hidden;white-space:nowrap;""><a href=""#{post.Url}"" style=""color:#f54100"">[#{post.Author}]</a> <a href=""#{post.Url}"" style=""#{post.TitleCss}"" title=""#{post.TitleFull}"" style=""#{post.TitleCss}"">#{post.Title}</a></div> </td><td style=""text-align:right; color:#666;"">#{post.CreatedDay}</td></tr> <!-- END list --> </table>"; cs.OwnerId = this.app.OwnerId; cs.OwnerType = this.app.OwnerType; cs.OwnerUrl = this.app.OwnerUrl; cs.Name = "" + DateTime.Now.ToShortDateString(); cs.Creator = ctx.viewer.obj as User; tplService.Insert(cs); s.CustomTemplateId = cs.Id; s.update("CustomTemplateId"); s = createSection("信息发布", typeof(TextController), "13"); createText(s, "<div><a href=\"\" class=\"cmd1\"><span>我要发布</span></a><a href=\"\" class=\"cmd2\"><span>新手起步</span></a><a href=\"\" class=\"cmd3\"><span>美食天地</span></a><a href=\"\" class=\"cmd4\"><span>谈天说地</span></a></div><div class=\"clear\"></div>"); s = createSection("公告", typeof(TextController), "13"); createText(s, "<div style=\"font-size:12px;\"><div><a href=\"http://www.wojilu.com\">· 我记录网站综合系统1.5.5正式发布</a></div><div><a href=\"http://news.163.com/10/1018/15/6J9NSJI100014JB6.html\">· 时速1600公里超音速汽车英国问世</a></div><div><a href=\"http://news.sina.com.cn/c/2010-10-18/205321300806.shtml\">· 影著协回应网吧等放电影缴版权费质疑</a></div></div>"); s = createSection("▍财经专栏", typeof(NormalController), "13"); createImgS(s, "房产税成为开发商提价的借口", "浙江绍兴县家印染企业出资万余元,购买一条快艇送给镇政府监督辖区内企业的排污。这是为了动员全社会的力量来整治环境污染,府不会对捐赠企业手下留情", "http://img1.cache.netease.com/cnews/2010/10/1/20101001074938966c6.jpg"); createPost(s, "高明骏回应涉毒事件 向家人及公众致歉"); createPost(s, "商天娥办婚宴 刘嘉玲吴君如到贺(组图)"); createPost(s, "利智被曝曾遭周润发羞辱 悄悄躲后台哭泣"); createPost(s, "巴黎看秀丢行李 林志玲买内衣应急(图)"); createPost(s, "姜昆:“海派清口”是好表演 但不适合上春晚"); // 第二行 s = createSection("通栏广告", typeof(TextController), "21"); createText(s, @"<img src=""/static/img/big/ad1.gif""/>"); css.AppendLine("#section" + s.Id + " { border-width:0px; }"); css.AppendLine("#sectionTitle" + s.Id + " { display:none; }"); css.AppendLine("#sectionContent" + s.Id + " { padding-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; }"); // 第三行 s = createSection("综合图文", typeof(PostImgController), "31"); StringBuilder sb = new StringBuilder(); sb.AppendLine("#section" + s.Id + ".sectionPanel {border:0px;}"); sb.AppendLine("#sectionTitle" + s.Id + " {background:url(/static/img/big/rowBg1.jpg);}"); sb.AppendLine("#sectionTitle" + s.Id + " .sectionTitleText a{color:#fff;}"); createImgPost(s, "丛林里的特雷莎修女", "谢欣燕填写问卷时,发现不对,计算机屏幕居然出现她和男友庄胜杰出游以及“嫁给我吧”的画面,被蒙在鼓里的谢女,一脸狐疑,此时,庄胜杰和几名友人,拿着“宝贝嫁给我吧”的海报,突然出现在她的眼前,让她又惊又喜。庄胜杰以颤抖音调说,“我们南北奔波那么久,可以不要再那么累,欣燕你可以嫁给我吗?”,说完送上捧花及定情戒指,旁边的友人起哄“嫁给他!嫁给他!”,谢女事先完全不知道有此场面,内心好感动,终于说出“我愿意”,立即一阵欢呼。", "http://img1.cache.netease.com/cnews/2010/10/11/201010110432204a6d3.jpg"); createPostC(s, "印度首富入住27层新居 造价66.5亿创全球最贵", "环球资讯"); createPostC(s, "美国汇率报告或推迟到11月G20峰会后发布", "股市金融"); createPostC(s, "北京周边县市出台政策限制外地人购房", "法律政策"); createPostC(s, "中国新车年销量将达1700万 逼近美国最高水平", "汽车销售"); createPostC(s, "河南教育厅发文组织数万学生到富士康实习", "教育政策"); createPostC(s, "印度首富入住27层新居 造价66.5亿创全球最贵", "环球资讯"); createImgHome(s, "湖南女特级教师驾车撞六学生", "女特级教师", 110, 80, "http://img4.cache.netease.com/club/2010/10/11/20101011082942d4f3e.jpg"); createImgHome(s, "明星与新欢旧爱间的情事纠葛", "明星与新欢", 110, 80, "http://img3.cache.netease.com/club/2010/10/11/20101011083326c2df5.jpg"); createImgHome(s, "陶寺遗址证 尧舜非传说", "陶寺遗址", 110, 80, "http://img1.cache.netease.com/cnews/2010/10/8/2010100812172846800.jpg"); createImgHome(s, "恋人搭高铁约会3年花36万", "恋人搭高铁", 110, 80, "http://img1.cache.netease.com/cnews/2010/10/3/20101003101238aa436.jpg"); s = createSection("▍明星追踪", typeof(NormalController), "32"); createImgS(s, "高明骏吸毒被抓满文军告密", "该片讲述了三个女人之间的情感故事,叶璇片中饰演一位寂寞的妻子", "http://img4.cache.netease.com/ent/2010/9/30/20100930191809ff7c0.png"); //createPost( s, "美国实验室创造4万亿摄氏度纪录" ); createPost(s, "华航被曝无视油箱漏油冒险载客飞行"); createPost(s, "直击最疯狂的摩托车飙车秀无视"); createPost(s, "图说娱乐圈那些花瓶女星无视"); createPost(s, "大义灭亲可减刑是在亵渎法律无视"); createPost(s, "彭帅受困体能制约惨遭逆转无视"); // 第四行 s = createSection("通栏广告", typeof(TextController), "41"); createText(s, @"<img src=""/static/img/big/ad2.gif""/>"); css.AppendLine("#section" + s.Id + " { border-width:0px; }"); css.AppendLine("#sectionTitle" + s.Id + " { display:none; }"); css.AppendLine("#sectionContent" + s.Id + " { padding-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; }"); // 第五行 s = createSection("娱乐资讯", typeof(PostImgController), "51"); sb.AppendLine("#section" + s.Id + ".sectionPanel {border:0px;}"); sb.AppendLine("#sectionTitle" + s.Id + " {background:url(/static/img/big/rowBg2.jpg);}"); sb.AppendLine("#sectionTitle" + s.Id + " .sectionTitleText a{color:#fff;}"); createImgPost(s, "林志颖生日曝儿子照片", "今天是林志颖36岁的生日,身在珠海赛车场拍戏的他发布微博曝光了小小志的照片,称儿子是今生最美好的事,还表示看著小小志用弯弯的眼睛对他笑感觉天使大概就是这样子,儿子是他的骄傲,儿子天使的笑容是最好的礼物", "http://img4.cache.netease.com/ent/2010/10/15/20101015132315ec733.png"); createPostC(s, "法国支持建立欧洲反导系统并称将保持核威慑", "环球军事"); createPostC(s, "深圳野生动物园承认失误 按工伤赔被虎咬死者", "社会新闻"); createPostC(s, "国家公务员考试昨日开始报名 网络一度堵塞", "天方夜谭"); createPostC(s, "住建部:违反限购房规定买卖住房有重大风险", "法律政策"); createPostC(s, "美国2010财年联邦财政赤字近1.3万亿美元", "财政要闻"); createPostC(s, "法国支持建立欧洲反导系统并称将保持核威慑", "环球军事"); createImgHome(s, "学历丢人成绩骄人的娱乐明星", "学历丢人明星", 110, 80, "http://img4.cache.netease.com/ent/2010/10/15/201010151038520fc9e.png?froment"); createImgHome(s, "摩登天空音乐节 世界城市音乐节", "摩登天空", 110, 80, "http://img3.cache.netease.com/ent/2010/9/13/201009131616576ab3c.jpg"); createImgHome(s, "第15届釜山电影节闭幕 中国两位新人导演获奖", "釜山电影节", 110, 80, "http://img4.cache.netease.com/ent/2010/10/11/201010111457590abb1.jpg"); createImgHome(s, "“东方风云榜”季选音乐营即将席卷热浪", "东方风云榜", 110, 80, "http://img4.cache.netease.com/ent/2010/10/11/201010111843492d214.jpg"); s = createSection("▍上市公司", typeof(NormalController), "52"); createImgS(s, "《时代》眼中的伊战", "该片讲述了三个女人之间的情感故事,叶璇片中饰演一位寂寞的妻子", "http://img2.cache.netease.com/cnews/2010/9/3/2010090308452932084.jpg"); createPost(s, "云南保山山体滑坡已致24人死亡24人失踪"); createPost(s, "广东政协委员调研称全省225万户仍住茅草房"); createPost(s, "徐州多家医院药品采购二次议价 不按中标价买"); createPost(s, "官员称供求关系变化系生姜价格上涨主因"); createPost(s, "舟曲上报重建规划 防洪标准升至50年一遇"); createPost(s, "发改委官员称国家将坚决抑制汽车产能过剩"); // 第六行 s = createSection("通栏广告", typeof(TextController), "61"); createText(s, @"<img src=""/static/img/big/ad3.gif""/>"); css.AppendLine("#section" + s.Id + " { border-width:0px; }"); css.AppendLine("#sectionTitle" + s.Id + " { display:none; }"); css.AppendLine("#sectionContent" + s.Id + " { padding-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; }"); s = createSection("综合图文", typeof(PostImgController), "71"); sb.AppendLine("#section" + s.Id + ".sectionPanel {border:0px;}"); sb.AppendLine("#sectionTitle" + s.Id + " {background:url(/static/img/big/rowBg3.jpg);}"); sb.AppendLine("#sectionTitle" + s.Id + " .sectionTitleText a{color:#fff;}"); createImgPost(s, "丛林里的特雷莎修女", "谢欣燕填写问卷时,发现不对,计算机屏幕居然出现她和男友庄胜杰出游以及“嫁给我吧”的画面,被蒙在鼓里的谢女,一脸狐疑,此时,庄胜杰和几名友人,拿着“宝贝嫁给我吧”的海报,突然出现在她的眼前,让她又惊又喜。庄胜杰以颤抖音调说,“我们南北奔波那么久,可以不要再那么累,欣燕你可以嫁给我吗?”,说完送上捧花及定情戒指,旁边的友人起哄“嫁给他!嫁给他!”,谢女事先完全不知道有此场面,内心好感动,终于说出“我愿意”,立即一阵欢呼。", "http://img1.cache.netease.com/cnews/2010/10/11/201010110432204a6d3.jpg"); createPostC(s, "印度首富入住27层新居 造价66.5亿创全球最贵", "环球资讯"); createPostC(s, "美国汇率报告或推迟到11月G20峰会后发布", "股市金融"); createPostC(s, "北京周边县市出台政策限制外地人购房", "法律政策"); createPostC(s, "中国新车年销量将达1700万 逼近美国最高水平", "汽车销售"); createPostC(s, "河南教育厅发文组织数万学生到富士康实习", "教育政策"); createPostC(s, "印度首富入住27层新居 造价66.5亿创全球最贵", "环球资讯"); createImgHome(s, "湖南女特级教师驾车撞六学生", "女特级教师", 110, 80, "http://img4.cache.netease.com/club/2010/10/11/20101011082942d4f3e.jpg"); createImgHome(s, "明星与新欢旧爱间的情事纠葛", "明星与新欢", 110, 80, "http://img3.cache.netease.com/club/2010/10/11/20101011083326c2df5.jpg"); createImgHome(s, "陶寺遗址证 尧舜非传说", "陶寺遗址", 110, 80, "http://img1.cache.netease.com/cnews/2010/10/8/2010100812172846800.jpg"); createImgHome(s, "恋人搭高铁约会3年花36万", "恋人搭高铁", 110, 80, "http://img1.cache.netease.com/cnews/2010/10/3/20101003101238aa436.jpg"); s = createSection("▍明星追踪", typeof(NormalController), "72"); createImgS(s, "高明骏吸毒被抓满文军告密", "该片讲述了三个女人之间的情感故事,叶璇片中饰演一位寂寞的妻子", "http://img4.cache.netease.com/ent/2010/9/30/20100930191809ff7c0.png"); //createPost( s, "美国实验室创造4万亿摄氏度纪录" ); createPost(s, "华航被曝无视油箱漏油冒险载客飞行"); createPost(s, "直击最疯狂的摩托车飙车秀无视"); createPost(s, "图说娱乐圈那些花瓶女星无视"); createPost(s, "大义灭亲可减刑是在亵渎法律无视"); createPost(s, "彭帅受困体能制约惨遭逆转无视"); this.app.Style = this.app.Style + Environment.NewLine + css.ToString(); css = new StringBuilder(); css.AppendLine("#portalContainer {color:#333333;}"); css.AppendLine("#portalContainer a {color:}"); css.AppendLine("#portalContainer .sectionPanel {border:1px #e6e6e6 solid;}"); css.AppendLine(".sectionTitle {background:url(/static/skin/apps/content/1/sectionTitleBg.jpg);}"); css.AppendLine("#portalContainer .sectionTitleText a {color:#839300;}"); css.AppendLine("#portalContainer .sectionMore a {color:#666;}"); css.AppendLine("#row1_column3 li{font-size:12px;}"); css.AppendLine("#row3_column2 li{font-size:12px;}"); css.AppendLine("#row5_column2 li{font-size:12px;}"); css.AppendLine("#row7_column2 li{font-size:12px;}"); this.app.SkinStyle = css.ToString() + sb.ToString(); this.app.update(); return(app); }
protected override IMemberApp createPortalApp() { StringBuilder designCss = new StringBuilder(); IMemberApp app = createApp(); createLayout(); ContentSection s = createSection("焦点图片", typeof(SlideController), "11"); createImgBig(s, "嫦娥二号整流罩坠落江西", "http://img2.cache.netease.com/cnews/2010/10/2/201010021526102b7fa.jpg"); createImgBig(s, "重庆特警开装甲车巡逻维稳", "http://img2.cache.netease.com/cnews/2010/10/2/201010020837190e40a.jpg"); createImgBig(s, "香港举行国庆烟花汇演", "http://img1.cache.netease.com/cnews/2010/10/2/20101002081623541f8.jpg"); designCss.AppendLine("#portalContainer #section" + s.Id + " { border:0px; }"); designCss.AppendLine("#sectionTitle" + s.Id + " { display:none; }"); designCss.AppendLine("#sectionContent" + s.Id + " { padding-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; }"); s = createSection("娱乐专题", typeof(NormalController), "11"); String desc = "<p>“我记录综合系统”是.net 领域领先的网站系统。集成了“SNS、门户、CMS、论坛、博客、相册、微博、群组、瀑布流、下载、WIKI”等APP,为您提供一站式解决方案。</p><p>功能强大、开放源代码、多语言支持,并带有丰富的二次开发教程和示例代码,扩展方便灵活。</p><p>我记录下载网址:<a href=\"http://www.wojilu.com\" title=\"我记录\">http://www.wojilu.com</a></p>"; String summary = "“我记录综合系统”是.net 领域领先的网站系统。集成了“SNS、门户、CMS、论坛、博客、相册、微博、群组、瀑布流、下载、WIKI”等APP,为您提供一站式解决方案。"; ContentPost post = createImgS(s, "我记录网站综合系统1.9发布", desc, "http://img3.cache.netease.com/ent/2010/10/18/2010101809310948fd9.png"); post.PickStatus = PickStatus.Focus; post.Summary = summary; post.update(); designCss.AppendLine("#sectionContent" + s.Id + " { font-size:12px; }"); createPost(s, "张柏芝借博客与谢霆锋传情"); createPost(s, "张家辉:拍激情戏不用向太太报批"); createPost(s, "金鹰节孙红雷摘三奖成最大赢家"); createPost(s, "钟楚红台湾出席剪彩活动"); createPost(s, "陈冠希被曝在香港秘密录唱"); createPost(s, "浙版西游记白骨精成为爱自尽美女"); s = createSectionMashup("资讯头条", 38, 21, "12"); s.CssClass = "focusSection"; s.ServiceParams = "param0=" + this.app.Id + ";param1=8"; s.update(); designCss.AppendLine("#sectionContent" + s.Id + " { padding-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; }"); s = createSection("要闻列表", typeof(ListController), "12"); s.ListCount = 9; s.update("ListCount"); createPost(s, "西安市一在建民房倒塌造成8人死亡"); createPost(s, "国税总局反驳中国税负痛苦指数世界第二传闻"); createPost(s, "香港货轮与日本渔船昨日在日本海域发生碰撞"); createPost(s, "菅直人继续宣称钓鱼岛是日本领土 中方回应"); createPost(s, "温家宝离京访问欧亚四国 中国掀秋季外交高潮 "); createPost(s, "2010年诺贝尔奖公布日期全部确定"); createPost(s, "上海眼科假药事件部分涉案人员被刑拘"); createPost(s, "日本神户将就熊猫死亡赔偿中方50万美元"); createPost(s, "菲总统称下周在网上公开人质事件完整报告"); createPost(s, "美性病实验曾致700危地马拉人染病 奥巴马道歉"); // 创建自定义模板 ContentCustomTemplate cs = new ContentCustomTemplate(); cs.Content = @"<ul class=""dot2 ulLR unstyled""> <!-- BEGIN list --> <li style=""height:20px;""><div class=""left-title"" style=""width:310px;font-size:14px;""> <a href=""#{post.Url}"" style=""#{post.TitleCss}"" title=""#{post.TitleFull}"" style=""#{post.TitleCss}"">#{post.Title}</a></div> <div class=""right-info"">#{post.CreatedDay}</div> <div class=""clear""></div> </li> <!-- END list --> </ul>"; cs.OwnerId = this.app.OwnerId; cs.OwnerType = this.app.OwnerType; cs.OwnerUrl = this.app.OwnerUrl; cs.Name = "" + DateTime.Now.ToShortDateString(); cs.Creator = ctx.viewer.obj as User; tplService.Insert(cs); s.CustomTemplateId = cs.Id; s.update("CustomTemplateId"); s = createSection("信息发布", typeof(TextController), "13"); createText(s, "<div style=\"margin:10px 0px 10px 10px;\">" + "<div><a href=\"" + Link.To(Site.Instance, new wojilu.Web.Controller.Content.Submit.PostController().Index, base.app.Id) + "\" class=\"btn btn-danger right10\"><i class=\"icon-plus icon-white\"></i> 投递资讯</a>" + "<a href=\"" + Link.To(new LinkController().MyProfile) + "\" class=\"btn btn-primary\"><i class=\"icon-plus icon-white\"></i> 我的资料</a></div>" + "<div><a href=\"#\" class=\"btn btn-info top10 right10\"><i class=\"icon-plus icon-white\"></i> 线下活动</a>" + "<a href=\"#\" class=\"btn btn-success top10\"><i class=\"icon-plus icon-white\"></i> 谈天说地</a></div>" + "</div><div class=\"clear\"></div>"); designCss.AppendLine("#sectionContentText" + s.Id + " a{ color:#fff;}"); s = createSection("公告", typeof(TextController), "13"); createText(s, "<div style=\"font-size:12px;\"><div><a href=\"http://www.wojilu.com\">我记录网站综合系统1.9正式发布</a></div><div><a href=\"http://news.163.com/10/1018/15/6J9NSJI100014JB6.html\">时速1600公里超音速汽车英国问世</a></div><div><a href=\"http://news.sina.com.cn/c/2010-10-18/205321300806.shtml\">影著协回应网吧等放电影缴版权费质疑</a></div></div>"); s = createSection("财经专栏", typeof(NormalController), "13"); createImgS(s, "房产税成为开发商提价的借口", "浙江绍兴县家印染企业出资万余元,购买一条快艇送给镇政府监督辖区内企业的排污。这是为了动员", "http://img1.cache.netease.com/cnews/2010/10/1/20101001074938966c6.jpg"); createPost(s, "高明骏回应涉毒事件 向家人及公众致歉"); createPost(s, "商天娥办婚宴 刘嘉玲吴君如到贺(组图)"); createPost(s, "利智被曝曾遭周润发羞辱 悄悄躲后台哭泣"); createPost(s, "巴黎看秀丢行李 林志玲买内衣应急(图)"); createPost(s, "姜昆:“海派清口”是好表演 但不适合上春晚"); // 第二行 s = createSection("通栏广告", typeof(TextController), "21"); createText(s, @"<img src=""/static/img/big/ad1.gif""/>"); designCss.AppendLine("#portalContainer #section" + s.Id + " { border:0px; }"); designCss.AppendLine("#sectionTitle" + s.Id + " { display:none; }"); designCss.AppendLine("#sectionContent" + s.Id + " { padding-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; margin-right:10px;}"); // 第三行 s = createSection("综合图文", typeof(PostImgController), "31"); StringBuilder customCss = new StringBuilder(); customCss.AppendLine("#portalContainer #section" + s.Id + " {border:0px;}"); customCss.AppendLine("#sectionTitle" + s.Id + " {background:url(/static/img/big/rowBg1.jpg) no-repeat;height:31px; border-bottom:0px;}"); customCss.AppendLine("#sectionTitle" + s.Id + " .sectionTitleText a{color:#fff;}"); customCss.AppendLine("#sectionTitle" + s.Id + " .sectionMore {margin-right:15px;}"); createImgPost(s, "丛林里的特雷莎修女", "谢欣燕填写问卷时,发现不对,计算机屏幕居然出现她和男友庄胜杰出游以及“嫁给我吧”的画面,被蒙在鼓里的谢女,一脸狐疑,此时,庄胜杰和几名友人,拿着“宝贝嫁给我吧”的海报,突然出现在她的眼前,让她又惊又喜。庄胜杰以颤抖音调说,“我们南北奔波那么久,可以不要再那么累,欣燕你可以嫁给我吗?”,说完送上捧花及定情戒指,旁边的友人起哄“嫁给他!嫁给他!”,谢女事先完全不知道有此场面,内心好感动,终于说出“我愿意”,立即一阵欢呼。", "http://img1.cache.netease.com/cnews/2010/10/11/201010110432204a6d3.jpg"); createPostC(s, "印度首富入住27层新居 造价66.5亿创全球最贵", "环球资讯"); createPostC(s, "美国汇率报告或推迟到11月G20峰会后发布", "股市金融"); createPostC(s, "北京周边县市出台政策限制外地人购房", "法律政策"); createPostC(s, "中国新车年销量将达1700万 逼近美国最高水平", "汽车销售"); createPostC(s, "河南教育厅发文组织数万学生到富士康实习", "教育政策"); createPostC(s, "印度首富入住27层新居 造价66.5亿创全球最贵", "环球资讯"); createImgHome(s, "湖南女特级教师驾车撞六学生", "女特级教师", 110, 80, "http://img4.cache.netease.com/club/2010/10/11/20101011082942d4f3e.jpg"); createImgHome(s, "明星与新欢旧爱间的情事纠葛", "明星与新欢", 110, 80, "http://img3.cache.netease.com/club/2010/10/11/20101011083326c2df5.jpg"); createImgHome(s, "陶寺遗址证 尧舜非传说", "陶寺遗址", 110, 80, "http://img1.cache.netease.com/cnews/2010/10/8/2010100812172846800.jpg"); createImgHome(s, "恋人搭高铁约会3年花36万", "恋人搭高铁", 110, 80, "http://img1.cache.netease.com/cnews/2010/10/3/20101003101238aa436.jpg"); s = createSection("明星追踪", typeof(NormalController), "32"); createImgS(s, "高明骏吸毒被抓满文军告密", "该片讲述了三个女人之间的情感故事,叶璇片中饰演一位寂寞的妻子", "http://img4.cache.netease.com/ent/2010/9/30/20100930191809ff7c0.png"); //createPost( s, "美国实验室创造4万亿摄氏度纪录" ); createPost(s, "华航被曝无视油箱漏油冒险载客飞行"); createPost(s, "直击最疯狂的摩托车飙车秀无视"); createPost(s, "图说娱乐圈那些花瓶女星无视"); createPost(s, "大义灭亲可减刑是在亵渎法律无视"); createPost(s, "彭帅受困体能制约惨遭逆转无视"); // 第四行 s = createSection("通栏广告", typeof(TextController), "41"); createText(s, @"<img src=""/static/img/big/ad2.gif""/>"); designCss.AppendLine("#portalContainer #section" + s.Id + " { border:0px; }"); designCss.AppendLine("#sectionTitle" + s.Id + " { display:none; }"); designCss.AppendLine("#sectionContent" + s.Id + " { padding-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; margin-right:10px;}"); // 第五行 s = createSection("娱乐资讯", typeof(PostImgController), "51"); customCss.AppendLine("#portalContainer #section" + s.Id + " {border:0px;}"); customCss.AppendLine("#sectionTitle" + s.Id + " {background:url(/static/img/big/rowBg2.jpg) no-repeat;height:31px;border-bottom:0px;}"); customCss.AppendLine("#sectionTitle" + s.Id + " .sectionTitleText a{color:#fff;}"); customCss.AppendLine("#sectionTitle" + s.Id + " .sectionMore {margin-right:15px;}"); createImgPost(s, "林志颖生日曝儿子照片", "今天是林志颖36岁的生日,身在珠海赛车场拍戏的他发布微博曝光了小小志的照片,称儿子是今生最美好的事,还表示看著小小志用弯弯的眼睛对他笑感觉天使大概就是这样子,儿子是他的骄傲,儿子天使的笑容是最好的礼物", "http://img4.cache.netease.com/ent/2010/10/15/20101015132315ec733.png"); createPostC(s, "法国支持建立欧洲反导系统并称将保持核威慑", "环球军事"); createPostC(s, "深圳野生动物园承认失误 按工伤赔被虎咬死者", "社会新闻"); createPostC(s, "国家公务员考试昨日开始报名 网络一度堵塞", "天方夜谭"); createPostC(s, "住建部:违反限购房规定买卖住房有重大风险", "法律政策"); createPostC(s, "美国2010财年联邦财政赤字近1.3万亿美元", "财政要闻"); createPostC(s, "法国支持建立欧洲反导系统并称将保持核威慑", "环球军事"); createImgHome(s, "学历丢人成绩骄人的娱乐明星", "学历丢人明星", 110, 80, "http://img4.cache.netease.com/ent/2010/10/15/201010151038520fc9e.png?froment"); createImgHome(s, "摩登天空音乐节 世界城市音乐节", "摩登天空", 110, 80, "http://img3.cache.netease.com/ent/2010/9/13/201009131616576ab3c.jpg"); createImgHome(s, "第15届釜山电影节闭幕 中国两位新人导演获奖", "釜山电影节", 110, 80, "http://img4.cache.netease.com/ent/2010/10/11/201010111457590abb1.jpg"); createImgHome(s, "“东方风云榜”季选音乐营即将席卷热浪", "东方风云榜", 110, 80, "http://img4.cache.netease.com/ent/2010/10/11/201010111843492d214.jpg"); s = createSection("上市公司", typeof(NormalController), "52"); createImgS(s, "《时代》眼中的伊战", "该片讲述了三个女人之间的情感故事,叶璇片中饰演一位寂寞的妻子", "http://img2.cache.netease.com/cnews/2010/9/3/2010090308452932084.jpg"); createPost(s, "云南保山山体滑坡已致24人死亡24人失踪"); createPost(s, "广东政协委员调研称全省225万户仍住茅草房"); createPost(s, "徐州多家医院药品采购二次议价 不按中标价买"); createPost(s, "官员称供求关系变化系生姜价格上涨主因"); createPost(s, "舟曲上报重建规划 防洪标准升至50年一遇"); createPost(s, "发改委官员称国家将坚决抑制汽车产能过剩"); // 第六行 s = createSection("通栏广告", typeof(TextController), "61"); createText(s, @"<img src=""/static/img/big/ad3.gif""/>"); designCss.AppendLine("#portalContainer #section" + s.Id + " { border:0px; }"); designCss.AppendLine("#sectionTitle" + s.Id + " { display:none; }"); designCss.AppendLine("#sectionContent" + s.Id + " { padding-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; margin-right:10px;}"); s = createSection("综合图文", typeof(PostImgController), "71"); customCss.AppendLine("#portalContainer #section" + s.Id + "{border:0px;}"); customCss.AppendLine("#sectionTitle" + s.Id + " {background:url(/static/img/big/rowBg3.jpg) no-repeat;height:31px;border-bottom:0px;}"); customCss.AppendLine("#sectionTitle" + s.Id + " .sectionTitleText a{color:#fff;}"); customCss.AppendLine("#sectionTitle" + s.Id + " .sectionMore {margin-right:15px;}"); createImgPost(s, "丛林里的特雷莎修女", "谢欣燕填写问卷时,发现不对,计算机屏幕居然出现她和男友庄胜杰出游以及“嫁给我吧”的画面,被蒙在鼓里的谢女,一脸狐疑,此时,庄胜杰和几名友人,拿着“宝贝嫁给我吧”的海报,突然出现在她的眼前,让她又惊又喜。庄胜杰以颤抖音调说,“我们南北奔波那么久,可以不要再那么累,欣燕你可以嫁给我吗?”,说完送上捧花及定情戒指,旁边的友人起哄“嫁给他!嫁给他!”,谢女事先完全不知道有此场面,内心好感动,终于说出“我愿意”,立即一阵欢呼。", "http://img1.cache.netease.com/cnews/2010/10/11/201010110432204a6d3.jpg"); createPostC(s, "印度首富入住27层新居 造价66.5亿创全球最贵", "环球资讯"); createPostC(s, "美国汇率报告或推迟到11月G20峰会后发布", "股市金融"); createPostC(s, "北京周边县市出台政策限制外地人购房", "法律政策"); createPostC(s, "中国新车年销量将达1700万 逼近美国最高水平", "汽车销售"); createPostC(s, "河南教育厅发文组织数万学生到富士康实习", "教育政策"); createPostC(s, "印度首富入住27层新居 造价66.5亿创全球最贵", "环球资讯"); createImgHome(s, "湖南女特级教师驾车撞六学生", "女特级教师", 110, 80, "http://img4.cache.netease.com/club/2010/10/11/20101011082942d4f3e.jpg"); createImgHome(s, "明星与新欢旧爱间的情事纠葛", "明星与新欢", 110, 80, "http://img3.cache.netease.com/club/2010/10/11/20101011083326c2df5.jpg"); createImgHome(s, "陶寺遗址证 尧舜非传说国内互联网业限时特卖", "陶寺遗址", 110, 80, "http://img1.cache.netease.com/cnews/2010/10/8/2010100812172846800.jpg"); createImgHome(s, "超强视觉冲击力恋人搭高铁约会3年花36万", "恋人搭高铁", 110, 80, "http://img1.cache.netease.com/cnews/2010/10/3/20101003101238aa436.jpg"); s = createSection("明星追踪", typeof(NormalController), "72"); createImgS(s, "任正非退休前打破神秘:为华为站出来中移动", "该片讲述了三个女人之间的情感故事,叶璇片中饰演一位寂寞的妻子", "http://img4.cache.netease.com/ent/2010/9/30/20100930191809ff7c0.png"); createPost(s, "91家网站华航被曝无视油箱漏油冒险载客飞行"); createPost(s, "微软回应直击最疯狂的摩托车飙车秀无视"); createPost(s, "图说娱乐圈那些花瓶女星无视图说娱乐圈"); createPost(s, "周末要闻回顾:苹果售后政策今秋起调整"); createPost(s, "美国政府叫停3D打印枪设计图下载美国政府"); setCss(designCss, customCss); return(app); }
public virtual void Update(ContentCustomTemplate ct) { ct.update(); }
public virtual void Update( ContentCustomTemplate ct ) { ct.update(); }
private void createAndUpdateSection( ContentSection s ) { // 创建一个template ContentCustomTemplate ct = new ContentCustomTemplate(); ct.Creator = (User)ctx.viewer.obj; ct.OwnerId = ctx.owner.Id; ct.OwnerType = ctx.owner.obj.GetType().FullName; ct.OwnerUrl = ctx.owner.obj.Url; String name = ctx.Post( "Name" ); if (strUtil.IsNullOrEmpty( name )) { name = string.Format( "section{0}({1})", s.Id, s.Title ); } ct.Name = strUtil.SubString( name, 50 ); ct.Description = strUtil.SubString( ctx.Post( "Description" ), 250 ); ct.Content = ctx.PostHtml( "Content" ); ctService.Insert( ct ); // 更新section的模板 s.CustomTemplateId = ct.Id; sectionService.Update( s ); }