public override void Page_Load(ref NVelocity.VelocityContext context) { base.Page_Load(ref context); #region 加载头部及Title //NewXzc.Web.templatecs.Head head = new Head(); //head.Init_Head(context, 0); type = String_Manage.Return_Request_Int("type", -1); curnavnames = ArticleHelper.Get_Type_Name(type); int curtype = 0; description = "红人资讯主要介绍红人参与的活动、演出跟踪报道、娱乐八卦消息."; switch (type) { case 1: title_val = "网红资讯-网红信息"; keywords_val = "网红资讯-网红资料"; description = "衣品搭配,专门分享报道网红最新资讯,有你想了解的一切网络红人相关资料"; curtype = 2; break; case 2: title_val = "红人写真"; keywords_val = "红人写真-红人图片_女装搭配|衣品搭配"; description = "红人写真主要是红人参与的一些影视照片、写真的综合集"; curtype = 3; break; case 3: title_val = "红人作品-演出作品"; keywords_val = "红人作品_女装搭配|衣品搭配"; description = "衣品搭配专注报道红人、红人作品、拍摄、演出作品汇集"; curtype = 4; break; case 4: title_val = "红人专访-网红专访"; keywords_val = "红人专访-网红专访"; description = "专访一些网络红人成长、求学、工作、成名经历,让粉丝进一步了解红人,更好亲近红人"; curtype = 5; break; case 5: description = "红人针对最新事件观点阐述,通过自己观点让粉丝进一步了解红人."; curtype = 6; break; case 35: description = "红人针对最新事件观点阐述,通过自己观点让粉丝进一步了解红人."; curtype = 8; break; case 40: title_val = "星网咖-网红-网络红人"; keywords_val = "星网咖-网红"; description = "衣品搭配针对红人最新事件观点阐述,通过红人的观点让粉丝进一步了解红人,帮红人拍摄红人自己的视频作品。"; curtype = 40; break; case 41: title_val = "衣品搭配网红营销的领导者_网红营销"; keywords_val = "网红营销,网红营销平台"; description = "衣品搭配这里是全套一站式的网红营销平台,轻松帮您达到意想不到的营销效果"; curtype = 0; break; case 42: title_val = "热点-热点话题-实时热点"; keywords_val = "热点-热点话题-实时热点"; description = "衣品搭配,热点栏目专门为您提供实时热点、红人经济热点和热点话题的深入报道和评论等内容。"; curtype = 42; break; case 44: title_val = "怎么成长为一名网红以及网红成长经历"; keywords_val = "网红成长,网红资料"; description = "介绍各个网红的成长经历以及他们的是怎么成为网红的的资讯。"; curtype = 44; break; case 45: title_val = "网红美女主播教你如何快速吸粉"; keywords_val = "网红主播,美女主播"; description = "衣品搭配汇聚各个网红主播大咖,教你如何成为网红如何快速吸粉。"; curtype = 45; break; case 46: title_val = "微博红人-微博营销-微博推广"; keywords_val = "微博营销,微博红人,微博达人,微博推广,自媒体营销"; description = "衣品搭配最大的网络红人服务平台!提供微博红人和各个大v资料、微博营销、自媒体营销。"; curtype = 46; break; case 47: title_val = "微信营销-微信推广"; keywords_val = "微信营销,微信推广,自媒体营销"; description = "衣品搭配最大的网络红人服务平台!提供微信营销、微信推广。"; curtype = 47; break; case 354: title_val = "穿衣搭配指南|女装搭配指南|服装搭配指南-衣品搭配网|衣服搭配指南"; keywords_val = "搭配,服装搭配,搭配指南,搭配技巧,女装搭配,风格搭配"; description = "服装搭配是每个女孩子的终身课题,搭配出适合自己的服饰无疑将展现自己各方面搭配技巧。衣品搭配网会为您展现最全面最专业的搭配指南,让每个爱美的女孩都能搭配出属于自己的风格。"; curtype = 354; break; } head.Init_Head(context, curtype); //title_val = title_val + title_val_common; context.Put("title", title_val); context.Put("keywords_cname", curnavnames.Replace("红人", "")); #region 获取keywords和description try { DataSet kdds = DbHelperSQL.Query("select keywords,description from hrenh_article_type where id=" + type + ""); 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 context.Put("keywords", title_val.Replace("_", ",").Replace("|", ",")); context.Put("description", description); context.Put("type", type); if (type < 1) { context.Put("redirecturl", "/404"); } #endregion ////获取顶部轮播图 //context.Put("lunbo",GetLB()); #region 右侧推荐位 ////获取最新资讯,右侧 //context.Put("newzx", ArticleHelper.Get_New_ZX(9,"",18)); ////广告图 //context.Put("ad",ArticleHelper.Get_Article_List_Ad()); ////热门图片 //context.Put("hot_img", ArticleHelper.Get_New_Img()); ////热门文章 //context.Put("hot_article", ArticleHelper.Get_New_Article(0)); #endregion #region 加载子级栏目 Get_Son_Type(context); #endregion #region 推荐位 #region 推荐公共项 //NewXzc.Web.templatecs.Article.Article_Search_Common article_common = new Article_Search_Common(); ////头部广告 //article_common.Init_Common_Ad(context); #endregion #endregion #region 热点 //context.Put("hotarticle",ArticleHelper.Get_Hot_Articel()); #endregion #region 今日热点 context.Put("jrrd", Get_Jrrd(context)); #endregion #region 每日精选 context.Put("mrjx_ad", ArticleHelper.Get_Tj_Img(0, 2100, 1010)); #endregion #region 获取面包屑导航 string mbxnav = ArticleHelper.Get_Article_Nav(type, stype); string[] mbx = mbxnav.Split('|'); context.Put("mbxnav", mbx[0]); context.Put("mbxnav_name", mbx[1]); #endregion int pageid = 2100; #region 列表页最新排行上方轮播图 //context.Put("lunbo1", ArticleHelper.Get_Tj_Img(0, pageid, 1002)); #endregion #region 获取最新排行的列表 //context.Put("zxph", ArticleHelper.Get_Zxph(10)); #endregion #region 列表页最新排行下方轮播图 //context.Put("lunbo2", ArticleHelper.Get_Tj_Img(0, pageid, 1003)); #endregion #region 大家都在搜 context.Put("djdzs", ArticleHelper.Get_Tj_Img(0, pageid, 1004)); #endregion //获取议会活动列表 GetList(context); ////加载资讯列表友情链接 //Get_FriendLink(context); }
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> /// 让头部导航当前栏目高亮显示,要高亮显示的栏目下标,1:首页,2:红人新闻,3:图片写真,4:影视作品,5:红人背后,6:红人观,7:红人爱品,8:红人求报道,10:网络红人 /// </summary> /// <param name="context"></param> /// <param name="cur">要高亮显示的栏目下标,1:首页,2:红人新闻,3:图片写真,4:影视作品,5:红人背后,6:红人观,7:红人爱品,8:红人求报道,10:网络红人</param> public void Init_Head(NVelocity.VelocityContext context, int cur) { context.Put("item", cur); #region 加载导航名称 DataSet type_ds = DbHelperSQL.Query("select top 5 id,typename from hrenh_article_type where state=1 order by id asc"); StringBuilder type_sbr = new StringBuilder(); if (type_ds != null && type_ds.Tables[0].Rows.Count > 0) { for (int i = 0; i < type_ds.Tables[0].Rows.Count; i++) { DataRow dr = type_ds.Tables[0].Rows[i]; int typeids = String_Manage.Return_Int(dr["id"].ToString(), 0); string nav_http_url = "/article_" + typeids; string nav_http_name = dr["typename"].ToString(); nav_http_url = "/" + ArticleHelper.Get_Nav_Type_Name(typeids); //if (String_Manage.Return_Request_Int("type",0) == Convert.ToInt32(dr["id"].ToString())) //{ // type_sbr.AppendFormat("<li>"); // type_sbr.AppendFormat("<span>"); // type_sbr.AppendFormat("<a href=\"{0}\" class=\"active\" title=\"{1}\">{1}</a>", nav_http_url, nav_http_name); // type_sbr.AppendFormat("</span>"); // type_sbr.AppendFormat("</li>"); //} //else //{ // type_sbr.AppendFormat("<li>"); // type_sbr.AppendFormat("<span>"); // type_sbr.AppendFormat("<a href=\"{0}\" title=\"{1}\">{1}</a>", nav_http_url, nav_http_name); // type_sbr.AppendFormat("</span>"); // type_sbr.AppendFormat("</li>"); //} if (String_Manage.Return_Request_Int("type", 0) == Convert.ToInt32(dr["id"].ToString())) { type_sbr.AppendFormat("<li>"); type_sbr.AppendFormat("<a href=\"{0}\" class=\"active\" title=\"{1}\">{1}</a>", nav_http_url, nav_http_name); type_sbr.AppendFormat("</li>"); } else { type_sbr.AppendFormat("<li>"); type_sbr.AppendFormat("<a href=\"{0}\" title=\"{1}\">{1}</a>", nav_http_url, nav_http_name); type_sbr.AppendFormat("</li>"); } } } context.Put("nav_list", type_sbr.ToString()); #endregion #region 记录用户的登录和时间 if (UserID_HongRenHui > 0) { NewXzc.Model.RED_USER_LOGIN_RECORD model_logintime = new Model.RED_USER_LOGIN_RECORD(); NewXzc.BLL.RED_USER_LOGIN_RECORD login_bll = new NewXzc.BLL.RED_USER_LOGIN_RECORD(); int logintype = 1; string ipAddress = RequestHelper.GetIP(); int isLogin = login_bll.GetRecordCount(" userid=" + UserID_HongRenHui + " and datediff(day,Login_Time,getdate())=0 and Login_Type=" + logintype + " "); string sessoinid = "0"; try { sessoinid = HttpContext.Current.Session.SessionID; } catch (Exception ex) { } try { if (isLogin <= 0) { model_logintime.USERID = UserID_HongRenHui; model_logintime.Login_IP = ipAddress; model_logintime.SessionID = sessoinid; model_logintime.Login_Time = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")); model_logintime.Remark = ""; model_logintime.Login_Type = logintype; login_bll.Add(model_logintime); } else { model_logintime = login_bll.GetModel(UserID_HongRenHui, logintype); if (model_logintime != null) { model_logintime.Login_IP = ipAddress; model_logintime.Login_Time = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")); model_logintime.Remark = ""; model_logintime.Login_Type = logintype; login_bll.Update(model_logintime); } } } catch (Exception ex) { } } #endregion }
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 GetList(NVelocity.VelocityContext context) { sbr.Clear(); try { PageClass pc = new PageClass(); int record_cnt = 0; int page_cnt = 0; int curpage = 1; int pagesize = 49; curpage = String_Manage.Return_Request_Int("page", 1); int page = 0; if (curpage > 0) { page = curpage - 1; } string where = " and types=" + type + " and isend=0 and a.pub_state=0 and type_parent=" + type_parent + " and New_Zixun_Is_Tbk=0 "; if (season_require_id != "") { //不是包包、美妆下的数据 if (type != baobao_id && type != meizhuang_id) { ////当前显示类型是配饰 //if (type == peishi_id) //{ // //当前被设置显示的季节是四季 // if (season_require_id_linshi.IndexOf(season_siji_id_linshi) >= 0) // { // where += " and New_Zixun_Season in(" + season_require_id + ") "; // } // else//当前被设置显示的季节不是四季 // { // where += " and New_Zixun_Season in("+season_require_id+","+season_siji_id+")"; // } //} //else //{ where += " and New_Zixun_Season in(" + season_require_id + ") "; //} } } if (stype > 0) { where = " and charindex('," + stype + ",',','+New_Zixun_Idlist+',')>0 "; } //context.Put("redirecturl_error",page+"@@@@@@"+ where); ds = pc.TagList_New("*", " edittime desc ", " hrenh_article a ", where, page, pagesize, " id,title,isimg,img_url,edittime,New_Zixun_Price,New_Zixun_intro_short,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 "); if (ds != null && ds.Tables[2].Rows.Count > 0) { record_cnt = Convert.ToInt32(ds.Tables[0].Rows[0][0].ToString()); page_cnt = Convert.ToInt32(ds.Tables[1].Rows[0][0].ToString()); for (int i = 0; i < ds.Tables[2].Rows.Count; i++) { DataRow dr = ds.Tables[2].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 short_intro = String_Manage.Return_Str(dr["New_Zixun_intro_short"].ToString(), ""); if (type != 370) { if (short_intro != "") { article_title = short_intro; } } string show_article_title = StringHelper.ReturnNumStr(article_title, 0, 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); } string article_addtime = TimeParser.ReturnCurTime(dr["edittime"].ToString(), 1); string prices = String_Manage.Return_Str(dr["New_Zixun_Price"].ToString(), "0"); prices = Recruit_Job.Return_Money(prices, 1); //搭配栏目 if (type == 370) { type_shouzimu = ""; } string article_url = " href='/" + prname + type_shouzimu + "/show_" + article_id + ".html' target='_blank' title='" + article_title + "' "; 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><img src=\"{0}\" alt=\"{1}\"></dt>", article_img, article_title); 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("</dl>"); #endregion } } else { sbr.Append("<div class=\"nodata\"></div>"); } if (curpage > page_cnt) { curpage = page_cnt; } if (curpage < page_cnt) { sbr.AppendFormat("<dl class=\"shopone\">"); sbr.AppendFormat("<a href=\"javascript:;\" title=\"下一页\" class=\"cat-page-next trans200\" onclick='GoPage(" + (curpage + 1) + ")'></a>"); sbr.AppendFormat("</dl>"); } context.Put("list", sbr.ToString()); context.Put("listPage", NewXzc.Common.GenerPage.pageHtml(record_cnt, pagesize, curpage, "GoPage")); } catch (Exception ex) { context.Put("redirecturl", "/404"); } }
/// <summary> /// 加载头部导航 /// </summary> /// <param name="context"></param> private string Get_Top_Nav(NVelocity.VelocityContext context, int cur) { StringBuilder weiba_sbr = new StringBuilder(); int topnum = 3;//5 #region 加载导航名称 string sql = "select top " + topnum + " id,pid,typename from hrenh_article_type where state=1 order by id asc";//旧版本 sql = "select * from ("; sql += "select top " + topnum + " id,pid,typename from hrenh_article_type where state=1 "; sql += "union "; //sql += "select id,pid,typename from hrenh_article_type where (id=35 or pid=35) and state=1"; sql += "select id,pid,typename from hrenh_article_type where (id=44 or pid=44) and state=1"; sql += ") a "; DataSet type_ds = DbHelperSQL.Query(sql); StringBuilder type_sbr = new StringBuilder(); //type_sbr.AppendFormat("<a href=\"{0}\" title=\"{1}\" class=\"f20\">{1}</a>", "http://www.ypindapei.com", "首页"); //type_sbr.AppendFormat("<span></span>"); int stype = String_Manage.Return_Request_Int("stype", 0); if (type_ds != null && type_ds.Tables[0].Rows.Count > 0) { for (int i = 0; i < type_ds.Tables[0].Rows.Count; i++) { DataRow dr = type_ds.Tables[0].Rows[i]; int typeids = String_Manage.Return_Int(dr["id"].ToString(), 0); int pid = String_Manage.Return_Int(dr["pid"].ToString(), 0); string nav_http_url = "/article_" + typeids; string nav_http_name = dr["typename"].ToString(); nav_http_url = "/" + ArticleHelper.Get_Nav_Type_Name(typeids); int curtid = Convert.ToInt32(dr["id"].ToString()); if (i > topnum) { nav_http_url += "_1_" + curtid; } if (i < topnum) { nav_http_name = nav_http_name.Replace("红人", ""); } if (i != topnum) { if (cur == typeids && pid == 0) { type_sbr.AppendFormat("<a href=\"{0}\" title=\"{1}\" class=\"f18 active\">{1}</a>", nav_http_url, nav_http_name); } else { if (pid == 35) { switch (typeids) { case 36: nav_http_url = "http://weiba.ypindapei.com/found_148"; break; case 37: nav_http_url = "http://weiba.ypindapei.com/found_143"; break; case 38: nav_http_url = "http://weiba.ypindapei.com/found_142"; break; case 39: nav_http_url = "http://weiba.ypindapei.com/found_129"; break; } if (stype == typeids) { weiba_sbr.AppendFormat("<a href=\"{0}\" title=\"{1}\" class=\"f18 active\" target=\"_blank\">{1}</a>", nav_http_url, nav_http_name); } else { weiba_sbr.AppendFormat("<a href=\"{0}\" title=\"{1}\" class=\"f18\" target=\"_blank\">{1}</a>", nav_http_url, nav_http_name); } } else { type_sbr.AppendFormat("<a href=\"{0}\" title=\"{1}\" class=\"f18\">{1}</a>", nav_http_url, nav_http_name); } } } //if (i == topnum) //{ // weiba_sbr.AppendFormat("<span></span>"); // nav_http_url = "http://weiba.ypindapei.com"; // if (cur==7) // { // weiba_sbr.AppendFormat("<a href=\"{0}\" title=\"{1}\" class=\"f22 active\" target=\"_blank\">{1}</a>", nav_http_url, nav_http_name); // } // else // { // weiba_sbr.AppendFormat("<a href=\"{0}\" title=\"{1}\" class=\"f22\" target=\"_blank\">{1}</a>", nav_http_url, nav_http_name); // } //} } } //type_sbr.AppendFormat("<a href=\"{0}\" title=\"{1}\" class=\"f20\" target=\"_blank\">{1}</a>", "http://weiba.ypindapei.com", "红人微吧"); //type_sbr.AppendFormat("<span></span>"); //type_sbr.AppendFormat("<a href=\"{0}\" title=\"{1}\" class=\"f20\">{1}</a>", "/hongren", "网络红人"); #endregion context.Put("weiba", weiba_sbr.ToString()); return(type_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"); } }
public override void Page_Load(ref NVelocity.VelocityContext context) { base.Page_Load(ref context); #region 加载头部及Title NewXzc.Web.templatecs.Head_Article head = new Head_Article(); head.Init_Head(context, 0); context.Put("title", "文章详情_衣品搭配"); #endregion articleid = String_Manage.Return_Request_Int("id", 0); Model.HRENH_ARTICLE article_model = new BLL.HRENH_ARTICLE().GetModel(articleid); if (article_model != null) { stype = Convert.ToInt32(article_model.TYPES); types_pid = article_model.TYPES_PID; #region 加载子级栏目 //Get_Son_Type(context); #endregion #region 获取面包屑导航 int ctypes = type; if (types_pid > 0) { ctypes = types_pid; } else { ctypes = stype; stype = -1; } string mbxnav = ArticleHelper.Get_Article_Nav(ctypes, stype, 1); context.Put("mbxnav", mbxnav); #endregion 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("lunbo1", ArticleHelper.Get_Tj_Img(0, pageid, 1005)); #endregion #region 获取最新排行的列表 //context.Put("zxph", ArticleHelper.Get_Zxph(10)); #endregion #region 详情页论坛精华 //context.Put("ltjh_ad", ArticleHelper.Get_Tj_Img(3, pageid, 1006)); #endregion #region 今日热点 context.Put("jrrd", Get_Jrrd(context)); #endregion #region 每日精选 //context.Put("mrjx_ad", ArticleHelper.Get_Tj_Img(0, pageid, 1007)); context.Put("mrjx_ad", ArticleHelper.Get_Tj_Img(0, pageid, 1010)); #endregion #region 大家都在搜 context.Put("djdzs", ArticleHelper.Get_Tj_Img(0, pageid, 1004)); #endregion #region 推荐位 ////最新娱乐热点 //context.Put("newzx", ArticleHelper.Get_New_ZX(8, "", 10)); #region 推荐公共项 //NewXzc.Web.templatecs.Article.Article_Search_Common article_common = new Article_Search_Common(); ////头部广告 //article_common.Init_Common_Ad(context); ////最火娱乐资讯 //article_common.Init_Zhylzx(context); ////相关搜索上方广告 //Init_Search_Ad(context); ////相关搜索 //Init_Xgss(context); ////为您推荐 //article_common.Init_Wntj(context); ////右侧推荐 //article_common.Init_Rgiht_Common_Ad(context); ////相关阅读 //Init_Xgyd(context); #endregion #endregion //获取文章详情 GetDetail(context); } else { context.Put("redirecturl", "/404"); } }
private void Is_Login(HttpContext context) { string result = "ok"; string tel = String_Manage.Return_Request_Str("tel"); string pwd = String_Manage.Return_Request_Str("upwd"); pwd = NewXzc.Common.DEncrypt.DESEncrypt.Encrypt(pwd);//给密码加密 int remmber = String_Manage.Return_Request_Int("remmber", 0); var istel = ValidatePhone_Function(context, tel); if (istel != "ok") { result = istel; } else { //前台生成的验证码,用于点击发送验证码前验证用 string send_code_yzm = String_Manage.Return_Request_Str("send_code_yzm"); if (send_code_yzm != "") { try { if (HttpContext.Current.Session["code"] != null) { if (!string.IsNullOrEmpty(HttpContext.Current.Session["code"].ToString())) { string str_yzm = HttpContext.Current.Session["code"].ToString(); if (send_code_yzm != str_yzm) { result = "error_yzm"; } } } } catch (Exception ex) { } } if (result == "ok") { string sql = "select top 1 userid from THINK_SNS_DB.dbo.HRENH_THINK_USER where tel=@tel and pwd=@pwd order by userid asc"; SqlParameter[] para = { new SqlParameter("@tel", SqlDbType.NVarChar, 50), new SqlParameter("@pwd", SqlDbType.NVarChar, 50) }; para[0].Value = tel; para[1].Value = pwd; int t = 0; try { t = Convert.ToInt32(DbHelperSQL.GetSingle(sql, para).ToString()); } catch (Exception ex) { } if (t <= 0) { result = "no"; } else { result = CheckIsLogin_HongRenHui.Get_User_CenterUrl_HongRenHui(); if (remmber == 0) { CookieManage_HongRenHui.AddCookie("RED_HREN_USERID", t.ToString(), 1, false); } else { CookieManage_HongRenHui.AddCookie("RED_HREN_USERID", t.ToString(), 7, false); } } } } context.Response.Write(result); }
private void Is_Register(HttpContext context) { string result = "ok"; string tel = "123456"; string pwd = "123456"; string uname = String_Manage.Return_Request_Str("uname"); string sex_val = String_Manage.Return_Request_Str("sex_val"); int sex = 1; string user_head = String_Manage.Return_Request_Str("uhead"); //登录途径,0:红人汇PC端,1:红人汇wap端,2:微吧PC端,3:微吧wap端 int login_type = Convert.ToInt32(CookieManage_HongRenHui.GetCookieValue("RED_HREN_Login_Type")); //第三方登录类型,0:默认,1:QQ,2:Sina,3:微信 int third_logintype = String_Manage.Return_Request_Int("third_logintype", 0); //第三方登录账号的唯一标识ID string third_uopenid = String_Manage.Return_Request_Str("third_uopenid"); pwd = NewXzc.Common.DEncrypt.DESEncrypt.Encrypt(pwd);//给密码加密 if (sex_val == "1" || sex_val == "man" || sex_val == "男") { sex = 1; } else { sex = 2; } //int third_old_logintype = Convert.ToInt32(CookieManage_HongRenHui.GetCookieValue("RED_HREN_Third_Login")); if (user_bll.GetRecordCount(" third_openid='" + third_uopenid + "' ") <= 0) { if (third_uopenid != "")// && uname != "qzuser" 未授权(uname == "qzuser") { //string[] uhead = user_head.Split(';'); //if (third_logintype == 1) //{ // //大头像 // user_head = Save_Img_Http.Save_Img_WebRequest(uhead[0].ToString(), "jpg", 1); // ////小头像 // //Save_Img_Http.Save_Img_WebRequest(uhead[1].ToString(), "jpg", 3); //} //else //{ // //大头像 // user_head = Save_Img_Http.Save_Img_WebRequest(user_head, "jpg", 1); //} //大头像 user_head = Save_Img_Http.Save_Img_WebRequest(user_head, "jpg", 1); user_head = user_head.Replace("large_", "").Replace(ImgHelper.GetCofigShowUrl(), ""); int userguid = user_bll.GetMaxId(); string empty = ""; int cnt_0 = 0; int utype = login_type + 1;//用户注册途径,0:红人议会,1:红人汇,2:红人汇手机端,3:微吧,4:微吧手机端,5:红人爱品 user_model.USERID = userguid; user_model.USERNAME = uname; user_model.PWD = pwd; user_model.TEL = tel; user_model.TEL_STATE = cnt_0; user_model.USER_HEAD = user_head; user_model.SEX = sex; user_model.EMAIL = empty; user_model.USER_TYPE = utype; user_model.ISCOMPLETE = cnt_0; user_model.PROVINCE = empty; user_model.CITY = empty; user_model.AREA = empty; user_model.PEOPLE_IDENTITY = empty; user_model.OCCUPATION = empty; user_model.PERSONALITY = empty; user_model.INTRODUCE = empty; user_model.IDENTIFICATION_STATE = cnt_0; user_model.SAME_HOBBY_PEOPLE = empty; user_model.EXP = cnt_0; user_model.SCORE = cnt_0; user_model.REALM_NAME = empty; user_model.ADDTIME = DateTime.Now; user_model.IS_RED = cnt_0; user_model.STATE = cnt_0; user_model.REMARK = empty; user_model.Person_Desc = empty; user_model.Person_NickName = empty; user_model.Porder = cnt_0; user_model.UpdateTime = DateTime.Now; user_model.PLAT_VAL = empty; user_model.SPECIALTY_VAL = empty; user_model.IPURL = empty; if (!user_bll.Add(user_model)) { result = "no"; } else { try { DbHelperSQL.ExecuteSql("update THINK_SNS_DB.dbo.hrenh_think_user set third_utype=" + third_logintype + ",third_openid='" + third_uopenid + "' where userid=" + userguid + " "); } catch (Exception ex) { } CookieManage_HongRenHui.AddCookie("RED_HREN_USERID", userguid.ToString(), 7, false); CookieManage_HongRenHui.AddCookie("RED_HREN_Third_Login", third_logintype.ToString(), 7, false); } } else { result = "noautho"; } } else { CookieManage_HongRenHui.AddCookie("RED_HREN_USERID", DbHelperSQL.GetSingle("select top 1 userid from THINK_SNS_DB.dbo.hrenh_think_user where third_openid='" + third_uopenid + "' ").ToString(), 7, false); CookieManage_HongRenHui.AddCookie("RED_HREN_Third_Login", third_logintype.ToString(), 7, false); } if (result == "ok") { ////登录途径,0:红人汇PC端,1:红人汇wap端,2:微吧PC端,3:微吧wap端 //switch (login_type) //{ // case 0: // result = "http://www.ypindapei.com"; // break; // case 1: // result = "http://m.ypindapei.com"; // break; // case 2: // result = "http://weiba.ypindapei.com"; // break; // case 3: // result = "http://w.ypindapei.com"; // break; // default: // result = "http://www.ypindapei.com"; // break; //} //result = "/UserLogin/Login_Third.aspx"; string urls = CookieManage_HongRenHui.GetCookieValue("RED_HREN_Login_Urls"); if (urls != "" && urls != "0") { result = urls; } else { result = CheckIsLogin_HongRenHui.Get_User_CenterUrl_HongRenHui(); } //登录微吧 //Get_Http_Url_Content.GetPostContent("http://weiba.ypindapei.com/login?uid=" + NewXzc.Common.DEncrypt.DESEncrypt.Encrypt(CookieManage_HongRenHui.GetCookieValue("RED_HREN_USERID"))); } context.Response.Write(result); }
/// <summary> /// 加载文章列表 /// </summary> /// <param name="context"></param> private void GetList(NVelocity.VelocityContext context) { sbr.Clear(); try { PageClass pc = new PageClass(); int record_cnt = 0; int page_cnt = 0; int curpage = 1; int pagesize = 49; curpage = String_Manage.Return_Request_Int("page", 1); int page = 0; if (curpage > 0) { page = curpage - 1; } string where = " and types=370 and isend=0 and a.pub_state=0 and type_parent=" + type_parent + " and New_Zixun_Is_Tbk=0 "; if (stype > 0) { where = " and charindex('," + stype + ",',','+New_Zixun_Idlist+',')>0 "; } #region 根据季节显示文章列表 string season_where = ""; if (season_require_id_linshi != "" && season_require_id_linshi != ",,") { season_where = " and ("; string[] sarr = season_require_id_linshi.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 //context.Put("redirecturl_error",page+"@@@@@@"+ where); ds = pc.TagList_New("*", " edittime desc ", " hrenh_article a ", where, page, pagesize, " id,title,isimg,img_url,edittime,New_Zixun_Price,New_Zixun_intro_short,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 "); if (ds != null && ds.Tables[2].Rows.Count > 0) { record_cnt = Convert.ToInt32(ds.Tables[0].Rows[0][0].ToString()); page_cnt = Convert.ToInt32(ds.Tables[1].Rows[0][0].ToString()); for (int i = 0; i < ds.Tables[2].Rows.Count; i++) { DataRow dr = ds.Tables[2].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 short_intro = String_Manage.Return_Str(dr["New_Zixun_intro_short"].ToString(), ""); //if (type != 406 && type != 407 && type != 431) //{ // if (short_intro != "") // { // article_title = short_intro; // } //} string show_article_title = StringHelper.ReturnNumStr(article_title, 0, 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); } string article_addtime = TimeParser.ReturnCurTime(dr["edittime"].ToString(), 1); string prices = String_Manage.Return_Str(dr["New_Zixun_Price"].ToString(), "0"); prices = Recruit_Job.Return_Money(prices, 1); //韩系、日系、欧美三个栏目下被推荐的文章 prname = "dapei"; type_shouzimu = ""; string article_url = " href='/" + prname + type_shouzimu + "/show_" + article_id + ".html' target='_blank' title='" + article_title + "' "; 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 } } else { sbr.Append("<div class=\"nodata\"></div>"); } if (curpage > page_cnt) { curpage = page_cnt; } if (curpage < page_cnt) { sbr.AppendFormat("<dl class=\"shopone\">"); sbr.AppendFormat("<a href=\"javascript:;\" title=\"下一页\" class=\"cat-page-next trans200\" onclick='GoPage(" + (curpage + 1) + ")'></a>"); sbr.AppendFormat("</dl>"); } context.Put("list", sbr.ToString()); context.Put("listPage", NewXzc.Common.GenerPage.pageHtml(record_cnt, pagesize, curpage, "GoPage")); } catch (Exception ex) { context.Put("redirecturl", "/404"); } }
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 == 406) { prname = "zhuanti/hanxi"; } else if (type == 407) { prname = "zhuanti/rixi"; } else if (type == 408) { prname = "zhuanti/oumeiz"; } else if (type == 417) { prname = "zhuanti/agez"; } //if (prname == "") //{ // context.Put("redirecturl", "/404"); //} //else //{ // if (type < 1) // { // type = ArticleHelper.Get_Dianpu_Type_Id(prname, 0); // } // //通过汉字获取该汉字的首字母 // if (type < 406) // { // type_shouzimu = Get_Hanzi_Shouzimu.GetSpellCode(type_bll.GetModel(type).TypeName); // } // prname = ArticleHelper.Get_Type_Rname(type); // if (type==406 || type==407 || type==408) // { // 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 + "/"; // } //} typeurl = "/" + prname; 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 == 406) { title_val = "韩国穿衣搭配|韩国女装搭配|韩国服饰图片-衣品搭配网|韩系穿衣搭配网"; } else if (type == 407) { title_val = "日系风格|日系搭配|日系女装|日系服装搭配-衣品搭配网|日系衣服搭配"; } else if (type == 408) { title_val = "欧美风搭配|欧美风图片|欧美风打扮-衣品搭配网|欧美衣服搭配"; } else if (type == 417) { 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 == 406 || type == 407 || type == 408 || type == 417) { if (type == 406) { context.Put("keywords", "韩国服饰,韩国服饰搭配,韩国街拍"); context.Put("description", "韩国服饰是亚洲范围内非常流行的流行服饰,也是最受穿搭潮人们喜爱的服饰类型!韩系服装现在是时尚圈无法阻挡的一股潮流,衣品搭配网将给您展示最新潮的韩式穿搭!"); } else if (type == 407) { context.Put("keywords", "日系,日系风格,日系服装搭配,日系服装特点,甜美日系风,日系秋装搭配"); context.Put("description", "日系是夹在欧美风和韩系风中的一种特立流行风格,突出可爱风格。日系和韩系都是越来越流行的服装类型,衣品搭配网将给您展示最适合您的日系搭配方法!"); } else if (type == 408) { context.Put("keywords", "欧美风,欧美风搭配,欧美风打扮,欧美风格图片"); context.Put("description", "欧美风,随性、简单,不同于以简约优雅著称的英伦风,更偏向于街头类型的纽约范,任何人穿都会变得更加自信、有范、洋气、大牌,让你彻底脱胎换骨、远离土里土气。"); } else if (type == 417) { context.Put("keywords", "矮个子,女装,矮个子女装,矮个子穿衣搭配图片,矮个子街拍,矮个子服装搭配图片"); context.Put("description", "矮个子女生常常因为身高问题影响穿衣搭配,通过衣品搭配网的专业推荐和分析一定能解决矮个子女生穿衣搭配的难题。"); } context.Put("keywords_cname", "搭配"); } else { context.Put("keywords", title_val.Replace("_", ",").Replace("|", ",")); context.Put("keywords_cname", keywords_val.Replace("红人", "")); context.Put("description", description); } #endregion // 获取当前类型的封面图和描述 Get_Type_Show_Dest(context); // 加载文章列表 GetList(context); }