public override void Page_Load(ref NVelocity.VelocityContext context) { base.Page_Load(ref context); #region 加载头部及Title string title_val = ""; string keywords_val = title_val; #endregion #region 热点 //context.Put("hotarticle", ArticleHelper.Get_Hot_Articel()); #endregion try { season_require_id = DbHelperSQL.GetSingle("select top 1 season_id from HRENH_SET_ARTICLE_SHOW_SEASON order by id desc").ToString(); } catch (Exception ex) { } season_require_id_linshi = "," + season_require_id + ","; //当type_mark不为空时,用于作为当前子级的重写地址 string linshi_srname = ""; type = String_Manage.Return_Request_Int("type", 0); //父级 prname = String_Manage.Return_Request_Str("prname"); linshi_srname = prname; //子级 srname = String_Manage.Return_Request_Str("srname"); if (type == 370) { prname = "dapei"; } if (prname == "") { context.Put("redirecturl", "/404"); } else { if (type < 1) { type = ArticleHelper.Get_Dianpu_Type_Id(prname, 0); } //通过汉字获取该汉字的首字母 if (type < 370) { type_shouzimu = Get_Hanzi_Shouzimu.GetSpellCode(type_bll.GetModel(type).TypeName); } prname = ArticleHelper.Get_Type_Rname(type); if (type == 370) { linshi_srname = prname; } if (srname != "") { //typeurl = "/"+prname+"/"+srname+"/"; typeurl = "/" + prname + "/" + srname + ".html"; stype = ArticleHelper.Get_Dianpu_Type_Id(srname, 1); } else { if (linshi_srname != "") { if (prname != linshi_srname) { stype = ArticleHelper.Get_Dianpu_Type_Id(linshi_srname, 1); } } //typeurl = "/" + prname + type_shouzimu + "/"; typeurl = "/" + linshi_srname + type_shouzimu + "/"; } } context.Put("typepurl", typeurl); head.Init_Head(context, type); #region 加载二级和三级 if (stype > 0) { typename = ArticleHelper.Get_Type_Name(stype, type_parent); typename = typename.Replace(",", "_"); } else { typename = ArticleHelper.Get_Type_Name(type); } title_val = typename + ""; if (type == 370) { title_val = "服装搭配|穿衣搭配|女装|红人汇穿衣搭配网"; } context.Put("title", title_val); #region 获取keywords和description try { int type_linshi = type; if (stype > 0) { type_linshi = stype; } DataSet kdds = DbHelperSQL.Query("select keywords,description from hrenh_article_type where id=" + type_linshi + ""); if (kdds != null && kdds.Tables[0].Rows.Count > 0) { foreach (DataRow kddr in kdds.Tables[0].Rows) { keywords_val = kddr["keywords"].ToString(); string description_val = kddr["description"].ToString(); if (keywords_val != "") { title_val = keywords_val; } if (description_val != "") { description = description_val; } } } } catch (Exception ex) { } #endregion if (type == 370) { context.Put("keywords", "女装,穿衣搭配,服装搭配,搭配技巧,服饰搭配,韩国服饰,穿衣搭配网"); context.Put("keywords_cname", "搭配"); context.Put("description", "红人汇穿衣搭配网是最专业的服装搭配网站。除了展示各类女装及配饰还有最专业最潮流的穿衣搭配指南,让时尚变的触手可及!"); } else { context.Put("keywords", title_val.Replace("_", ",").Replace("|", ",")); context.Put("keywords_cname", keywords_val.Replace("红人", "")); context.Put("description", description); } if (type < 370) { Get_Second_Third(context); } #endregion // 加载文章列表 GetList(context); }
/// <summary> /// 获取更多穿搭推荐 /// </summary> /// <param name="context"></param> private void Get_Top20_Zixun(NVelocity.VelocityContext context) { sbr.Clear(); StringBuilder listsbr = new StringBuilder(); int pagesize = 20; string where = " isend=0 and pub_state=0 and ishot=1 "; if (season_require_id != "") { #region 根据季节显示文章列表 string season_where = ""; if (season_require_id != "" && season_require_id != ",,") { season_where = " and ("; string[] sarr = season_require_id.Split(','); for (int s = 0; s < sarr.Length; s++) { string nseasonid = sarr[s]; if (nseasonid != "") { season_where += "or charindex('," + nseasonid + ",',','+New_Zixun_Season+',')>0 "; } } season_where = season_where.Replace("(or", "("); season_where += ")"; } if (season_where.IndexOf("charindex") > 0) { where += season_where; } #endregion } string sql = "select top " + pagesize + " id,title,New_Zixun_intro_short,isimg,img_url,New_Zixun_Price,types,isnull((select product_name from HRENH_PRODUCT_PLATINFO where id=a.product_plat_id),'') as platname,isnull((select Produce_Img from HRENH_PRODUCT_PLATINFO where id=a.product_plat_id),'') as platimg,New_Zixun_Idlist from Hrenh_Article a where " + where + "order by istop desc,edittime desc"; ds = DbHelperSQL.Query(sql); if (ds != null && ds.Tables[0].Rows.Count > 0) { sbr.AppendFormat("<h4 class=\"lineread\">更多穿搭推荐</h4>"); sbr.AppendFormat("<div class=\"shop\" style=\"margin-left:-20px;\">"); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { DataRow dr = ds.Tables[0].Rows[i]; #region 文章列表的信息 int article_id = String_Manage.Return_Int(dr["id"].ToString(), 0); string article_title = String_Manage.Return_Str(dr["title"].ToString(), ""); string show_article_title = StringHelper.ReturnNumStr(article_title, 1, 29); int isimg = String_Manage.Return_Int(dr["isimg"].ToString(), 0); string article_img = "/template/img/nocontent.png"; if (isimg == 1) { article_img = ImgHelper.Get_UploadImgUrl(dr["img_url"].ToString(), 1); } int atype = Convert.ToInt32(dr["types"].ToString()); if (atype != 370) { article_title = String_Manage.Return_Str(dr["New_Zixun_intro_short"].ToString(), ""); } //string atypename = type_bll.GetModel(type).TypeName; string typeurl = ""; //if (type == 370) //{ // typeurl = "/" + ArticleHelper.Get_Type_Rname(type) + "/"; //} //else //{ // //通过汉字获取该汉字的首字母 // string type_shouzimu = Get_Hanzi_Shouzimu.GetSpellCode(typename); // typeurl = "/" + ArticleHelper.Get_Type_Rname(type) + type_shouzimu + "/"; //} if (atype == 370) { typeurl = "/" + ArticleHelper.Get_Type_Rname(type) + "/"; } else { typename = type_bll.GetModel(atype).TypeName; //通过汉字获取该汉字的首字母 string type_shouzimu = Get_Hanzi_Shouzimu.GetSpellCode(typename); typeurl = "/" + ArticleHelper.Get_Type_Rname(atype) + type_shouzimu + "/"; } string navurl = typeurl + "show_"; string article_url = "href=\"" + navurl + article_id + ".html\" target=\"_blank\" title=\"" + article_title + "\""; string New_Zixun_Price = dr["New_Zixun_Price"].ToString(); New_Zixun_Price = Recruit_Job.Return_Money(New_Zixun_Price, 1); string platname = String_Manage.Return_Str(dr["platname"].ToString(), ""); string platimg = String_Manage.Return_Str(dr["platimg"].ToString(), ""); if (platimg != "") { platimg = ImgHelper.Get_UploadImgUrl(platimg, 1); } #region 获取当前文章类型下的(特点人群下的第一类和气质风格下的第一类) string typeidlist = dr["New_Zixun_Idlist"].ToString(); typeidlist = Set_Season_Ypdp_Typename.Get_Typename_list(typeidlist); #endregion #endregion #region 加载文章列表 sbr.AppendFormat("<dl class=\"shopone\">"); //sbr.AppendFormat("<a {0}>", article_url); //sbr.AppendFormat("<dt><img src=\"{0}\" alt=\"{1}\"><p>{2}</p></dt>", article_img,article_title, typeidlist); ////sbr.AppendFormat("<dt><img src=\"{0}\" alt=\"{1}\"><img class=\"tb\" src=\"{2}\" alt=\"{3}\"></dt>", article_img, article_title, platimg, platname + "有售"); //sbr.AppendFormat("<dd>"); //sbr.AppendFormat("<h4>{0}</h4>", show_article_title); ////if (platname != "") ////{ //// sbr.AppendFormat("<b title=\"{1}购买直通车\"><i class=\"sppt\"><img src=\"{2}\" alt=\"{1}\"></i><i>¥</i>{0}</b>", prices, platname, platimg); ////} ////else ////{ //// sbr.AppendFormat("<b><i>¥</i>{0}</b>",prices); ////} //////sbr.AppendFormat("<div class=\"fav\"><em class=\"fav-i\"></em> <span class=\"fav-n\">1228</span> </div>"); //sbr.AppendFormat("</dd>"); //sbr.AppendFormat("</a>"); sbr.AppendFormat("<dt>"); sbr.AppendFormat("<a {0}>", article_url); sbr.AppendFormat("<img src=\"{0}\" alt=\"{1}\">", article_img, article_title); sbr.AppendFormat("</a>"); sbr.AppendFormat("<p><a {0}>{1}</a></p>", article_url, typeidlist); sbr.AppendFormat("</dt>"); sbr.AppendFormat("<dd>"); sbr.AppendFormat("<a {0}>", article_url); sbr.AppendFormat("<h4>{0}</h4>", show_article_title); sbr.AppendFormat("</a>"); sbr.AppendFormat("</dd>"); sbr.AppendFormat("</dl>"); #endregion } sbr.AppendFormat("</div>"); } context.Put("gdcdtj", sbr.ToString()); }
public override void Page_Load(ref NVelocity.VelocityContext context) { base.Page_Load(ref context); #region 加载头部及Title string title_val = ""; string keywords_val = title_val; context.Put("title", title_val); context.Put("keywords", keywords_val); context.Put("keywords_cname", keywords_val.Replace("红人", "")); head.Init_Head(context, 0); #endregion try { season_require_id = DbHelperSQL.GetSingle("select top 1 season_id from HRENH_SET_ARTICLE_SHOW_SEASON order by id desc").ToString(); } catch (Exception ex) { } articleid = String_Manage.Return_Request_Int("id", 0); Model.HRENH_ARTICLE article_model = new BLL.HRENH_ARTICLE().GetModel(articleid); if (article_model != null) { type = Convert.ToInt32(article_model.TYPES); typename = type_bll.GetModel(type).TypeName; context.Put("parent_nav", typename); //通过汉字获取该汉字的首字母 type_shouzimu = Get_Hanzi_Shouzimu.GetSpellCode(typename); string typeurl = "/" + ArticleHelper.Get_Type_Rname(type) + type_shouzimu + "/"; if (type == 370) { typeurl = "/" + ArticleHelper.Get_Type_Rname(type) + "/"; } context.Put("typepurl", typeurl); navurl = typeurl + "show_"; int pageid = 2100; #region 今日热点 context.Put("jrrd", Get_Jrrd(context)); #endregion #region 每日精选 context.Put("mrjx_ad", ArticleHelper.Get_Tj_Img(0, pageid, 1010)); #endregion #region 大家都在搜 context.Put("djdzs", ArticleHelper.Get_Tj_Img(0, pageid, 1004)); #endregion //获取文章详情 GetDetail(context); } else { context.Put("redirecturl", "/404"); } }
/// <summary> /// 获取更多穿搭推荐 /// </summary> /// <param name="context"></param> private void Get_Top20_Zixun(NVelocity.VelocityContext context) { sbr.Clear(); StringBuilder listsbr = new StringBuilder(); int pagesize = 20; string where = " isend=0 and pub_state=0 and ishot=1 "; string sql = "select top " + pagesize + " id,title,New_Zixun_intro_short,isimg,img_url,New_Zixun_Price,types,isnull((select product_name from HRENH_PRODUCT_PLATINFO where id=a.product_plat_id),'') as platname,isnull((select Produce_Img from HRENH_PRODUCT_PLATINFO where id=a.product_plat_id),'') as platimg from Hrenh_Article a where " + where + "order by istop desc,edittime desc"; ds = DbHelperSQL.Query(sql); if (ds != null && ds.Tables[0].Rows.Count > 0) { sbr.AppendFormat("<h4 class=\"lineread\">更多穿搭推荐</h4>"); sbr.AppendFormat("<div class=\"shop\" style=\"margin-left:-20px;\">"); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { DataRow dr = ds.Tables[0].Rows[i]; #region 文章列表的信息 int article_id = String_Manage.Return_Int(dr["id"].ToString(), 0); string article_title = String_Manage.Return_Str(dr["title"].ToString(), ""); string show_article_title = StringHelper.ReturnNumStr(article_title, 1, 29); int isimg = String_Manage.Return_Int(dr["isimg"].ToString(), 0); string article_img = "/template/img/nocontent.png"; if (isimg == 1) { article_img = ImgHelper.Get_UploadImgUrl(dr["img_url"].ToString(), 1); } int atype = Convert.ToInt32(dr["types"].ToString()); if (atype != 370) { article_title = String_Manage.Return_Str(dr["New_Zixun_intro_short"].ToString(), ""); } //string atypename = type_bll.GetModel(type).TypeName; string typeurl = ""; //if (type == 370) //{ // typeurl = "/" + ArticleHelper.Get_Type_Rname(type) + "/"; //} //else //{ // //通过汉字获取该汉字的首字母 // string type_shouzimu = Get_Hanzi_Shouzimu.GetSpellCode(typename); // typeurl = "/" + ArticleHelper.Get_Type_Rname(type) + type_shouzimu + "/"; //} if (atype == 370) { typeurl = "/" + ArticleHelper.Get_Type_Rname(type) + "/"; } else { typename = type_bll.GetModel(atype).TypeName; //通过汉字获取该汉字的首字母 string type_shouzimu = Get_Hanzi_Shouzimu.GetSpellCode(typename); typeurl = "/" + ArticleHelper.Get_Type_Rname(atype) + type_shouzimu + "/"; } string navurl = typeurl + "show_"; string article_url = "href=\"" + navurl + article_id + ".html\" target=\"_blank\" title=\"" + article_title + "\""; string New_Zixun_Price = dr["New_Zixun_Price"].ToString(); New_Zixun_Price = Recruit_Job.Return_Money(New_Zixun_Price, 1); string platname = String_Manage.Return_Str(dr["platname"].ToString(), ""); string platimg = String_Manage.Return_Str(dr["platimg"].ToString(), ""); if (platimg != "") { platimg = ImgHelper.Get_UploadImgUrl(platimg, 1); } #endregion #region 加载文章列表 sbr.AppendFormat("<dl class=\"shopone\">"); sbr.AppendFormat("<a {0}>", article_url); sbr.AppendFormat("<dt>"); sbr.AppendFormat("<img src=\"{0}\" alt=\"{1}\">", article_img, article_title); sbr.AppendFormat("</dt>"); sbr.AppendFormat("<dd>"); sbr.AppendFormat("<h4>{0}</h4>", show_article_title); //if (platname != "") //{ // sbr.AppendFormat("<b title=\"{1}购买直通车\"><i class=\"sppt\"><img src=\"{2}\" alt=\"{1}\"></i><i>¥</i>{0}</b>", New_Zixun_Price, platname, platimg); //} //else //{ // sbr.AppendFormat("<b><i>¥</i>{0}</b>", New_Zixun_Price); //} sbr.AppendFormat("</dd>"); sbr.AppendFormat("</a>"); sbr.AppendFormat("</dl>"); #endregion } sbr.AppendFormat("</div>"); } context.Put("gdcdtj", sbr.ToString()); }
/// <summary> /// 获取去这里选更多 /// </summary> /// <param name="context"></param> private void Get_Top5_Zixun(NVelocity.VelocityContext context) { sbr.Clear(); StringBuilder listsbr = new StringBuilder(); int pagesize = 5; string sql = "select b.*,(select TypeRename from HRENH_ARTICLE_TYPE where ID=b.parents_id) as prname,(select TypeName from HRENH_ARTICLE_TYPE where ID=b.parents_id) as ptypename,(select min(id) from HRENH_ARTICLE_TYPE where pid=b.parents_id) as first_type_id from "; sql += "("; sql += "select top " + pagesize + " id,TypeImg,TypeName,TypeRename,PID,TypeOrder,Addtime,(select PID from HRENH_ARTICLE_TYPE where ID=a.PID) as parents_id from HRENH_ARTICLE_TYPE a where ISTOP=1 and Type_parent=1"; sql += ") b order by TypeOrder asc,Addtime desc"; ds = DbHelperSQL.Query(sql); if (ds != null && ds.Tables[0].Rows.Count > 0) { sbr.AppendFormat("<h4 class=\"lineread\">去这里选更多</h4>"); sbr.AppendFormat("<div class=\"smore\">"); sbr.AppendFormat("<ul>"); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { DataRow dr = ds.Tables[0].Rows[i]; #region 文章列表的信息 string article_title = String_Manage.Return_Str(dr["TypeName"].ToString(), ""); string article_img = "/template/img/nocontent.png"; article_img = ImgHelper.Get_UploadImgUrl(dr["TypeImg"].ToString(), 1); string prname = dr["prname"].ToString(); string son_rname = dr["TypeRename"].ToString(); string navurl = ""; if (dr["pid"].ToString() == dr["first_type_id"].ToString()) { //通过汉字获取该汉字的首字母 string type_shouzimu = Get_Hanzi_Shouzimu.GetSpellCode(dr["ptypename"].ToString()); navurl = "/" + son_rname + type_shouzimu + "/"; } else { navurl = "/" + prname + "/" + son_rname + ".html"; } string article_url = "href=\"" + navurl + "\" target=\"_blank\" title=\"" + article_title + "\""; #endregion #region 加载文章列表 sbr.AppendFormat("<li>"); sbr.AppendFormat("<a {0}>", article_url); sbr.AppendFormat("<img src=\"{0}\" alt=\"{1}\">", article_img, article_title); sbr.AppendFormat("<i>{0}</i>", article_title); sbr.AppendFormat("</a>"); sbr.AppendFormat("</li>"); #endregion } sbr.AppendFormat("</ul>"); sbr.AppendFormat("</div>"); } context.Put("qzlxgd", sbr.ToString()); }
public override void Page_Load(ref NVelocity.VelocityContext context) { base.Page_Load(ref context); #region 加载头部及Title string title_val = ""; string keywords_val = title_val; context.Put("title", title_val); context.Put("keywords", keywords_val); context.Put("keywords_cname", keywords_val.Replace("红人", "")); head.Init_Head(context, 0); #endregion articleid = String_Manage.Return_Request_Int("id", 0); Model.HRENH_ARTICLE article_model = new BLL.HRENH_ARTICLE().GetModel(articleid); if (article_model != null) { type = Convert.ToInt32(article_model.TYPES); typename = type_bll.GetModel(type).TypeName; context.Put("parent_nav", typename); //通过汉字获取该汉字的首字母 type_shouzimu = Get_Hanzi_Shouzimu.GetSpellCode(typename); string typeurl = "/" + ArticleHelper.Get_Type_Rname(type) + type_shouzimu + "/"; if (type == 370) { typeurl = "/" + ArticleHelper.Get_Type_Rname(type) + "/"; } context.Put("typepurl", typeurl); navurl = typeurl + "show_"; int pageid = 2100; #region 详情页相关阅读上方广告图 //context.Put("topad", ArticleHelper.Get_Tj_Img(1, pageid, 1008)); #endregion #region 详情页相关阅读轮播图 //context.Put("topadlb", ArticleHelper.Get_Tj_Img(0, pageid, 1009)); #endregion #region 获取最新排行的列表 //context.Put("zxph", ArticleHelper.Get_Zxph(10)); #endregion #region 今日热点 context.Put("jrrd", Get_Jrrd(context)); #endregion #region 每日精选 context.Put("mrjx_ad", ArticleHelper.Get_Tj_Img(0, pageid, 1010)); #endregion #region 大家都在搜 context.Put("djdzs", ArticleHelper.Get_Tj_Img(0, pageid, 1004)); #endregion //获取文章详情 GetDetail(context); } else { context.Put("redirecturl", "/404"); } }