示例#1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        xc.CheckAdminLogin(string.Empty);

        xClass.NewsTypeData("ads", adWhere);

        string strSql = string.Empty;
        string ifStr  = string.Empty;

        if (!IsPostBack)
        {
            Int64 aidTemp = xc.SafeNum(Request["aid"]);
            if (aidTemp > 0)
            {
                string idNums = xClass.getClassAllID("ads", Convert.ToInt32(aidTemp));

                if (!idNums.Equals(aidTemp.ToString()))
                {
                    string[] ids = idNums.Split(new char[] { ',' });
                    for (int i = 0; i <= ids.GetUpperBound(0); i++)
                    {
                        ifStr += "classID=" + ids[i].ToString().Trim() + " or ";
                    }
                    ifStr = " and (" + ifStr.Substring(0, ifStr.Length - 3) + ")";
                }
                else
                {
                    ifStr += " and classID=" + aidTemp.ToString().Trim();
                }
                this.adWhere.Items.FindByValue(aidTemp.ToString()).Selected = true;
            }

            strSql = "select * from ads where 1=1 " + ifStr + " order by stopDate DESC,aID desc";
            //Response.Write(strSql);
            lblCurrentPage.Text = db.RepeaterDB(RepeaterList, strSql, "&aid=" + aidTemp, 5, "page", "center", true);
        }
    }
示例#2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string classNav = "淘画报 ";

        if (!IsPostBack)
        {
            DataTable dt;

            dt = db.getDataTable("select top 5 Tid,TreeName from NewsTree where taobaoKe<>'' order by newid() ");
            for (int i = 0; i < 5; i++)
            {
                ppRnd.Text += "<a href=\"/" + dt.Rows[i]["Tid"].ToString().Trim() + ".htm\" target=\"_blank\" title=\"查看 " + dt.Rows[i]["TreeName"].ToString().Trim() + "\" alt=\"查看 " + dt.Rows[i]["TreeName"].ToString().Trim() + "\">" + dt.Rows[i]["TreeName"].ToString().Trim() + "</a>";
                if (i < 4)
                {
                    ppRnd.Text += "&nbsp;<span class=\"headLine\">|</span>&nbsp;";
                }
            }
            dt.Dispose();
            ad468.Text = ad.getAdCode(0, 468, 60, 1, 0, true, string.Empty);

            long cidTemp = xc.SafeNum(Request.QueryString["id"]);
            if (cidTemp < 1)
            {
                string urlID = Page.RouteData.Values["cID"].ToString();
                urlID   = urlID.Replace(".htm", "");
                cidTemp = xc.SafeNum(urlID);
            }
            //Response.Write(cidTemp.ToString());
            listTop.Text = "<a href=\"" + cidTemp.ToString() + ".htm\" target=\"_top\">默认</a>";

            string ifStr     = string.Empty;
            string pageStr   = string.Empty;
            string searchStr = Server.UrlDecode(Request["keyWord"]);
            string searchIf  = string.Empty;
            string orderBy   = "order by modified_date DESC,hits DESC";

            long sale = xc.SafeNum(Request.QueryString["hit"]);
            if (sale > 0)
            {
                listTop.Text += "&nbsp;&nbsp;<a href=\"/huabao/" + cidTemp.ToString() + ".htm?hit=1\" style=\"color:#cb0201; font-weight:bold;\" target=\"_top\">热门</a>";
                orderBy       = " Order By hits DESC";
                pageStr      += "&hit=1";
            }
            else
            {
                listTop.Text += "&nbsp;&nbsp;<a href=\"/huabao/" + cidTemp.ToString() + ".htm?hit=1\" target=\"_top\">热门</a>";
            }

            long good = xc.SafeNum(Request.QueryString["good"]);
            if (good > 0)
            {
                listTop.Text += "&nbsp;&nbsp;<a href=\"/huabao/" + cidTemp.ToString() + ".htm?good=1\" style=\"color:#cb0201; font-weight:bold;\" target=\"_top\">推荐</a>";
                orderBy       = " Order By weight DESC";
                pageStr      += "&good=1";
            }
            else
            {
                listTop.Text += "&nbsp;&nbsp;<a href=\"/huabao/" + cidTemp.ToString() + ".htm?good=1\" target=\"_top\">推荐</a>";
            }

            //淘品牌分类
            dt = db.getDataTable("select * from posterChannelIDs where isFlag>0 order by id ASC");
            for (int l = 0; l < dt.Rows.Count; l++)
            {
                string css     = string.Empty;
                long   tidTree = xc.SafeNum(dt.Rows[l]["id"].ToString().Trim());
                if (tidTree == cidTemp)
                {
                    css       = " style=\"color:#cb0201; font-weight:bold;\"";
                    classNav += dt.Rows[l]["channel_name"].ToString().Trim();
                }
                navList.Text += "<a href=\"/huabao/" + tidTree.ToString() + ".htm\" target=\"_top\" " + css + ">" + dt.Rows[l]["channel_name"].ToString().Trim() + "</a>&nbsp;&nbsp;";
            }
            dt.Dispose();

            navClass.Text = "图搜画报";

            if (!string.IsNullOrEmpty(searchStr as string))
            {
                searchIf = " and title like '%" + searchStr + "%'";

                searchWord.Text = searchStr;
                pageStr         = "&keyWord=" + Server.UrlEncode(searchStr);

                classNav      = "搜索结果";
                navClass.Text = classNav;
            }

            //导航
            headMenu.Text = "<td valign=\"middle\" class=\"headBg1\"><a href=\"/\" target=\"_top\" class=\"head\">网站首页</a></td>";
            dt            = db.getDataTable("select Tid,TreeName from newsTree where TreeID=0 and TreeType='taobaoke' order by ListID ASC,Tid ASC");
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                string tid       = dt.Rows[i]["Tid"].ToString().Trim();
                string treeName  = dt.Rows[i]["TreeName"].ToString().Trim();
                string className = "headBg1";

                headMenu.Text += "<td valign=\"middle\" class=\"" + className + "\"><a href=\"/" + tid + ".htm\" target=\"_top\" class=\"head\">" + treeName + "</a></td>";
            }
            headMenu.Text += "<td valign=\"middle\" class=\"headBg2\"><a href=\"/huabao/default.htm\" target=\"_top\" class=\"head\">图搜画报</a></td><td valign=\"middle\" class=\"headBg1\"><a href=\"/huabao/\" target=\"_top\" class=\"head\">画报淘宝</a></td>";
            dt.Dispose();

            if (cidTemp > 0)
            {
                ifStr = " and channel_id=" + cidTemp.ToString();
            }

            string strSql = "select top 3000 * from posterChannelTitle where flagID=1 " + ifStr + searchIf + orderBy;
            //Response.Write(strSql);
            //Response.End();
            lblCurrentPage.Text = db.RepeaterDB(RepeaterList, strSql, pageStr, 30, "page", "right", true);
            string[] inputStr = lblCurrentPage.Text.Replace("<!-- input -->", "@").Split(new char[] { '@' });
            pageTop.Text = inputStr[0] + "</tr></table>";
            if (this.RepeaterList.Items.Count < 1)
            {
                if (string.IsNullOrEmpty(searchStr as string))
                {
                    errInfo.Text   = "目前暂没有任何信息!";
                    errDiv.Visible = true;
                }
                else
                {
                    //即时搜索淘宝客显示商品
                    string     appkey             = XmlReader.GetConfig(Server.MapPath("~/xabara.config"), "taobaoKeAppKey");
                    string     appsecret          = XmlReader.GetConfig(Server.MapPath("~/xabara.config"), "taobaoKeAppSecret");
                    string     url                = XmlReader.GetConfig(Server.MapPath("~/xabara.config"), "taobaoKeUrl");
                    string     alimamaID          = XmlReader.GetConfig(Server.MapPath("~/xabara.config"), "taobaoKeAlimamaID"); //淘宝客推广ID
                    ITopClient client             = new DefaultTopClient(url, appkey, appsecret);
                    TaobaokeListurlGetRequest req = new TaobaokeListurlGetRequest();
                    req.Q    = searchStr;
                    req.Nick = alimamaID;
                    TaobaokeListurlGetResponse response = client.Execute(req);

                    Response.Redirect(response.TaobaokeItem.KeywordClickUrl, true);
                }
            }
            else
            {
                errDiv.Visible = false;
            }

            //热搜关键词
            string   hot     = XmlReader.GetConfig(Server.MapPath("~/xabara.config"), "hotSearch");
            string[] hotWord = hot.Split(new char[] { ',' });
            for (int h = 0; h <= hotWord.GetUpperBound(0); h++)
            {
                hotSearch.Text += "<a href=\"/search.htm?keyWord=" + Server.UrlEncode(hotWord[h]) + "\" target=\"_top\" title=\"搜索 " + hotWord[h] + "\">" + hotWord[h] + "</a>&nbsp;";
            }

            xc.webMeta(this.Page, XmlReader.GetConfig(Server.MapPath("~/xabara.config"), "KeyWord"), XmlReader.GetConfig(Server.MapPath("~/xabara.config"), "metaStr"));
        }

        this.Page.Title = classNav + " " + XmlReader.GetConfig(Server.MapPath("~/xabara.config"), "webName") + XmlReader.GetConfig(Server.MapPath("~/xabara.config"), "titleMeta");
    }
示例#3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string classNav = "找店铺_ZDianPU.com";

        if (!IsPostBack)
        {
            DataTable dt;

            dt = db.getDataTable("select top 5 Tid,TreeName from NewsTree where taobaoKe<>'' order by newid() ");
            for (int i = 0; i < 5; i++)
            {
                ppRnd.Text += "<a href=\"/" + dt.Rows[i]["Tid"].ToString().Trim() + ".htm\" target=\"_blank\" title=\"查看 " + dt.Rows[i]["TreeName"].ToString().Trim() + "\" alt=\"查看 " + dt.Rows[i]["TreeName"].ToString().Trim() + "\">" + dt.Rows[i]["TreeName"].ToString().Trim() + "</a>";
                if (i < 4)
                {
                    ppRnd.Text += "&nbsp;<span class=\"headLine\">|</span>&nbsp;";
                }
            }
            dt.Dispose();
            ad468.Text = ad.getAdCode(0, 468, 60, 1, 0, true, string.Empty);

            long cidTemp = xc.SafeNum(Request.QueryString["id"]);
            if (cidTemp < 1)
            {
                string urlID = Page.RouteData.Values["cID"].ToString();
                urlID   = urlID.Replace(".htm", "");
                cidTemp = xc.SafeNum(urlID);
            }
            //Response.Write(cidTemp.ToString());
            listTop.Text = "<a href=\"" + cidTemp.ToString() + ".htm\" target=\"_top\">默认</a>";

            string ifStr     = string.Empty;
            string pageStr   = string.Empty;
            string searchStr = xc.SafeSql(Server.UrlDecode(Request["keyWord"]));
            string searchIf  = string.Empty;
            string orderBy   = " Order By isGood desc,volume DESC";
            long   sale      = xc.SafeNum(Request.QueryString["sale"]);
            if (sale > 0)
            {
                listTop.Text += "&nbsp;&nbsp;<a href=\"" + cidTemp.ToString() + ".htm?sale=1\" style=\"color:#cb0201; font-weight:bold;\" target=\"_top\">销售</a>";
                orderBy       = " Order By volume DESC";
                pageStr      += "&sale=1";
            }
            else
            {
                listTop.Text += "&nbsp;&nbsp;<a href=\"" + cidTemp.ToString() + ".htm?sale=1\" target=\"_top\">销售</a>";
            }
            long price = xc.SafeNum(Request.QueryString["price"]);
            if (price > 0)
            {
                listTop.Text += "&nbsp;&nbsp;<a href=\"" + cidTemp.ToString() + ".htm?price=1\" style=\"color:#cb0201; font-weight:bold;\" target=\"_top\">价格</a>";
                orderBy       = " Order By price ASC";
                pageStr      += "&price=1";
            }
            else
            {
                listTop.Text += "&nbsp;&nbsp;<a href=\"" + cidTemp.ToString() + ".htm?price=1\" target=\"_top\">价格</a>";
            }

            navClass.Text = xClass.getClass(cidTemp, "*.htm", "");

            if (!string.IsNullOrEmpty(searchStr as string))
            {
                if (xc.SafeNum(searchStr) > 0)
                {
                    searchIf = " and num_iid=" + searchStr;
                }
                else
                {
                    searchIf = " and title like '%" + searchStr + "%'";
                }

                searchWord.Text = HttpUtility.HtmlEncode(searchStr);
                pageStr         = "&keyWord=" + Server.UrlEncode(searchStr);

                classNav      = "搜索结果";
                navClass.Text = classNav;
            }

            dt = db.getDataTable("select Tid,TreeID,treeNameTxt,idLayerStr from newsTree where Tid=" + cidTemp.ToString());
            if (dt.Rows.Count > 0)
            {
                string tID    = dt.Rows[0]["Tid"].ToString().Trim();
                string treeID = dt.Rows[0]["TreeID"].ToString().Trim();
                classNav = dt.Rows[0]["treeNameTxt"].ToString().Trim();

                //读取二级分类
                string id = dt.Rows[0]["idLayerStr"].ToString().Trim();
                if (!string.IsNullOrEmpty(id as string))
                {
                    string[] bigID = id.Split(new char[] { '|' });
                    id = bigID[1];
                }
                else
                {
                    id = cidTemp.ToString();
                }
                dt = db.getDataTable("select Tid,TreeName from NewsTree where TreeID=" + id + " order by ListID ASC,Tid ASC");
                for (int l = 0; l < dt.Rows.Count; l++)
                {
                    string css     = string.Empty;
                    long   tidTree = xc.SafeNum(dt.Rows[l]["Tid"].ToString().Trim());
                    if (tidTree == cidTemp || classNav.IndexOf(dt.Rows[l]["TreeName"].ToString().Trim() + "&nbsp;") > -1)
                    {
                        css = " style=\"color:#cb0201; font-weight:bold;\"";
                    }
                    navList.Text += "<a href=\"" + tidTree.ToString() + ".htm\" target=\"_top\" " + css + ">" + dt.Rows[l]["TreeName"].ToString().Trim() + "</a>&nbsp;&nbsp;";
                }
                dt.Dispose();

                //读取品牌
                ppClass.Text = "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"width:960px;\">";
                dt           = db.getDataTable("select Tid,TreeName from newsTree where taobaoKe<>'' and TreeID=" + treeID + " order by ListID ASC,Tid ASC");
                if (dt.Rows.Count > 0)
                {
                    for (int p = 0; p < dt.Rows.Count; p++)
                    {
                        if ((p + 1) % 6 == 1)
                        {
                            ppClass.Text += "<tr>";
                        }
                        string css     = string.Empty;
                        long   tidTree = xc.SafeNum(dt.Rows[p]["Tid"].ToString().Trim());
                        if (tidTree == cidTemp)
                        {
                            css = " style=\"color:#cb0201; font-weight:bold;\"";
                        }
                        ppClass.Text += "<td style=\"height:22px; line-height:22px; text-align:left; width:160px;\"><a href=\"" + tidTree.ToString() + ".htm\" target=\"_top\" " + css + ">" + dt.Rows[p]["TreeName"].ToString().Trim() + "</a></td>";
                        if ((p + 1) % 6 == 0)
                        {
                            ppClass.Text += "</tr>";
                        }
                    }
                }
                else
                {
                    dt = db.getDataTable("select Tid,TreeName from newsTree where taobaoKe<>'' and idLayerStr like '%|" + tID + "|%' order by ListID ASC,Tid ASC");
                    if (dt.Rows.Count > 0)
                    {
                        for (int p = 0; p < dt.Rows.Count; p++)
                        {
                            if ((p + 1) % 6 == 1)
                            {
                                ppClass.Text += "<tr>";
                            }
                            string css     = string.Empty;
                            long   tidTree = xc.SafeNum(dt.Rows[p]["Tid"].ToString().Trim());
                            if (tidTree == cidTemp)
                            {
                                css = " style=\"color:#cb0201; font-weight:bold;\"";
                            }
                            ppClass.Text += "<td style=\"height:22px; line-height:22px; text-align:left; width:160px;\"><a href=\"" + tidTree.ToString() + ".htm\" target=\"_top\" " + css + ">" + dt.Rows[p]["TreeName"].ToString().Trim() + "</a></td>";
                            if ((p + 1) % 6 == 0)
                            {
                                ppClass.Text += "</tr>";
                            }
                        }
                    }
                }
            }
            dt.Dispose();
            ppClass.Text += "</table>";

            //导航
            headMenu.Text = "<td valign=\"middle\" class=\"headBg1\"><a href=\"/\" target=\"_top\" class=\"head\">网站首页</a></td>";
            dt            = db.getDataTable("select Tid,TreeName from newsTree where TreeID=0 and TreeType='taobaoke' order by ListID ASC,Tid ASC");
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                string tid       = dt.Rows[i]["Tid"].ToString().Trim();
                string treeName  = dt.Rows[i]["TreeName"].ToString().Trim();
                string className = "headBg1";
                if (xc.SafeNum(tid) == cidTemp || classNav.IndexOf(treeName + "&nbsp;") > -1)
                {
                    className = "headBg2";
                }

                headMenu.Text += "<td valign=\"middle\" class=\"" + className + "\"><a href=\"/" + tid + ".htm\" target=\"_top\" class=\"head\">" + treeName + "</a></td>";
            }
            headMenu.Text += "<td valign=\"middle\" class=\"headBg1\"><a href=\"/huabao/default.htm\" target=\"_top\" class=\"head\">图搜画报</a></td><td valign=\"middle\" class=\"headBg1\"><a href=\"/huabao/\" target=\"_top\" class=\"head\">画报淘宝</a></td>";
            dt.Dispose();

            if (cidTemp > 0)
            {
                string cidStr = xClass.getClassAllID("taobaoke", cidTemp); //得到所有ID

                if (cidStr.IndexOf(",") > 0)
                {
                    string[] ids = cidStr.Split(new char[] { ',' });
                    for (int i = 0; i <= ids.GetUpperBound(0); i++)
                    {
                        ifStr += " select * from taobaoke where classID=" + ids[i].ToString().Trim() + searchIf + " union ";
                    }
                }
                else
                {
                    ifStr = " select * from taobaoke where classID=" + cidTemp.ToString().Trim() + searchIf + " union ";
                }
            }
            else
            {
                ifStr = " select * from taobaoke where isBad=1 " + searchIf + " union ";
            }

            ifStr = "(" + ifStr.Substring(0, ifStr.Length - 6) + ") as news";

            string strSql = "select top 3000 * from " + ifStr + orderBy;
            //Response.Write(strSql);
            //Response.End();
            lblCurrentPage.Text = db.RepeaterDB(RepeaterList, strSql, pageStr, 30, "page", "right", true);
            string[] inputStr = lblCurrentPage.Text.Replace("<!-- input -->", "@").Split(new char[] { '@' });
            pageTop.Text = inputStr[0] + "</tr></table>";
            if (this.RepeaterList.Items.Count < 1)
            {
                if (string.IsNullOrEmpty(searchStr as string))
                {
                    errInfo.Text   = "目前暂没有任何信息!";
                    errDiv.Visible = true;
                }
                else
                {
                    //即时搜索淘宝客显示商品
                    string     appkey             = XmlReader.GetConfig(Server.MapPath("~/xabara.config"), "taobaoKeAppKey");
                    string     appsecret          = XmlReader.GetConfig(Server.MapPath("~/xabara.config"), "taobaoKeAppSecret");
                    string     url                = XmlReader.GetConfig(Server.MapPath("~/xabara.config"), "taobaoKeUrl");
                    string     alimamaID          = XmlReader.GetConfig(Server.MapPath("~/xabara.config"), "taobaoKeAlimamaID"); //淘宝客推广ID
                    ITopClient client             = new DefaultTopClient(url, appkey, appsecret);
                    TaobaokeListurlGetRequest req = new TaobaokeListurlGetRequest();
                    req.Q    = searchStr;
                    req.Nick = alimamaID;
                    TaobaokeListurlGetResponse response = client.Execute(req);

                    Response.Redirect(response.TaobaokeItem.KeywordClickUrl, true);
                }
            }
            else
            {
                errDiv.Visible = false;
            }

            //热搜关键词
            string   hot     = XmlReader.GetConfig(Server.MapPath("~/xabara.config"), "hotSearch");
            string[] hotWord = hot.Split(new char[] { ',' });
            for (int h = 0; h <= hotWord.GetUpperBound(0); h++)
            {
                hotSearch.Text += "<a href=\"/search.htm?keyWord=" + Server.UrlEncode(hotWord[h]) + "\" target=\"_top\" title=\"搜索 " + hotWord[h] + "\">" + hotWord[h] + "</a>&nbsp;";
            }

            xc.webMeta(this.Page, XmlReader.GetConfig(Server.MapPath("~/xabara.config"), "KeyWord"), XmlReader.GetConfig(Server.MapPath("~/xabara.config"), "metaStr"));
        }

        this.Page.Title = classNav + " " + XmlReader.GetConfig(Server.MapPath("~/xabara.config"), "webName") + XmlReader.GetConfig(Server.MapPath("~/xabara.config"), "titleMeta");
    }
示例#4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        xc.CheckAdminLogin(string.Empty);

        if (!IsPostBack)
        {
            xClass.NewsTypeData("taobaoke", classID);

            string ifStr     = string.Empty;
            string pageStr   = string.Empty;
            string searchStr = Server.UrlDecode(Request["keyWord"]);
            string searchIf  = string.Empty;
            string orderBy   = " Order By id desc";
            long   sale      = xc.SafeNum(Request.QueryString["sale"]);
            if (sale > 0)
            {
                orderBy  = " Order By volume DESC";
                pageStr += "&sale=1";
            }

            if (!string.IsNullOrEmpty(searchStr as string))
            {
                if (xc.SafeNum(searchStr) > 0)
                {
                    searchIf = " and num_iid=" + searchStr;
                }
                else
                {
                    searchIf = " and title like '%" + searchStr + "%'";
                }

                searchWord.Text = searchStr;
                pageStr        += "&keyWord=" + searchStr;
            }

            //显示推荐商品
            long isGood = xc.SafeNum(Request.QueryString["isGood"]);
            if (isGood > 0 || this.goodCheck.Checked)
            {
                searchIf += " and isGood>0 ";

                pageStr += "&isGood=1";

                orderBy = " Order By volume DESC";

                this.goodCheck.Checked = true;
            }

            long ifGood = xc.SafeNum(Request.QueryString["ifGood"]);
            if (ifGood > 0) //建议推荐商品
            {
                searchIf += " and isGood<1 and commission>10 and volume>1 and classID>0 ";

                pageStr += "&ifGood=1";

                orderBy = " Order By volume DESC";
            }
            if (ifGood < 0) //建议取消推荐商品或删除商品
            {
                searchIf += " and volume<2 and isGood>0 ";

                pageStr += "&ifGood=-1";

                orderBy = " Order By commission ASC";
            }

            long isBad = xc.SafeNum(Request.QueryString["isBad"]);
            if (isBad > 0)  //无效信息列表
            {
                searchIf += " and isBad=0 ";

                pageStr += "&isBad=1";
            }

            long cidTemp = xc.SafeNum(Request.QueryString["cid"]);
            if (cidTemp > 0)
            {
                this.classID.Items.FindByValue(cidTemp.ToString()).Selected = true;
                pageStr += "&cid=" + cidTemp.ToString();
            }

            if (cidTemp > 0)
            {
                string cidStr = xClass.getClassAllID("taobaoke", cidTemp); //得到所有ID
                if (cidStr.IndexOf(",") > 0)
                {
                    string[] ids = cidStr.Split(new char[] { ',' });
                    for (int i = 0; i <= ids.GetUpperBound(0); i++)
                    {
                        ifStr += " select * from taobaoke where classID=" + ids[i].ToString().Trim() + searchIf + " union ";
                    }
                }
                else
                {
                    ifStr = " select * from taobaoke where classID=" + cidTemp.ToString().Trim() + searchIf + " union ";
                }
            }
            else
            {
                ifStr = " select * from taobaoke where 1=1 " + searchIf + " union ";
            }

            ifStr = "(" + ifStr.Substring(0, ifStr.Length - 6) + ") as news";

            string strSql = "select * from " + ifStr + orderBy;
            //Response.Write(strSql);
            //Response.End();
            lblCurrentPage.Text = db.RepeaterDB(RepeaterList, strSql, pageStr, 30, "page", "center", true);
            if (this.RepeaterList.Items.Count < 1)
            {
                errInfo.Text   = "目前暂没有任何信息!";
                errDiv.Visible = true;
            }
            else
            {
                errDiv.Visible = false;
            }
        }
    }
示例#5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        xc.CheckAdminLogin(string.Empty);

        if (!IsPostBack)
        {
            DataTable dt;
            dt = db.getDataTable("select * from posterChannelIDs order by id ASC");
            this.classID.DataSource     = dt.DefaultView;
            this.classID.DataTextField  = "channel_name";
            this.classID.DataValueField = "id";
            this.classID.DataBind();
            dt.Dispose();
            this.classID.Items.Add(new ListItem("== 分类 ==", ""));

            string ifStr     = string.Empty;
            string pageStr   = string.Empty;
            string searchStr = Server.UrlDecode(Request["keyWord"]);
            string searchIf  = string.Empty;
            string orderBy   = " Order By posterChannelTitle.tID desc";

            if (!string.IsNullOrEmpty(searchStr as string))
            {
                searchIf        = " and (posterChannelTitle.title like '%" + searchStr + "%' or posterChannelTitle.title_short like '%" + searchStr + "%' )";
                searchWord.Text = searchStr;
                pageStr        += "&keyWord=" + searchStr;
            }

            long isGood = xc.SafeNum(Request.QueryString["isGood"]);
            if (isGood > 0 || this.goodCheck.Checked)
            {
                searchIf += " and posterChannelTitle.weight>10000 ";

                pageStr += "&isGood=1";

                orderBy = " Order By posterChannelTitle.weight DESC";

                this.goodCheck.Checked = true;
            }

            long ifGood = xc.SafeNum(Request.QueryString["ifGood"]);
            if (ifGood > 0) //建议推荐商品
            {
                searchIf += " and weight<100 and hits>10000 and create_date>'" + DateTime.Now.AddDays(-7).ToString() + "' ";
                pageStr  += "&ifGood=1";
            }

            long cidTemp = xc.SafeNum(Request.QueryString["cid"]);
            if (cidTemp > 0)
            {
                ifStr += " and posterChannelTitle.channel_id=" + cidTemp.ToString();
                this.classID.Items.FindByValue(cidTemp.ToString()).Selected = true;
                pageStr += "&cid=" + cidTemp.ToString();
            }
            else
            {
                this.classID.Items.FindByText("== 分类 ==").Selected = true;
            }

            string strSql = "select * from posterChannelTitle left join posterChannelIDs on posterChannelTitle.channel_id=posterChannelIDs.id where  posterChannelTitle.flagID=1 " + ifStr + searchIf + orderBy;
            //Response.Write(strSql);
            //Response.End();
            lblCurrentPage.Text = db.RepeaterDB(RepeaterList, strSql, pageStr, 30, "page", "center", true);
            if (this.RepeaterList.Items.Count < 1)
            {
                errInfo.Text   = "目前暂没有任何信息!";
                errDiv.Visible = true;
            }
            else
            {
                errDiv.Visible = false;
            }
        }
    }
示例#6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string classNav = "淘画报 ";
        string title = classNav;
        string tag = classNav;

        if (!IsPostBack)
        {
            DataTable dt;
            long cidTemp = 0;

            dt = db.getDataTable("select top 5 Tid,TreeName from NewsTree where taobaoKe<>'' order by newid() ");
            for (int i = 0; i < 5; i++)
            {
                ppRnd.Text += "<a href=\"/" + dt.Rows[i]["Tid"].ToString().Trim() + ".htm\" target=\"_blank\" title=\"查看 " + dt.Rows[i]["TreeName"].ToString().Trim() + "\" alt=\"查看 " + dt.Rows[i]["TreeName"].ToString().Trim() + "\">" + dt.Rows[i]["TreeName"].ToString().Trim() + "</a>";
                if (i < 4)
                {
                    ppRnd.Text += "&nbsp;<span class=\"headLine\">|</span>&nbsp;";
                }
            }
            dt.Dispose();
            ad468.Text = ad.getAdCode(0, 468, 60, 1, 0, true, string.Empty);

            long idTemp = xc.SafeNum(Request["id"]);
            if (idTemp < 1)
            {
                string urlID = Page.RouteData.Values["sID"].ToString();
                urlID = urlID.Replace(".htm", "");
                idTemp = xc.SafeNum(urlID);
            }

            dt = db.getDataTable("select channel_id,title,tag from posterChannelTitle where id=" + idTemp.ToString());
            if (dt.Rows.Count > 0)
            {
                cidTemp = xc.SafeNum(dt.Rows[0]["channel_id"].ToString().Trim());
                title = dt.Rows[0]["title"].ToString().Trim();
                titleName.Text = title;
                tag = dt.Rows[0]["tag"].ToString().Trim();
            }
            dt.Dispose();

            string strSql = "select * from taobaoKe left join posterTkID on taobaoKe.num_iid=posterTkID.tK_num_iid where taobaoKe.isBad>0 and posterTkID.title_id=" + idTemp.ToString() + " order by commission DESC,volume DESC";
            lblCurrentPage.Text = db.RepeaterDB(RepeaterList, strSql, "", 30, "page", "right", true);
            string[] inputStr = lblCurrentPage.Text.Replace("<!-- input -->", "@").Split(new char[] { '@' });
            pageTop.Text = inputStr[0] + "</tr></table>";            

            //淘品牌分类            
            dt = db.getDataTable("select * from posterChannelIDs where isFlag>0 order by id ASC");
            for (int l = 0; l < dt.Rows.Count; l++)
            {
                string css = string.Empty;
                long tidTree = xc.SafeNum(dt.Rows[l]["id"].ToString().Trim());
                if (tidTree == cidTemp)
                {
                    css = " style=\"color:#cb0201; font-weight:bold;\"";
                    classNav += dt.Rows[l]["channel_name"].ToString().Trim();
                }
                navList.Text += "<a href=\"/huabao/" + tidTree.ToString() + ".htm\" target=\"_top\" " + css + ">" + dt.Rows[l]["channel_name"].ToString().Trim() + "</a>&nbsp;&nbsp;";
            }
            dt.Dispose();

            navClass.Text = "淘画报";

            //导航
            headMenu.Text = "<td valign=\"middle\" class=\"headBg1\"><a href=\"/\" target=\"_top\" class=\"head\">网站首页</a></td>";
            dt = db.getDataTable("select Tid,TreeName from newsTree where TreeID=0 and TreeType='taobaoke' order by ListID ASC,Tid ASC");
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                string tid = dt.Rows[i]["Tid"].ToString().Trim();
                string treeName = dt.Rows[i]["TreeName"].ToString().Trim();
                string className = "headBg1";

                headMenu.Text += "<td valign=\"middle\" class=\"" + className + "\"><a href=\"/" + tid + ".htm\" target=\"_top\" class=\"head\">" + treeName + "</a></td>";
            }
            headMenu.Text += "<td valign=\"middle\" class=\"headBg2\"><a href=\"/huabao/default.htm\" target=\"_top\" class=\"head\">图搜画报</a></td><td valign=\"middle\" class=\"headBg1\"><a href=\"/huabao/\" target=\"_top\" class=\"head\">画报淘宝</a></td>";
            dt.Dispose();

            //热搜关键词
            string hot = XmlReader.GetConfig(Server.MapPath("~/xabara.config"), "hotSearch");
            string[] hotWord = hot.Split(new char[] { ',' });
            for (int h = 0; h <= hotWord.GetUpperBound(0); h++)
            {
                hotSearch.Text += "<a href=\"/search.htm?keyWord=" + Server.UrlEncode(hotWord[h]) + "\" target=\"_top\" title=\"搜索 " + hotWord[h] + "\">" + hotWord[h] + "</a>&nbsp;";
            }

            xc.webMeta(this.Page, tag, title);
        }

        this.Page.Title = title + " " + XmlReader.GetConfig(Server.MapPath("~/xabara.config"), "webName") + XmlReader.GetConfig(Server.MapPath("~/xabara.config"), "titleMeta");
    }