Ejemplo n.º 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        xc.CheckAdminLogin("|" + typeClss + "|");
        if (!IsPostBack)
        {
            xClass.NewsTypeData(typeClss, DropDownListClass);
            classListName.Visible = true;
            classListName.Text    = "如需排序,请选择带有子级分类的父分类并点击 显示所选分类排序 按钮!";
            xClass.getTreeList(typeClss, treeList, string.Empty, "top", false, true, false);

            titleClass.Text = Server.UrlDecode(titleTemp);

            DataTable dt = db.getDataTable("select Tid from newsTree where treeNameTxt is null");
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                long cid = xc.SafeNum(dt.Rows[i]["Tid"].ToString().Trim());
                xClass.treeNameUpdate(cid);
                xClass.updateIDs(typeClss, cid);
            }
            dt.Dispose();

            FormCheck fCheck = new FormCheck();
            classUrlRegExpre.ValidationExpression = fCheck.RegExpressionValidator("urlHttp", 0, 0, false);
            classUrlRegExpre.ErrorMessage         = fCheck.RegExpressionValidator("urlHttp", 0, 0, true);
        }
    }
Ejemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        XabaraCom      xc = new XabaraCom();
        dbDataFunction db = new dbDataFunction();

        if (!IsPostBack)
        {
            long adSize = xc.SafeNum(Request.QueryString["size"]);
            if (adSize < 1)
            {
                adSize = 300;
            }
            double topSql = Math.Ceiling(adSize / 37.5);
            if (topSql % 2 == 1)
            {
                topSql -= 1;
            }
            adSize    = adSize - 2;
            adSizeStr = adSize.ToString();

            string f = Request.QueryString["f"];
            if (!string.IsNullOrEmpty(f as string))
            {
                fontColor = f;
            }
            string c = Request.QueryString["c"];
            if (!string.IsNullOrEmpty(c as string))
            {
                bgColor = c;
            }
            string a = Request.QueryString["a"];
            if (!string.IsNullOrEmpty(a as string))
            {
                alpha = a;
            }

            string    strSql = "select top " + topSql.ToString() + " * from (select title,nick,pic_url,price,click_url,shop_click_url from taobaoKe where isBad>0 and commission>0 and isGood>0) as newGood order by newid()";
            DataTable dt     = db.getDataTable(strSql);
            if (dt.Rows.Count < 1)
            {
                strSql = "select top " + topSql.ToString() + " * from (select top 100 title,nick,pic_url,price,click_url,shop_click_url from taobaoKe where isBad>0 and commission>0 order by volume DESC) as news order by newid()";
                dt     = db.getDataTable(strSql);
            }
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                string pic = dt.Rows[i]["pic_url"].ToString().Trim() + "_310x310.jpg";
                kinSlideshow.Text += "<a href=\"" + dt.Rows[i]["click_url"].ToString().Trim() + "\" target=\"_blank\"><img src=\"" + pic + "\" style=\"height:" + adSizeStr + "px; width:" + adSizeStr + "px;\" alt=\"" + dt.Rows[i]["title"].ToString().Trim() + "\" title=\"" + dt.Rows[i]["title"].ToString().Trim() + "\" /></a>";
            }
            dt.Dispose();
        }
    }
Ejemplo n.º 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        XabaraCom xc=new XabaraCom();
        dbDataFunction db = new dbDataFunction();

        if (!IsPostBack)
        {
            long adSize = xc.SafeNum(Request.QueryString["size"]);
            if (adSize < 1)
            {
                adSize = 300;
            }
            double topSql = Math.Ceiling(adSize / 37.5);
            if (topSql % 2 == 1)
            {
                topSql -= 1;
            }
            adSize = adSize - 2;
            adSizeStr = adSize.ToString();

            string f = Request.QueryString["f"];
            if (!string.IsNullOrEmpty(f as string))
            {
                fontColor = f;
            }
            string c = Request.QueryString["c"];
            if (!string.IsNullOrEmpty(c as string))
            {
                bgColor = c;
            }
            string a = Request.QueryString["a"];
            if (!string.IsNullOrEmpty(a as string))
            {
                alpha = a;
            }

            string strSql = "select top " + topSql.ToString() + " * from (select title,nick,pic_url,price,click_url,shop_click_url from taobaoKe where isBad>0 and commission>0 and isGood>0) as newGood order by newid()";
            DataTable dt = db.getDataTable(strSql);
            if (dt.Rows.Count < 1)
            {
                strSql = "select top " + topSql.ToString() + " * from (select top 100 title,nick,pic_url,price,click_url,shop_click_url from taobaoKe where isBad>0 and commission>0 order by volume DESC) as news order by newid()";
                dt = db.getDataTable(strSql);
            }
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                string pic = dt.Rows[i]["pic_url"].ToString().Trim() + "_310x310.jpg";
                kinSlideshow.Text += "<a href=\"" + dt.Rows[i]["click_url"].ToString().Trim() + "\" target=\"_blank\"><img src=\"" + pic + "\" style=\"height:" + adSizeStr + "px; width:" + adSizeStr + "px;\" alt=\"" + dt.Rows[i]["title"].ToString().Trim() + "\" title=\"" + dt.Rows[i]["title"].ToString().Trim() + "\" /></a>";
            }
            dt.Dispose();
        }
    }
Ejemplo n.º 4
0
    protected void waterImgButton_Click(object sender, EventArgs e)
    {
        if (waterImgFileUpload.HasFile)    //本地上传
        {
            string uploadFloderImg = "/images/";
            if (!Directory.Exists(Server.MapPath(uploadFloderImg))) //判断上传目录是否存在
            {
                Directory.CreateDirectory(Server.MapPath(uploadFloderImg));
            }

            string fileName = waterImgFileUpload.PostedFile.FileName.ToLower();
            if (fileName == string.Empty || fileName == null)
            {
                xc.divError("", "请选择文件后再上传!", 350, 150, "", "");
            }

            string fileExe    = fileName.Substring(fileName.LastIndexOf(".") + 1);                                   //取后缀名
            long   UploadSize = xc.SafeNum(XmlReader.GetConfig(Server.MapPath("~/xabara.config"), "UploadImgSize")); //上传大小
            if (!fileExe.Equals("png"))                                                                              //判断该扩展名是否合法
            {
                xc.divError("", "请选择一张png格式的透明背景水印图!", 350, 150, "", "");
            }

            if (waterImgFileUpload.PostedFile.ContentLength > UploadSize) // 判断上传文件大小是否超过最大值
            {
                xc.divError("", "目前支持大小:" + Convert.ToString(UploadSize / 1048576) + "MB<br />当前大小为:" + Convert.ToString(waterImgFileUpload.PostedFile.ContentLength / 1048576) + "MB", 350, 150, "", "");
            }

            string UploadTemp = HttpContext.Current.Server.MapPath(@uploadFloderImg + "WaterMark.png");
            waterImgFileUpload.PostedFile.SaveAs(UploadTemp); //保存水印图片
            xc.divError("", "更换水印文件成功!", 350, 150, "", "");
        }
        else
        {
            xc.divError("", "请选择文件后再上传!", 350, 150, "", "");
        }
    }
Ejemplo n.º 5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        XabaraCom      xc    = new XabaraCom();
        dbDataFunction db    = new dbDataFunction();
        string         title = "找店铺 ZDianPU.com";

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

            DataTable dt = db.getDataTable("select title,pic_url,click_url from taobaoKe where num_iid=" + idTemp.ToString());
            if (dt.Rows.Count > 0)
            {
                title                  = dt.Rows[0]["title"].ToString().Trim();
                linkWebName.Text       = title;
                urlStr                 = dt.Rows[0]["click_url"].ToString().Trim();
                img.Text               = "<a href=\"" + urlStr + "\"><img id=\"imgshow\" src=\"" + dt.Rows[0]["pic_url"].ToString().Trim() + "\" style=\"width:350px; height:350px;\" title=\"" + title + "\" alt=\"" + title + "\" /></a>";
                linkWebUrl.NavigateUrl = urlStr;
            }
            else
            {
                Response.Redirect("http://s.click.taobao.com/t_9?p=mm_14288563_0_0&l=http%3A%2F%2Fwww.tmall.com", true);
            }
            dt.Dispose();

            xc.webMeta(Page, title, XmlReader.GetConfig(Server.MapPath("~/xabara.config"), "metaStr"));
            countStr.Text = XmlReader.GetConfig(Server.MapPath("~/xabara.config"), "countScript");
        }

        this.Page.Title = title + XmlReader.GetConfig(Server.MapPath("~/xabara.config"), "webName") + XmlReader.GetConfig(Server.MapPath("~/xabara.config"), "titleMeta");
    }
Ejemplo n.º 6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        XabaraCom xc = new XabaraCom();
        dbDataFunction db = new dbDataFunction();
        string title = "找店铺 ZDianPU.com";

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

            DataTable dt = db.getDataTable("select title,pic_url,click_url from taobaoKe where num_iid=" + idTemp.ToString());
            if (dt.Rows.Count > 0)
            {
                title = dt.Rows[0]["title"].ToString().Trim();
                linkWebName.Text = title;
                urlStr = dt.Rows[0]["click_url"].ToString().Trim();
                img.Text = "<a href=\"" + urlStr + "\"><img id=\"imgshow\" src=\"" + dt.Rows[0]["pic_url"].ToString().Trim() + "\" style=\"width:350px; height:350px;\" title=\"" + title + "\" alt=\"" + title + "\" /></a>";
                linkWebUrl.NavigateUrl = urlStr;
            }
            else
            {
                Response.Redirect("http://s.click.taobao.com/t_9?p=mm_14288563_0_0&l=http%3A%2F%2Fwww.tmall.com", true);
            }
            dt.Dispose();

            xc.webMeta(Page, title, XmlReader.GetConfig(Server.MapPath("~/xabara.config"), "metaStr"));
            countStr.Text = XmlReader.GetConfig(Server.MapPath("~/xabara.config"), "countScript");
        }

        this.Page.Title = title + XmlReader.GetConfig(Server.MapPath("~/xabara.config"), "webName") + XmlReader.GetConfig(Server.MapPath("~/xabara.config"), "titleMeta");
    }
Ejemplo n.º 7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        XabaraCom xc = new XabaraCom();
        xc.CheckAdminLogin("|adsDel|");

        dbDataFunction db = new dbDataFunction();
        string returnValue = string.Empty;

        long idTemp = xc.SafeNum(Request["id"].Trim());

        returnValue = db.DelDB("ads", "aID", xc.SafeSql(Request["id"].Trim()).ToString(), string.Empty, false, "adImg");

        xc.insertMyLog(xc.adminID, "admin", "删除广告");

        xc.divError("", returnValue, 350, 150, Server.UrlDecode(xc.errorUrlTwo), "goto");
    }
Ejemplo n.º 8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        XabaraCom xc = new XabaraCom();

        xc.CheckAdminLogin("|adsDel|");

        dbDataFunction db          = new dbDataFunction();
        string         returnValue = string.Empty;

        long idTemp = xc.SafeNum(Request["id"].Trim());

        returnValue = db.DelDB("ads", "aID", xc.SafeSql(Request["id"].Trim()).ToString(), string.Empty, false, "adImg");

        xc.insertMyLog(xc.adminID, "admin", "删除广告");

        xc.divError("", returnValue, 350, 150, Server.UrlDecode(xc.errorUrlTwo), "goto");
    }
Ejemplo n.º 9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        xc.CheckAdminLogin(string.Empty);

        long   cidTemp    = xc.SafeNum(Request["cid"]);
        string strSql     = string.Empty;
        string ifStr      = string.Empty;
        string keyWordStr = xc.SafeSql(Server.UrlDecode(Request["keyWords"]));

        if (!IsPostBack)
        {
            xClass.NewsTypeData("department", classList);

            if (cidTemp > 0) //分类读取
            {
                string idNums = xClass.getClassAllID("department", cidTemp);

                if (!idNums.Equals(cidTemp.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=" + cidTemp.ToString().Trim();
                }
                this.classList.Items.FindByValue(cidTemp.ToString()).Selected = true;
            }
            if (!string.IsNullOrEmpty(keyWordStr as string))
            {
                ifStr       += " and (UserName like '%" + keyWordStr + "%' or UserId like '%" + keyWordStr + "%') ";
                keyWord.Text = keyWordStr;
            }
            strSql = "select * from AdminUser where classID>0 " + ifStr + " Order By LoginDate desc";
            //Response.Write(strSql);

            lblCurrentPage.Text = new dbDataFunction().RepeaterDB(RepeaterList, strSql, "&keyWords=" + keyWordStr, 20, "page", "center", true);
        }
    }
Ejemplo n.º 10
0
    protected void imgLogin_Click(object sender, ImageClickEventArgs e)
    {
        string uid    = UID.Text.Trim().ToLower().ToString();
        string pw     = xc.GetMd5(PW.Text.ToString());
        string strSql = "select * from AdminUser where userID='" + uid + "' and UserPW='" + pw + "' and loginFlag=2 ";

        DataTable dt = db.getDataTable(strSql);

        if (dt.Rows.Count < 1)
        {
            xc.divError("登陆提示", "您的帐号或密码不正确!", 350, 150, xc.AdminFileName, "top");
        }
        else
        {
            long   lgNums  = xc.SafeNum(dt.Rows[0]["LoginNum"].ToString()) + 1;
            string strDim  = "@SessionError,@LoginNum,@LoginDate,@LoginIP";
            string rndNums = xc.GetRnd("abc", 8);
            Session.Add("AdminRndNums", rndNums);

            string[] strValue = new string[5];
            strValue[0] = xc.GetMd5(rndNums);
            strValue[1] = lgNums.ToString();
            strValue[2] = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            strValue[3] = xc.GetIP();
            db.InsertUpdateDB("AdminUser", strDim, strValue, "userID='" + uid + "'");

            xc.insertMyLog(uid, "admin", "管理员登录");

            HttpCookie XabaraAdminCookies = new HttpCookie("XabaraAdmin");      //cookies写入磁盘
            XabaraAdminCookies.Values.Add("AdminID", uid);
            XabaraAdminCookies.Values.Add("AdminName", HttpUtility.UrlEncode(dt.Rows[0]["UserName"].ToString().Trim()));
            XabaraAdminCookies.Values.Add("AdminLgNums", lgNums.ToString());
            XabaraAdminCookies.Values.Add("AdminLgDate", dt.Rows[0]["LoginDate"].ToString().Trim());
            XabaraAdminCookies.Values.Add("AdminLgIP", dt.Rows[0]["LoginIP"].ToString().Trim());
            XabaraAdminCookies.Expires = DateTime.Now.AddDays(15d);
            Response.Cookies.Add(XabaraAdminCookies);

            dt.Dispose();
            Response.Redirect("admin.aspx", true);
        }
    }
Ejemplo n.º 11
0
    protected void Page_Load(object sender, EventArgs e)
    {
        XabaraCom xc = new XabaraCom();
        dbDataFunction db = new dbDataFunction();
        XabaraClass xClass = new XabaraClass();

        xc.CheckAdminLogin("");

        DataTable dt = db.getDataTable("select Tid,TreeType from newsTree order by Tid");
        for (int i = 0; i < dt.Rows.Count; i++)
        {
            long cid = xc.SafeNum(dt.Rows[i]["Tid"].ToString().Trim());
            xClass.treeNameUpdate(cid);
            xClass.updateID(dt.Rows[i]["TreeType"].ToString().Trim(), cid);

            Response.Write("正在更新第 " + cid.ToString() + " 条<br />");
            Response.Flush();
        }
        dt.Dispose();

        Response.Write("更新全站缓存完成!");
    }
Ejemplo n.º 12
0
    protected void Page_Load(object sender, EventArgs e)
    {
        XabaraCom xc = new XabaraCom();

        xc.CheckAdminLogin("|adminPW|");

        string idTemp = xc.SafeNum(Request["id"].Trim()).ToString();
        string dimStr = "@UserPW";
        string[] strValue = new string[1];
        string strVlaueTemp = xc.GetRnd("abc", 1) + xc.GetRnd("abc123", 7).ToLower();
        strValue[0] = xc.GetMd5(strVlaueTemp).ToString();

        if (new dbDataFunction().InsertUpdateDB("AdminUser", dimStr, strValue, "Uid=" + idTemp + " and UserId<>'" + xc.adminID + "'").Equals("更新成功"))
        {
            xc.insertMyLog(xc.adminID, "admin", "管理员密码初始化");
            xc.divError("", "新密码:" + strVlaueTemp, 350, 150, "userList.aspx", "goto");
        }
        else
        {
            xc.divError("", "不能给自己密码初始化或操作错误!", 350, 150, "userList.aspx", "goto");
        }
    }
Ejemplo n.º 13
0
    protected void Page_Load(object sender, EventArgs e)
    {
        XabaraCom      xc     = new XabaraCom();
        dbDataFunction db     = new dbDataFunction();
        XabaraClass    xClass = new XabaraClass();

        xc.CheckAdminLogin("");

        DataTable dt = db.getDataTable("select Tid,TreeType from newsTree order by Tid");

        for (int i = 0; i < dt.Rows.Count; i++)
        {
            long cid = xc.SafeNum(dt.Rows[i]["Tid"].ToString().Trim());
            xClass.treeNameUpdate(cid);
            xClass.updateID(dt.Rows[i]["TreeType"].ToString().Trim(), cid);

            Response.Write("正在更新第 " + cid.ToString() + " 条<br />");
            Response.Flush();
        }
        dt.Dispose();

        Response.Write("更新全站缓存完成!");
    }
Ejemplo n.º 14
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);
        }
    }
Ejemplo n.º 15
0
    protected void Page_Load(object sender, EventArgs e)
    {
        XabaraCom xc = new XabaraCom();

        xc.CheckAdminLogin("|adminPW|");

        string idTemp = xc.SafeNum(Request["id"].Trim()).ToString();
        string dimStr = "@UserPW";

        string[] strValue     = new string[1];
        string   strVlaueTemp = xc.GetRnd("abc", 1) + xc.GetRnd("abc123", 7).ToLower();

        strValue[0] = xc.GetMd5(strVlaueTemp).ToString();

        if (new dbDataFunction().InsertUpdateDB("AdminUser", dimStr, strValue, "Uid=" + idTemp + " and UserId<>'" + xc.adminID + "'").Equals("更新成功"))
        {
            xc.insertMyLog(xc.adminID, "admin", "管理员密码初始化");
            xc.divError("", "新密码:" + strVlaueTemp, 350, 150, "userList.aspx", "goto");
        }
        else
        {
            xc.divError("", "不能给自己密码初始化或操作错误!", 350, 150, "userList.aspx", "goto");
        }
    }
Ejemplo n.º 16
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");
    }
Ejemplo n.º 17
0
    protected void Page_Load(object sender, EventArgs e)
    {
        xc.CheckAdminLogin(string.Empty);

        if (!Page.IsPostBack)
        {
            //自动升级
            long updateID = xc.SafeNum(Request.QueryString["update"]);
            if (updateID > 0)
            {
                xc.autoUpdate();
            }

            string   soft     = ed.softName();
            string[] softName = soft.Split(new char[] { '_' });
            soft = softName[0];

            //检查版本
            string oldVer = "v1.12.0330";
            xc.xmlSave("webVer", oldVer); //自动更新版本号
            string newVer = xc.getRomoteHtmCode("http://www.zdianpu.com/api/ver/?id=" + ed.softName(), "utf-8", "", "");
            if (string.IsNullOrEmpty(newVer as string) || newVer.IndexOf("zdianpu.com") > 0)
            {
                ver.Text = "当前版本:" + oldVer;
            }
            else
            {
                if (oldVer.Equals(newVer))
                {
                    ver.Text = "当前版本:" + oldVer + "<br />您已经是最新版本!";
                }
                else
                {
                    ver.Text = "当前版本:" + oldVer + "<br />最新版本:<span style=\"color:#b60202; font-weight:bold;\">" + newVer + "</span> 【<a href=\"http://www.zdianpu.com/soft/" + soft + "/\" target=\"_blank\" style=\"font-weight:bold;\">手工升级</a>】【<a href=\"main.aspx?update=1\" style=\"font-weight:bold;\">在线升级</a>】";
                }
            }
            buyLink.NavigateUrl = "http://www.zdianpu.com/soft/" + soft + "/server.aspx";

            adminLog.DataSource = db.getDataTable("select top 6 * from logLogin where userType='admin' and  exeTitle='管理员登录' order by id desc");
            adminLog.DataBind();
            adminLog.Dispose();

            serverIP.Text    = Request.ServerVariables["LOCAL_ADDR"] + ":" + Request.ServerVariables["Server_Port"].ToString();
            ServerOS.Text    = Environment.OSVersion.ToString();
            ServerOSVer.Text = xc.os(Environment.OSVersion.ToString());
            ServerSoft.Text  = Request.ServerVariables["SERVER_SOFTWARE"];
            netVer.Text      = Environment.Version.ToString();
            ServerPath.Text  = Request.ServerVariables["PATH_TRANSLATED"];
            serverTime.Text  = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            sqlVer.Text      = db.sqlVer();

            string infoTxt = "";
            infoTxt += "<li style=\"line-height:200%; padding:2px 0px 2px 5px;\">统计离上次登录网站信息情况</li><li style=\"line-height:200%; background-color:#e9f8fc; padding:2px 0px 2px 5px;\">共有 ";

            DataTable dt;
            dt       = db.getDataTable("select count(Tid) as nums from newsTree where taobaoKe<>''");
            infoTxt += dt.Rows[0]["nums"].ToString().Trim() + " 个店铺关联信息&nbsp;&nbsp;<a href=\"../shop/taobao.aspx\" target=\"mainFrame\" style=\"color:red;\">自动更新</a></li><li style=\"line-height:200%; padding:2px 0px 2px 5px;\">共有 ";
            dt.Dispose();

            dt       = db.getDataTable("select count(num_iid) as nums from taobaoKe where isBad>0");
            infoTxt += dt.Rows[0]["nums"].ToString().Trim() + " 条淘宝客有效信息</li><li style=\"line-height:200%; background-color:#e9f8fc; padding:2px 0px 2px 5px;\">共有 ";
            dt.Dispose();

            dt       = db.getDataTable("select count(num_iid) as nums from taobaoKe where isBad<1");
            infoTxt += dt.Rows[0]["nums"].ToString().Trim() + " 个淘宝客无效信息&nbsp;&nbsp;<a href=\"../shop/Default.aspx?isBad=1\" target=\"mainFrame\" style=\"color:red;\">查看</a>&nbsp;&nbsp;<a href=\"../shop/taobaoke.aspx\" target=\"mainFrame\" style=\"color:red;\">强制转换</a></li>";
            dt.Dispose();

            infoLJ.Text = infoTxt;
        }
    }
Ejemplo n.º 18
0
    protected void Page_Load(object sender, EventArgs e)
    {
        XabaraCom xc = new XabaraCom();
        dbDataFunction db = new dbDataFunction();
        xabaraAD ad = new xabaraAD();
        XabaraClass xClass = new XabaraClass();
        webPublic wp = new webPublic();

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

        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 adID = 116;

            vipCode.Text = "<div class=\"divWidth\"><a href=\"/278.htm\" target=\"_blank\"><img src=\"/ad/images/okitch_20120630.gif\" /></a></div><div class=\"height5px\"></div>";

            //淘画报
            dt = db.getDataTable("select top 5 id,title,title_short,cover_pic_url_h,cover_pic_url_w from posterChannelTitle where flagID>0 and weight>10000 and modified_date>'" + DateTime.Now.AddDays(-7) + "' order by newid()");
            if (dt.Rows.Count > 4)
            {
                HuaBaoLeft.Text = "<table cellspacing=\"0\" cellpadding=\"0\" style=\"border-width:0px;\"><tr>";
                string txtLink = string.Empty;
                for (int i = 0; i < 3; i++)
                {
                    HuaBaoLeft.Text += "<td style=\"text-align:center; width:190px;\"><a href=\"/huabao/show/" + dt.Rows[i]["id"].ToString().Trim() + ".htm\" target=\"_blank\"><img src=\"" + dt.Rows[i]["cover_pic_url_h"].ToString().Trim() + "\" class=\"picHuaBaoH\" alt=\"" + dt.Rows[i]["title"].ToString().Trim() + "\" title=\"" + dt.Rows[i]["title_short"].ToString().Trim() + "\" id=\"imghbh\" /></a></td>";

                    txtLink += "<td style=\"text-align:center; height:28px; line-height:28px;\"><a href=\"/huabao/show/" + dt.Rows[i]["id"].ToString().Trim() + ".htm\" target=\"_blank\" class=\"huabao\">" + dt.Rows[i]["title_short"].ToString().Trim() + "</a></td>";
                }
                HuaBaoLeft.Text += "</tr><tr>" + txtLink + "</tr></table>";

                HuaBaoRight.Text = "<table cellspacing=\"0\" cellpadding=\"0\" style=\"border-width:0px;\"><tr>";
                txtLink = string.Empty;
                for (int i = 3; i < 5; i++)
                {
                    HuaBaoRight.Text += "<td style=\"text-align:center; width:190px;\"><a href=\"/huabao/show/" + dt.Rows[i]["id"].ToString().Trim() + ".htm\" target=\"_blank\"><img src=\"" + dt.Rows[i]["cover_pic_url_w"].ToString().Trim() + "\" class=\"picHuaBaoW\" alt=\"" + dt.Rows[i]["title"].ToString().Trim() + "\" title=\"" + dt.Rows[i]["title_short"].ToString().Trim() + "\" id=\"imghbw\" /></a></td>";

                    txtLink += "<td style=\"text-align:center; height:32px; line-height:32px;\"><a href=\"/huabao/show/" + dt.Rows[i]["id"].ToString().Trim() + ".htm\" target=\"_blank\" class=\"huabao\">" + dt.Rows[i]["title_short"].ToString().Trim() + "</a></td>";
                }
                HuaBaoRight.Text += "</tr><tr>" + txtLink + "</tr><tr><td colspan=\"2\" style=\"padding-top:5px;\"><table align=\"center\" cellspacing=\"0\" cellpadding=\"0\" style=\"border-width:0px;width:98%;\"><tr><td style=\"text-align:left;\">" + ad.getAdCode(335, 0, 0, 3, 1, true, "") + "</td><td style=\"text-align:right;\">" + ad.getAdCode(334, 0, 0, 1, 0, true, "") + "</td></tr></table></td></tr></table>";
            }
            else
            {
                huabao.Visible = false;
            }
            dt.Dispose();

            //导航及产品
            headMenu.Text = "<td valign=\"middle\" class=\"headBg2\"><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();

                //广告代码
                adID += 1;
                string adCodeWidth = ad.getAdCode(adID, 0, 0, 1, 1, true, "");
                int shopNums = 12;   //每个版块读取商品数
                if (!string.IsNullOrEmpty(adCodeWidth as string))
                {
                    adCodeWidth = "<div class=\"divWidth\">" + adCodeWidth + "</div>";
                }
                string adCodeHeight = ad.getAdCode(adID + 8, 0, 0, 1, 1, true, "");
                if (string.IsNullOrEmpty(adCodeHeight as string))
                {
                    DataTable ppDt = db.getDataTable("select top 22 Tid,TreeName from NewsTree where taobaoKe<>'' and idLayerStr like '%|" + tid + "|%' order by listID ASC,Tid ASC ");
                    if (ppDt.Rows.Count > 0)
                    {
                        adCodeHeight = "<table cellspacing=\"0\" cellpadding=\"0\" style=\"width:100%;\" align=\"center\" class=\"indexTable\">";
                        for (int p = 0; p < ppDt.Rows.Count; p++)
                        {
                            adCodeHeight += "<tr><td><a href=\"/" + ppDt.Rows[p]["Tid"].ToString().Trim() + ".htm\" target=\"_blank\" title=\"查看 " + ppDt.Rows[p]["TreeName"].ToString().Trim() + "\" alt=\"查看 " + ppDt.Rows[p]["TreeName"].ToString().Trim() + "\" class=\"classID\">" + ppDt.Rows[p]["TreeName"].ToString().Trim() + "</a></td></tr>";
                        }
                        adCodeHeight += "<tr><td style=\"text-align:right;\"><a href=\"/" + tid + ".htm\" target=\"_blank\" title=\"更多 " + treeName + " 品牌\" alt=\"更多 " + treeName + " 品牌\" class=\"classID\">>> 更多品牌</a></td></tr></table>";
                    }
                    ppDt.Dispose();
                }
                else
                {
                    shopNums = 12;
                }

                //商品读取
                string shopHtm = string.Empty;
                string ifStr = string.Empty;
                string cidStr = xClass.getClassAllID("taobaoke", xc.SafeNum(tid)); //得到所有ID
                if (cidStr.IndexOf(",") > 0)
                {
                    string[] ids = cidStr.Split(new char[] { ',' });
                    int iiCount = ids.GetUpperBound(0);
                    int readTop = 1;
                    if (shopNums > iiCount-5)
                    {
                        readTop = 2;
                    }

                    for (int ii = 0; ii <= iiCount; ii++)
                    {
                        ifStr += " select top " + readTop.ToString() + " num_iid,title,pic_url,click_url,commission,price,volume from taobaoke where isBad>0 and isGood>0 and classID=" + ids[ii].ToString().Trim() + " order by volume DESC union ";
                    }
                }
                else
                {
                    ifStr = " select num_iid,title,pic_url,click_url,commission,price,volume from taobaoke where isBad>0 and isGood>0 and classID=" + tid + " union ";
                }
                ifStr = "(" + ifStr.Substring(0, ifStr.Length - 6) + ") as news";

                string strSql = "select top " + shopNums.ToString() + " * from " + ifStr + " Order By newid()";
                DataTable dtShop = db.getDataTable(strSql);
                //Response.Write(strSql);
                //Response.End();
                shopHtm = string.Empty;
                for (int s = 0; s < dtShop.Rows.Count; s++)
                {
                    shopHtm += "<td valign=\"top\" style=\"border-style: none solid solid none; border-width: 1px; border-color: #323232; text-align:center; width:200px;\"><a class=\"moneyLink\" href=\"/show/" + dtShop.Rows[s]["num_iid"].ToString().Trim() + ".htm\" target=\"_blank\" alt=\"" + dtShop.Rows[s]["title"].ToString().Trim() + "\" title=\"" + dtShop.Rows[s]["title"].ToString().Trim() + "\"><div style=\"position:absolute;\"><ul><li style=\"height:168px;\"></li><li class=\"moneyFont\" style=\"background-color:#323232; filter:Alpha(opacity=30);opacity:0.3; text-align:right; padding:5px; width:190px; color:#b8b8b8;\">" + xc.getMoney(dtShop.Rows[s]["price"].ToString().Trim()) + "</li></ul></div><img id=\"imgshow\" src=\"" + dtShop.Rows[s]["pic_url"].ToString().Trim() + "_310x310.jpg\" style=\"height:200px; width:200px;\" alt=\"" + dtShop.Rows[s]["title"].ToString().Trim() + "\" title=\"" + dtShop.Rows[s]["title"].ToString().Trim() + "\" /></a></td>";

                    if (s == 3 || s == 7)
                    {
                        shopHtm += "</tr><tr>";
                    }
                }
                dtShop.Dispose();

                headMenu.Text += "<td valign=\"middle\" class=\"headBg1\"><a href=\"/" + tid + ".htm\" target=\"_top\" class=\"head\">" + treeName + "</a></td>";
                //产品二级分类
                string class2 = "<span class=\"headLine\">|</span>&nbsp;";
                DataTable dtClass = db.getDataTable("select Tid,TreeName from newsTree where TreeID=" + tid + " and TreeType='taobaoke' order by ListID ASC,Tid ASC");
                for (int c = 0; c < dtClass.Rows.Count; c++)
                {
                    string classID = dtClass.Rows[c]["Tid"].ToString().Trim();
                    string className = dtClass.Rows[c]["TreeName"].ToString().Trim();
                    class2 += "<a href=\"/" + dtClass.Rows[c]["Tid"].ToString().Trim() + ".htm\" target=\"_blank\" title=\"查看 " + className + "\" alt=\"查看 " + className + "\">" + className + "</a>&nbsp;<span class=\"headLine\">|</span>&nbsp;";
                }
                dtClass.Dispose();

                shopList.Text += adCodeWidth;
                shopList.Text += "<div class=\"height5px\"></div>";
                shopList.Text += "<div class=\"divWidth\"><table cellspacing=\"0\" cellpadding=\"0\" style=\"border-width:0px; border-collapse:collapse; height:26px; width:100%;\"><tr><td style=\"width:125px; text-align:left;\"><img src=\"images/class" + tid + ".gif\" alt=\"" + treeName + "\" title=\"" + treeName + "\" /></td><td style=\"text-align:right; vertical-align:bottom; width:807px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;\">" + class2 + "</td><td style=\"text-align:right; vertical-align:bottom; width:38px;\"><a href=\"/" + tid + ".htm\" target=\"_top\"><img src=\"images/more.gif\" alt=\"更多 " + treeName + "\" title=\"更多 " + treeName + "\" /></a></td></tr></table></div>";
                shopList.Text += "<div class=\"divWidth\" style=\"height:2px; background-color:Black; font-size:0px;\"></div>";
                shopList.Text += "<div class=\"divWidth\"><table cellspacing=\"0\" cellpadding=\"0\"><tr><td valign=\"top\" style=\"background-color:#323232; width:166px; text-align:center;\" rowspan=\"3\">" + adCodeHeight + "</td>" + shopHtm + "</tr></table></div>";
            }
            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();

            //热搜关键词
            string hot = XmlReader.GetConfig(HttpContext.Current.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;";
            }

            this.Page.MetaKeywords = XmlReader.GetConfig(Server.MapPath("~/xabara.config"), "KeyWord");
            this.Page.MetaDescription = XmlReader.GetConfig(Server.MapPath("~/xabara.config"), "metaStr");
        }
    }
Ejemplo n.º 19
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");
    }
Ejemplo n.º 20
0
    protected void Page_Load(object sender, EventArgs e)
    {
        xc.CheckAdminLogin("|adsEdit|");

        if (!IsPostBack)
        {
            FormCheck fCheck = new FormCheck();
            pdateRegExpree.ValidationExpression = fCheck.RegExpressionValidator("dateTime", 0, 0, false);
            pdateRegExpree.ErrorMessage         = fCheck.RegExpressionValidator("dateTime", 0, 0, true);
            eDateRegExpree.ValidationExpression = fCheck.RegExpressionValidator("dateTime", 0, 0, false);
            eDateRegExpree.ErrorMessage         = fCheck.RegExpressionValidator("dateTime", 0, 0, true);
            httpRegExpree.ValidationExpression  = fCheck.RegExpressionValidator("urlHttp", 0, 0, false);
            httpRegExpree.ErrorMessage          = fCheck.RegExpressionValidator("urlHttp", 0, 0, true);
            wRegExpree.ValidationExpression     = fCheck.RegExpressionValidator("number", 0, 0, false);
            wRegExpree.ErrorMessage             = "宽度" + fCheck.RegExpressionValidator("number", 0, 0, true);
            hRegExpree.ValidationExpression     = fCheck.RegExpressionValidator("number", 0, 0, false);
            hRegExpree.ErrorMessage             = "高度" + fCheck.RegExpressionValidator("number", 0, 0, true);

            XabaraClass xClass = new XabaraClass();
            xClass.NewsTypeData("ads", adClass);

            string img = XmlReader.GetConfig(Server.MapPath("~/xabara.config"), "UploadImgType");
            this.adImg.Items.Add(new ListItem(img, "Img"));
            string flash = XmlReader.GetConfig(Server.MapPath("~/xabara.config"), "UploadFlashType");
            this.adImg.Items.Add(new ListItem(flash, "Flash"));
            this.adImg.Items.Add(new ListItem("广告代码", "Code"));

            DataTable dt = db.getDataTable("select * from ads where aID=" + xc.SafeNum(Request["id"]).ToString());
            if (dt.Rows.Count > 0)
            {
                this.adClass.Items.FindByValue(dt.Rows[0]["classID"].ToString().Trim()).Selected = true;
                string fileName = dt.Rows[0]["adImg"].ToString().Trim();
                upImg.Value = fileName;
                if (!string.IsNullOrEmpty(fileName as string))
                {
                    string fileExe = fileName.Substring(fileName.Length - 3);
                    if (img.IndexOf(fileExe) > -1)
                    {
                        this.adImg.Items.FindByValue("Img").Selected = true;
                    }
                    else
                    {
                        this.adImg.Items.FindByValue("Flash").Selected = true;
                    }
                }
                else
                {
                    this.adImg.Items.FindByValue("Code").Selected = true;
                }

                adW.Text       = dt.Rows[0]["adW"].ToString().Trim();
                adH.Text       = dt.Rows[0]["adH"].ToString().Trim();
                adHttp.Text    = dt.Rows[0]["adHttp"].ToString().Trim();
                adCode.Text    = dt.Rows[0]["adCode"].ToString().Trim();
                pDate.Text     = Convert.ToDateTime(dt.Rows[0]["starDate"].ToString().Trim()).ToString("yyyy-MM-dd HH:mm:ss");
                eDate.Text     = Convert.ToDateTime(dt.Rows[0]["stopDate"].ToString().Trim()).ToString("yyyy-MM-dd HH:mm:ss");
                adCodeImg.Text = dt.Rows[0]["adCode"].ToString().Trim();
            }
            else
            {
                xc.divError("", "您的操作有误!", 350, 150, "default.aspx", "goto");
            }
            dt.Dispose();
        }
    }
Ejemplo n.º 21
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;
            }
        }
    }
Ejemplo n.º 22
0
    protected void Page_Load(object sender, EventArgs e)
    {
        XabaraCom      xc     = new XabaraCom();
        dbDataFunction db     = new dbDataFunction();
        xabaraAD       ad     = new xabaraAD();
        XabaraClass    xClass = new XabaraClass();
        webPublic      wp     = new webPublic();

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

        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 adID = 116;

            vipCode.Text = "<div class=\"divWidth\"><a href=\"/278.htm\" target=\"_blank\"><img src=\"/ad/images/okitch_20120630.gif\" /></a></div><div class=\"height5px\"></div>";

            //淘画报
            dt = db.getDataTable("select top 5 id,title,title_short,cover_pic_url_h,cover_pic_url_w from posterChannelTitle where flagID>0 and weight>10000 and modified_date>'" + DateTime.Now.AddDays(-7) + "' order by newid()");
            if (dt.Rows.Count > 4)
            {
                HuaBaoLeft.Text = "<table cellspacing=\"0\" cellpadding=\"0\" style=\"border-width:0px;\"><tr>";
                string txtLink = string.Empty;
                for (int i = 0; i < 3; i++)
                {
                    HuaBaoLeft.Text += "<td style=\"text-align:center; width:190px;\"><a href=\"/huabao/show/" + dt.Rows[i]["id"].ToString().Trim() + ".htm\" target=\"_blank\"><img src=\"" + dt.Rows[i]["cover_pic_url_h"].ToString().Trim() + "\" class=\"picHuaBaoH\" alt=\"" + dt.Rows[i]["title"].ToString().Trim() + "\" title=\"" + dt.Rows[i]["title_short"].ToString().Trim() + "\" id=\"imghbh\" /></a></td>";

                    txtLink += "<td style=\"text-align:center; height:28px; line-height:28px;\"><a href=\"/huabao/show/" + dt.Rows[i]["id"].ToString().Trim() + ".htm\" target=\"_blank\" class=\"huabao\">" + dt.Rows[i]["title_short"].ToString().Trim() + "</a></td>";
                }
                HuaBaoLeft.Text += "</tr><tr>" + txtLink + "</tr></table>";

                HuaBaoRight.Text = "<table cellspacing=\"0\" cellpadding=\"0\" style=\"border-width:0px;\"><tr>";
                txtLink          = string.Empty;
                for (int i = 3; i < 5; i++)
                {
                    HuaBaoRight.Text += "<td style=\"text-align:center; width:190px;\"><a href=\"/huabao/show/" + dt.Rows[i]["id"].ToString().Trim() + ".htm\" target=\"_blank\"><img src=\"" + dt.Rows[i]["cover_pic_url_w"].ToString().Trim() + "\" class=\"picHuaBaoW\" alt=\"" + dt.Rows[i]["title"].ToString().Trim() + "\" title=\"" + dt.Rows[i]["title_short"].ToString().Trim() + "\" id=\"imghbw\" /></a></td>";

                    txtLink += "<td style=\"text-align:center; height:32px; line-height:32px;\"><a href=\"/huabao/show/" + dt.Rows[i]["id"].ToString().Trim() + ".htm\" target=\"_blank\" class=\"huabao\">" + dt.Rows[i]["title_short"].ToString().Trim() + "</a></td>";
                }
                HuaBaoRight.Text += "</tr><tr>" + txtLink + "</tr><tr><td colspan=\"2\" style=\"padding-top:5px;\"><table align=\"center\" cellspacing=\"0\" cellpadding=\"0\" style=\"border-width:0px;width:98%;\"><tr><td style=\"text-align:left;\">" + ad.getAdCode(335, 0, 0, 3, 1, true, "") + "</td><td style=\"text-align:right;\">" + ad.getAdCode(334, 0, 0, 1, 0, true, "") + "</td></tr></table></td></tr></table>";
            }
            else
            {
                huabao.Visible = false;
            }
            dt.Dispose();

            //导航及产品
            headMenu.Text = "<td valign=\"middle\" class=\"headBg2\"><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();

                //广告代码
                adID += 1;
                string adCodeWidth = ad.getAdCode(adID, 0, 0, 1, 1, true, "");
                int    shopNums    = 12; //每个版块读取商品数
                if (!string.IsNullOrEmpty(adCodeWidth as string))
                {
                    adCodeWidth = "<div class=\"divWidth\">" + adCodeWidth + "</div>";
                }
                string adCodeHeight = ad.getAdCode(adID + 8, 0, 0, 1, 1, true, "");
                if (string.IsNullOrEmpty(adCodeHeight as string))
                {
                    DataTable ppDt = db.getDataTable("select top 22 Tid,TreeName from NewsTree where taobaoKe<>'' and idLayerStr like '%|" + tid + "|%' order by listID ASC,Tid ASC ");
                    if (ppDt.Rows.Count > 0)
                    {
                        adCodeHeight = "<table cellspacing=\"0\" cellpadding=\"0\" style=\"width:100%;\" align=\"center\" class=\"indexTable\">";
                        for (int p = 0; p < ppDt.Rows.Count; p++)
                        {
                            adCodeHeight += "<tr><td><a href=\"/" + ppDt.Rows[p]["Tid"].ToString().Trim() + ".htm\" target=\"_blank\" title=\"查看 " + ppDt.Rows[p]["TreeName"].ToString().Trim() + "\" alt=\"查看 " + ppDt.Rows[p]["TreeName"].ToString().Trim() + "\" class=\"classID\">" + ppDt.Rows[p]["TreeName"].ToString().Trim() + "</a></td></tr>";
                        }
                        adCodeHeight += "<tr><td style=\"text-align:right;\"><a href=\"/" + tid + ".htm\" target=\"_blank\" title=\"更多 " + treeName + " 品牌\" alt=\"更多 " + treeName + " 品牌\" class=\"classID\">>> 更多品牌</a></td></tr></table>";
                    }
                    ppDt.Dispose();
                }
                else
                {
                    shopNums = 12;
                }

                //商品读取
                string shopHtm = string.Empty;
                string ifStr   = string.Empty;
                string cidStr  = xClass.getClassAllID("taobaoke", xc.SafeNum(tid)); //得到所有ID
                if (cidStr.IndexOf(",") > 0)
                {
                    string[] ids     = cidStr.Split(new char[] { ',' });
                    int      iiCount = ids.GetUpperBound(0);
                    int      readTop = 1;
                    if (shopNums > iiCount - 5)
                    {
                        readTop = 2;
                    }

                    for (int ii = 0; ii <= iiCount; ii++)
                    {
                        ifStr += " select top " + readTop.ToString() + " num_iid,title,pic_url,click_url,commission,price,volume from taobaoke where isBad>0 and isGood>0 and classID=" + ids[ii].ToString().Trim() + " order by volume DESC union ";
                    }
                }
                else
                {
                    ifStr = " select num_iid,title,pic_url,click_url,commission,price,volume from taobaoke where isBad>0 and isGood>0 and classID=" + tid + " union ";
                }
                ifStr = "(" + ifStr.Substring(0, ifStr.Length - 6) + ") as news";

                string    strSql = "select top " + shopNums.ToString() + " * from " + ifStr + " Order By newid()";
                DataTable dtShop = db.getDataTable(strSql);
                //Response.Write(strSql);
                //Response.End();
                shopHtm = string.Empty;
                for (int s = 0; s < dtShop.Rows.Count; s++)
                {
                    shopHtm += "<td valign=\"top\" style=\"border-style: none solid solid none; border-width: 1px; border-color: #323232; text-align:center; width:200px;\"><a class=\"moneyLink\" href=\"/show/" + dtShop.Rows[s]["num_iid"].ToString().Trim() + ".htm\" target=\"_blank\" alt=\"" + dtShop.Rows[s]["title"].ToString().Trim() + "\" title=\"" + dtShop.Rows[s]["title"].ToString().Trim() + "\"><div style=\"position:absolute;\"><ul><li style=\"height:168px;\"></li><li class=\"moneyFont\" style=\"background-color:#323232; filter:Alpha(opacity=30);opacity:0.3; text-align:right; padding:5px; width:190px; color:#b8b8b8;\">" + xc.getMoney(dtShop.Rows[s]["price"].ToString().Trim()) + "</li></ul></div><img id=\"imgshow\" src=\"" + dtShop.Rows[s]["pic_url"].ToString().Trim() + "_310x310.jpg\" style=\"height:200px; width:200px;\" alt=\"" + dtShop.Rows[s]["title"].ToString().Trim() + "\" title=\"" + dtShop.Rows[s]["title"].ToString().Trim() + "\" /></a></td>";

                    if (s == 3 || s == 7)
                    {
                        shopHtm += "</tr><tr>";
                    }
                }
                dtShop.Dispose();

                headMenu.Text += "<td valign=\"middle\" class=\"headBg1\"><a href=\"/" + tid + ".htm\" target=\"_top\" class=\"head\">" + treeName + "</a></td>";
                //产品二级分类
                string    class2  = "<span class=\"headLine\">|</span>&nbsp;";
                DataTable dtClass = db.getDataTable("select Tid,TreeName from newsTree where TreeID=" + tid + " and TreeType='taobaoke' order by ListID ASC,Tid ASC");
                for (int c = 0; c < dtClass.Rows.Count; c++)
                {
                    string classID   = dtClass.Rows[c]["Tid"].ToString().Trim();
                    string className = dtClass.Rows[c]["TreeName"].ToString().Trim();
                    class2 += "<a href=\"/" + dtClass.Rows[c]["Tid"].ToString().Trim() + ".htm\" target=\"_blank\" title=\"查看 " + className + "\" alt=\"查看 " + className + "\">" + className + "</a>&nbsp;<span class=\"headLine\">|</span>&nbsp;";
                }
                dtClass.Dispose();

                shopList.Text += adCodeWidth;
                shopList.Text += "<div class=\"height5px\"></div>";
                shopList.Text += "<div class=\"divWidth\"><table cellspacing=\"0\" cellpadding=\"0\" style=\"border-width:0px; border-collapse:collapse; height:26px; width:100%;\"><tr><td style=\"width:125px; text-align:left;\"><img src=\"images/class" + tid + ".gif\" alt=\"" + treeName + "\" title=\"" + treeName + "\" /></td><td style=\"text-align:right; vertical-align:bottom; width:807px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;\">" + class2 + "</td><td style=\"text-align:right; vertical-align:bottom; width:38px;\"><a href=\"/" + tid + ".htm\" target=\"_top\"><img src=\"images/more.gif\" alt=\"更多 " + treeName + "\" title=\"更多 " + treeName + "\" /></a></td></tr></table></div>";
                shopList.Text += "<div class=\"divWidth\" style=\"height:2px; background-color:Black; font-size:0px;\"></div>";
                shopList.Text += "<div class=\"divWidth\"><table cellspacing=\"0\" cellpadding=\"0\"><tr><td valign=\"top\" style=\"background-color:#323232; width:166px; text-align:center;\" rowspan=\"3\">" + adCodeHeight + "</td>" + shopHtm + "</tr></table></div>";
            }
            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();

            //热搜关键词
            string   hot     = XmlReader.GetConfig(HttpContext.Current.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;";
            }

            this.Page.MetaKeywords    = XmlReader.GetConfig(Server.MapPath("~/xabara.config"), "KeyWord");
            this.Page.MetaDescription = XmlReader.GetConfig(Server.MapPath("~/xabara.config"), "metaStr");
        }
    }
Ejemplo n.º 23
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");
    }
Ejemplo n.º 24
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;
            }
        }
    }