Пример #1
0
    private void DownTextPage()
    {
        Master.Title = "功能箱";
        int    id    = int.Parse(Utils.GetRequest("id", "all", 2, @"^[0-9]\d*$", "ID错误"));
        string Title = new BCW.BLL.Detail().GetTitle(id);

        if (Title == "")
        {
            Utils.Error("不存在的记录", "");
        }
        builder.Append(Out.Tab("<div>", ""));
        builder.Append("选择下载选项:");
        builder.Append(Out.Tab("</div>", "<br />"));
        builder.Append(Out.Tab("<div>", ""));
        builder.Append("<a href=\"" + Utils.getUrl("detail.aspx?act=downtxt&amp;id=" + id + "&amp;backurl=" + Utils.getPage(0) + "") + "\">下载txt</a>.");
        builder.Append("<a href=\"" + Utils.getUrl("detail.aspx?act=downjar&amp;id=" + id + "&amp;backurl=" + Utils.getPage(0) + "") + "\">jar</a>.");
        builder.Append("<a href=\"" + Utils.getUrl("detail.aspx?act=downumd&amp;id=" + id + "&amp;backurl=" + Utils.getPage(0) + "") + "\">umd</a>.");
        builder.Append("<a href=\"" + Utils.getUrl("detail.aspx?act=downpdf&amp;id=" + id + "&amp;backurl=" + Utils.getPage(0) + "") + "\">pdf</a>.");
        builder.Append("<a href=\"" + Utils.getUrl("detail.aspx?act=downchm&amp;id=" + id + "&amp;backurl=" + Utils.getPage(0) + "") + "\">chm</a>.");
        builder.Append("<a href=\"" + Utils.getUrl("detail.aspx?act=downword&amp;id=" + id + "&amp;backurl=" + Utils.getPage(0) + "") + "\">word</a>");
        builder.Append(Out.Tab("</div>", ""));
        builder.Append(Out.Tab("<div class=\"title\">", Out.Hr()));
        builder.Append("<a href=\"" + Utils.getUrl("detail.aspx?id=" + id + "&amp;backurl=" + Utils.getPage(0) + "") + "\">.." + Title + "</a>");
        builder.Append(Out.Tab("</div>", ""));
    }
Пример #2
0
 /// <summary>
 /// 设置列表封面
 /// </summary>
 private void InsertCover(int ptype, string Path, string SavePath, string fileName, string fileExtension, int iFile, int iFileCount, int newId)
 {
     if (fileExtension == ".gif" || fileExtension == ".jpg" || fileExtension == ".jpeg" || fileExtension == ".png" || fileExtension == ".bmp")
     {
         if ((iFile + 1) == iFileCount)
         {
             string CoverPath    = Path + "cover/";
             string CoverDirPath = "";
             if (FileTool.CreateDirectory(CoverPath, out CoverDirPath))
             {
                 string CoverSavePath = System.Web.HttpContext.Current.Request.MapPath(CoverDirPath) + fileName;
                 int    width         = Convert.ToInt32(ub.GetSub("UpCoverWidth", xmlPath));
                 int    height        = Convert.ToInt32(ub.GetSub("UpCoverHeight", xmlPath));
                 bool   pbool         = false;
                 try
                 {
                     if (fileExtension == ".gif")
                     {
                         new BCW.Graph.GifHelper().GetThumbnail(SavePath, CoverSavePath, width, height, pbool);
                     }
                     else
                     {
                         new BCW.Graph.ImageHelper().ResizeImage(SavePath, CoverSavePath, width, height, pbool);
                     }
                     //更新封面
                     string Cover = "";
                     if (ptype != 14)
                     {
                         Cover = new BCW.BLL.Detail().GetCover(newId);
                     }
                     else
                     {
                         Cover = new BCW.BLL.Goods().GetCover(newId);
                     }
                     if (Cover != "")
                     {
                         BCW.Files.FileTool.DeleteFile(Cover);
                     }
                     if (ptype != 14)
                     {
                         new BCW.BLL.Detail().UpdateCover(newId, CoverDirPath + fileName);
                     }
                     else
                     {
                         new BCW.BLL.Goods().UpdateCover(newId, CoverDirPath + fileName);
                     }
                 }
                 catch { }
             }
         }
     }
 }
Пример #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        int    id    = int.Parse(Utils.GetRequest("id", "all", 2, @"^[0-9]\d*$", "ID错误"));
        int    ptype = int.Parse(Utils.GetRequest("ptype", "all", 1, @"^[0-9]\d*$", "0"));
        string Title = "";

        if (ptype == 0)
        {
            Title = new BCW.BLL.Detail().GetTitle(id);
        }
        else
        {
            Title = new BCW.BLL.Goods().GetTitle(id);
        }
        if (Title == "")
        {
            Utils.Error("不存在的记录", "");
        }
        string act = Utils.GetRequest("act", "all", 1, "", "");

        switch (act)
        {
        case "add":
            AddComment(id, ptype);
            break;

        case "admin":
            AdminComment(Title, id, ptype);
            break;

        case "del":
            DelComment(Title, id, ptype);
            break;

        case "reok":
            ReOkComment(Title, id, ptype);
            break;

        case "ok":
            SaveComment(id, ptype);
            break;

        default:
            ReloadPage(Title, id, ptype);
            break;
        }
    }
Пример #4
0
    /// <summary>
    /// 更新截图进数据库
    /// </summary>
    /// <param name="act"></param>
    /// <param name="ptype"></param>
    /// <param name="nid"></param>
    /// <param name="id"></param>
    private void UpdatePic(string act, int ptype, int nid, int id)
    {
        string ac     = Utils.GetRequest("ac", "post", 1, "", "");
        string sFiles = string.Empty;
        string aName  = string.Empty;

        if (Utils.ToSChinese(ac) == "上传截图")
        {
            if (SaveFiles(15, id, out sFiles))
            {
                aName = "上传截图成功";
                string sPics = "";
                if (sFiles != "")
                {
                    sPics = Utils.Mid(sFiles, 1, sFiles.Length);
                }
                if (sPics == "#")
                {
                    sPics = "";
                }

                if (sPics != "")
                {
                    string Pics = new BCW.BLL.Detail().GetPics(id);
                    if (Pics != "")
                    {
                        sPics = Pics + "#" + sPics;
                    }

                    new BCW.BLL.Detail().UpdatePics(id, sPics);
                }
            }
            else
            {
                aName = "上传截图失败";
            }
            builder.Append(Out.Tab("<div>", ""));
            builder.Append("" + aName + "成功!请等待管理员进行审核,多谢您对本站的支持!");
            builder.Append(Out.Tab("</div>", ""));
            builder.Append(Out.Tab("<div class=\"title\">", Out.Hr()));
            builder.Append("<a href=\"" + Utils.getUrl("default.aspx") + "\">首页</a>-");
            builder.Append("<a href=\"" + Utils.getPage("default.aspx") + "\">返回上级</a>");
            builder.Append(Out.Tab("</div>", ""));
        }
    }
Пример #5
0
    private void VerifyPage()
    {
        Master.Title = "审核文件";
        int    id   = int.Parse(Utils.GetRequest("id", "all", 2, @"^[1-9]\d*$", "页面ID错误"));
        string info = Utils.GetRequest("info", "all", 1, "", "");

        if (info != "ok")
        {
            builder.Append(Out.Tab("<div class=\"title\">", ""));
            builder.Append("确定审核文件吗");
            builder.Append(Out.Tab("</div>", ""));
            string strText = "奖励" + ub.Get("SiteBz") + "/,,,";
            string strName = "cent,id,act,info";
            string strType = "num,hidden,hidden,hidden";
            string strValu = "0'" + id + "'verify'ok";
            string strEmpt = "false,false,false,false";
            string strIdea = "/";
            string strOthe = "确定审核并内线,filepass.aspx,post,1,red";
            builder.Append(Out.wapform(strText, strName, strType, strValu, strEmpt, strIdea, strOthe));

            builder.Append(Out.Tab("<div>", "<br />"));
            builder.Append("<a href=\"" + Utils.getUrl("filepass.aspx") + "\">再看看吧..</a>");
            builder.Append(Out.Tab("</div>", "<br />"));
            builder.Append(Out.Tab("<div>", ""));
            builder.Append("<a href=\"" + Utils.getUrl("filepass.aspx") + "\">返回上一级</a>");
            builder.Append(Out.Tab("</div>", "<br />"));
        }
        else
        {
            long cent = int.Parse(Utils.GetRequest("cent", "post", 4, @"^[1-9]\d*$", "奖励金额填写错误"));
            new BCW.BLL.Detail().UpdateHidden(id, 0);
            int UsID = new BCW.BLL.Detail().GetUsID(id);
            if (cent > 0)
            {
                string mename = new BCW.BLL.User().GetUsName(UsID);
                new BCW.BLL.User().UpdateiGold(UsID, mename, cent, "上传文件通过审核奖币");
                //发信给上传会员
                new BCW.BLL.Guest().Add(UsID, mename, "您的上传的[url=/detail.aspx?id=" + id + "]" + new BCW.BLL.Detail().GetTitle(id) + "[/url]已通过审核,恭喜你获得" + cent + "" + ub.Get("SiteBz") + "奖励!");
            }
            Utils.Success("审核文件", "审核文件成功,正在返回..", Utils.getUrl("filepass.aspx"), "1");
        }
    }
Пример #6
0
    private void ReloadPage()
    {
        Master.Title = "适用机型";
        int    id    = int.Parse(Utils.GetRequest("id", "all", 2, @"^[0-9]\d*$", "ID错误"));
        string Title = new BCW.BLL.Detail().GetTitle(id);

        if (Title == "")
        {
            Utils.Error("不存在的记录", "");
        }
        string Model = new BCW.BLL.Detail().GetPhoneModel(id);

        builder.Append(Out.Tab("<div class=\"title\">适用机型</div>", ""));
        builder.Append(Out.Tab("<div>", ""));
        builder.Append(Out.SysUBB(Model));
        builder.Append(Out.Tab("</div>", ""));
        builder.Append(Out.Tab("<div class=\"title\">", Out.Hr()));
        builder.Append("<a href=\"" + Utils.getUrl("detail.aspx?id=" + id + "&amp;backurl=" + Utils.getPage(0) + "") + "\">.." + Title + "</a>");
        builder.Append(Out.Tab("</div>", ""));
    }
Пример #7
0
    /// <summary>
    /// 更新截图进数据库
    /// </summary>
    /// <param name="act"></param>
    /// <param name="ptype"></param>
    /// <param name="nid"></param>
    /// <param name="id"></param>
    private void UpdatePic(string act, int ptype, int nid, int id)
    {
        string ac     = Utils.GetRequest("ac", "post", 1, "", "");
        string sFiles = string.Empty;
        string aName  = string.Empty;

        if (Utils.ToSChinese(ac) == "上传截图")
        {
            if (SaveFiles(15, id, out sFiles))
            {
                aName = "上传截图成功";
                string sPics = "";
                if (sFiles != "")
                {
                    sPics = Utils.Mid(sFiles, 1, sFiles.Length);
                }
                if (sPics == "#")
                {
                    sPics = "";
                }

                if (sPics != "")
                {
                    string Pics = new BCW.BLL.Detail().GetPics(id);
                    if (Pics != "")
                    {
                        sPics = Pics + "#" + sPics;
                    }

                    new BCW.BLL.Detail().UpdatePics(id, sPics);
                }
            }
            else
            {
                aName = "上传截图失败";
            }
            builder.Append(Out.Tab("<div class=\"title\">", "<br />"));
            builder.Append("" + aName + "");
            builder.Append(Out.Tab("</div>", ""));
        }
    }
Пример #8
0
    private void ReloadPage()
    {
        Master.Title = "审核文件";
        builder.Append(Out.Tab("<div class=\"title\">", ""));
        builder.Append("未审核文件");
        builder.Append(Out.Tab("</div>", ""));

        int    pageIndex;
        int    recordCount;
        int    pageSize = Convert.ToInt32(ub.Get("SiteListNo"));
        string strWhere = "";

        string[] pageValUrl = { "act" };
        pageIndex = Utils.ParseInt(Request.QueryString["page"]);
        if (pageIndex == 0)
        {
            pageIndex = 1;
        }
        //查询条件
        strWhere = "Types=13 and Hidden=1";

        // 开始读取文章
        IList <BCW.Model.Detail> listDetail = new BCW.BLL.Detail().GetDetails(pageIndex, pageSize, strWhere, out recordCount);

        if (listDetail.Count > 0)
        {
            int k = 1;
            foreach (BCW.Model.Detail n in listDetail)
            {
                if (k % 2 == 0)
                {
                    builder.Append(Out.Tab("<div class=\"text\">", "<br />"));
                }
                else
                {
                    builder.Append(Out.Tab("<div>", "<br />"));
                }

                string IsHidden = string.Empty;
                if (n.Hidden == 1)
                {
                    IsHidden = "^";
                }

                builder.AppendFormat("<a href=\"" + Utils.getUrl("classact.aspx?act=info&amp;ptype={0}&amp;nid={1}&amp;id={2}&amp;backurl=" + Utils.PostPage(1) + "") + "\">[管理]&gt;</a><a href=\"" + Utils.getUrl("/detail.aspx?id={2}&amp;backurl=" + Utils.PostPage(1) + "") + "\">" + IsHidden + "{3}</a><a href=\"" + Utils.getUrl("filepass.aspx?act=verify&amp;id={2}&amp;backurl=" + Utils.PostPage(1) + "") + "\">[审核]</a><a href=\"" + Utils.getUrl("class.aspx?act=del2&amp;ptype={0}&amp;id={2}&amp;backurl=" + Utils.PostPage(1) + "") + "\">[删]</a><br />上传者:<a href=\"" + Utils.getUrl("uinfo.aspx?uid=" + n.UsID + "&amp;backurl=" + Utils.PostPage(1) + "") + "\">" + new BCW.BLL.User().GetUsName(n.UsID) + "</a>(" + DT.FormatDate(n.AddTime, 1) + ")", n.Types, n.NodeId, n.ID, n.Title);

                k++;
                builder.Append(Out.Tab("</div>", ""));
            }

            // 分页
            builder.Append(BasePage.MultiPage(pageIndex, pageSize, recordCount, Utils.getPageUrl(), pageValUrl, "page", 0));
        }
        else
        {
            builder.Append(Out.Tab("", "<br />"));
            builder.Append(Out.Div("text", "没有相关记录"));
        }
        builder.Append(Out.Tab("<div class=\"hr\"></div>", Out.Hr()));
        builder.Append(Out.Tab("<div>", ""));
        builder.Append("<a href=\"" + Utils.getUrl("filepass.aspx?act=verifypage&amp;page=" + pageIndex + "") + "\">审核本页文件</a><br />");
        builder.Append(Out.Tab("</div><div class=\"title\"><a href=\"" + Utils.getUrl("default.aspx") + "\">返回管理中心</a>", "<a href=\"" + Utils.getUrl("default.aspx") + "\">返回管理中心</a>"));
        builder.Append(Out.Tab("</div>", "<br />"));
    }
Пример #9
0
    private void VerifypagePage()
    {
        Master.Title = "审核本页文件";
        int    page = int.Parse(Utils.GetRequest("page", "all", 2, @"^[1-9]\d*$", "页面ID错误"));
        string info = Utils.GetRequest("info", "all", 1, "", "");

        if (info != "ok")
        {
            builder.Append(Out.Tab("<div class=\"title\">", ""));
            builder.Append("确定审核本页文件吗");
            builder.Append(Out.Tab("</div>", ""));
            string strText = "奖励" + ub.Get("SiteBz") + "/,,,";
            string strName = "cent,page,act,info";
            string strType = "num,hidden,hidden,hidden";
            string strValu = "0'" + page + "'verifypage'ok";
            string strEmpt = "false,false,false,false";
            string strIdea = "/";
            string strOthe = "确定审核并内线,filepass.aspx,post,1,red";
            builder.Append(Out.wapform(strText, strName, strType, strValu, strEmpt, strIdea, strOthe));

            builder.Append(Out.Tab("<div>", "<br />"));
            builder.Append("<a href=\"" + Utils.getUrl("filepass.aspx") + "\">再看看吧..</a>");
            builder.Append(Out.Tab("</div>", "<br />"));
            builder.Append(Out.Tab("<div>", ""));
            builder.Append("<a href=\"" + Utils.getUrl("filepass.aspx") + "\">返回上一级</a>");
            builder.Append(Out.Tab("</div>", "<br />"));
        }
        else
        {
            long cent = int.Parse(Utils.GetRequest("cent", "post", 4, @"^[1-9]\d*$", "奖励金额填写错误"));
            int  pageIndex;
            int  recordCount;
            int  pageSize = Convert.ToInt32(ub.Get("SiteListNo"));

            string strWhere = "";
            pageIndex = page;
            if (pageIndex == 0)
            {
                pageIndex = 1;
            }

            strWhere = "Types=13 and Hidden=1";

            // 开始读取列表
            IList <BCW.Model.Detail> listDetail = new BCW.BLL.Detail().GetDetails(pageIndex, pageSize, strWhere, out recordCount);
            if (listDetail.Count > 0)
            {
                foreach (BCW.Model.Detail n in listDetail)
                {
                    new BCW.BLL.Detail().UpdateHidden(n.ID, 0);
                    if (cent > 0)
                    {
                        string mename = new BCW.BLL.User().GetUsName(n.UsID);
                        new BCW.BLL.User().UpdateiGold(n.UsID, mename, cent, "上传文件通过审核奖币");
                        //发信给上传会员
                        new BCW.BLL.Guest().Add(n.UsID, mename, "您的上传的[url=/detail.aspx?id=" + n.ID + "]" + n.Title + "[/url]已通过审核,恭喜你获得" + cent + "" + ub.Get("SiteBz") + "奖励!");
                    }
                }
            }

            Utils.Success("审核本页文件", "审核本页文件成功,正在返回..", Utils.getUrl("filepass.aspx"), "1");
        }
    }
Пример #10
0
    private void InsertPicSoft(string act, int ptype, int nid, int id)
    {
        string VE  = ConfigHelper.GetConfigString("VE");
        string SID = ConfigHelper.GetConfigString("SID");

        if (ptype != 12 && !Utils.Isie())
        {
            Master.Title = "温馨提示";
            builder.Append("<a href=\"classact.aspx?act=" + act + "&amp;ptype=" + ptype + "&amp;nid=" + nid + "&amp;id=" + id + "&amp;backurl=" + Utils.getPage(0) + "&amp;" + VE + "=2a&amp;" + SID + "=" + Utils.getstrU() + "\">[切换2.0上传]</a>");
        }
        else
        {
            string TypeName = string.Empty;
            if (ptype == 12)
            {
                TypeName = "图片";
            }
            else
            {
                TypeName = "文件";
            }

            if (id != 0)
            {
                Master.Title = "编辑" + TypeName + "";
                builder.Append(Out.Tab("<div class=\"title\">WAP2.0编辑" + TypeName + "</div>", "编辑" + TypeName + ""));
            }
            else
            {
                Master.Title = "添加" + TypeName + "";
                builder.Append(Out.Tab("<div class=\"title\">WAP2.0添加" + TypeName + "</div>", "添加" + TypeName + ""));
            }

            //上传个数
            int max = Convert.ToInt32(ub.GetSub("UpbMaxFileNum", xmlPath));
            int nn  = int.Parse(Utils.GetRequest("nn", "get", 1, @"^[0-9]\d*$", "1"));
            if (nn > max)
            {
                nn = max;
            }
            int num = int.Parse(Utils.GetRequest("num", "get", 1, @"^[0-9]\d*$", "1"));
            if (num > max)
            {
                num = max;
            }

            builder.Append(Out.Tab("<div>", "<br />"));

            builder.Append("" + TypeName + ":");
            for (int i = 1; i <= max; i++)
            {
                builder.Append("<a href=\"" + Utils.getUrl("classact.aspx?act=" + act + "&amp;nid=" + nid + "&amp;id=" + id + "&amp;ptype=" + ptype + "&amp;num=" + i + "&amp;nn=" + nn + "") + "\"><b>" + i + "</b></a> ");
            }

            builder.Append(Out.Tab("</div>", ""));

            //编辑状态时的显示
            string sUpType = string.Empty;
            string sText   = string.Empty;
            string sName   = string.Empty;
            string sType   = string.Empty;
            string sValu   = string.Empty;
            string sEmpt   = string.Empty;

            int picNum = 0;
            if (ptype == 12)
            {
                if (id != 0)
                {
                    BCW.Model.Detail model = new BCW.BLL.Detail().GetDetail(id);
                    sUpType = "续传";
                    sText   = "" + TypeName + "标题:/," + TypeName + "性质:/,搜索关键字:(多个用#分隔)/,图片收费:/,收费币种:/,生成缩略图:/,宽度:,高度:,";
                    sName   = "Title,IsAd,KeyWord,Cent,BzType,ThumbType,width,height,";
                    sType   = "text,select,textarea,num,select,select,num,num,";
                    sValu   = "" + model.Title + "'" + model.IsAd + "'" + model.KeyWord + "'" + model.Cent + "'" + model.BzType + "'" + ub.GetSub("UpbThumbType", xmlPath) + "'" + ub.GetSub("UpbWidth", xmlPath) + "'" + ub.GetSub("UpbHeight", xmlPath) + "'";
                    sEmpt   = "false,True|正常" + TypeName + "|False|跳到广告,true,false,0|" + ub.Get("SiteBz") + "|1|" + ub.Get("SiteBz2") + ",0|不生成|1|保持比例|2|固定尺寸,true,true,";
                }
                else
                {
                    sText = "" + TypeName + "标题:/," + TypeName + "性质:/,搜索关键字:(多个用#分隔)/,图片收费:/,收费币种:/,生成缩略图:/,宽度:,高度:,";
                    sName = "Title,IsAd,KeyWord,Cent,BzType,ThumbType,width,height,";
                    sType = "text,select,textarea,num,select,select,num,num,";
                    sValu = "'True''0'0'" + ub.GetSub("UpbThumbType", xmlPath) + "'" + ub.GetSub("UpbWidth", xmlPath) + "'" + ub.GetSub("UpbHeight", xmlPath) + "'";
                    sEmpt = "false,True|正常" + TypeName + "|False|跳到广告,true,false,0|" + ub.Get("SiteBz") + "|1|" + ub.Get("SiteBz2") + ",0|不生成|1|保持比例|2|固定尺寸,true,true,";
                }
            }
            else
            {
                if (id != 0)
                {
                    BCW.Model.Detail model = new BCW.BLL.Detail().GetDetail(id);
                    if (model.Pics != "")
                    {
                        picNum = (Utils.GetStringNum(model.Pics, "#")) + 1;
                    }
                    sUpType = "续传";
                    sText   = "" + TypeName + "标题:/," + TypeName + "描述:/," + TypeName + "性质:/,关键字:(多个用逗号分隔)/,资费说明:/,语言:/,检查说明:/,来源:/,更新说明:/,需要签证:/,下载收费:/,收费币种:/,适用机型(逗号分开):/,";
                    sName   = "Title,Content,IsAd,KeyWord,TarText,LanText,SafeText,LyText,UpText,IsVisa,Cent,BzType,Model,";
                    sType   = "text,big,select,textarea,text,text,text,text,text,select,num,select,textarea,";
                    sValu   = "" + model.Title + "'" + model.Content + "'" + model.IsAd + "'" + model.KeyWord + "'" + model.TarText + "'" + model.LanText + "'" + model.SafeText + "'" + model.LyText + "'" + model.UpText + "'" + model.IsVisa + "'" + model.Cent + "'" + model.BzType + "'" + model.Model + "'";
                    sEmpt   = "false,false,True|正常" + TypeName + "|False|跳到广告,true,true,true,true,true,true,0|不显示|1|未知|2|需要|3|不需要,false,0|" + ub.Get("SiteBz") + "|1|" + ub.Get("SiteBz2") + ",true,";
                }
                else
                {
                    sUpType = "上传";
                    sText   = "" + TypeName + "标题:/," + TypeName + "描述:/," + TypeName + "性质:/,关键字:(多个用逗号分隔)/,资费说明:/,语言:/,检查说明:/,来源:/,更新说明:/,需要签证:/,下载收费:/,收费币种:/,适用机型(逗号分开):/,";
                    sName   = "Title,Content,IsAd,KeyWord,TarText,LanText,SafeText,LyText,UpText,IsVisa,Cent,BzType,Model,";
                    sType   = "text,big,select,textarea,text,text,text,text,text,select,num,select,textarea,";
                    sValu   = "''True''完全免费'中文'绿色,无病毒'''1'0'0''";
                    sEmpt   = "false,false,True|正常" + TypeName + "|False|跳到广告,true,true,true,true,true,true,0|不显示|1|未知|2|需要|3|不需要,false,0|" + ub.Get("SiteBz") + "|1|" + ub.Get("SiteBz2") + ",true,";
                }


                strText += ",是否" + sUpType + "截图:/";
                strName += ",blpic";
                strType += ",select";
                strValu += "'False";
                strEmpt += ",True|上传|False|不上传";
                nn       = 0; //截图标识
            }
            for (int i = 0; i < num; i++)
            {
                string y = ",";
                if (ptype == 12)
                {
                    if (num == 1)
                    {
                        strText = strText + y + "第" + (i + 1) + "个图片:/";
                    }
                    else
                    {
                        strText = strText + y + "" + sUpType + "第" + (i + 1) + "个图片:/";
                    }
                    strName = strName + y + "file" + (i + 1);
                    if (!Utils.Isie() || act == "pic2" || act == "info2")
                    {
                        strType = strType + y + "text";
                    }
                    else
                    {
                        strType = strType + y + "file";
                    }
                    strValu = strValu + "'";
                    strEmpt = strEmpt + y;
                }
                else
                {
                    if (num == 1)
                    {
                        strText = strText + y + "选择" + sUpType + "附件:/," + sUpType + "附件描述:/";
                    }
                    else
                    {
                        strText = strText + y + "" + sUpType + "第" + (i + 1) + "个附件:/," + sUpType + "附件描述" + (i + 1) + ":/";
                    }
                    strName = strName + y + "file" + (i + 1) + y + "stext" + (i + 1);
                    if (!Utils.Isie())
                    {
                        strType = strType + y + "text" + y + "text";
                    }
                    else
                    {
                        strType = strType + y + "file" + y + "text";
                    }
                    strValu = strValu + "''";
                    strEmpt = strEmpt + y + y;
                }
            }

            strText = sText + Utils.Mid(strText, 1, strText.Length) + ",,,,,,";
            strName = sName + Utils.Mid(strName, 1, strName.Length) + ",ptype,nid,id,act,num,nn";
            strType = sType + Utils.Mid(strType, 1, strType.Length) + ",hidden,hidden,hidden,hidden,hidden,hidden";
            if (ptype == 12)
            {
                string actType = "pic";//采集标识
                if (Utils.Right(act, 1) == "2")
                {
                    actType = "picget";
                }

                strValu = sValu + Utils.Mid(strValu, 1, strValu.Length) + "'" + ptype + "'" + nid + "'" + id + "'" + actType + "'" + num + "'" + nn + "";
            }
            else
            {
                strValu = sValu + Utils.Mid(strValu, 1, strValu.Length) + "'" + ptype + "'" + nid + "'" + id + "'soft'" + num + "'" + nn + "";
            }
            strEmpt = sEmpt + Utils.Mid(strEmpt, 1, strEmpt.Length) + ",,,,,,";
            strIdea = "";

            strIdea = "/温馨提示:搜索关键字留空时,系统将根据标题自动生成../";
            if (ptype == 13)
            {
                strIdea += "多个机型请用逗号分隔,支持UBB,系统智能分析/资费\\语言\\检查\\来源\\更新说明留空时则不显示在前台/";
            }
            if (ptype == 12 && !Utils.Isie())
            {
                strIdea += "支持地址采集上传,切换WAP2.0可以使用上传功能/";
            }

            if (!Utils.Isie() || act == "pic2" || act == "info2")
            {
                strOthe = "上传" + TypeName + "|reset,classok.aspx,post,1,red|blue|blue";
            }
            else
            {
                strOthe = "上传" + TypeName + "|reset,classok.aspx,post,2,red|blue|blue";
            }

            builder.Append(Out.wapform(strText, strName, strType, strValu, strEmpt, strIdea, strOthe));
            if (id != 0)
            {
                builder.Append(Out.Tab("<div>", "<br />"));
                builder.Append("<a href=\"" + Utils.getUrl("../detail.aspx?id=" + id + "&amp;backurl=" + Utils.PostPage(1) + "") + "\">预览</a>");

                if (ptype == 13)
                {
                    builder.Append(" <a href=\"" + Utils.getUrl("class.aspx?act=delpic&amp;nid=" + nid + "&amp;id=" + id + "&amp;ptype=" + ptype + "") + "\">删截图(" + picNum + ")</a>");
                }
                builder.Append(" <a href=\"" + Utils.getUrl("class.aspx?act=delfile&amp;nid=" + nid + "&amp;id=" + id + "&amp;ptype=" + ptype + "") + "\">删文件(" + new BCW.BLL.File().GetCount(id) + ")</a>");
                builder.Append(Out.Tab("</div>", ""));
            }
            builder.Append(Out.Tab("<div>", "<br />"));
            if (ptype == 12 && Utils.Isie() && act != "pic2" && act != "info2")
            {
                builder.Append("<a href=\"" + Utils.getUrl("classact.aspx?act=" + act + "2&amp;ptype=" + ptype + "&amp;nid=" + nid + "&amp;id=" + id + "") + "\">切换采集上传</a>");
            }
            else
            {
                builder.Append("<a href=\"classact.aspx?act=" + act.Replace("2", "") + "&amp;ptype=" + ptype + "&amp;nid=" + nid + "&amp;id=" + id + "&amp;" + VE + "=2a&amp;" + SID + "=" + Utils.getstrU() + "\">切换WAP2.0上传</a>");
            }
            builder.Append(Out.Tab("</div>", ""));
        }
    }
Пример #11
0
    /// <summary>
    /// 添加/编辑文章
    /// </summary>
    private void InsertText(int ptype, int nid, int id)
    {
        if (id != 0)
        {
            Master.Title = "编辑文章";
            builder.Append(Out.Tab("<div class=\"title\">WAP2.0编辑文章</div>", "编辑文章"));
        }
        else
        {
            Master.Title = "添加文章";
            builder.Append(Out.Tab("<div class=\"title\">WAP2.0添加文章</div>", "添加文章"));
        }
        //附图数量
        int picNum = 0;

        if (!Utils.Isie())
        {
            if (id != 0)
            {
                strText = "文章标题:/,文章内容:/,搜索关键字:(多个用#分隔)/,文章收费:/,收费币种:/,文章性质:/,,,,";
                strName = "Title,Content,KeyWord,Cent,BzType,IsAd,ptype,nid,id,act";
                strType = "text,big,text,num,select,select,hidden,hidden,hidden,hidden";
                //读取实体
                BCW.Model.Detail model = new BCW.BLL.Detail().GetDetail(id);
                if (model.Pics != "")
                {
                    picNum = (Utils.GetStringNum(model.Pics, "#")) + 1;
                }
                strValu = "" + model.Title + "'" + model.Content + "'" + model.KeyWord + "'" + model.Cent + "'" + model.BzType + "'" + model.IsAd + "'" + ptype + "'" + nid + "'" + id + "'text";
                strEmpt = "false,false,true,false,0|" + ub.Get("SiteBz") + "|1|" + ub.Get("SiteBz2") + ",True|正常文章|False|跳到广告,,,,";
            }
            else
            {
                strText = "文章标题:/,文章内容:/,搜索关键字:(多个用#分隔)/,文章收费:/,收费币种:/,文章性质:/,,,,";
                strName = "Title,Content,KeyWord,Cent,BzType,IsAd,ptype,nid,id,act";
                strType = "text,big,text,num,select,select,hidden,hidden,hidden,hidden";
                strValu = "'''0'0'True'" + ptype + "'" + nid + "'" + id + "'text";
                strEmpt = "false,false,true,false,0|" + ub.Get("SiteBz") + "|1|" + ub.Get("SiteBz2") + ",True|正常文章|False|跳到广告,,,,";
            }
            strIdea = "/温馨提示:切换wap2.0可上传附件或续传附件./搜索关键字留空时,系统将根据标题自动生成./";
            strOthe = "";
            if (id != 0)
            {
                strOthe = "确定编辑|reset,classok.aspx,post,1,red|blue";
            }
            else
            {
                strOthe = "确定添加|reset,classok.aspx,post,1,red|blue";
            }
            builder.Append(Out.wapform(strText, strName, strType, strValu, strEmpt, strIdea, strOthe));
        }
        else
        {
            builder.Append(Out.Tab("<div>", ""));
            builder.Append("图片:");
            for (int i = 1; i < 10; i++)
            {
                builder.Append("<a href=\"" + Utils.getUrl("classact.aspx?act=view&amp;nid=" + nid + "&amp;id=" + id + "&amp;ptype=" + ptype + "&amp;num=" + i + "") + "\"><b>" + i + "</b></a> ");
            }
            builder.Append("张");

            builder.Append(Out.Tab("</div>", ""));
            int num = int.Parse(Utils.GetRequest("num", "get", 1, @"^[0-9]\d*$", "1"));
            if (num > 10)
            {
                num = 10;
            }

            //编辑状态时的显示
            string sUpType = string.Empty;
            string sText   = string.Empty;
            string sName   = string.Empty;
            string sType   = string.Empty;
            string sValu   = string.Empty;
            string sEmpt   = string.Empty;
            if (id != 0)
            {
                BCW.Model.Detail model = new BCW.BLL.Detail().GetDetail(id);
                if (model.Pics != "")
                {
                    picNum = (Utils.GetStringNum(model.Pics, "#")) + 1;
                }
                sUpType = "续传";
                sText   = "文章标题:/,文章内容:/,文章性质:/,搜索关键字:(多个用#分隔)/,文章收费:/,收费币种:/,";
                sName   = "Title,Content,IsAd,KeyWord,Cent,BzType,";
                sType   = "text,big,select,textarea,num,select,";
                sValu   = "" + model.Title + "'" + model.Content + "'" + model.IsAd + "'" + model.KeyWord + "'" + model.Cent + "'" + model.BzType + "'";
                sEmpt   = "false,false,True|正常文章|False|跳到广告,true,true,0|" + ub.Get("SiteBz") + "|1|" + ub.Get("SiteBz2") + ",";
            }
            else
            {
                sText = "文章标题:/,文章内容:/,文章性质:/,搜索关键字:(多个用#分隔)/,文章收费:/,收费币种:/,";
                sName = "Title,Content,IsAd,KeyWord,Cent,BzType,";
                sType = "text,big,select,textarea,num,select,";
                sValu = "''True''0''";
                sEmpt = "false,false,True|正常文章|False|跳到广告,true,true,0|" + ub.Get("SiteBz") + "|1|" + ub.Get("SiteBz2") + ",";
            }
            for (int i = 0; i < num; i++)
            {
                string y = ",";
                if (num == 1)
                {
                    strText = strText + y + "选择" + sUpType + "附图:/";
                }
                else
                {
                    strText = strText + y + "" + sUpType + "第" + (i + 1) + "个附图:/";
                }
                strName = strName + y + "file" + (i + 1);
                strType = strType + y + "file";
                strValu = strValu + "'";
                strEmpt = strEmpt + y;
            }

            strText = sText + Utils.Mid(strText, 1, strText.Length) + ",,,,";
            strName = sName + Utils.Mid(strName, 1, strName.Length) + ",ptype,nid,id,act";
            strType = sType + Utils.Mid(strType, 1, strType.Length) + ",hidden,hidden,hidden,hidden";
            strValu = sValu + Utils.Mid(strValu, 1, strValu.Length) + "'" + ptype + "'" + nid + "'" + id + "'text";
            strEmpt = sEmpt + Utils.Mid(strEmpt, 1, strEmpt.Length) + ",,,,";
            strIdea = "/温馨提示:搜索关键字留空时,系统将根据标题自动生成./";
            strOthe = "发表文本|上传|reset,classok.aspx,post,2,red|blue|blue";
            builder.Append(Out.wapform(strText, strName, strType, strValu, strEmpt, strIdea, strOthe));
        }
        if (id != 0)
        {
            builder.Append(Out.Tab("<div>", "<br />"));
            builder.Append(" <a href=\"" + Utils.getUrl("../detail.aspx?id=" + id + "&amp;backurl=" + Utils.PostPage(1) + "") + "\">预览</a>");
            builder.Append(" <a href=\"" + Utils.getUrl("class.aspx?act=delfile&amp;nid=" + nid + "&amp;id=" + id + "&amp;ptype=" + ptype + "") + "\">删附图(" + picNum + ")</a>");
            builder.Append(Out.Tab("</div>", ""));
        }
    }
Пример #12
0
    protected void Page_Load(object sender, EventArgs e)
    {
        int id = int.Parse(Utils.GetRequest("id", "get", 2, @"^[0-9]\d*$", "ID错误"));
        int v  = int.Parse(Utils.GetRequest("v", "get", 1, @"^[0-9]\d*$", "0"));

        if (!new BCW.BLL.Detail().Exists(id))
        {
            Utils.Error("不存在的记录", "");
        }
        int pageIndex;
        int recordCount;
        int pageSize = Utils.ParseInt(ub.GetSub("FtTextDetailNum", xmlPath));
        int pover    = int.Parse(Utils.GetRequest("pover", "get", 1, @"^[0-9]\d*$", "0"));

        string[] pageValUrl = { "id", "backurl" };
        pageIndex = Utils.ParseInt(Request.QueryString["vp"]);
        if (pageIndex == 0)
        {
            pageIndex = 1;
        }

        int pn = Utils.ParseInt(Request.QueryString["pn"]);

        if (pn == 0)
        {
            pn = 1;
        }

        int    meid = 0;
        string act  = Utils.GetRequest("act", "get", 1, "", "");

        BCW.Model.Detail model = new BCW.BLL.Detail().GetDetail(id);
        Master.Title = model.Title;
        string NodeTitle = new BCW.BLL.Topics().GetTitle(model.NodeId);

        //收费
        if (model.Types != 13)
        {
            if (model.Cent > 0)
            {
                if (meid == 0)
                {
                    meid = new BCW.User.Users().GetUsId();
                    if (meid == 0)
                    {
                        Utils.Login();//显示登录
                    }
                }
                string BT     = string.Empty;
                string Bz     = string.Empty;
                long   megold = 0;
                if (model.Types == 11)
                {
                    BT = "文章";
                }
                else
                {
                    BT = "图片";
                }
                if (model.BzType == 0)
                {
                    megold = new BCW.BLL.User().GetGold(meid);
                    Bz     = ub.Get("SiteBz");
                }
                else
                {
                    megold = new BCW.BLL.User().GetMoney(meid);
                    Bz     = ub.Get("SiteBz2");
                }
                string payIDs = "|" + model.PayId + "|";
                if (act != "ok" && payIDs.IndexOf("|" + meid + "|") == -1)
                {
                    new Out().head(Utils.ForWordType("温馨提示"));
                    Response.Write(Out.Tab("<div class=\"text\">", ""));
                    Response.Write("" + BT + "收费" + model.Cent + "" + Bz + ",确定要浏览吗?扣费一次,永久浏览");
                    Response.Write(Out.Tab("</div>", "<br />"));
                    Response.Write(Out.Tab("<div>", ""));
                    Response.Write("您自带" + megold + "" + Bz + "<a href=\"" + Utils.getUrl("/bbs/finance.aspx?act=vippay") + "\">[充值]</a><br />");
                    Response.Write("<a href=\"" + Utils.getUrl("detail.aspx?act=ok&amp;id=" + id + "&amp;backurl=" + Utils.getPage(0) + "") + "\">马上进入浏览</a><br />");
                    Response.Write("<a href=\"" + Utils.getPage("list.aspx?id=" + model.NodeId + "") + "\">返回上级</a>");
                    Response.Write(Out.Tab("</div>", ""));
                    Response.Write(new Out().foot());
                    Response.End();
                }
                if (payIDs.IndexOf("|" + meid + "|") == -1)
                {
                    if (megold < model.Cent)
                    {
                        Utils.Error("您的" + Bz + "不足", "");
                    }
                    //扣币
                    if (model.BzType == 0)
                    {
                        new BCW.BLL.User().UpdateiGold(meid, -Convert.ToInt64(model.Cent), "浏览收费" + BT + "");
                    }
                    else
                    {
                        new BCW.BLL.User().UpdateiMoney(meid, -Convert.ToInt64(model.Cent), "浏览收费" + BT + "");
                    }

                    //更新
                    payIDs = model.PayId + "|" + meid;
                    new BCW.BLL.Detail().UpdatePayId(id, payIDs);
                }
            }
        }
        if (model.Types == 11)
        {
            if (act.Contains("down"))
            {
                if (meid == 0)
                {
                    meid = new BCW.User.Users().GetUsId();
                    if (meid == 0)
                    {
                        Utils.Login();//显示登录
                    }
                }
                //下载文章
                BCW.User.Down.DownText(act, model);
            }

            //拾物随机
            builder.Append(BCW.User.Game.GiftFlows.ShowGiftFlows(12));
        }
        //顶部调用
        string TopUbb = string.Empty;

        if (model.Types == 11)
        {
            TopUbb = ub.GetSub("FtTextDetailTop", xmlPath);
        }
        else if (model.Types == 12)
        {
            TopUbb = ub.GetSub("FtPicDetailTop", xmlPath);
        }
        else if (model.Types == 13)
        {
            TopUbb = ub.GetSub("FtFileDetailTop", xmlPath);
        }
        if (TopUbb != "")
        {
            TopUbb = BCW.User.AdminCall.AdminUBB(Out.SysUBB(TopUbb));
            if (TopUbb.IndexOf("</div>") == -1)
            {
                builder.Append(Out.Tab("<div>", ""));
                builder.Append(TopUbb);
                builder.Append(Out.Tab("</div>", ""));
            }
            else
            {
                builder.Append(TopUbb);
            }
        }
        if (model.Types == 11)
        {
            builder.Append(Out.Tab("<div>", ""));
            builder.Append("<a href=\"" + Utils.getUrl("default.aspx") + "\">首页</a>&gt;");
            if (!Utils.GetDomain().Contains("boyi929"))
            {
                builder.Append("<a href=\"" + Utils.getUrl("default.aspx?id=298") + "\">新闻</a>&gt;");
            }
            builder.Append("<a href=\"" + Utils.getUrl("list.aspx?id=" + model.NodeId + "") + "\">" + new BCW.BLL.Topics().GetTitle(model.NodeId) + "</a>&gt;正文");
            builder.Append(Out.Tab("</div>", "<br />"));
        }
        builder.Append(Out.Tab("<div class=\"title\">" + model.Title + "</div>", "" + model.Title + ""));
        if (model.Types == 11)
        {
            builder.Append(Out.Tab("<div>", "<br />"));
            builder.Append("" + DT.FormatDate(model.AddTime, 1) + "");
            builder.Append(Out.Tab("</div>", ""));
        }
        builder.Append(Out.Tab("", Out.LHr()));
        if (pageIndex == 1)
        {
            string Pics = string.Empty;
            Pics = model.Pics.Trim();
            if (!string.IsNullOrEmpty(Pics))
            {
                string[] txtPic = Pics.Split("#".ToCharArray());
                if (model.Types != 12)
                {
                    builder.Append(Out.Tab("<div>", "<br />"));

                    if (pn > txtPic.Length)
                    {
                        pn = txtPic.Length;
                    }
                    builder.Append("<img src=\"" + Out.SysUBB(txtPic[pn - 1]) + "\" alt=\"load\"/>");
                    if (pn < txtPic.Length)
                    {
                        builder.Append("<br /><a href=\"" + Utils.getUrl("detail.aspx?id=" + id + "&amp;backurl=" + Utils.getPage(0) + "&amp;pn=" + (pn + 1) + "") + "\">下张</a> ");
                    }
                    if (pn > 1)
                    {
                        if (pn >= txtPic.Length)
                        {
                            builder.Append("<br />");
                        }
                        builder.Append("<a href=\"" + Utils.getUrl("detail.aspx?id=" + id + "&amp;backurl=" + Utils.getPage(0) + "&amp;pn=" + (pn - 1) + "") + "\">上张</a>");
                    }
                    if (txtPic.Length > 1)
                    {
                        builder.Append("(" + pn + "/" + txtPic.Length + ")");
                    }

                    builder.Append(Out.Tab("</div>", ""));
                }
            }

            if (model.Types == 13)
            {
                builder.Append(Out.Tab("<div>", "<br />"));
                if (!string.IsNullOrEmpty(model.TarText))
                {
                    builder.Append("[资费]:" + model.TarText + "<br />");
                }
                builder.Append("[分类]:<a href=\"" + Utils.getUrl("list.aspx?id=" + model.NodeId + "") + "\">" + NodeTitle + "</a><br />");
                builder.Append("[更新]:" + DT.FormatDate(model.AddTime, 11) + "<br />");
                if (!string.IsNullOrEmpty(model.LanText))
                {
                    builder.Append("[语言]:" + model.LanText + "<br />");
                }
                if (!string.IsNullOrEmpty(model.SafeText))
                {
                    builder.Append("[检查]:" + model.SafeText + "<br />");
                }
                if (model.IsVisa > 0)
                {
                    string IsVisa = string.Empty;
                    if (model.IsVisa == 1)
                    {
                        IsVisa = "未知";
                    }
                    else if (model.IsVisa == 1)
                    {
                        IsVisa = "需要";
                    }
                    else
                    {
                        IsVisa = "不需要";
                    }

                    builder.Append("[签证]:" + IsVisa + "<br />");
                }
                if (!string.IsNullOrEmpty(model.LyText))
                {
                    builder.Append("[来源]:" + model.LyText + "<br />");
                }
                string Content = string.Empty;
                if (pover == 0)
                {
                    if (model.Content.Length > 200)
                    {
                        Content = "" + Out.SysUBB(Utils.Left(model.Content, 200)) + "<a href=\"" + Utils.getUrl("detail.aspx?id=" + id + "&amp;pover=1&amp;&amp;backurl=" + Utils.PostPage(1) + "") + "\">详细&gt;&gt;</a>";
                    }
                    else
                    {
                        Content = Out.SysUBB(model.Content);
                    }
                }
                else
                {
                    Content = Out.SysUBB(model.Content);
                }
                builder.Append("[简介]:" + Content + "<br />");
                if (!string.IsNullOrEmpty(model.UpText))
                {
                    builder.Append("[更新]:" + model.UpText + "<br />");
                }
                if (!string.IsNullOrEmpty(model.Model))
                {
                    //机型适配
                    string PhoneBrand  = "";
                    string PhoneModel  = "";
                    string PhoneSystem = "";

                    if (Request.Cookies["BrandComment"] != null)
                    {
                        PhoneBrand  = HttpUtility.UrlDecode(Request.Cookies["BrandComment"]["PhoneBrand"]);
                        PhoneModel  = HttpUtility.UrlDecode(Request.Cookies["BrandComment"]["PhoneModel"]);
                        PhoneSystem = HttpUtility.UrlDecode(Request.Cookies["BrandComment"]["PhoneSystem"]);
                    }
                    builder.Append("<a href=\"" + Utils.getUrl("demore.aspx?id=" + id + "&amp;backurl=" + Utils.getPage(0) + "") + "\">适用机型</a>:");

                    if (PhoneModel != "" && model.Model.Contains(PhoneBrand))
                    {
                        string Model = "," + model.Model + ",";
                        if (Model.IndexOf("," + PhoneModel + ",") != -1)
                        {
                            builder.Append("" + (PhoneBrand + PhoneModel) + "");
                        }
                        else if (Model.IndexOf("," + PhoneSystem + ",") != -1)
                        {
                            builder.Append("" + PhoneSystem + "");
                        }
                    }
                    else
                    {
                        builder.Append("<a href=\"" + Utils.getUrl("model.aspx?backurl=" + Utils.PostPage(1) + "") + "\">未设置</a>");
                    }
                }
                builder.Append(Out.Tab("</div>", ""));
            }

            if (model.Types == 12 || model.Types == 13)
            {
                pageSize = Utils.ParseInt(ub.GetSub("FtPicListNum", xmlPath));
                if (model.Types == 13)
                {
                    pageSize = 20;
                }

                pageIndex = Utils.ParseInt(Request.QueryString["page"]);
                if (pageIndex == 0)
                {
                    pageIndex = 1;
                }
                //查询条件
                string strWhere = "NodeId=" + id + "";
                // 开始读取列表
                IList <BCW.Model.File> listFile = new BCW.BLL.File().GetFiles(pageIndex, pageSize, strWhere, out recordCount);
                if (listFile.Count > 0)
                {
                    int k = 1;
                    foreach (BCW.Model.File n in listFile)
                    {
                        if (k % 2 == 0)
                        {
                            builder.Append(Out.Tab("<div class=\"text\">", "<br />"));
                        }
                        else
                        {
                            builder.Append(Out.Tab("<div>", "<br />"));
                        }

                        if (model.Types == 12)
                        {
                            builder.Append("<img src=\"" + ((n.PrevFiles == "") ? n.Files : n.PrevFiles.ToString()) + "\" alt=\"load\"/><br /><a href=\"" + Utils.getUrl("" + n.Files + "") + "\">&gt;原图下载</a>.<a href=\"" + Utils.getUrl("/showpic.aspx?pic=" + n.PrevFiles + "&amp;backurl=" + Utils.PostPage(1) + "") + "\">编辑</a>");
                        }
                        else
                        {
                            builder.Append("[格式:" + n.FileExt.Replace(".", "") + "/大小:" + BCW.Files.FileTool.GetContentLength(n.FileSize) + " " + n.Content + "]<br />");
                            builder.Append("<a href=\"" + Utils.getUrl("demore.aspx?act=down&amp;id=" + n.ID + "&amp;backurl=" + Utils.PostPage(1) + "") + "\">&gt;&gt;免费下载到手机</a>");
                        }
                        k++;
                        builder.Append(Out.Tab("</div>", ""));
                    }
                    //分页
                    builder.Append(BasePage.MultiPage(pageIndex, pageSize, recordCount, Utils.getPageUrl(), pageValUrl, "page", 0));
                    builder.Append(Out.Tab("", "<br />"));
                }
            }
        }

        if (model.Types == 11)
        {
            //手工分页设置
            if (model.Content.IndexOf("##") != -1)
            {
                pageSize = 0;
            }
            string content = BasePage.MultiContent(model.Content, pageIndex, pageSize, pover, out recordCount);
            builder.Append(Out.Tab("<div>", "<br />"));
            builder.Append(Out.SysUBB(content.Replace("查看大图更多热图", "~摘自新华网~")).Replace("<br/>     <br/>", "<br />"));
            builder.Append(Out.Tab("</div>", ""));
            builder.Append(BasePage.MultiContentPage(model.Content, pageIndex, pageSize, recordCount, Utils.getPageUrl(), pageValUrl, "vp", pover));

            builder.Append(Out.Tab("", "<br />"));
        }
        if (ub.GetSub("FtGNset", xmlPath) == "0")
        {
            builder.Append(Out.Tab("<div>", ""));
            if (model.Types == 11)
            {
                builder.Append("<a href=\"" + Utils.getUrl("demore.aspx?act=downtext&amp;id=" + id + "&amp;backurl=" + Utils.getPage(0) + "") + "\">功能箱</a>.");
            }
            builder.Append("<a href=\"" + Utils.getUrl("/bbs/favorites.aspx?act=addin&amp;backurl=" + Utils.PostPage(1) + "") + "\">收藏</a>.");
            builder.Append("<a href=\"" + Utils.getUrl("/inter.aspx?act=recom&amp;backurl=" + Utils.PostPage(1) + "") + "\">分享.举报</a>");
            builder.Append(Out.Tab("</div>", "<br />"));
        }
        if (ub.GetSub("FtCKset", xmlPath) == "0")
        {
            builder.Append(Out.Tab("<div class=\"text\">", ""));
            builder.Append("=评论回复=");
            builder.Append(Out.Tab("</div>", "<br />"));
        }
        //快速评论
        string ReText = ub.GetSub("FtKCset", xmlPath);

        if (ReText != "")
        {
            builder.Append(Out.Tab("<div>", ""));
            ReText = ReText.Replace("#", "|");
            string ReStats = model.ReStats;
            if (string.IsNullOrEmpty(ReStats))
            {
                ReStats = ReText;
            }
            string sStats = string.Empty;
            //修改用户点击

            /*
             * 3*/
            if (v != 0)//点击支持反对路过选项进入
            {
                int myid = new BCW.User.Users().GetUsId();
                if (myid == 0)
                {
                    Utils.Login();  //需要登录
                }
                // builder.Append("clickid:" + model.ClickID + "<br/>");
                if (!("#" + model.ClickID + "#").Contains("#" + myid + "#"))//用户未点击过
                {
                    string[] arrReStats = ReStats.Split("|".ToCharArray());
                    for (int i = 0; i < arrReStats.Length; i++)
                    {
                        if ((v - 1) == i)
                        {
                            sStats += "|" + Convert.ToInt32(Utils.ParseInt(arrReStats[i]) + 1);
                        }
                        else
                        {
                            sStats += "|" + Utils.ParseInt(arrReStats[i]);
                        }
                    }
                    sStats = Utils.Mid(sStats, 1, sStats.Length);
                    new BCW.BLL.Detail().UpdateReStats(id, sStats, Utils.GetUsIP());
                    string click  = model.ClickID;
                    string saveid = string.Empty;
                    if (string.IsNullOrEmpty(click))
                    {
                        saveid = saveid + myid;
                    }
                    else
                    {
                        saveid = myid + "#" + click;
                    }
                    //    builder.Append(saveid+"<br/>");
                    new BCW.BLL.Detail().UpdateClickID(id, saveid);
                }
                else
                {
                    string[] arrReStats = ReStats.Split("|".ToCharArray());
                    for (int i = 0; i < arrReStats.Length; i++)
                    {
                        if (string.IsNullOrEmpty(sStats))
                        {
                            sStats += arrReStats[i];
                        }
                        else
                        {
                            sStats += "|" + Utils.ParseInt(arrReStats[i]);
                        }
                    }
                }
            }
            else
            {
                sStats = ReStats;
            }
            string[] arrText   = ReText.Split("|".ToCharArray());
            string[] arrsStats = sStats.Split("|".ToCharArray());
            for (int i = 0; i < arrText.Length; i++)
            {
                string aStats = string.Empty;
                if (arrsStats.Length <= i)
                {
                    aStats = "0";
                }
                else
                {
                    aStats = Utils.ParseInt(arrsStats[i].ToString()).ToString();
                }

                builder.Append("<a href=\"" + Utils.getUrl("detail.aspx?id=" + id + "&amp;v=" + (i + 1) + "&amp;backurl=" + Utils.getPage(0) + "") + "\">" + Out.BasUBB(arrText[i].ToString()) + "(" + aStats + ")</a> ");
            }
            builder.Append(Out.Tab("</div>", "<br />"));
        }
        //更新人气点击
        new BCW.BLL.Detail().UpdateReadcount(id, 1);

        if (ub.GetSub("FtCKset", xmlPath) == "0")
        {
            string strText = ",,,";
            string strName = "Content,id,act,backurl";
            string strType = "text,hidden,hidden,hidden";
            string strValu = "'" + id + "'ok'" + Utils.getPage(0) + "";
            string strEmpt = "true,,,";
            string strIdea = "/";
            string strOthe = "发表评论,comment.aspx,post,3,red";
            builder.Append(Out.wapform(strText, strName, strType, strValu, strEmpt, strIdea, strOthe));

            DataSet ds = new BCW.BLL.Comment().GetList(id, 3, 0);
            builder.Append(Out.Tab("<div>", "<br />"));
            if (ds != null && ds.Tables[0].Rows.Count > 0)
            {
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    builder.AppendFormat("{0}.{1}:{2}({3})", (i + 1), ds.Tables[0].Rows[i]["UserName"].ToString(), ds.Tables[0].Rows[i]["Content"].ToString(), DT.FormatDate(Convert.ToDateTime(ds.Tables[0].Rows[i]["AddTime"]), 1));
                    if (!string.IsNullOrEmpty(ds.Tables[0].Rows[i]["ReText"].ToString()))
                    {
                        builder.Append(Out.Tab("<font color=\"red\">", ""));
                        builder.Append("<br />★管理员回复:" + ds.Tables[0].Rows[i]["ReText"].ToString() + "");
                        builder.Append(Out.Tab("</font>", ""));
                    }
                    builder.Append("<br />");
                }
            }
            builder.Append("<a href=\"" + Utils.getUrl("comment.aspx?id=" + id + "&amp;backurl=" + Utils.getPage(0) + "") + "\">查看更多评论(" + model.Recount + "条)</a>");
            builder.Append(Out.Tab("</div>", "<br />"));
        }
        // 下条
        builder.Append(Out.Tab("<div>", ""));
        BCW.Model.Detail x = new BCW.BLL.Detail().GetPreviousNextDetail(id, model.NodeId, true);
        if (!string.IsNullOrEmpty(x.Title))
        {
            builder.Append("<a href=\"" + Utils.getUrl("detail.aspx?id=" + x.ID + "&amp;backurl=" + Utils.getPage(0) + "") + "\">下一条:" + x.Title + "</a><br />");
        }
        // 上条
        BCW.Model.Detail s = new BCW.BLL.Detail().GetPreviousNextDetail(id, model.NodeId, false);
        if (!string.IsNullOrEmpty(s.Title))
        {
            builder.Append("<a href=\"" + Utils.getUrl("detail.aspx?id=" + s.ID + "&amp;backurl=" + Utils.getPage(0) + "") + "\">上一条:" + s.Title + "</a><br />");
        }
        builder.Append(Out.Tab("</div>", ""));

        ////根据关键字取相关记录
        //if (model.Types == 11)
        //{
        //    string wheTabs = string.Empty;
        //    if (!string.IsNullOrEmpty(model.KeyWord))
        //    {
        //        string[] wheTab;
        //        wheTab = model.KeyWord.Split("#".ToCharArray());
        //        for (int i = 0; i < wheTab.Length; i++)
        //        {
        //            if (i > 0)
        //            {
        //                wheTabs = wheTabs + " OR ";
        //            }
        //            wheTabs = wheTabs + "'#'+KeyWord+'#' like '%#" + wheTab[i] + "#%'";
        //        }
        //    }
        //    ds = new BCW.BLL.Detail().GetList("ID,Title", "NodeId=" + model.NodeId + " AND Types=" + model.Types + " AND ID<>" + id + " AND (" + wheTabs + ") ORDER BY ID DESC");
        //    if (ds != null && ds.Tables[0].Rows.Count > 0)
        //    {
        //        builder.Append(Out.Tab("<div>", ""));
        //        builder.Append("=相关文章=");
        //        builder.Append(Out.Tab("</div>", ""));
        //        for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
        //        {
        //            builder.Append(Out.Tab("<div>", "<br />"));
        //            builder.Append("<a href=\"" + Utils.getUrl("detail.aspx?id=" + ds.Tables[0].Rows[i]["ID"].ToString() + "") + "\">" + ds.Tables[0].Rows[i]["Title"].ToString() + "</a>");
        //            builder.Append(Out.Tab("</div>", ""));
        //        }
        //        if (ds.Tables[0].Rows.Count > 3)
        //        {
        //            builder.Append(Out.Tab("<div>", "<br />"));
        //            builder.Append("<a href=\"" + Utils.getUrl("detail.aspx?id=" + id + "") + "\">..更多相关(" + ds.Tables[0].Rows.Count + ")</a>");
        //            builder.Append(Out.Tab("</div>", ""));
        //        }
        //    }
        //}

        //底部调用
        string FootUbb = string.Empty;

        if (model.Types == 11)
        {
            FootUbb = ub.GetSub("FtTextDetailFoot", xmlPath);
        }
        else if (model.Types == 12)
        {
            FootUbb = ub.GetSub("FtPicDetailFoot", xmlPath);
        }
        else if (model.Types == 13)
        {
            FootUbb = ub.GetSub("FtFileDetailFoot", xmlPath);
        }
        if (FootUbb != "")
        {
            FootUbb = BCW.User.AdminCall.AdminUBB(Out.SysUBB(FootUbb));
            if (FootUbb.IndexOf("</div>") == -1)
            {
                builder.Append(Out.Tab("<div>", ""));
                builder.Append(FootUbb);
                builder.Append(Out.Tab("</div>", ""));
            }
            else
            {
                builder.Append(TopUbb);
            }
        }
        builder.Append(Out.Tab("<div class=\"title\">", Out.RHr()));
        builder.Append("<a href=\"" + Utils.getUrl("default.aspx") + "\">首页</a>-");
        builder.Append("<a href=\"" + Utils.getPage("list.aspx?id=" + model.NodeId + "") + "\">上级</a>-");
        builder.Append("<a href=\"" + Utils.getUrl("list.aspx?id=" + model.NodeId + "") + "\">" + new BCW.BLL.Topics().GetTitle(model.NodeId) + "</a>");
        builder.Append(Out.Tab("</div>", ""));
    }
Пример #13
0
    private void DownPage()
    {
        if (ub.GetSub("FtFileIsUser", xmlPath) == "2")
        {
            Utils.Error("下载已关闭", "");
        }
        int meid = 0;

        if (ub.GetSub("FtFileIsUser", xmlPath) == "1")
        {
            meid = new BCW.User.Users().GetUsId();
            if (meid == 0)
            {
                Utils.Login();
            }
        }
        int id = int.Parse(Utils.GetRequest("id", "get", 2, @"^[1-9]\d*$", "ID错误"));

        BCW.Model.File m = new BCW.BLL.File().GetFile(id);
        if (m == null)
        {
            Utils.Error("不存在的文件", "");
        }

        //下载收费
        BCW.Model.Detail model = new BCW.BLL.Detail().GetDetail(m.NodeId);
        if (model.Cent > 0)
        {
            if (meid == 0)
            {
                meid = new BCW.User.Users().GetUsId();
                if (meid == 0)
                {
                    Utils.Login();
                }
            }
            string Bz     = string.Empty;
            long   megold = 0;
            if (model.BzType == 0)
            {
                megold = new BCW.BLL.User().GetGold(meid);
                Bz     = ub.Get("SiteBz");
            }
            else
            {
                megold = new BCW.BLL.User().GetMoney(meid);
                Bz     = ub.Get("SiteBz2");
            }
            string info   = Utils.GetRequest("info", "get", 1, "", "");
            string payIDs = "|" + model.PayId + "|";
            if (info != "ok" && payIDs.IndexOf("|" + meid + "|") == -1)
            {
                new Out().head(Utils.ForWordType("温馨提示"));
                Response.Write(Out.Tab("<div class=\"text\">", ""));
                Response.Write("下载收费" + model.Cent + "" + Bz + ",确定要下载吗?扣费一次,永久下载");
                Response.Write(Out.Tab("</div>", "<br />"));
                Response.Write(Out.Tab("<div>", ""));
                Response.Write("您自带" + megold + "" + Bz + "<a href=\"" + Utils.getUrl("/bbs/finance.aspx?act=vippay") + "\">[充值]</a><br />");
                Response.Write("<a href=\"" + Utils.getUrl("demore.aspx?act=down&amp;info=ok&amp;id=" + id + "&amp;backurl=" + Utils.getPage(0) + "") + "\">马上进入下载</a><br />");
                Response.Write("<a href=\"" + Utils.getPage("detail.aspx?id=" + model.NodeId + "") + "\">返回上级</a>");
                Response.Write(Out.Tab("</div>", ""));
                Response.Write(new Out().foot());
                Response.End();
            }
            if (payIDs.IndexOf("|" + meid + "|") == -1)
            {
                if (megold < model.Cent)
                {
                    Utils.Error("您的" + Bz + "不足", "");
                }
                //扣币
                if (model.BzType == 0)
                {
                    new BCW.BLL.User().UpdateiGold(meid, -Convert.ToInt64(model.Cent), "下载收费文件");
                }
                else
                {
                    new BCW.BLL.User().UpdateiMoney(meid, -Convert.ToInt64(model.Cent), "下载收费文件");
                }

                //更新
                payIDs = model.PayId + "|" + meid;
                new BCW.BLL.Detail().UpdatePayId(model.NodeId, payIDs);
            }
        }
        //更新下载次数
        new BCW.BLL.File().UpdateDownNum(id, 1);
        BCW.User.Down.ShowMsg(m.Files);
    }
Пример #14
0
    /// <summary>
    /// 添加/编辑文章/图片/文件
    /// </summary>
    private void UpdateOther(string act, string TypeName, int ptype, int nid, int id)
    {
        string ac      = Utils.GetRequest("ac", "post", 1, "", "");
        string Title   = Utils.GetRequest("Title", "post", 2, @"^[\s\S]{1,50}$", "" + TypeName + "标题限1-50字");
        string KeyWord = Utils.GetRequest("KeyWord", "post", 1, "", "");
        string Content = string.Empty;

        if (ptype != 12)
        {
            Content = Utils.GetRequest("Content", "post", 2, @"^[\s\S]{1,}$", "" + TypeName + "内容不能为空");
        }
        string TarText  = string.Empty;
        string LanText  = string.Empty;
        string SafeText = string.Empty;
        string LyText   = string.Empty;
        string UpText   = string.Empty;
        int    IsVisa   = 0;

        if (ptype == 13)
        {
            TarText  = Utils.GetRequest("TarText", "post", 3, @"^[\s\S]{1,50}$", "资费说明限50字内,可留空");
            LanText  = Utils.GetRequest("LanText", "post", 3, @"^[\s\S]{1,50}$", "语言说明限50字内,可留空");
            SafeText = Utils.GetRequest("SafeText", "post", 3, @"^[\s\S]{1,50}$", "检查说明限50字内,可留空");
            LyText   = Utils.GetRequest("LyText", "post", 3, @"^[\s\S]{1,50}$", "来源说明限50字内,可留空");
            UpText   = Utils.GetRequest("UpText", "post", 3, @"^[\s\S]{1,50}$", "更新说明限50字内,可留空");
            IsVisa   = int.Parse(Utils.GetRequest("IsVisa", "post", 1, @"^[0-3]$", "0"));
        }
        bool   IsAd   = bool.Parse(Utils.GetRequest("IsAd", "post", 2, @"^False|True$", "" + TypeName + "性质选择错误"));
        bool   blpic  = bool.Parse(Utils.GetRequest("blpic", "post", 1, @"^False|True$", "False"));//文件是否上传截图
        int    BzType = int.Parse(Utils.GetRequest("BzType", "post", 1, @"^[0-1]$", "0"));
        int    Cent   = int.Parse(Utils.GetRequest("Cent", "post", 1, @"^[0-9]\d*$", "0"));
        string sFiles = string.Empty;
        string aName  = string.Empty;
        string Model  = Utils.GetRequest("Model", "post", 1, "", "");
        int    newId  = 0;

        //关键字的生成
        if (string.IsNullOrEmpty(KeyWord))
        {
            KeyWord = Out.CreateKeyWord(Title, 2);
        }
        else
        {
            if (KeyWord.Length > 500)
            {
                Utils.Error("关键字不能超500字", "");
            }
            KeyWord = Utils.GetRequest("KeyWord", "post", 2, @"^[^\#]{1,50}(?:\#[^\#]{1,50}){0,500}$", "关键字填写格式错误");
        }
        if (blpic != true)
        {
            if (id == 0)
            {
                aName = "添加" + TypeName + "";
            }
            else
            {
                aName = "编辑" + TypeName + "";
            }
        }
        else
        {
            aName = "上传截图";
        }
        Master.Title = aName;

        //添加验证
        if (id == 0)
        {
            if (new BCW.BLL.Detail().Exists(Title))
            {
                Utils.Error("数据库记录已存在“" + Title + "”", "");
            }
        }

        BCW.Model.Detail model = new BCW.Model.Detail();
        model.Title     = Title;
        model.KeyWord   = KeyWord;
        model.Model     = Model.ToUpper().Replace(",", ",");
        model.IsAd      = IsAd;
        model.Types     = ptype;
        model.NodeId    = nid;
        model.Content   = Content;
        model.TarText   = TarText;
        model.LanText   = LanText;
        model.SafeText  = SafeText;
        model.LyText    = LyText;
        model.UpText    = UpText;
        model.IsVisa    = IsVisa;
        model.AddTime   = DateTime.Now;
        model.Readcount = 0;
        model.Recount   = 0;
        model.Cent      = Cent;
        model.BzType    = BzType;
        model.Hidden    = 0;
        model.UsID      = 0;
        if (id == 0)
        {
            newId = new BCW.BLL.Detail().Add(model);
        }
        else
        {
            newId    = id;
            model.ID = id;
            new BCW.BLL.Detail().Update(model);
        }

        //-----------------文章附件/图片附件的提交开始
        if (ptype == 11 || ptype == 12)
        {
            //文章上传文件开始
            if (Utils.ToSChinese(ac) == "上传")
            {
                if (SaveFiles(ptype, newId, out sFiles))
                {
                    aName += "/上传文章附件";
                }
            }
            //文章上传文件结束

            else if (Utils.ToSChinese(ac) == "上传图片")
            {
                if (SaveFiles(ptype, newId, out sFiles))
                {
                    aName += "/上传图片";
                }
            }
            //添加图片结束
        }
        //-----------------文章附件/图片附件的提交结束

        //-----------------文件附件提交开始
        else if (ptype == 13)
        {
            if (Utils.ToSChinese(ac) == "上传文件")
            {
                if (SaveFiles(ptype, newId, out sFiles))
                {
                    aName += "/上传文件";
                }
            }
        }
        //-----------------文件附件提交结束
        //得到截图文件
        string sPics = "";
        string Pics  = "";

        if (sFiles != "")
        {
            sPics = Utils.Mid(sFiles, 1, sFiles.Length);
        }
        if (sPics == "#")
        {
            sPics = "";
        }

        if (sPics != "")
        {
            Pics = new BCW.BLL.Detail().GetPics(newId);
            if (Pics != "")
            {
                sPics = Pics + "#" + sPics;
            }

            new BCW.BLL.Detail().UpdatePics(newId, sPics);
        }

        //截图上传开始

        if (blpic == true)
        {
            UiPic(act, ptype, nid, newId);
        }
        else
        {
            builder.Append(Out.Tab("<div class=\"title\">", ""));
            builder.Append("" + aName + "成功");
            builder.Append(Out.Tab("</div>", ""));
        }
    }
Пример #15
0
    private void CommentPage(string act)
    {
        int ptype = int.Parse(Utils.GetRequest("ptype", "all", 1, @"^[0-9]\d*$", "0"));
        int id    = int.Parse(Utils.GetRequest("id", "all", 1, @"^[0-9]\d*$", "0"));
        int uid   = int.Parse(Utils.GetRequest("uid", "all", 1, @"^[0-9]\d*$", "0"));

        builder.Append(Out.Tab("<div class=\"title\">", ""));
        builder.Append("主站评论管理");
        builder.Append(Out.Tab("</div>", "<br />"));
        if (id != 0)
        {
            if (!new BCW.BLL.Detail().Exists(id))
            {
                Utils.Error("不存在的记录", "");
            }
            string Title = new BCW.BLL.Detail().GetTitle(id);
            builder.Append(Out.Tab("<div class=\"text\">", ""));

            builder.Append("<a href=\"" + Utils.getUrl("../detail.aspx?id=" + id + "&amp;backurl=" + Utils.getPage(0) + "") + "\">.." + Title + "</a>");
            builder.Append(Out.Tab("</div>", "<br />"));
        }
        else
        {
            builder.Append(Out.Tab("<div class=\"text\">", ""));

            if (ptype == 0)
            {
                builder.Append("全部|");
            }
            else
            {
                builder.Append("<a href=\"" + Utils.getUrl("commentary.aspx?act=" + act + "&amp;id=" + id + "&amp;uid=" + uid + "&amp;ptype=0&amp;backurl=" + Utils.getPage(0) + "") + "\">全部</a>|");
            }

            if (ptype == 1)
            {
                builder.Append("文章|");
            }
            else
            {
                builder.Append("<a href=\"" + Utils.getUrl("commentary.aspx?act=" + act + "&amp;id=" + id + "&amp;uid=" + uid + "&amp;ptype=1&amp;backurl=" + Utils.getPage(0) + "") + "\">文章</a>|");
            }

            if (ptype == 2)
            {
                builder.Append("图片|");
            }
            else
            {
                builder.Append("<a href=\"" + Utils.getUrl("commentary.aspx?act=" + act + "&amp;id=" + id + "&amp;uid=" + uid + "&amp;ptype=2&amp;backurl=" + Utils.getPage(0) + "") + "\">图片</a>|");
            }

            if (ptype == 3)
            {
                builder.Append("文件|");
            }
            else
            {
                builder.Append("<a href=\"" + Utils.getUrl("commentary.aspx?act=" + act + "&amp;id=" + id + "&amp;uid=" + uid + "&amp;ptype=3&amp;backurl=" + Utils.getPage(0) + "") + "\">文件</a>|");
            }

            if (ptype == 4)
            {
                builder.Append("商品");
            }
            else
            {
                builder.Append("<a href=\"" + Utils.getUrl("commentary.aspx?act=" + act + "&amp;id=" + id + "&amp;uid=" + uid + "&amp;ptype=4&amp;backurl=" + Utils.getPage(0) + "") + "\">商品</a>");
            }

            builder.Append(Out.Tab("</div>", "<br />"));
        }
        int    pageIndex;
        int    recordCount;
        int    pageSize = Convert.ToInt32(ub.Get("SiteListNo"));
        string strWhere = string.Empty;
        string arrId    = string.Empty;

        string[] pageValUrl = { "act", "ptype", "id", "uid", "backurl" };
        pageIndex = Utils.ParseInt(Request.QueryString["page"]);
        if (pageIndex == 0)
        {
            pageIndex = 1;
        }
        //查询条件
        if (id == 0)
        {
            if (ptype != 0)
            {
                strWhere += "Types=" + (ptype + 10) + "";
            }
            if (uid != 0)
            {
                if (strWhere == "")
                {
                    strWhere += "userid=" + uid + "";
                }
                else
                {
                    strWhere += "and userid=" + uid + "";
                }
            }
        }
        else
        {
            strWhere = "DetailId=" + id + "";
        }
        // 开始读取列表
        IList <BCW.Model.Comment> listComment = new BCW.BLL.Comment().GetComments(pageIndex, pageSize, strWhere, out recordCount);

        if (listComment.Count > 0)
        {
            int k = 1;
            foreach (BCW.Model.Comment n in listComment)
            {
                if (k % 2 == 0)
                {
                    builder.Append(Out.Tab("<div class=\"text\">", "<br />"));
                }
                else
                {
                    if (k == 1)
                    {
                        builder.Append(Out.Tab("<div>", ""));
                    }
                    else
                    {
                        builder.Append(Out.Tab("<div>", "<br />"));
                    }
                }
                string sFace = string.Empty;
                //if (n.Face != 0)
                //    sFace = "<img src=\"/Files/face/" + n.Face + ".gif\" alt=\"load\"/>";
                builder.AppendFormat("<a href=\"" + Utils.getUrl("commentary.aspx?act=del&amp;ptype=" + ptype + "&amp;id={0}&amp;backurl=" + Utils.PostPage(true) + "") + "\">[删]</a>{1}.{2}:{3}{4}({5})", n.ID, (pageIndex - 1) * pageSize + k, n.UserName, sFace, n.Content, DT.FormatDate(n.AddTime, 1));
                if (!string.IsNullOrEmpty(n.ReText))
                {
                    builder.Append(Out.Tab("<font color=\"red\">", ""));
                    builder.Append("<br />★管理员回复:" + n.ReText + "");
                    builder.Append(Out.Tab("</font>", ""));
                }
                builder.Append("<a href=\"" + Utils.getUrl("commentary.aspx?act=reok&amp;ptype=" + ptype + "&amp;pid=" + n.ID + "&amp;backurl=" + Utils.PostPage(1) + "") + "\">[回]</a>");

                k++;
                builder.Append(Out.Tab("</div>", ""));
            }

            // 分页
            builder.Append(BasePage.MultiPage(pageIndex, pageSize, recordCount, Utils.getPageUrl(), pageValUrl, "page", 0));
        }
        else
        {
            builder.Append(Out.Div("div", "没有相关记录.."));
        }
        if (id == 0)
        {
            builder.Append(Out.Tab("</div>", ""));
            string strText = "输入用户ID:/,,";
            string strName = "uid,ptype,act";
            string strType = "num,hidden,hidden";
            string strValu = "'" + ptype + "'comment";
            string strEmpt = "true,false,false";
            string strIdea = "/";
            string strOthe = "搜评论,commentary.aspx,post,1,red";
            builder.Append(Out.wapform(strText, strName, strType, strValu, strEmpt, strIdea, strOthe));
        }
        builder.Append(Out.Tab("</div>", ""));
        builder.Append(Out.Tab("<div class=\"hr\"></div>", Out.Hr()));
        builder.Append(Out.Tab("<div>", ""));
        if (Utils.getPage(1) != "")
        {
            builder.Append(" <a href=\"" + Utils.getPage(1) + "\">返回上一级</a><br />");
        }
        builder.Append("<a href=\"" + Utils.getUrl("commentary.aspx?act=delpage&amp;ptype=" + ptype + "&amp;uid=" + uid + "&amp;id=" + id + "&amp;page=" + pageIndex + "&amp;backurl=" + Utils.PostPage(1) + "") + "\">删除本页评论</a><br />");
        builder.Append("<a href=\"" + Utils.getUrl("commentary.aspx") + "\">返回评论管理</a><br />");
        builder.Append(Out.Tab("</div><div class=\"title\"><a href=\"" + Utils.getUrl("default.aspx") + "\">返回管理中心</a>", "<a href=\"" + Utils.getUrl("default.aspx") + "\">返回管理中心</a>"));
        builder.Append(Out.Tab("</div>", "<br />"));
    }
Пример #16
0
    /// <summary>
    /// 添加/编辑文章/图片/文件
    /// </summary>
    private void UpdateOther(string act, string TypeName, int ptype, int nid, int id)
    {
        int meid = new BCW.User.Users().GetUsId();

        if (meid == 0)
        {
            Utils.Login();
        }

        string ac       = Utils.GetRequest("ac", "post", 1, "", "");
        string Title    = Utils.GetRequest("Title", "post", 2, @"^[\s\S]{1,50}$", "" + TypeName + "标题限1-50字");
        string KeyWord  = Utils.GetRequest("KeyWord", "post", 1, "", "");
        string Content  = Utils.GetRequest("Content", "post", 2, @"^[\s\S]{1,}$", "" + TypeName + "内容不能为空");
        string TarText  = string.Empty;
        string LanText  = string.Empty;
        string SafeText = string.Empty;
        string LyText   = string.Empty;
        string UpText   = string.Empty;
        int    IsVisa   = 0;
        bool   IsAd     = true;
        bool   blpic    = bool.Parse(Utils.GetRequest("blpic", "post", 1, @"^False|True$", "False"));//文件是否上传截图
        int    BzType   = 0;
        int    Cent     = 0;
        string sFiles   = string.Empty;
        string aName    = string.Empty;
        string Model    = Utils.GetRequest("Model", "post", 1, "", "");
        int    newId    = 0;

        //关键字的生成
        if (string.IsNullOrEmpty(KeyWord))
        {
            KeyWord = Out.CreateKeyWord(Title, 2);
        }
        else
        {
            if (KeyWord.Length > 500)
            {
                Utils.Error("关键字不能超500字", "");
            }
            KeyWord = Utils.GetRequest("KeyWord", "post", 2, @"^[^\#]{1,50}(?:\#[^\#]{1,50}){0,500}$", "关键字填写格式错误");
        }
        if (blpic != true)
        {
            if (id == 0)
            {
                aName = "添加" + TypeName + "";
            }
            else
            {
                aName = "编辑" + TypeName + "";
            }
        }
        else
        {
            aName = "上传截图";
        }
        Master.Title = aName;

        BCW.Model.Detail model = new BCW.Model.Detail();
        model.Title     = Title;
        model.KeyWord   = KeyWord;
        model.Model     = Model.ToUpper().Replace(",", ",");
        model.IsAd      = IsAd;
        model.Types     = ptype;
        model.NodeId    = nid;
        model.Content   = Content;
        model.TarText   = TarText;
        model.LanText   = LanText;
        model.SafeText  = SafeText;
        model.LyText    = LyText;
        model.UpText    = UpText;
        model.IsVisa    = IsVisa;
        model.AddTime   = DateTime.Now;
        model.Readcount = 0;
        model.Recount   = 0;
        model.Cent      = Cent;
        model.BzType    = BzType;
        model.Hidden    = 1;
        model.UsID      = meid;
        if (id == 0)
        {
            newId = new BCW.BLL.Detail().Add(model);
        }
        else
        {
            newId    = id;
            model.ID = id;
            new BCW.BLL.Detail().Update(model);
        }

        //-----------------文件附件提交开始
        if (SaveFiles(ptype, newId, out sFiles))
        {
            aName += "/上传文件";
        }
        //-----------------文件附件提交结束
        //得到截图文件
        string sPics = "";
        string Pics  = "";

        if (sFiles != "")
        {
            sPics = Utils.Mid(sFiles, 1, sFiles.Length);
        }
        if (sPics == "#")
        {
            sPics = "";
        }

        if (sPics != "")
        {
            Pics = new BCW.BLL.Detail().GetPics(newId);
            if (Pics != "")
            {
                sPics = Pics + "#" + sPics;
            }

            new BCW.BLL.Detail().UpdatePics(newId, sPics);
        }

        //截图上传开始

        if (blpic == true)
        {
            UiPic(act, ptype, nid, newId);
        }
        else
        {
            builder.Append(Out.Tab("<div>", ""));
            builder.Append("" + aName + "成功!请等待管理员进行审核,多谢您对本站的支持!");
            builder.Append(Out.Tab("</div>", ""));
            builder.Append(Out.Tab("<div class=\"title\">", Out.Hr()));
            builder.Append("<a href=\"" + Utils.getUrl("default.aspx") + "\">首页</a>-");
            builder.Append("<a href=\"" + Utils.getPage("default.aspx") + "\">返回上级</a>");
            builder.Append(Out.Tab("</div>", ""));
        }
    }
Пример #17
0
    private void DetailPage(int ptype, string NodeId)
    {
        Master.Title = "资源搜索";
        string keyword = Utils.GetRequest("keyword", "all", 2, @"^[\s\S]{1,102}$", "请输入1-10字的搜索关键字");

        builder.Append(Out.Tab("<div class=\"title\">", ""));
        builder.Append("搜索:'" + keyword + "'");
        builder.Append(Out.Tab("</div>", "<br />"));
        int    pageIndex;
        int    recordCount;
        int    pageSize = Convert.ToInt32(ub.Get("SiteListNo"));
        string strWhere = "";

        string[] pageValUrl = { "pt", "keyword", "backurl" };
        pageIndex = Utils.ParseInt(Request.QueryString["page"]);
        if (pageIndex == 0)
        {
            pageIndex = 1;
        }
        //查询条件
        if (ptype == 0)
        {
            strWhere = "Types=11 and (Title like '%" + keyword + "%' OR '#'+KeyWord+'#' like '%#" + keyword + "#%')";
        }
        else if (ptype == 1)
        {
            strWhere = "Types=13 and (Title like '%" + keyword + "%' OR '#'+KeyWord+'#' like '%#" + keyword + "#%')";
        }
        else if (ptype == 2)
        {
            strWhere = "Types=12 and (Title like '%" + keyword + "%' OR '#'+KeyWord+'#' like '%#" + keyword + "#%')";
        }
        else if (ptype == 3)
        {
            strWhere = "(Title like '%" + keyword + "%' OR '#'+KeyWord+'#' like '%#" + keyword + "#%')";
        }

        if (NodeId != "0" && NodeId.Contains(";"))
        {
            NodeId    = NodeId.Replace(";", ",");
            strWhere += " and NodeId in(" + NodeId + ")";
        }

        // 开始读取列表
        if (ptype < 3)
        {
            IList <BCW.Model.Detail> listDetail = new BCW.BLL.Detail().GetDetails(pageIndex, pageSize, strWhere, out recordCount);
            if (listDetail.Count > 0)
            {
                int k = 1;
                foreach (BCW.Model.Detail n in listDetail)
                {
                    if (k % 2 == 0)
                    {
                        builder.Append(Out.Tab("<div class=\"text\">", "<br />"));
                    }
                    else
                    {
                        if (k == 1)
                        {
                            builder.Append(Out.Tab("<div>", ""));
                        }
                        else
                        {
                            builder.Append(Out.Tab("<div>", "<br />"));
                        }
                    }
                    builder.AppendFormat("<a href=\"" + Utils.getUrl("detail.aspx?id={0}&amp;backurl=" + Utils.PostPage(1) + "") + "\">{1}.{2}</a>", n.ID, (pageIndex - 1) * pageSize + k, n.Title);

                    k++;
                    builder.Append(Out.Tab("</div>", ""));
                }

                // 分页
                builder.Append(BasePage.MultiPage(pageIndex, pageSize, recordCount, Utils.getPageUrl(), pageValUrl, "page", 0));
            }
            else
            {
                builder.Append(Out.Div("div", "没有相关记录.."));
            }
        }
        else if (ptype == 3)
        {
            // 开始读取列表
            IList <BCW.Model.Goods> listGoods = new BCW.BLL.Goods().GetGoodss(pageIndex, pageSize, strWhere, out recordCount);
            if (listGoods.Count > 0)
            {
                int k = 1;
                foreach (BCW.Model.Goods n in listGoods)
                {
                    if (k % 2 == 0)
                    {
                        builder.Append(Out.Tab("<div class=\"text\">", "<br />"));
                    }
                    else
                    {
                        if (k == 1)
                        {
                            builder.Append(Out.Tab("<div>", ""));
                        }
                        else
                        {
                            builder.Append(Out.Tab("<div>", "<br />"));
                        }
                    }
                    builder.AppendFormat("<a href=\"" + Utils.getUrl("shopdetail.aspx?id={0}&amp;backurl=" + Utils.PostPage(1) + "") + "\">{2}.{3}</a>", n.ID, pageIndex, (pageIndex - 1) * pageSize + k, n.Title);

                    k++;
                    builder.Append(Out.Tab("</div>", ""));
                }

                // 分页
                builder.Append(BasePage.MultiPage(pageIndex, pageSize, recordCount, Utils.getPageUrl(), pageValUrl, "page", 0));
            }
            else
            {
                builder.Append(Out.Div("div", "没有相关记录.."));
            }
        }
        else if (ptype == 4)
        {
            strWhere += "Title like '%" + keyword + "%'";
            string strOrder = "ID Desc";
            // 开始读取列表
            IList <BCW.Model.Text> listText = new BCW.BLL.Text().GetTexts(pageIndex, pageSize, strWhere, strOrder, out recordCount);
            if (listText.Count > 0)
            {
                int k = 1;
                foreach (BCW.Model.Text n in listText)
                {
                    if (k % 2 == 0)
                    {
                        builder.Append(Out.Tab("<div class=\"text\">", "<br />"));
                    }
                    else
                    {
                        if (k == 1)
                        {
                            builder.Append(Out.Tab("<div>", ""));
                        }
                        else
                        {
                            builder.Append(Out.Tab("<div>", "<br />"));
                        }
                    }
                    builder.AppendFormat("<a href=\"" + Utils.getUrl("/bbs/topic.aspx?forumid=" + n.ForumId + "&amp;bid={0}&amp;backurl=" + Utils.getPage(0) + "") + "\">{1}.{2}</a>", n.ID, (pageIndex - 1) * pageSize + k, n.Title);

                    k++;
                    builder.Append(Out.Tab("</div>", ""));
                }
                // 分页
                builder.Append(BasePage.MultiPage(pageIndex, pageSize, recordCount, Utils.getPageUrl(), pageValUrl, "page", 0));
            }
            else
            {
                builder.Append(Out.Div("div", "没有相关记录.."));
            }
        }
        builder.Append(Out.Tab("<div class=\"title\">", Out.Hr()));
        builder.Append("<a href=\"" + Utils.getUrl("default.aspx") + "\">首页</a>-");
        builder.Append("<a href=\"" + Utils.getPage("search.aspx").Replace("&amp;?", "?") + "\">返回上级</a>");
        builder.Append(Out.Tab("</div>", ""));
    }
Пример #18
0
    protected void Page_Load(object sender, EventArgs e)
    {
        int id = int.Parse(Utils.GetRequest("id", "get", 2, @"^[0-9]\d*$", "ID错误"));

        if (!new BCW.BLL.Topics().Exists(id))
        {
            Utils.Error("不存在的记录", "");
        }

        BCW.Model.Topics model = new BCW.BLL.Topics().GetTopics(id);
        Master.Title = model.Title;
        //顶部调用
        string TopUbb = string.Empty;

        if (model.Types == 11)
        {
            TopUbb = ub.GetSub("FtTextListTop", xmlPath);
        }
        else if (model.Types == 12)
        {
            TopUbb = ub.GetSub("FtPicListTop", xmlPath);
        }
        else if (model.Types == 13)
        {
            TopUbb = ub.GetSub("FtFileListTop", xmlPath);
        }
        if (TopUbb != "")
        {
            TopUbb = BCW.User.AdminCall.AdminUBB(Out.SysUBB(TopUbb));
            if (TopUbb.IndexOf("</div>") == -1)
            {
                builder.Append(Out.Tab("<div>", ""));
                builder.Append(TopUbb);
                builder.Append(Out.Tab("</div>", ""));
            }
            else
            {
                builder.Append(TopUbb);
            }
        }

        //机型适配
        string PhoneBrand  = "";
        string PhoneModel  = "";
        string PhoneSystem = "";

        if (model.Types == 13)
        {
            if (Request.Cookies["BrandComment"] != null)
            {
                PhoneBrand  = HttpUtility.UrlDecode(Request.Cookies["BrandComment"]["PhoneBrand"]);
                PhoneModel  = HttpUtility.UrlDecode(Request.Cookies["BrandComment"]["PhoneModel"]);
                PhoneSystem = HttpUtility.UrlDecode(Request.Cookies["BrandComment"]["PhoneSystem"]);
            }

            if (PhoneBrand != "" && PhoneModel != "")
            {
                if (Request["view"] != "all")
                {
                    Master.Title = PhoneModel + "-" + model.Title;
                    //builder.Append(Out.Tab("<div class=\"title\">" + PhoneModel + "-" + model.Title + "</div>", ""));
                    builder.Append(Out.Tab("<div>", ""));
                    builder.Append("<a href=\"" + Utils.getUrl("list.aspx?id=" + id + "&amp;view=all&amp;backurl=" + Utils.getPage(0) + "") + "\">查看全部</a>&gt;" + PhoneModel + "系列");
                }
                else
                {
                    //builder.Append(Out.Tab("<div class=\"title\">" + model.Title + "</div>", ""));
                    builder.Append(Out.Tab("<div>", ""));
                    builder.Append("查看全部&gt;<a href=\"" + Utils.getUrl("list.aspx?id=" + id + "&amp;backurl=" + Utils.getPage(0) + "") + "\">" + PhoneModel + "系列</a>");
                }
                builder.Append(Out.Tab("</div>", "<br />"));
            }
        }
        //else
        //{
        //    builder.Append(Out.Tab("<div class=\"title\">" + model.Title + "</div>", ""));
        //}

        int    pageIndex;
        int    recordCount;
        int    pageSize = Convert.ToInt32(ub.Get("SiteListNo"));
        string strWhere = "";

        string[] pageValUrl = { "id", "view", "backurl" };
        pageIndex = Utils.ParseInt(Request.QueryString["page"]);
        if (pageIndex == 0)
        {
            pageIndex = 1;
        }
        //查询条件
        strWhere = "NodeId=" + id + " and Hidden=0";
        if (model.Types == 13)
        {
            if (!string.IsNullOrEmpty(PhoneModel) && Request["view"] != "all")
            {
                strWhere += " AND (Model LIKE '%" + (PhoneModel) + "%' Or Model LIKE '%" + PhoneSystem + "%' OR Model LIKE '%" + (PhoneBrand) + "%')";
            }
        }
        // 开始读取列表
        IList <BCW.Model.Detail> listDetail = new BCW.BLL.Detail().GetDetails(pageIndex, pageSize, strWhere, out recordCount);

        if (listDetail.Count > 0)
        {
            int k = 1;
            foreach (BCW.Model.Detail n in listDetail)
            {
                if (k % 2 == 0)
                {
                    builder.Append(Out.Tab("<div class=\"text\">", "<br />"));
                }
                else
                {
                    if (k == 1)
                    {
                        builder.Append(Out.Tab("<div>", ""));
                    }
                    else
                    {
                        builder.Append(Out.Tab("<div>", "<br />"));
                    }
                }
                builder.AppendFormat("<a href=\"" + Utils.getUrl("detail.aspx?id={0}&amp;backurl=" + Utils.PostPage(1) + "") + "\">{1}.{2}</a>", n.ID, (pageIndex - 1) * pageSize + k, n.Title);
                if (!string.IsNullOrEmpty(n.Cover) && IsCover(n.Types) == true)
                {
                    builder.Append("<br /><img src=\"" + n.Cover + "\" alt=\"load\"/>");
                }

                k++;
                builder.Append(Out.Tab("</div>", ""));
            }

            // 分页
            builder.Append(BasePage.MultiPage(pageIndex, pageSize, recordCount, Utils.getPageUrl(), pageValUrl, "page", 0));
        }
        else
        {
            builder.Append(Out.Div("div", "没有相关记录.."));
        }
        //上传连接
        if (model.Types == 13 && Utils.GetTopDomain().Equals("tl88.cc"))
        {
            builder.Append(Out.Tab("<div>", "<br />"));
            builder.Append("<a href=\"" + Utils.getUrl("addfile.aspx?nid=" + id + "&amp;backurl=" + Utils.PostPage(1) + "") + "\">&gt;我要上传</a>");
            builder.Append(Out.Tab("</div>", ""));
        }

        //底部调用
        string FootUbb = string.Empty;

        if (model.Types == 11)
        {
            FootUbb = ub.GetSub("FtTextListFoot", xmlPath);
        }
        else if (model.Types == 12)
        {
            FootUbb = ub.GetSub("FtPicListFoot", xmlPath);
        }
        else if (model.Types == 13)
        {
            FootUbb = ub.GetSub("FtFileListFoot", xmlPath);
        }
        if (FootUbb != "")
        {
            FootUbb = BCW.User.AdminCall.AdminUBB(Out.SysUBB(FootUbb));
            if (FootUbb.IndexOf("</div>") == -1)
            {
                builder.Append(Out.Tab("<div>", ""));
                builder.Append(FootUbb);
                builder.Append(Out.Tab("</div>", ""));
            }
            else
            {
                builder.Append(TopUbb);
            }
        }

        builder.Append(Out.Tab("<div class=\"title\">", Out.Hr()));
        builder.Append("<a href=\"" + Utils.getUrl("default.aspx") + "\">首页</a>-");
        builder.Append("<a href=\"" + Utils.getPage("default.aspx") + "\">上级</a>");
        if (model.NodeId != 0)
        {
            builder.Append("-<a href=\"" + Utils.getUrl("default.aspx?id=" + model.NodeId + "") + "\">" + new BCW.BLL.Topics().GetTitle(model.NodeId) + "</a>");
        }
        builder.Append(Out.Tab("</div>", ""));
    }