/// <summary>
        /// 相关搜索
        /// </summary>
        /// <param name="context"></param>
        public void Init_Xgss(NVelocity.VelocityContext context)
        {
            StringBuilder sbr = new StringBuilder();
            DataSet       ds  = null;

            try
            {
                string sql = "select top 6 id,title,types,isimg,img_url from hrenh_article where isend=0 and types in(1,3,4,5) and pub_state=0";

                sql += " order by read_cnt desc,id desc";

                ds = DbHelperSQL.Query(sql);

                if (ds != null && ds.Tables[0].Rows.Count > 0)
                {
                    for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                    {
                        DataRow dr = ds.Tables[0].Rows[i];

                        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, 10);
                        string article_url        = "href=\"/article_detail_" + article_id + "\" target=\"_blank\" title=\"" + article_title + "\"";

                        article_url = "href=\"/" + ArticleHelper.Get_Nav_Type_Name(Convert.ToInt32(dr["types"].ToString())) + "/detail_" + article_id + ".html\" target=\"_blank\" title=\"" + article_title + "\"";
                        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);
                        }

                        sbr.AppendFormat("<li>");
                        sbr.AppendFormat("<a {0}>{1}", article_url, show_article_title);
                        //sbr.AppendFormat("<img src=\"{0}\" height=\"80\" width=\"140\" alt=\"{1}\">", article_img, article_title);
                        //sbr.AppendFormat("<p>{0}</p>", show_article_title);
                        //sbr.AppendFormat("<i class=\"vedioIcon\"></i>");
                        sbr.AppendFormat("</a>");
                        sbr.AppendFormat("</li>");
                    }
                }
                else
                {
                    sbr.Append("<div class=\"nodata\">没有找到相关数据</div>");
                }
            }
            catch (Exception ex)
            {
                sbr.AppendFormat(ex.ToString());
            }

            context.Put("xgss", sbr.ToString());
        }
Esempio n. 2
0
        /// <summary>
        /// 获取红人资讯、红人作品、红人专访、红人专题,这四项右侧的推荐图
        /// </summary>
        /// <param name="cid">对应位置编号</param>
        private string GetItemImg(int cid)
        {
            sbr.Clear();

            ds = recommend_bll.GetList_NewIndex(1, " pageid=1000 and cid=" + cid + " ");

            if (ds != null && ds.Tables[0].Rows.Count > 0)
            {
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    DataRow dr = ds.Tables[0].Rows[i];

                    string title      = StringHelper.ReturnNumStr(dr["v1"].ToString(), 0, 0);
                    string show_title = StringHelper.ReturnNumStr(title, 0, 14);
                    string desc       = StringHelper.ReturnNumStr(dr["v2"].ToString(), 0, 80);
                    string imgurl     = ImgHelper.GetCofigShowUrl() + dr["v3"].ToString();
                    string httpurl    = String_Manage.Return_Str(dr["url"].ToString(), "");
                    //链接打开方式,1:在本页面打,2:在新页面打开
                    int openstyle = String_Manage.Return_Int(dr["v4"].ToString(), 0);

                    string width_height = "height=\"138\" width=\"236\"";


                    sbr.AppendFormat("<div class=\"item-content-img\">");

                    if (openstyle != 1 && openstyle != 2)
                    {
                        sbr.AppendFormat("<a href=\"javascript:void(0)\" title=\"{0}\">", title);
                        sbr.AppendFormat("<img src=\"{0}\" alt=\"{1}\" {2}>", imgurl, title, width_height);
                        sbr.AppendFormat("</a>");
                        sbr.AppendFormat("<span>");
                        sbr.AppendFormat("<a href=\"javascript:void(0)\" title=\"{1}\">{0}</a>", show_title, title);
                        sbr.AppendFormat("</span>");
                    }
                    else
                    {
                        sbr.AppendFormat("<a {0} title=\"{1}\">", Return_HttpURL.Return_Url(httpurl, openstyle), title);
                        sbr.AppendFormat("<img src=\"{0}\" alt=\"{1}\" {2}>", imgurl, title, width_height);
                        sbr.AppendFormat("</a>");
                        sbr.AppendFormat("<span>");
                        sbr.AppendFormat("<a {2} title=\"{1}\">{0}</a>", show_title, title, Return_HttpURL.Return_Url(httpurl, openstyle));
                        sbr.AppendFormat("</span>");
                    }
                    sbr.AppendFormat("</div>");
                }
            }

            return(sbr.ToString());
        }
Esempio n. 3
0
        /// <summary>
        /// 新闻热点、红人专访
        /// </summary>
        /// <param name="cid"></param>
        /// <returns></returns>
        private string Get_News_Hren(int cid)
        {
            sbr.Clear();

            ds = recommend_bll.GetList_NewIndex(8, " pageid=1000 and cid=" + cid + " ");

            if (ds != null && ds.Tables[0].Rows.Count > 0)
            {
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    DataRow dr = ds.Tables[0].Rows[i];

                    string title = ArticleHelper.GetArticleTitle(dr["v2"].ToString());
                    title = StringHelper.ReturnNumStr(title, 2, 0);
                    string show_title = StringHelper.ReturnNumStr(title, 2, 18);
                    string desc       = StringHelper.ReturnNumStr(dr["v2"].ToString(), 0, 80);
                    string imgurl     = ImgHelper.GetCofigShowUrl() + dr["v3"].ToString();
                    string httpurl    = String_Manage.Return_Str(dr["url"].ToString(), "");
                    //链接打开方式,1:在本页面打,2:在新页面打开
                    int openstyle = String_Manage.Return_Int(dr["v4"].ToString(), 0);

                    string width_height = "height=\"130\" width=\"300\"";


                    sbr.AppendFormat("<li>");

                    if (openstyle != 1 && openstyle != 2)
                    {
                        sbr.AppendFormat("<a href=\"javascript:void(0)\" title=\"{0}\">{1}", title, show_title);
                        sbr.AppendFormat("<img src=\"{0}\" alt=\"{1}\" {2}>", imgurl, title, width_height);
                        sbr.AppendFormat("</a>");
                    }
                    else
                    {
                        sbr.AppendFormat("<a {1} title=\"{0}\">{2}", title, Return_HttpURL.Return_Url(httpurl, openstyle), show_title);
                        sbr.AppendFormat("<img src=\"{0}\" alt=\"{1}\" {2}>", imgurl, title, width_height);
                        sbr.AppendFormat("</a>");
                    }

                    sbr.AppendFormat("</li>");
                }
            }

            return(sbr.ToString());
        }
Esempio n. 4
0
        public override void Page_Load(ref NVelocity.VelocityContext context)
        {
            base.Page_Load(ref context);

            #region  加载首页友情链接

            StringBuilder     sbr_foot           = new StringBuilder();
            DataSet           ds_foot            = null;
            BLL.RED_RECOMMEND recommend_bll_foot = new BLL.RED_RECOMMEND();

            ds_foot = recommend_bll_foot.GetList_NewIndex(0, " pageid=2000 and cid=1001 ");

            if (ds_foot != null && ds_foot.Tables[0].Rows.Count > 0)
            {
                sbr_foot.AppendFormat("<div class=\"friendLink\">");
                sbr_foot.AppendFormat("<div class=\"box\">");
                sbr_foot.AppendFormat("<div>");
                sbr_foot.AppendFormat("<h2>友情链接</h2>");

                for (int i = 0; i < ds_foot.Tables[0].Rows.Count; i++)
                {
                    DataRow dr = ds_foot.Tables[0].Rows[i];

                    string title   = StringHelper.ReturnNumStr(dr["v1"].ToString(), 3, 0);
                    string httpurl = String_Manage.Return_Str(dr["url"].ToString(), "");
                    //链接打开方式,1:在本页面打,2:在新页面打开
                    int openstyle = String_Manage.Return_Int(dr["v4"].ToString(), 0);

                    sbr_foot.AppendFormat("<a {1} title=\"{0}\">{0}</a>", title, Return_HttpURL.Return_Url(httpurl, openstyle));
                    if (i < ds_foot.Tables[0].Rows.Count - 1)
                    {
                        sbr_foot.AppendFormat("<i>|</i>");
                    }
                }

                sbr_foot.AppendFormat("</div>");
                sbr_foot.AppendFormat("</div>");
                sbr_foot.AppendFormat("</div>");
            }

            context.Put("foot_link", sbr_foot.ToString());
            #endregion
        }
Esempio n. 5
0
        /// <summary>
        /// 获取文章详情
        /// </summary>
        /// <param name="context"></param>
        private void GetDetail(NVelocity.VelocityContext context)
        {
            sbr.Clear();

            context.Put("id", articleid);

            string ishave_rcode = "0";

            string result = "ok";

            if (articleid == 0)
            {
                context.Put("redirecturl", "/404");
            }
            else
            {
                try
                {
                    ds = DbHelperSQL.Query("select top 1 id,title,isimg,img_url,isnull((select contents from hrenh_article_html where article_id=a.id),'') as contents,edittime,types,isnull(keywords,'文章详情') as keywords,isnull(description,'文章详情') as description,isnull((select top 1 uname from hrenh_article_author where id=a.AuthorId),'') as author,isnull((select top 1 USER_HEAD from hrenh_article_author where id=a.AuthorId),'') as uhead,New_Zixun_Tbk_Url,New_Zixun_Price,New_Zixun_Intro_Short,New_Zixun_Idlist,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 id=" + articleid + " ");// and a.pub_state=0

                    if (ds != null && ds.Tables[0].Rows.Count > 0)
                    {
                        DbHelperSQL.ExecuteSql("update hrenh_article set read_cnt=read_cnt+1 where id=" + articleid + "");

                        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 = dr["title"].ToString();

                            context.Put("atitle", article_title);

                            type = String_Manage.Return_Int(dr["types"].ToString(), -1);

                            if (type == 6)
                            {
                                context.Put("title", StringHelper.ReturnNumStr(article_title, 1, 0) + "-衣品搭配网|女装穿衣搭配");
                            }
                            else
                            {
                                context.Put("title", StringHelper.ReturnNumStr(article_title, 0, 0) + "-衣品搭配网|女装穿衣搭配");
                            }

                            //context.Put("navurl", "/" + ArticleHelper.Get_Nav_Type_Name(type));
                            //context.Put("navnames", ArticleHelper.Get_Type_Name(type));

                            string article_contents  = dr["contents"].ToString();
                            string article_addtime   = TimeParser.ReturnCurTime(dr["edittime"].ToString(), 0);
                            string New_Zixun_Tbk_Url = dr["New_Zixun_Tbk_Url"].ToString();
                            string New_Zixun_Price   = dr["New_Zixun_Price"].ToString();
                            New_Zixun_Price = Recruit_Job.Return_Money(New_Zixun_Price, 1);


                            string author = String_Manage.Return_Str(dr["author"].ToString(), "");

                            string New_Zixun_Intro_Short = String_Manage.Return_Str(dr["New_Zixun_Intro_Short"].ToString(), "");

                            string New_Zixun_Idlist = String_Manage.Return_Str(dr["New_Zixun_Idlist"].ToString(), "");

                            string keywords_detail    = dr["keywords"].ToString();
                            string description_detail = dr["description"].ToString();

                            description_detail = StringHelper.ReturnNumStr(article_contents, 1, 110);

                            if (New_Zixun_Idlist != "")
                            {
                                keywords_detail = TypeHelper.Get_type_New_Zixun__name(New_Zixun_Idlist);

                                Get_type_New_Zixun__name(New_Zixun_Idlist, context);
                            }


                            context.Put("keywords", keywords_detail);
                            context.Put("description", description_detail);

                            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("<div class=\"portrait-header newportrait\">");
                            sbr.AppendFormat("<h1>{0}</h1>", article_title);
                            sbr.AppendFormat("<p class=\"clearfix\">");
                            if (author != "")
                            {
                                sbr.AppendFormat("<em class=\"pic\"><img src=\"{0}\" alt=\"{1}\"></em>", ImgHelper.GetCofigShowUrl() + dr["uhead"].ToString(), author);
                                sbr.AppendFormat("<em>编辑:<i>{0}</i></em>", author);
                                //sbr.AppendFormat("<em style=\"margin-left:53px\">{0}</em>", article_addtime);
                            }
                            //else
                            //{
                            //    sbr.AppendFormat("<em style=\"margin-left:0\">{0}</em>", article_addtime);
                            //}

                            sbr.AppendFormat("<span class=\"org\"><i>{0}</i>来源于:<a href=\"http://www.ypindapei.com/\" title=\"衣品搭配\" target=\"_blank\">衣品搭配</a></span>", article_addtime);

                            sbr.AppendFormat("<span>");
                            //sbr.AppendFormat("<span class=\"comment-sum\"><b>{0}</b> 评论</span>", review_cnt);
                            //sbr.AppendFormat("<span><b></b>分享</span>");

                            sbr.AppendFormat("<span>");
                            sbr.AppendFormat("分享:<span class=\"bdsharebuttonbox\" id=\"share\" style=\"float: right;\"><a href=\"#\" class=\"bds_weixin\" data-cmd=\"weixin\" title=\"分享到微信\"></a><a href=\"#\" class=\"bds_tsina\" data-cmd=\"tsina\" title=\"分享到新浪微博\"></a><a href=\"#\" class=\"bds_qzone\" data-cmd=\"qzone\" title=\"分享到QQ空间\"></a></span>");
                            sbr.AppendFormat("</span>");

                            sbr.AppendFormat("</span>");
                            sbr.AppendFormat("</p>");
                            //sbr.AppendFormat("</div>");
                            //sbr.AppendFormat("<div class=\"hren-header\">");
                            //sbr.AppendFormat("<span class=\"cbhren\">唱吧红人</span>");
                            //sbr.AppendFormat("<span class=\"hrenID\">ID:<em>SHL-123456789</em></span>");
                            //sbr.AppendFormat("<span class=\"hrenfans\">唱吧粉丝:<em>33万</em></span>");
                            //sbr.AppendFormat("<span class=\"hrentx\"><img src=\"http://e.hiphotos.baidu.com/baike/w%3D268%3Bg%3D0/sign=52775554b6003af34dbadb660d11a161/d50735fae6cd7b89faf58fde0f2442a7d8330ed5.jpg\"></span>");
                            //sbr.AppendFormat("<span class=\"hrenfonc\">关注:34</span>");
                            //sbr.AppendFormat("<span class=\"hrenfc\">粉丝:16334</span>");
                            //sbr.AppendFormat("<span class=\"hrenName\">魏道道</span>");
                            //sbr.AppendFormat("<span class=\"hrenloc\">来自:<em>北京</em><em>北京</em><em>朝阳区</em></span>");
                            //sbr.AppendFormat("<a class=\"hrenfasixin\"><img src=\"/template/img/fasixin.jpg\"></a>");
                            //sbr.AppendFormat("<a class=\"hrenjiaguanzhu\"><img src=\"template/img/jiaguanzhu.jpg\"></a>");
                            sbr.AppendFormat("</div>");


                            sbr.AppendFormat("<div class=\"main-content-body\">");

                            #region  加载新说明

                            if (New_Zixun_Intro_Short != "")
                            {
                                sbr.AppendFormat("<div class=\"double_quotes\">");
                                sbr.AppendFormat("<div>{0}</div>", New_Zixun_Intro_Short);
                                sbr.AppendFormat("</div>");
                            }

                            #endregion

                            article_contents = article_contents.Replace("<img", "<img alt='衣品搭配'").Replace("undefined", "");

                            //将A标签下的href替换成javascript:;
                            article_contents = Get_A_Href.get_a_info(article_contents);

                            sbr.AppendFormat("{0}", article_contents);

                            sbr.AppendFormat("</div>");

                            //sbr.AppendFormat("<p class=\"gobuy\"><b>¥{0}</b></p>", New_Zixun_Price);

                            if (New_Zixun_Tbk_Url != "")
                            {
                                New_Zixun_Tbk_Url = "/rfzdp/" + articleid + ".html";

                                if (platname != "")
                                {
                                    //sbr.AppendFormat("<p class=\"gobuy\"><b>¥{0}</b><span><a href=\"{1}\" title='购买' target='_blank' rel=\"nofollow\">点击这里去“<strong>{3}</strong>”购买</a><i class=\"sppt\"><img src=\"{2}\" alt=\"{3}\"></i></span></p>", New_Zixun_Price, New_Zixun_Tbk_Url, platimg, platname);
                                    sbr.AppendFormat("<p class=\"gobuy\"><b>¥{0}</b><span><a href=\"{1}\" title='购买' target='_blank' rel=\"nofollow\">点击这里去购买</a><i class=\"sppt\"><img src=\"{2}\" alt=\"{3}\"></i></span></p>", New_Zixun_Price, New_Zixun_Tbk_Url, platimg, platname);
                                }
                                else
                                {
                                    sbr.AppendFormat("<p class=\"gobuy\"><b>¥{0}</b><a href=\"{1}\" title='购买' target='_blank' rel=\"nofollow\">点击这里去购买</a></p>", New_Zixun_Price, New_Zixun_Tbk_Url);
                                }
                            }

                            #endregion
                        }
                    }
                    else
                    {
                        result = "no";
                        sbr.Append("<div class=\"nodata\">没有找到相关数据</div>");
                    }
                }
                catch (Exception ex)
                {
                    sbr.Append(ex.ToString());
                }

                if (type == 6)
                {
                    result = "no";
                }

                context.Put("detail", sbr.ToString());
                context.Put("result", result);

                ////获取当前文章所在类型的最新的几篇文章
                //GetList(context);

                //获取相关搭配推荐
                Get_Top10_Zixun(context);

                //获取去这里选更多
                Get_Top5_Zixun(context);

                //获取更多穿搭推荐
                Get_Top20_Zixun(context);
            }
        }
Esempio n. 6
0
        /// <summary>
        /// 获取当前文章所在类型的最新的几篇文章
        /// </summary>
        /// <param name="context"></param>
        private void GetList(NVelocity.VelocityContext context)
        {
            sbr.Clear();

            StringBuilder listsbr = new StringBuilder();

            int pagesize = 10;

            string where = " types=" + type + " and isend=0 and pub_state=0 ";

            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
            }

            where += " and id<>" + articleid;

            string sql = "select top " + pagesize + " id,title,isimg,img_url,contents,edittime,(isnull(read_cnt,0)+FALSH_READ_CNT) as read_cnt from hrenh_article where " + where + "order by istop desc,edittime desc";

            ds = DbHelperSQL.Query(sql);

            if (ds != null && ds.Tables[0].Rows.Count > 0)
            {
                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, 34);
                    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_contents       = StringHelper.ReturnNumStr(dr["contents"].ToString(), 1, 102);
                    string article_contents_noimg = StringHelper.ReturnNumStr(dr["contents"].ToString(), 1, 170);
                    string article_addtime        = TimeParser.ReturnCurTime(dr["edittime"].ToString(), 1);

                    string article_url = "href=\"" + navurl + article_id + ".html\" target=\"_blank\" title=\"" + article_title + "\"";

                    int read_cnt = String_Manage.Return_Int(dr["read_cnt"].ToString(), 0);

                    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  加载文章列表

                    if (i < 3)
                    {
                        if (i == 0)
                        {
                            sbr.AppendFormat("<li class=\"mar0\">");
                        }
                        else
                        {
                            sbr.AppendFormat("<li>");
                        }
                        sbr.AppendFormat("<span>{0}</span>", article_addtime);
                        sbr.AppendFormat("<a {0}>{1}</a>", article_url, show_article_title);
                        sbr.AppendFormat("</li>");
                    }
                    else
                    {
                        show_article_title = StringHelper.ReturnNumStr(article_title, 1, 18);
                        listsbr.AppendFormat("<dl class=\"claint-main-list\">");
                        listsbr.AppendFormat("<dt><a {0}><img src=\"{1}\" alt=\"{2}\"></a></dt>", article_url, article_img, article_title);
                        listsbr.AppendFormat("<dd>");
                        listsbr.AppendFormat("<h3><a {0}>{1}</a></h3>", article_url, show_article_title);
                        listsbr.AppendFormat("<p><a {0}>{1}</a></p>", article_url, article_contents);
                        //listsbr.AppendFormat("<span><i class=\"mar0\">网络红人</i><i>国家运动员</i><i>网络红人</i></span>");
                        listsbr.AppendFormat("<span style=\"border:0;margin-left:0px;color:#999;font-size:12px;\" >{0}<i  style=\"position:absolute; right: -20px;top: -3px;color:#999;border:none;\">{1}人阅</i></span>", article_addtime, read_cnt);
                        //listsbr.AppendFormat("<i  style=\"position:absolute; right: -20px;top: 13px;\">{0}人阅</i>", read_cnt);
                        listsbr.AppendFormat("</dd>");
                        listsbr.AppendFormat("</dl>");
                    }


                    #endregion
                }
            }
            else
            {
                sbr.Append("<div class=\"nodata\">没有找到相关数据</div>");
            }

            context.Put("list3", sbr.ToString());
            context.Put("list_more", listsbr.ToString());
        }
Esempio n. 7
0
        /// <summary>
        /// 产品推荐
        /// </summary>
        /// <param name="context"></param>
        private void GetProductImg(NVelocity.VelocityContext context)
        {
            sbr.Clear();

            ds = recommend_bll.GetList_NewIndex(6, " pageid=1000 and cid=1007 ");

            if (ds != null && ds.Tables[0].Rows.Count > 0)
            {
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    DataRow dr = ds.Tables[0].Rows[i];

                    string title      = StringHelper.ReturnNumStr(dr["v1"].ToString(), 2, 0);
                    string show_title = StringHelper.ReturnNumStr(title, 2, 22);
                    string desc       = StringHelper.ReturnNumStr(dr["v2"].ToString(), 0, 80);
                    string imgurl     = ImgHelper.GetCofigShowUrl() + dr["v3"].ToString();
                    string httpurl    = String_Manage.Return_Str(dr["url"].ToString(), "");
                    //链接打开方式,1:在本页面打,2:在新页面打开
                    int openstyle = String_Manage.Return_Int(dr["v4"].ToString(), 0);

                    string width_height = "height=\"180\" width=\"429\"";

                    switch (i)
                    {
                    case 0:
                        width_height = "height=\"180\" width=\"429\"";
                        show_title   = StringHelper.ReturnNumStr(title, 2, 28);
                        context.Put("p1", GetProductContent(title, show_title, openstyle, httpurl, imgurl, width_height));
                        break;

                    case 1:
                        width_height = "height=\"365\" width=\"283\"";
                        show_title   = StringHelper.ReturnNumStr(title, 2, 18);
                        context.Put("p2", GetProductContent(title, show_title, openstyle, httpurl, imgurl, width_height));
                        break;

                    case 2:
                        width_height = "height=\"180\" width=\"278\"";
                        show_title   = StringHelper.ReturnNumStr(title, 2, 12);
                        context.Put("p3", GetProductContent(title, show_title, openstyle, httpurl, imgurl, width_height));
                        break;

                    case 3:
                        width_height = "height=\"180\" width=\"212\"";
                        show_title   = StringHelper.ReturnNumStr(title, 2, 13);
                        context.Put("p4", GetProductContent(title, show_title, openstyle, httpurl, imgurl, width_height));
                        break;

                    case 4:
                        width_height = "height=\"180\" width=\"212\"";
                        show_title   = StringHelper.ReturnNumStr(title, 2, 13);
                        context.Put("p5", GetProductContent(title, show_title, openstyle, httpurl, imgurl, width_height));
                        break;

                    case 5:
                        width_height = "height=\"180\" width=\"278\"";
                        show_title   = StringHelper.ReturnNumStr(title, 2, 17);
                        context.Put("p6", GetProductContent(title, show_title, openstyle, httpurl, imgurl, width_height));
                        break;
                    }
                }
            }
        }
        /// <summary>
        /// 获取文章详情
        /// </summary>
        /// <param name="context"></param>
        private void GetDetail(NVelocity.VelocityContext context)
        {
            sbr.Clear();

            context.Put("id", articleid);

            string ishave_rcode = "0";

            string result = "ok";

            if (articleid == 0)
            {
                context.Put("redirecturl", "/404");
            }
            else
            {
                try
                {
                    ds = DbHelperSQL.Query("select top 1 id,title,isimg,img_url,isnull((select contents from hrenh_article_html where article_id=a.id),'') as contents,(isnull(read_cnt,0)+FALSH_READ_CNT) as read_cnt,isnull((select count(*) from hrenh_article_REVIEW_REPLY where article_id=a.id and reply_id=0),0) as review_cnt,edittime,types,isnull(vurl,'') as video_url,isnull(keywords,'文章详情') as keywords,isnull(description,'文章详情') as description,isnull((select top 1 uname from hrenh_article_author where id=a.AuthorId),'') as author,isnull((select top 1 USER_HEAD from hrenh_article_author where id=a.AuthorId),'') as uhead from hrenh_article a where id=" + articleid + " ");// and a.pub_state=0

                    if (ds != null && ds.Tables[0].Rows.Count > 0)
                    {
                        DbHelperSQL.ExecuteSql("update hrenh_article set read_cnt=read_cnt+1 where id=" + articleid + "");

                        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 = dr["title"].ToString();

                            context.Put("atitle", article_title);

                            type = String_Manage.Return_Int(dr["types"].ToString(), -1);

                            if (type == 6)
                            {
                                context.Put("title", StringHelper.ReturnNumStr(article_title, 1, 0) + "-衣品搭配网|女装穿衣搭配");
                            }
                            else
                            {
                                context.Put("title", StringHelper.ReturnNumStr(article_title, 0, 0) + "-衣品搭配网|女装穿衣搭配");
                            }

                            //context.Put("navurl", "/" + ArticleHelper.Get_Nav_Type_Name(type));
                            //context.Put("navnames", ArticleHelper.Get_Type_Name(type));

                            string article_contents = dr["contents"].ToString();
                            string article_addtime  = TimeParser.ReturnCurTime(dr["edittime"].ToString(), 0);
                            int    read_cnt         = String_Manage.Return_Int(dr["read_cnt"].ToString(), 0) + 1;
                            int    review_cnt       = String_Manage.Return_Int(dr["review_cnt"].ToString(), 0);
                            //视频地址
                            string video_url = String_Manage.Return_Str(dr["video_url"].ToString(), "");

                            context.Put("keywords", dr["keywords"].ToString());
                            context.Put("description", dr["description"].ToString());

                            string author = String_Manage.Return_Str(dr["author"].ToString(), "");

                            #endregion

                            #region  加载文章详情


                            sbr.AppendFormat("<div class=\"portrait-header newportrait\">");
                            sbr.AppendFormat("<h1>{0}</h1>", article_title);
                            sbr.AppendFormat("<p class=\"clearfix\">");
                            if (author != "")
                            {
                                sbr.AppendFormat("<em class=\"pic\"><img src=\"{0}\" alt=\"{1}\"></em>", ImgHelper.GetCofigShowUrl() + dr["uhead"].ToString(), author);
                                sbr.AppendFormat("<em>编辑:<i>{0}</i></em>", author);
                                //sbr.AppendFormat("<em style=\"margin-left:53px\">{0}</em>", article_addtime);
                            }
                            //else
                            //{
                            //    sbr.AppendFormat("<em style=\"margin-left:0\">{0}</em>", article_addtime);
                            //}

                            sbr.AppendFormat("<span class=\"org\"><i>{0}</i>来源于:<a href=\"http://www.ypindapei.com/\" title=\"衣品搭配\" target=\"_blank\">衣品搭配</a></span>", article_addtime);



                            sbr.AppendFormat("<span>");
                            //sbr.AppendFormat("<span class=\"comment-sum\"><b>{0}</b> 评论</span>", review_cnt);
                            //sbr.AppendFormat("<span><b></b>分享</span>");

                            sbr.AppendFormat("<span>");
                            sbr.AppendFormat("分享:<span class=\"bdsharebuttonbox\" id=\"share\" style=\"float: right;\"><a href=\"#\" class=\"bds_weixin\" data-cmd=\"weixin\" title=\"分享到微信\"></a><a href=\"#\" class=\"bds_tsina\" data-cmd=\"tsina\" title=\"分享到新浪微博\"></a><a href=\"#\" class=\"bds_qzone\" data-cmd=\"qzone\" title=\"分享到QQ空间\"></a></span>");
                            sbr.AppendFormat("</span>");

                            sbr.AppendFormat("</span>");
                            sbr.AppendFormat("</p>");
                            //sbr.AppendFormat("</div>");
                            //sbr.AppendFormat("<div class=\"hren-header\">");
                            //sbr.AppendFormat("<span class=\"cbhren\">唱吧红人</span>");
                            //sbr.AppendFormat("<span class=\"hrenID\">ID:<em>SHL-123456789</em></span>");
                            //sbr.AppendFormat("<span class=\"hrenfans\">唱吧粉丝:<em>33万</em></span>");
                            //sbr.AppendFormat("<span class=\"hrentx\"><img src=\"http://e.hiphotos.baidu.com/baike/w%3D268%3Bg%3D0/sign=52775554b6003af34dbadb660d11a161/d50735fae6cd7b89faf58fde0f2442a7d8330ed5.jpg\"></span>");
                            //sbr.AppendFormat("<span class=\"hrenfonc\">关注:34</span>");
                            //sbr.AppendFormat("<span class=\"hrenfc\">粉丝:16334</span>");
                            //sbr.AppendFormat("<span class=\"hrenName\">魏道道</span>");
                            //sbr.AppendFormat("<span class=\"hrenloc\">来自:<em>北京</em><em>北京</em><em>朝阳区</em></span>");
                            //sbr.AppendFormat("<a class=\"hrenfasixin\"><img src=\"/template/img/fasixin.jpg\"></a>");
                            //sbr.AppendFormat("<a class=\"hrenjiaguanzhu\"><img src=\"template/img/jiaguanzhu.jpg\"></a>");
                            sbr.AppendFormat("</div>");


                            sbr.AppendFormat("<div class=\"main-content-body\">");
                            //sbr.AppendFormat("<p class=\"abstract\">[<strong>摘要</strong>]她尝试了各种事情,也尝试了和王子约会,然后发现,还是做女王大人更有趣。</p>");

                            if (video_url != "")
                            {
                                if (video_url.Contains("swf"))
                                {
                                    sbr.AppendFormat("<p style=\"text-align: center;\"><embed width=\"600\" height=\"390\" allowfullscreen=\"true\" allowscriptaccess=\"never\" menu=\"false\" loop=\"false\" play=\"true\" wmode=\"transparent\" src=\"{0}\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" class=\"edui-faked-video\" type=\"application/x-shockwave-flash\"></p>", video_url);
                                }
                                else
                                {
                                    sbr.AppendFormat("<object id=\"CuPlayerVideo_video_object\" width=\"100%\" height=\"400\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\"><param name=\"movie\" value=\"/Flash/player.swf?v=2.5\"><param name=\"flashvars\" value=\"JcScpFile=/Flash/CuSunV2set.xml&amp;JcScpVideoPath={0}&amp;JcScpImg=/Flash/start.jpg\"><param name=\"allowFullScreen\" value=\"true\"><param name=\"allowScriptAccess\" value=\"always\"><param name=\"wmode\" value=\"Transparent\"><embed id=\"CuPlayerVideo_video_embed\" src=\"/Flash/player.swf?v=2.5\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" allowfullscreen=\"true\" wmode=\"Transparent\" width=\"100%\" height=\"400\" flashvars=\"JcScpFile=/Flash/CuSunV2set.xml&amp;JcScpVideoPath={0}&amp;JcScpImg=/Flash/start.jpg\"></object>", video_url);
                                }
                            }

                            if (article_contents.Contains("欲查看更多精彩内容请扫描下方二维码"))
                            {
                                ishave_rcode = "1";
                            }


                            sbr.AppendFormat("{0}", article_contents.Replace("<img", "<img alt='衣品搭配'").Replace("undefined", ""));

                            sbr.AppendFormat("</div>");


                            #endregion
                        }
                    }
                    else
                    {
                        result = "no";
                        sbr.Append("<div class=\"nodata\">没有找到相关数据</div>");
                    }
                }
                catch (Exception ex)
                {
                    sbr.Append(ex.ToString());
                }

                if (type == 6)
                {
                    result = "no";
                }

                context.Put("detail", sbr.ToString());
                context.Put("result", result);

                context.Put("ishave_rcode", ishave_rcode);

                ////获取评论、回复内容列表
                //GetReviewContent(context);

                context.Put("type", type);

                //获取指南栏目下最新的10条记录
                GetList(context);

                //获取上衣、裤装、裙装、女鞋、包包、配饰、美妆等栏目下的最新的16条记录
                GetList_fuzhuang(context);
            }
        }
        /// <summary>
        /// 获取指南栏目下最新的10条记录
        /// </summary>
        /// <param name="context"></param>
        private void GetList(NVelocity.VelocityContext context)
        {
            StringBuilder listsbr = new StringBuilder();

            int pagesize = 10;

            int zhinan_type = 354;

            string where = " (types=" + zhinan_type + " or types_pid=" + zhinan_type + ") and isend=0 and pub_state=0 ";

            where += " and id<>" + articleid;

            string sql = "select top " + pagesize + " id,title,isimg,img_url,contents,edittime,(isnull(read_cnt,0)+FALSH_READ_CNT) as read_cnt from hrenh_article where " + where + "order by istop desc,edittime desc";

            ds = DbHelperSQL.Query(sql);

            if (ds != null && ds.Tables[0].Rows.Count > 0)
            {
                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, 34);
                    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_contents       = StringHelper.ReturnNumStr(dr["contents"].ToString(), 1, 102);
                    string article_contents_noimg = StringHelper.ReturnNumStr(dr["contents"].ToString(), 1, 170);
                    string article_addtime        = TimeParser.ReturnCurTime(dr["edittime"].ToString(), 1);

                    string article_url = "href=\"/article_detail_" + article_id + "\" target=\"_blank\" title=\"" + article_title + "\"";

                    article_url = "href=\"/zhinan/detail_" + article_id + ".html\" target=\"_blank\" title=\"" + article_title + "\"";

                    int read_cnt = String_Manage.Return_Int(dr["read_cnt"].ToString(), 0);

                    #endregion

                    #region  加载文章列表

                    show_article_title = StringHelper.ReturnNumStr(article_title, 1, 18);
                    listsbr.AppendFormat("<dl class=\"claint-main-list\">");
                    listsbr.AppendFormat("<dt><a {0}><img src=\"{1}\" alt=\"{2}\"></a></dt>", article_url, article_img, article_title);
                    listsbr.AppendFormat("<dd>");
                    listsbr.AppendFormat("<h3><a {0}>{1}</a></h3>", article_url, show_article_title);
                    listsbr.AppendFormat("<p><a {0}>{1}</a></p>", article_url, article_contents);
                    //listsbr.AppendFormat("<span><i class=\"mar0\">网络红人</i><i>国家运动员</i><i>网络红人</i></span>");
                    listsbr.AppendFormat("<span style=\"border:0;margin-left:0px;color:#999;font-size:12px;\" >{0}<i  style=\"position:absolute; right: -20px;top: -3px;color:#999;border:none;\">{1}人阅</i></span>", article_addtime, read_cnt);
                    //listsbr.AppendFormat("<i  style=\"position:absolute; right: -20px;top: 13px;\">{0}人阅</i>", read_cnt);
                    listsbr.AppendFormat("</dd>");
                    listsbr.AppendFormat("</dl>");


                    #endregion
                }
            }
            else
            {
                //listsbr.Append("<div class=\"nodata\">没有找到相关数据</div>");
            }

            context.Put("list_more", listsbr.ToString());
        }
Esempio n. 10
0
        /// <summary>
        /// 红人写真
        /// </summary>
        /// <param name="context"></param>
        private void GetXZImg(NVelocity.VelocityContext context)
        {
            sbr.Clear();

            ds = recommend_bll.GetList_NewIndex(5, " pageid=1000 and cid=1006 ");

            if (ds != null && ds.Tables[0].Rows.Count > 0)
            {
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    DataRow dr = ds.Tables[0].Rows[i];

                    string title      = StringHelper.ReturnNumStr(dr["v1"].ToString(), 2, 0);
                    string show_title = StringHelper.ReturnNumStr(title, 2, 22);
                    string desc       = StringHelper.ReturnNumStr(dr["v2"].ToString(), 0, 80);
                    string imgurl     = ImgHelper.GetCofigShowUrl() + dr["v3"].ToString();
                    string httpurl    = String_Manage.Return_Str(dr["url"].ToString(), "");
                    //链接打开方式,1:在本页面打,2:在新页面打开
                    int openstyle = String_Manage.Return_Int(dr["v4"].ToString(), 0);

                    string width_height = "height=\"405\" width=\"450\"";

                    switch (i)
                    {
                    case 0:
                        width_height = "height=\"405\" width=\"450\"";
                        break;

                    case 1:
                        width_height = "height=\"200\" width=\"340\"";
                        break;

                    case 2:
                        width_height = "height=\"200\" width=\"200\"";
                        show_title   = StringHelper.ReturnNumStr(title, 2, 12);
                        break;

                    case 3:
                        width_height = "height=\"200\" width=\"200\"";
                        show_title   = StringHelper.ReturnNumStr(title, 2, 12);
                        break;

                    case 4:
                        width_height = "height=\"200\" width=\"340\"";
                        break;
                    }

                    sbr.AppendFormat("<div class=\"item-photo-box\">");

                    if (openstyle != 1 && openstyle != 2)
                    {
                        sbr.AppendFormat("<a href=\"javascript:void(0)\" title=\"{0}\">", title);
                        sbr.AppendFormat("<img src=\"{0}\" alt=\"{1}\" {2}>", imgurl, title, width_height);
                        sbr.AppendFormat("</a>");
                        sbr.AppendFormat("<span>");
                        sbr.AppendFormat("<a href=\"javascript:void(0)\" title=\"{1}\">{0}</a>", show_title, title);
                        sbr.AppendFormat("</span>");
                    }
                    else
                    {
                        sbr.AppendFormat("<a {1} title=\"{0}\">", title, Return_HttpURL.Return_Url(httpurl, openstyle));
                        sbr.AppendFormat("<img src=\"{0}\" alt=\"{1}\" {2}>", imgurl, title, width_height);
                        sbr.AppendFormat("</a>");
                        sbr.AppendFormat("<span>");
                        sbr.AppendFormat("<a {1} title=\"{0}\">{2}</a>", title, Return_HttpURL.Return_Url(httpurl, openstyle), show_title);
                        sbr.AppendFormat("</span>");
                    }

                    sbr.AppendFormat("</div>");
                }
            }

            context.Put("xz", sbr.ToString());
        }
Esempio n. 11
0
        /// <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
        }
Esempio n. 12
0
        /// <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");
            }
        }
Esempio n. 13
0
        /// <summary>
        /// 相关阅读
        /// </summary>
        /// <param name="context"></param>
        public void Init_Xgyd(NVelocity.VelocityContext context)
        {
            StringBuilder sbr = new StringBuilder();
            DataSet       ds  = null;
            int           pid = 1300;

            try
            {
                ds = recommend_bll.GetList_NewIndex(4, " pageid=" + pid + " and cid=1010 ");

                if (ds != null && ds.Tables[0].Rows.Count > 0)
                {
                    for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                    {
                        DataRow dr = ds.Tables[0].Rows[i];


                        string desc = StringHelper.ReturnNumStr(dr["v2"].ToString(), 0, 80);

                        string title   = "";
                        int    isimg   = 0;
                        string imgurl  = "/template/img/nocontent.png";
                        string addtime = "";
                        string httpurl = String_Manage.Return_Str(dr["url"].ToString(), "");
                        //链接打开方式,1:在本页面打,2:在新页面打开
                        int openstyle = String_Manage.Return_Int(dr["v4"].ToString(), 0);

                        try
                        {
                            DataSet ads = DbHelperSQL.Query("select top 1 title,isimg,img_url,addtime from hrenh_article where id=" + desc + " and pub_state=0");

                            if (ads != null && ads.Tables[0].Rows.Count > 0)
                            {
                                for (int j = 0; j < ads.Tables[0].Rows.Count; j++)
                                {
                                    DataRow adr = ads.Tables[0].Rows[j];
                                    title = adr["title"].ToString();
                                    isimg = String_Manage.Return_Int(adr["isimg"].ToString(), 0);
                                    if (isimg == 1)
                                    {
                                        imgurl = ImgHelper.Get_UploadImgUrl(adr["img_url"].ToString(), 1);
                                    }
                                    addtime = TimeParser.ReturnCurTime(adr["addtime"].ToString(), 4);
                                }
                            }
                        }
                        catch (Exception ex)
                        {
                        }

                        title = StringHelper.ReturnNumStr(title, 0, 0);
                        string show_title = StringHelper.ReturnNumStr(title, 1, 38);

                        string width_height = "height=\"60\" width=\"90\"";

                        sbr.AppendFormat("<li>");
                        sbr.AppendFormat("<em></em>");
                        sbr.AppendFormat("<a {1} title=\"{0}\">", title, Return_HttpURL.Return_Url(httpurl, openstyle));
                        sbr.AppendFormat("{0}", show_title);
                        sbr.AppendFormat("</a>");
                        sbr.AppendFormat("<span>{0}</span>", addtime);
                        sbr.AppendFormat("</li>");
                    }
                }
                else
                {
                    sbr.Append("<div class=\"nodata\">没有找到相关数据</div>");
                }
            }
            catch (Exception ex)
            {
                sbr.AppendFormat(ex.ToString());
            }

            context.Put("xgyd", sbr.ToString());
        }
Esempio n. 14
0
        /// <summary>
        /// 获取相关搭配推荐
        /// </summary>
        /// <param name="context"></param>
        private void Get_Top10_Zixun(NVelocity.VelocityContext context)
        {
            sbr.Clear();

            //被要求显示的季节ID
            string season_require_id = "";


            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)
            {
            }

            StringBuilder listsbr = new StringBuilder();

            int pagesize = 10;

            string where = " types=" + type + " and isend=0 and pub_state=0 ";
            if (season_require_id != "")
            {
                where += " and New_Zixun_Season in(" + season_require_id + ")";
            }

            where += " and id<>" + articleid;

            string sql = "select top " + pagesize + " id,title,types,New_Zixun_intro_short,isimg,img_url,New_Zixun_Price,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 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("xgdptj", sbr.ToString());
        }
Esempio n. 15
0
        /// <summary>
        /// 相关搜索上方广告
        /// </summary>
        /// <param name="context"></param>
        private void Init_Search_Ad(NVelocity.VelocityContext context)
        {
            StringBuilder sbr = new StringBuilder();
            DataSet       ds  = null;
            int           pid = 1300;

            sbr.Clear();

            ds = recommend_bll.GetList_NewIndex(0, " pageid=" + pid + " and cid=1009 ");

            if (ds != null && ds.Tables[0].Rows.Count > 0)
            {
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    DataRow dr = ds.Tables[0].Rows[i];

                    string title      = StringHelper.ReturnNumStr(dr["v1"].ToString(), 0, 0);
                    string show_title = StringHelper.ReturnNumStr(title, 1, 10);
                    string desc       = StringHelper.ReturnNumStr(dr["v2"].ToString(), 0, 80);
                    string imgurl     = ImgHelper.GetCofigShowUrl() + dr["v3"].ToString();
                    string httpurl    = String_Manage.Return_Str(dr["url"].ToString(), "");
                    //链接打开方式,1:在本页面打,2:在新页面打开
                    int openstyle = String_Manage.Return_Int(dr["v4"].ToString(), 0);

                    string width_height = "height=\"90\" width=\"640\"";


                    //if (openstyle != 1 && openstyle != 2)
                    //{
                    //    sbr.AppendFormat("<a href=\"javascript:void(0)\" title=\"{0}\">", title);
                    //    sbr.AppendFormat("<img src=\"{0}\" alt=\"{1}\" {2}>", imgurl, title, width_height);
                    //    sbr.AppendFormat("</a>");
                    //}
                    //else
                    //{
                    //    sbr.AppendFormat("<a {1} title=\"{0}\">", title, Return_HttpURL.Return_Url(httpurl, openstyle));
                    //    sbr.AppendFormat("<img src=\"{0}\" alt=\"{1}\" {2}>", imgurl, title, width_height);
                    //    sbr.AppendFormat("</a>");
                    //}

                    string hittpurl = " href=\"javascript:;\" ";
                    show_title   = StringHelper.ReturnNumStr(title, 1, 0);
                    width_height = "height=\"128\" width=\"128\"";

                    //<div class="nn" style="position: relative;"><a href="javascript:;"><img src="$img/01.jpg"><p class="tuceng4"><span class="mone">¥54.00</span></p></a></div>

                    sbr.AppendFormat("<div class=\"nn\" style=\"position: relative;\">");

                    if (openstyle != 1 && openstyle != 2)
                    {
                        sbr.AppendFormat("<a {0} title=\"{1}\">", hittpurl, title);
                    }
                    else
                    {
                        sbr.AppendFormat("<a {0} title=\"{1}\">", Return_HttpURL.Return_Url(httpurl, openstyle), title);
                    }

                    sbr.AppendFormat("<img src=\"{0}\" alt=\"{1}\" {2}>", imgurl, show_title, width_height);
                    sbr.AppendFormat("<p class=\"tuceng4\"><span class=\"mone\">¥{0}</span></p>", Recruit_Job.Return_Money(desc, 2));
                    sbr.AppendFormat("</a>");
                    sbr.AppendFormat("</div>");
                }
            }

            context.Put("Search_Ad", sbr.ToString());
        }
Esempio n. 16
0
        /// <summary>
        /// 加载头部导航
        /// </summary>
        /// <param name="context"></param>
        private string Get_Top_Nav(NVelocity.VelocityContext context)
        {
            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>");

            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)
                    {
                        //type_sbr.AppendFormat("<a href=\"{0}\" title=\"{1}\" class=\"f18\">{1}</a>", nav_http_url, nav_http_name);

                        if (pid == 0 && typeids != 35)
                        {
                            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;
                                }

                                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)
                    //{

                    //    nav_http_url = "http://weiba.ypindapei.com";

                    //    weiba_sbr.AppendFormat("<span></span>");
                    //    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());
        }
        /// <summary>
        /// 获取上衣、裤装、裙装、女鞋、包包、配饰、美妆等栏目下的最新的16条记录
        /// </summary>
        /// <param name="context"></param>
        private void GetList_fuzhuang(NVelocity.VelocityContext context)
        {
            sbr.Clear();

            StringBuilder listsbr = new StringBuilder();

            int pagesize = 8;

            string where = " types between 49 and 55 and isend=0 and pub_state=0 ";

            where = " types=370 and isend=0 and pub_state=0 ";

            where += " and id<>" + articleid;

            string sql = "select top " + pagesize + " id,title,types from hrenh_article where " + where + "order by edittime desc"; //"order by istop desc,edittime desc";

            ds = DbHelperSQL.Query(sql);

            if (ds != null && ds.Tables[0].Rows.Count > 0)
            {
                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, 17);

                    int fuzhuang_type = Convert.ToInt32(dr["types"].ToString());

                    //string fuzhuang_type_parname = "";

                    //switch (fuzhuang_type)
                    //{
                    //    case 49:
                    //        fuzhuang_type_parname = "shangyisy";
                    //        break;
                    //    case 50:
                    //        fuzhuang_type_parname = "kuzhuangkz";
                    //        break;
                    //    case 51:
                    //        fuzhuang_type_parname = "qunzhuangqz";
                    //        break;
                    //    case 52:
                    //        fuzhuang_type_parname = "nvxienx";
                    //        break;
                    //    case 53:
                    //        fuzhuang_type_parname = "baobaobb";
                    //        break;
                    //    case 54:
                    //        fuzhuang_type_parname = "peiships";
                    //        break;
                    //    case 55:
                    //        fuzhuang_type_parname = "meizhuangmz";
                    //        break;
                    //}

                    //string article_url = "href=\"/"+fuzhuang_type_parname+"/show_" + article_id + ".html\" target=\"_blank\" title=\"" + article_title + "\"";


                    string article_url = "href=\"/dapei/show_" + article_id + ".html\" target=\"_blank\" title=\"" + article_title + "\"";

                    #endregion

                    #region  加载文章列表

                    if (i % 2 == 0)
                    {
                        sbr.AppendFormat("<li><a {0}>{1}</a></li>", article_url, show_article_title);
                    }
                    else
                    {
                        listsbr.AppendFormat("<li><a {0}>{1}</a></li>", article_url, show_article_title);
                    }
                    #endregion
                }
            }
            else
            {
                //listsbr.Append("<div class=\"nodata\">没有找到相关数据</div>");
            }

            context.Put("list_fuzhuang_left", sbr.ToString());
            context.Put("list_fuzhuang_right", listsbr.ToString());
        }
Esempio n. 18
0
        /// <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());
        }
Esempio n. 19
0
        /// <summary>
        /// 获取议会活动列表
        /// </summary>
        /// <param name="context"></param>
        private void GetList(NVelocity.VelocityContext context)
        {
            sbr.Clear();

            PageClass pc = new PageClass();

            int record_cnt = 0;
            int page_cnt   = 0;
            int curpage    = 1;
            int pagesize   = 10;

            curpage = String_Manage.Return_Request_Int("page", 1);

            int page = 0;

            if (curpage > 0)
            {
                page = curpage - 1;
            }

            string where = " and (types=" + type + " or types_pid=" + type + ") and isend=0 and a.pub_state=0 ";

            if (stype > 0)
            {
                where = " and types=" + stype + " and isend=0 ";
            }

            context.Put("stype", stype);

            ds = pc.TagList_New("*", " istop desc,edittime desc ", " hrenh_article a ", where, page, pagesize, " id,title,isimg,img_url,contents,(isnull(read_cnt,0)+FALSH_READ_CNT) as read_cnt,isnull((select count(*) from hrenh_article_REVIEW_REPLY where article_id=a.id and reply_id=0),0) as review_cnt,edittime ");

            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 show_article_title = StringHelper.ReturnNumStr(article_title, 0, 36);
                    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_contents       = StringHelper.ReturnNumStr(dr["contents"].ToString(), 1, 76);
                    string article_contents_noimg = StringHelper.ReturnNumStr(dr["contents"].ToString(), 1, 170);
                    string article_addtime        = TimeParser.ReturnCurTime(dr["edittime"].ToString(), 1);
                    int    read_cnt   = String_Manage.Return_Int(dr["read_cnt"].ToString(), 0);
                    int    review_cnt = String_Manage.Return_Int(dr["review_cnt"].ToString(), 0);

                    string article_url = "href=\"/article_detail_" + article_id + "\" target=\"_blank\" title=\"" + article_title + "\"";

                    string parent_type_url = ArticleHelper.Get_Nav_Type_Name(type);

                    string surl = parent_type_url + "/detail";

                    //if (stype >= 359 && stype <= 362)
                    //{
                    //    surl = "zhinan/";
                    //    switch (stype)
                    //    {
                    //        case 359:
                    //            surl += "clys";
                    //            break;
                    //        case 360:
                    //            surl += "fzdp";
                    //            break;
                    //        case 361:
                    //            surl += "hzjq";
                    //            break;
                    //        case 362:
                    //            surl += "hdth";
                    //            break;
                    //        case 369:
                    //            surl += "psdp";
                    //            break;
                    //    }
                    //    surl += "/show";
                    //}
                    surl += "_" + article_id + ".html";

                    article_url = "href=\"/" + surl + "\" target=\"_blank\" title=\"" + article_title + "\"";

                    #endregion

                    #region  加载文章列表


                    sbr.AppendFormat("<li>");
                    sbr.AppendFormat("<dl>");
                    //if (isimg == 1)
                    //{
                    sbr.AppendFormat("<dt><a {0}><img src=\"{1}\" alt=\"{2}\"></a></dt>", article_url, article_img, article_title);
                    //}
                    sbr.AppendFormat("<dd style=\"position:absolute;left:0;top:20px;left:336px;max-height:69px;\">");

                    string static_class = "";

                    //if (isimg != 1)
                    //{
                    //    //static_class = "style=\"position:static;\"";
                    //    article_contents = article_contents_noimg;
                    //}

                    sbr.AppendFormat("<h4 {2} style=\"position:static;\"><a {0}>{1}</a></h4>", article_url, show_article_title, static_class);
                    sbr.AppendFormat("<p class=\"list-content\" {2}  style=\"position:static;\"><a {0}> {1}</a></p>", article_url, article_contents, static_class);

                    sbr.AppendFormat("<p style=\"position:relative;background:url('/template/img/clock.png') no-repeat left center;\">");
                    //sbr.AppendFormat("<span  style=\"margin-left:0px;\">网络红人</span>");
                    //sbr.AppendFormat("<span class=\"mar12\">国家运动员</span>");
                    //sbr.AppendFormat("<span>网络红人</span>");
                    sbr.AppendFormat("<span style=\"border:0;margin-left:0px;color:#999;padding-left:20px;\" >{0}</span>", article_addtime);
                    sbr.AppendFormat("<i  style=\"position:absolute; right: -20px;top: 13px;\">{0}人阅</i>", read_cnt);
                    sbr.AppendFormat("</p>");
                    sbr.AppendFormat("</dd>");
                    sbr.AppendFormat("</dl>");
                    sbr.AppendFormat("</li>");



                    #endregion
                }
            }
            else
            {
                sbr.Append("<div class=\"nodata\">没有找到相关数据</div>");
            }

            if (curpage > page_cnt)
            {
                curpage = page_cnt;
            }

            context.Put("list", sbr.ToString());
            context.Put("listPage", NewXzc.Common.GenerPage.pageHtml(record_cnt, pagesize, curpage, "GoPage"));
        }
Esempio n. 20
0
        /// <summary>
        /// 获取二级和三级
        /// </summary>
        private void Get_Second_Third(NVelocity.VelocityContext context)
        {
            sbr.Clear();

            int pageid = 2200;
            int cid    = 1001;

            string navurl_list = "";

            switch (type)
            {
            case 49:
                cid = 1001;
                break;

            case 50:
                cid = 1002;
                break;

            case 51:
                cid = 1003;
                break;

            case 52:
                cid = 1004;
                break;

            case 53:
                cid = 1005;
                break;

            case 54:
                cid = 1006;
                break;

            case 55:
                cid = 1007;
                break;

            case 370:
                cid = 1008;
                break;
            }

            try
            {
                DataSet adds = DbHelperSQL.Query("select v3,v4,url from red_recommend where pageid=" + pageid + " and cid=" + cid + " order by sort asc,id desc");

                if (adds != null && adds.Tables[0].Rows.Count > 0)
                {
                    StringBuilder adsbr = new StringBuilder();

                    foreach (DataRow addr in adds.Tables[0].Rows)
                    {
                        string imgurl  = ImgHelper.GetCofigShowUrl() + addr["v3"].ToString();
                        string httpurl = String_Manage.Return_Str(addr["url"].ToString(), "");
                        //链接打开方式,1:在本页面打,2:在新页面打开
                        int openstyle = String_Manage.Return_Int(addr["v4"].ToString(), 0);

                        adsbr.AppendFormat("<a class=\"right_img\" {0} title=\"女装搭配\">", Return_HttpURL.Return_Url(httpurl, openstyle));
                        adsbr.AppendFormat("<img src=\"{0}\" alt=\"女装搭配\">", imgurl);
                        adsbr.AppendFormat("</a>");
                    }

                    context.Put("adimgs", adsbr.ToString());
                }
            }
            catch (Exception ex)
            {
            }

            //不是搭配栏目
            if (type < 370)
            {
                //当前大类型下的第一类型的ID
                int first_type_id = 0;

                try
                {
                    first_type_id = Convert.ToInt32(DbHelperSQL.GetSingle("select top 1 id from HRENH_ARTICLE_TYPE where pid=" + type + " order by id asc").ToString());
                }
                catch (Exception ex)
                {
                }

                try
                {
                    string son_sql = "select a.id,a.typename,a.lvl,(select top 1 TypeImg from HRENH_ARTICLE_TYPE where id=a.id) as typeimg from return_article_all_son_typelist(" + type + "," + type_parent + ") a where a.lvl=1";


                    ds = DbHelperSQL.Query(son_sql);

                    if (ds != null && ds.Tables[0].Rows.Count > 0)
                    {
                        for (int f = 0; f < ds.Tables[0].Rows.Count; f++)
                        {
                            DataRow dr = ds.Tables[0].Rows[f];

                            string id       = dr["id"].ToString();
                            string typename = dr["typename"].ToString();
                            string lvl      = dr["lvl"].ToString();
                            string typeimg  = dr["typeimg"].ToString();

                            if (typeimg != "")
                            {
                                typeimg = ImgHelper.Get_UploadImgUrl(typeimg, 1);
                            }

                            string article_url = " href='javascript:void(0)' title='" + typename + "' ";

                            //sbr.AppendFormat("<div class=\"resumeWrap\">");

                            //sbr.AppendFormat("<div class=\"catalogInfo\">");
                            //sbr.AppendFormat("<a {0}>", article_url);
                            //sbr.AppendFormat("<p class=\"title\">{0}</p>", typename);
                            //sbr.AppendFormat("</a>");
                            //sbr.AppendFormat("<a class=\"imgWrap\" {0}>", article_url);
                            //sbr.AppendFormat("<img src=\"{0}\" alt=\"{1}\">", typeimg, typename);
                            //sbr.AppendFormat("</a>");
                            //sbr.AppendFormat("</div>");

                            sbr.AppendFormat("<dl class=\"type_section first\">");
                            sbr.AppendFormat("<dt><a {0}>{1}</a></dt>", article_url, typename);
                            sbr.AppendFormat("<dd>");
                            sbr.AppendFormat("<a class=\"cat_img\" {0}>", article_url);
                            sbr.AppendFormat("<img src=\"{0}\" alt=\"{1}\">", typeimg, typename);
                            sbr.AppendFormat("</a>");
                            sbr.AppendFormat("<ul>");

                            #region  加载三级

                            string third_sql = "select a.id,a.typename,(select TypeRename from hrenh_article_type where id=a.id) as rname from return_article_all_son_typelist(" + id + "," + type_parent + ") a where a.lvl=1";

                            //不是包包、美妆下的类型
                            if (type != baobao_id && type != meizhuang_id)
                            {
                                if (first_type_id.ToString() == id)
                                {
                                    if (season_require_id != "")
                                    {
                                        ////当前显示类型是配饰
                                        //if (type == peishi_id)
                                        //{
                                        //    //当前被设置显示的季节是四季
                                        //    if (season_require_id_linshi.IndexOf(season_siji_id_linshi) >= 0)
                                        //    {
                                        //        third_sql += " and charindex('" + season_require_id_linshi+ "',','+(select season_id from hrenh_article_type where id=a.id)+',')>0 ";
                                        //    }
                                        //    else//当前被设置显示的季节不是四季
                                        //    {
                                        //        third_sql += " and charindex('" + season_require_id_linshi + season_siji_id_linshi + "',','+(select season_id from hrenh_article_type where id=a.id)+',')>0 ";
                                        //    }
                                        //}
                                        //else
                                        //{
                                        third_sql += " and (select season_id from hrenh_article_type where id=a.id) in(" + season_require_id + ")";
                                        //}
                                    }
                                }
                            }


                            DataSet sonds = DbHelperSQL.Query(third_sql);


                            if (sonds != null && sonds.Tables[0].Rows.Count > 0)
                            {
                                int total_cnt = sonds.Tables[0].Rows.Count;

                                int column = 4;
                                int rows   = 0;

                                if (total_cnt % column == 0)
                                {
                                    rows = total_cnt / column;
                                }
                                else
                                {
                                    rows = total_cnt / column + 1;
                                }

                                for (int i = 0; i < rows; i++)
                                {
                                    //sbr.AppendFormat("<div class=\"catalogChoice\">");
                                    //sbr.AppendFormat("<ul>");

                                    for (int j = i * column; j < (i + 1) * column; j++)
                                    {
                                        if (j < total_cnt)
                                        {
                                            DataRow sdr = sonds.Tables[0].Rows[j];
                                            id       = sdr["id"].ToString();
                                            typename = sdr["typename"].ToString();
                                            string rname = sdr["rname"].ToString();

                                            //是否是被热推的类型
                                            string cur_type_hot = "";

                                            if (f == 0)
                                            {
                                                //cur_type_hot = "hot";
                                                typeurl = "/" + rname + type_shouzimu + "/";
                                            }
                                            else
                                            {
                                                //typeurl = "/" + prname + "/" + rname + "/";
                                                typeurl = "/" + prname + "/" + rname + ".html";
                                            }

                                            article_url = " href='" + typeurl + "' title='" + typename + "' ";

                                            navurl_list += "http://www.ypindapei.com" + typeurl + "|" + typename;

                                            //sbr.AppendFormat("<li><a {0}>{1}</a></li>", article_url, typename);
                                            sbr.AppendFormat("<li>");
                                            sbr.AppendFormat("<a {0} class=\"pagani_log_link {2}\" >{1}</a>", article_url, typename, cur_type_hot);
                                            sbr.AppendFormat("</li>");
                                        }
                                        else
                                        {
                                            break;
                                        }
                                    }

                                    //sbr.AppendFormat("</ul>");
                                    //sbr.AppendFormat("</div>");
                                }
                            }

                            #endregion

                            //sbr.AppendFormat("</div>");

                            sbr.AppendFormat("</ul>");
                            sbr.AppendFormat("</dd>");
                            sbr.AppendFormat("</dl>");
                        }
                    }


                    context.Put("Second_Third", sbr.ToString());

                    context.Put("redirecturl_error", navurl_list);
                }
                catch (Exception ex)
                {
                    //context.Put("redirecturl","/404");
                    context.Put("redirecturl_error", ex.ToString());
                }
            }
        }
Esempio n. 21
0
        /// <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");
            }
        }
Esempio n. 22
0
        /// <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>
        /// <returns></returns>
        private void GetReviewContent(NVelocity.VelocityContext context)
        {
            sbr.Clear();

            PageClass pc       = new PageClass();
            DataSet   reply_ds = null;

            int record_cnt = 0;
            int page_cnt   = 0;
            int curpage    = 0;
            int pagesize   = 10;

            ds = pc.TagList_New("*", " review_addtime desc ", " hrenh_review_reply_article ", " and reply_id=0 and islike=0 and article_id=" + articleid + " ", curpage, pagesize, " id,userid,review_uname,review_user_head,review_contents,review_addtime,like_cnt ");

            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    pid       = String_Manage.Return_Int(dr["id"].ToString(), 0);
                    int    puserid   = String_Manage.Return_Int(dr["userid"].ToString(), 0);
                    string uname     = String_Manage.Return_Str(dr["review_uname"].ToString(), "");
                    string show_name = StringHelper.ReturnNumStr(uname, 0, 20);
                    string user_head = ImgHelper.Return_User_Head(dr["review_user_head"].ToString(), 2);
                    string contents  = String_Manage.Return_Str(dr["review_contents"].ToString(), "");
                    string addtime   = dr["review_addtime"].ToString();
                    addtime = TimeParser.ReturnCurTime(addtime, 1);

                    string is_href      = "href=\"javascript:void(0)\"";
                    string width_height = "height=\"48\" width=\"48\"";

                    int like_cnt    = String_Manage.Return_Int(dr["like_cnt"].ToString(), 0);
                    int is_like_own = review_bll.GetRecordCount(" reply_id=" + pid + " and userid=" + UserID_HongRenHui + " and islike=1 ");

                    #endregion

                    #region  加载评论及回复的内容
                    sbr.AppendFormat("<div class=\"activity-details-discuss-item clearfix\">");
                    sbr.AppendFormat("<a class=\"item-photo\" {0} title=\"{1}\">", is_href, uname);
                    sbr.AppendFormat("<img src=\"{0}\" {1} alt=\"{2}\">", user_head, width_height, uname);
                    sbr.AppendFormat("</a>");
                    sbr.AppendFormat("<div class=\"item-content\">");
                    sbr.AppendFormat("<h3>");
                    sbr.AppendFormat("<a {0} title=\"{1}\">{2}</a>", is_href, uname, show_name);
                    sbr.AppendFormat("<em>{0}</em>", addtime);
                    sbr.AppendFormat("</h3>");
                    sbr.AppendFormat("<p>{0}</p>", contents);
                    sbr.AppendFormat("<p class=\"item-btns\">");
                    if (is_like_own == 0)
                    {
                        sbr.AppendFormat("<a class=\"laud laud_up\" href=\"javascript: void(0);\">{0}</a>", like_cnt);
                    }
                    else
                    {
                        sbr.AppendFormat("<a class=\"laud laud_up lauded\" href=\"javascript: void(0);\">{0}</a>", like_cnt);
                    }

                    if (UserID_HongRenHui == puserid)
                    {
                        sbr.AppendFormat("<a class=\"reply_report\" href=\"javascript: void(0);\">举报</a>");
                        sbr.AppendFormat("<a class=\"reply_del\" href=\"javascript: void(0);\">删除</a>");
                    }
                    else
                    {
                        sbr.AppendFormat("<a class=\"reply_report\" href=\"javascript: void(0);\">举报</a>");
                        sbr.AppendFormat("<a class=\"reply_article\" href=\"javascript: void(0);\">回复</a>");
                    }

                    sbr.AppendFormat("</p>");

                    #region  加载回复的列表

                    reply_ds = DbHelperSQL.Query("select * from hrenh_review_reply_article where review_pid=" + pid + " and islike=0 ");

                    if (reply_ds != null & reply_ds.Tables[0].Rows.Count > 0)
                    {
                        for (int j = 0; j < reply_ds.Tables[0].Rows.Count; j++)
                        {
                            DataRow rdr = reply_ds.Tables[0].Rows[j];

                            #region  回复的内容的信息
                            int    id              = String_Manage.Return_Int(rdr["id"].ToString(), 0);
                            int    reply_userid    = String_Manage.Return_Int(rdr["userid"].ToString(), 0);
                            string reply_uname     = String_Manage.Return_Str(rdr["review_uname"].ToString(), "");
                            string reply_show_name = StringHelper.ReturnNumStr(reply_uname, 0, 20);
                            user_head = ImgHelper.Return_User_Head(rdr["review_user_head"].ToString(), 2);
                            string reply_contents = String_Manage.Return_Str(rdr["review_contents"].ToString(), "");
                            string reply_addtime  = rdr["review_addtime"].ToString();

                            reply_addtime = TimeParser.ReturnCurTime(reply_addtime, 1);
                            like_cnt      = String_Manage.Return_Int(rdr["like_cnt"].ToString(), 0);
                            is_like_own   = review_bll.GetRecordCount(" reply_id=" + id + " and userid=" + UserID_HongRenHui + " and islike=1 ");
                            #endregion

                            sbr.AppendFormat("<div class=\"activity-details-discuss-item clearfix\">");
                            sbr.AppendFormat("<a class=\"item-photo\" {0} title=\"{1}\"s>", is_href, reply_uname);
                            sbr.AppendFormat("<img src=\"{0}\" {1} alt=\"{2}\">", user_head, width_height, reply_uname);
                            sbr.AppendFormat("</a>");
                            sbr.AppendFormat("<div class=\"item-content\">");
                            sbr.AppendFormat("<h3>");
                            sbr.AppendFormat("<a {0} title=\"{1}\">{2}</a>", is_href, reply_uname, reply_show_name);
                            sbr.AppendFormat("<em>{0}</em>", reply_addtime);
                            sbr.AppendFormat("</h3>");
                            sbr.AppendFormat("<p>{0}</p>", reply_contents);
                            sbr.AppendFormat("<p class=\"item-btns\">");
                            if (is_like_own == 0)
                            {
                                sbr.AppendFormat("<a class=\"laud laud_under\" href=\"javascript: void(0);\">{0}</a>", like_cnt);
                            }
                            else
                            {
                                sbr.AppendFormat("<a class=\"laud laud_under lauded\" href=\"javascript: void(0);\">{0}</a>", like_cnt);
                            }


                            if (UserID_HongRenHui == reply_userid)
                            {
                                sbr.AppendFormat("<a class=\"reply_under_report\" href=\"javascript: void(0);\">举报</a>");
                                sbr.AppendFormat("<a class=\"reply_under_del\" href=\"javascript: void(0);\">删除</a>");
                            }
                            else
                            {
                                sbr.AppendFormat("<a class=\"reply_under_report\" href=\"javascript: void(0);\">举报</a>");
                                sbr.AppendFormat("<a class=\"reply_under_article\" href=\"javascript: void(0);\">回复</a>");
                            }

                            sbr.AppendFormat("</p>");
                            sbr.AppendFormat("<input type=\"hidden\" class=\"hidval\" data-id=\"{0}\" data-type=\"{1}\" data-pid=\"{2}\">", id, type, pid);
                            sbr.AppendFormat("</div>");
                            sbr.AppendFormat("</div>");
                        }
                    }
                    #endregion

                    sbr.AppendFormat("<input type=\"hidden\" class=\"hidval_first\" data-id=\"{0}\" data-type=\"{1}\" data-pid=\"{2}\">", pid, type, pid);
                    sbr.AppendFormat("</div>");
                    sbr.AppendFormat("</div>");


                    #endregion
                }
            }
            else
            {
                //sbr.Append("<div class=\"nodata\">没有找到相关数据</div>");
                sbr.Append("");
            }

            int cpage = curpage + 1;

            if (cpage > page_cnt)
            {
                cpage = page_cnt;
            }

            context.Put("reviewcontent", sbr.ToString());
            context.Put("listPage", NewXzc.Common.GenerPage.pageHtml(record_cnt, pagesize, cpage));
        }
Esempio n. 24
0
        /// <summary>
        /// 获取列表页中头部的轮播图
        /// </summary>
        private string GetLB()
        {
            sbr.Clear();

            int cid = 0;

            switch (type)
            {
            case 1:
                cid = 1001;
                break;

            case 2:
                cid = 1002;
                break;

            case 3:
                cid = 1003;
                break;

            case 4:
                cid = 1004;
                break;

            case 5:
                cid = 1005;
                break;

            case 35:
                cid = 1012;
                break;

            case 40:
                cid = 1012;
                break;

            case 41:
                cid = 1012;
                break;

            case 42:
                cid = 1012;
                break;
            }

            ds = recommend_bll.GetList_NewIndex(6, " pageid=1100 and cid=" + cid + " ");

            if (ds != null && ds.Tables[0].Rows.Count > 0)
            {
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    DataRow dr = ds.Tables[0].Rows[i];

                    string title      = StringHelper.ReturnNumStr(dr["v1"].ToString(), 0, 0);
                    string show_title = StringHelper.ReturnNumStr(title, 0, 18);
                    string desc       = StringHelper.ReturnNumStr(dr["v2"].ToString(), 0, 80);
                    string imgurl     = ImgHelper.GetCofigShowUrl() + dr["v3"].ToString();
                    string httpurl    = String_Manage.Return_Str(dr["url"].ToString(), "");
                    //链接打开方式,1:在本页面打,2:在新页面打开
                    int openstyle = String_Manage.Return_Int(dr["v4"].ToString(), 0);

                    string width_height = "height=\"300\" width=\"640\"";

                    sbr.AppendFormat("<div>");

                    if (openstyle != 1 && openstyle != 2)
                    {
                        sbr.AppendFormat("<img src=\"{0}\" alt=\"{1}\" {2}>", imgurl, title, width_height);
                        sbr.AppendFormat("<span class=\"slides-descride\">");
                        sbr.AppendFormat("<a href=\"javascript:void(0)\" title=\"{1}\">{0}</a>", show_title, title);
                        sbr.AppendFormat("</span>");
                    }
                    else
                    {
                        sbr.AppendFormat("<a {2} title=\"{1}\"><img src=\"{0}\" alt=\"{1}\" {3}></a>", imgurl, title, Return_HttpURL.Return_Url(httpurl, openstyle), width_height);
                        sbr.AppendFormat("<span class=\"slides-descride\">");
                        sbr.AppendFormat("<a {2} title=\"{1}\">{0}</a>", show_title, title, Return_HttpURL.Return_Url(httpurl, openstyle));
                        sbr.AppendFormat("</span>");
                    }
                    sbr.AppendFormat("</div>");
                }
            }

            return(sbr.ToString());
        }
Esempio n. 25
0
        /// <summary>
        /// 首页轮播图
        /// </summary>
        /// <param name="context"></param>
        private void GetTopImg(NVelocity.VelocityContext context)
        {
            sbr.Clear();
            StringBuilder html = new StringBuilder();
            int           cnt  = 0;

            ds = recommend_bll.GetList_NewIndex(0, " pageid=1000 and cid=1001 ");

            if (ds != null && ds.Tables[0].Rows.Count > 0)
            {
                cnt = ds.Tables[0].Rows.Count;

                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    DataRow dr = ds.Tables[0].Rows[i];

                    string title      = StringHelper.ReturnNumStr(dr["v1"].ToString(), 0, 0);
                    string show_title = StringHelper.ReturnNumStr(title, 0, 22);
                    string desc       = StringHelper.ReturnNumStr(dr["v2"].ToString(), 0, 80);
                    string imgurl     = ImgHelper.GetCofigShowUrl() + dr["v3"].ToString();
                    string httpurl    = String_Manage.Return_Str(dr["url"].ToString(), "");
                    //链接打开方式,1:在本页面打,2:在新页面打开
                    int openstyle = String_Manage.Return_Int(dr["v4"].ToString(), 0);

                    string width_height = "height=\"350\" width=\"680\"";


                    //sbr.AppendFormat("<div>");

                    //if (openstyle != 1 && openstyle != 2)
                    //{
                    //    sbr.AppendFormat("<img src=\"{0}\" alt=\"{1}\" {2}>", imgurl, title, width_height);
                    //    sbr.AppendFormat("<span class=\"slides-descride\">");
                    //    sbr.AppendFormat("<a href=\"javascript:void(0)\" title=\"{1}\">{0}</a>",show_title,title);
                    //    sbr.AppendFormat("</span>");
                    //}
                    //else
                    //{
                    //    sbr.AppendFormat("<a {2} title=\"{1}\"><img src=\"{0}\" alt=\"{1}\" {3}></a>", imgurl, title, Return_HttpURL.Return_Url(httpurl, openstyle), width_height);
                    //    sbr.AppendFormat("<span class=\"slides-descride\">");
                    //    sbr.AppendFormat("<a {2} title=\"{1}\">{0}</a>", show_title, title, Return_HttpURL.Return_Url(httpurl, openstyle));
                    //    sbr.AppendFormat("</span>");
                    //}
                    //sbr.AppendFormat("</div>");


                    sbr.AppendFormat("<div class=\"item imgwrap\">");

                    if (openstyle != 1 && openstyle != 2)
                    {
                        sbr.AppendFormat("<img src=\"{0}\" alt=\"{1}\">", imgurl, title);
                        //sbr.AppendFormat("<span class=\"slides-descride\">");
                        //sbr.AppendFormat("<a href=\"javascript:void(0)\" title=\"{1}\">{0}</a>", show_title, title);
                        //sbr.AppendFormat("</span>");
                    }
                    else
                    {
                        sbr.AppendFormat("<a {2} title=\"{1}\"><img src=\"{0}\" alt=\"{1}\"></a>", imgurl, title, Return_HttpURL.Return_Url(httpurl, openstyle));
                        //sbr.AppendFormat("<span class=\"slides-descride\">");
                        //sbr.AppendFormat("<a {2} title=\"{1}\">{0}</a>", show_title, title, Return_HttpURL.Return_Url(httpurl, openstyle));
                        //sbr.AppendFormat("</span>");
                    }
                    sbr.AppendFormat("</div>");

                    if (i == 0)
                    {
                        html.AppendFormat("<span class=\"dot_list current\" onmouseover=\"slide_00.slideToNearBy({0})\"></span>", i);
                    }
                    else
                    {
                        html.AppendFormat("<span class=\"dot_list\" onmouseover=\"slide_00.slideToNearBy({0})\"></span>", i);
                    }
                }
            }

            context.Put("lunbo", sbr.ToString());
            context.Put("lunbo_2", html.ToString());
            context.Put("cnt", cnt);
        }
Esempio n. 26
0
        /// <summary>
        /// 今日热点
        /// </summary>
        /// <param name="context"></param>
        private string Get_Jrrd(NVelocity.VelocityContext context)
        {
            StringBuilder sbr = new StringBuilder();
            DataSet       ds  = null;
            int           pid = 2100;

            sbr.Clear();

            ds = recommend_bll.GetList_NewIndex(24, " pageid=" + pid + " and cid=1012 ");

            if (ds != null && ds.Tables[0].Rows.Count > 0)
            {
                int total = ds.Tables[0].Rows.Count;

                int cols = 6;

                int rows = 0;

                if (total % cols == 0)
                {
                    rows = total / cols;
                }
                else
                {
                    rows = total / cols + 1;
                }

                for (int i = 0; i < rows; i++)
                {
                    sbr.AppendFormat("<div class=\"today_div\">");

                    for (int j = i * cols; j < (i + 1) * cols; j++)
                    {
                        if (j < total)
                        {
                            DataRow dr = ds.Tables[0].Rows[j];

                            string title      = StringHelper.ReturnNumStr(dr["v1"].ToString(), 0, 0);
                            string show_title = StringHelper.ReturnNumStr(title, 1, 17);
                            string httpurl    = String_Manage.Return_Str(dr["url"].ToString(), "");
                            //链接打开方式,1:在本页面打,2:在新页面打开
                            int openstyle = String_Manage.Return_Int(dr["v4"].ToString(), 0);

                            sbr.AppendFormat("<div class=\"fcut\">");

                            sbr.AppendFormat("<div class=\"mask\">");

                            sbr.AppendFormat("<a {0} title=\"{1}\">", Return_HttpURL.Return_Url(httpurl, openstyle), title);
                            sbr.AppendFormat("{0}</a>", show_title);

                            sbr.AppendFormat("</div>");

                            sbr.AppendFormat("</div>");
                        }
                        else
                        {
                            break;
                        }
                    }

                    sbr.AppendFormat("</div>");
                }
            }

            return(sbr.ToString());
        }
Esempio n. 27
0
        /// <summary>
        /// 获取议会活动列表
        /// </summary>
        /// <param name="context"></param>
        private void GetList(NVelocity.VelocityContext context)
        {
            StringBuilder sbr = new StringBuilder();

            int pagesize = 2;
            int type     = 1;

            string where = " (types=" + type + " or types_pid=" + type + ") and isend=0 and a.pub_state=0 ";

            DataSet ds = DbHelperSQL.Query("select top " + pagesize + " id,title,isimg,img_url,contents,(isnull(read_cnt,0)+FALSH_READ_CNT) as read_cnt,edittime from hrenh_article a where" + where);

            if (ds != null && ds.Tables[0].Rows.Count > 0)
            {
                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, 0, 36);
                    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_contents       = StringHelper.ReturnNumStr(dr["contents"].ToString(), 1, 76);
                    string article_contents_noimg = StringHelper.ReturnNumStr(dr["contents"].ToString(), 1, 170);
                    string article_addtime        = TimeParser.ReturnCurTime(dr["edittime"].ToString(), 1);
                    int    read_cnt = String_Manage.Return_Int(dr["read_cnt"].ToString(), 0);

                    string article_url = "href=\"/article_detail_" + article_id + "\" target=\"_blank\" title=\"" + article_title + "\"";

                    article_url = "href=\"/zixun/detail_" + article_id + ".html\" target=\"_blank\" title=\"" + article_title + "\"";

                    #endregion

                    #region  加载文章列表


                    sbr.AppendFormat("<dl class=\"mar0 listone\">");
                    sbr.AppendFormat("<dt style=\"float:left;\">");
                    sbr.AppendFormat("<a {0}>", article_url);
                    sbr.AppendFormat("<img src=\"{0}\" alt=\"{1}\" width=\"300\" height=\"200\">", article_img, article_title);
                    sbr.AppendFormat("</a>");
                    sbr.AppendFormat("</dt>");
                    sbr.AppendFormat("<dd style=\"float: left;padding-left:19px; \">");
                    sbr.AppendFormat("<h3>");
                    sbr.AppendFormat("<a {0} style=\" color: #333;font-size: 20px;font-weight: 900; \">{1}</a>", article_url, show_article_title);
                    sbr.AppendFormat("</h3>");
                    sbr.AppendFormat("<h3 class=\"hh2\">");
                    sbr.AppendFormat("<p class=\"content\"\">");
                    sbr.AppendFormat("<a {0}>{1}", article_url, article_contents);
                    sbr.AppendFormat("</a>");
                    sbr.AppendFormat("</p>");
                    sbr.AppendFormat("<p class=\"main-share\">");
                    sbr.AppendFormat("<span class=\"clearfix\" style=\"margin-top:4px;\">");
                    sbr.AppendFormat("<span class=\"list-time\">发布时间:{0}</span>", article_addtime);
                    sbr.AppendFormat("<span class=\"list-view-data\">");
                    sbr.AppendFormat("</span>");
                    sbr.AppendFormat("</span>");
                    sbr.AppendFormat("</p>");
                    sbr.AppendFormat("</h3>");
                    sbr.AppendFormat("</dd>");
                    sbr.AppendFormat("</dl>");


                    #endregion
                }
            }
            else
            {
                sbr.Append("<div class=\"nodata\">没有找到相关数据</div>");
            }

            context.Put("list", sbr.ToString());
        }