private void DelPage() { string info = Utils.GetRequest("info", "all", 1, "", ""); int id = int.Parse(Utils.GetRequest("id", "all", 2, @"^[0-9]\d*$", "ID错误")); if (info != "ok") { Master.Title = "删除文件"; builder.Append(Out.Tab("<div class=\"title\">", "")); builder.Append("不能恢复!确定删除此文件吗"); builder.Append(Out.Tab("</div>", "<br />")); builder.Append(Out.Tab("<div>", "")); builder.Append("<a href=\"" + Utils.getUrl("albums.aspx?info=ok&act=del&id=" + id + "&backurl=" + Utils.getPage(0) + "") + "\">确定删除</a><br />"); builder.Append("<a href=\"" + Utils.getPage("albums.aspx") + "\">先留着吧..</a>"); builder.Append(Out.Tab("</div>", "")); builder.Append(Out.Tab("<div class=\"hr\"></div>", Out.Hr())); builder.Append(Out.Tab("<div>", "")); builder.Append("<a href=\"" + Utils.getUrl("albums.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 />")); } else { BCW.Model.Upfile model = new BCW.BLL.Upfile().GetUpfile(id); if (model == null) { Utils.Error("不存在的记录", ""); } //删除 new BCW.BLL.Upfile().Delete(id); new BCW.BLL.FComment().Delete(model.Types, id); //删除文件 BCW.Files.FileTool.DeleteFile(model.Files); if (!string.IsNullOrEmpty(model.PrevFiles)) { BCW.Files.FileTool.DeleteFile(model.PrevFiles); } //关联帖子回帖减去文件数 if (model.ReID > 0) { new BCW.BLL.Reply().UpdateFileNum(model.ReID, -1); } else if (model.BID > 0) { new BCW.BLL.Text().UpdateFileNum(model.BID, -1); int FileNum = new BCW.BLL.Text().GetFileNum(model.BID); if (FileNum == 0) { //去掉附件帖标识 new BCW.BLL.Text().UpdateTypes(model.BID, 0); } } Utils.Success("删除文件", "删除文件成功..", Utils.getPage("albums.aspx"), "1"); } }
private void EditPage() { Master.Title = "编辑帖子"; int id = int.Parse(Utils.GetRequest("id", "get", 2, @"^[1-9]\d*$", "帖子ID错误")); BCW.Model.Text model = new BCW.BLL.Text().GetText(id); if (model == null) { Utils.Error("不存在的帖子记录", ""); } builder.Append(Out.Tab("<div class=\"title\">", "")); builder.Append("编辑帖子"); builder.Append(Out.Tab("</div>", "")); //得到论坛列表 string strForum = string.Empty; DataSet ds = new BCW.BLL.Forum().GetList("ID,Title", ""); if (ds != null && ds.Tables[0].Rows.Count != 0) { for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { strForum += "|" + ds.Tables[0].Rows[i]["ID"] + "|" + ds.Tables[0].Rows[i]["Title"] + ""; } } strForum = Utils.Mid(strForum, 1, strForum.Length); //得到帖子类型 string Label = new BCW.BLL.Forum().GetLabel(model.ForumId); if (Label != "") { Label = "0|综合|" + Label + ""; } else { Label = "0|综合"; } string strText = "主题:/,内容:/,类型:,用户ID:/,用户昵称:/,阅读数:/,精华:,申精缩略图/,推荐:,置顶:,锁定:,结束:,删除:,回帖时间:/,所在版块:/,,"; string strName = "Title,Content,LabelId,UsID,UsName,ReadNum,IsGood,GoodSmallIcon,IsRecom,IsTop,IsLock,IsOver,IsDel,ReTime,ForumID,id,act"; string strType = "text,textarea,select,num,text,num,select,text,select,select,select,select,select,date,select,hidden,hidden"; string strValu = "" + model.Title + "'" + model.Content + "'" + model.LabelId + "'" + model.UsID + "'" + model.UsName + "'" + model.ReadNum + "'" + model.IsGood + "'" + model.GoodSmallIcon + "'" + model.IsRecom + "'" + model.IsTop + "'" + model.IsLock + "'" + model.IsOver + "'" + model.IsDel + "'" + DT.FormatDate(model.ReTime, 0) + "'" + model.ForumId + "'" + id + "'save"; string strEmpt = "false,false," + Label + ",false,false,false,0|普通|1|精华,true,0|普通|1|推荐,-1|固底|0|普通|1|普通置顶|2|全区置顶,0|普通|1|锁定,0|普通|1|结束,0|正常|1|已删,false," + strForum + ",false,false"; string strIdea = "/"; string strOthe = "确定编辑,thread.aspx,post,1,red"; builder.Append(Out.wapform(strText, strName, strType, strValu, strEmpt, strIdea, strOthe)); builder.Append(Out.Tab("<div>", "")); builder.Append(" <a href=\"" + Utils.getPage("thread.aspx") + "\">取消</a>"); builder.Append(Out.Tab("</div>", "")); builder.Append(Out.Tab("<div class=\"hr\"></div>", Out.Hr())); builder.Append(Out.Tab("<div>", "")); builder.Append("<a href=\"" + Utils.getUrl("thread.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 />")); }
private void AddokPage(int uid) { Master.Title = "加入收藏"; string strFavgroup = string.Empty; DataSet ds = new BCW.BLL.Favgroup().GetList("ID,Title", "UsID=" + uid + " and Types=0"); if (ds == null || ds.Tables[0].Rows.Count == 0) { Utils.Success("加入收藏", "请先建收藏夹再加入收藏..", Utils.getUrl("favorites.aspx?act=addgroup&backurl=" + Utils.getPage(0) + ""), "1"); } int NodeId = 0; NodeId = int.Parse(ds.Tables[0].Rows[0]["ID"].ToString()); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { strFavgroup += "|" + ds.Tables[0].Rows[i]["ID"] + "|" + ds.Tables[0].Rows[i]["Title"] + ""; } strFavgroup = Utils.Mid(strFavgroup, 1, strFavgroup.Length); builder.Append(Out.Tab("<div class=\"title\">加入收藏</div>", "")); int ptype = int.Parse(Utils.GetRequest("ptype", "get", 2, @"^[1-4]$", "收藏类型选择错误")); int forumid = int.Parse(Utils.GetRequest("forumid", "get", 1, @"^[1-9]\d*$", "0")); int bid = int.Parse(Utils.GetRequest("bid", "get", 1, @"^[1-9]\d*$", "0")); string Title = string.Empty; string PUrl = string.Empty; //加入帖子收藏 builder.Append(Out.Tab("<div>", "")); if (ptype == 1) { Title = new BCW.BLL.Text().GetTitle(bid); if (Title == "") { Utils.Error("不存在的记录", ""); } PUrl = "/bbs/topic.aspx?forumid=" + forumid + "&bid=" + bid + ""; builder.Append("主题:<a href=\"" + Utils.getUrl(PUrl) + "\">" + Title + "</a>"); } builder.Append(Out.Tab("</div>", "")); strText = ",,选择收藏夹:/,,,"; strName = "Title,PUrl,NodeId,ptype,act,backurl"; strType = "hidden,hidden,select,hidden,hidden,hidden"; strValu = "" + Title + "'" + PUrl + "'" + NodeId + "'" + ptype + "'save'" + Utils.getPage(0) + ""; strEmpt = "false,false," + strFavgroup + ",false,false,false"; strIdea = "/"; strOthe = "确定收藏,favorites.aspx,post,1,red"; builder.Append(Out.wapform(strText, strName, strType, strValu, strEmpt, strIdea, strOthe)); builder.Append(Out.Tab("<div class=\"title\">", Out.Hr())); builder.Append("<a href=\"" + Utils.getUrl("/default.aspx") + "\">首页</a>-"); builder.Append("<a href=\"" + Utils.getPage("uinfo.aspx?uid=" + uid + "") + "\">上级</a>-"); builder.Append("<a href=\"" + Utils.getUrl("favorites.aspx") + "\">收藏夹</a>"); builder.Append(Out.Tab("</div>", "")); }
private void ViewPage(int forumid, string ForumName, int uid) { Master.Title = "查看专题"; int id = int.Parse(Utils.GetRequest("id", "get", 2, @"^[1-9]\d*$", "ID错误")); string ForumtsName = new BCW.BLL.Forumts().GetTitle(id, forumid); if (ForumtsName == "") { Utils.Error("不存在的专题记录", ""); } builder.Append(Out.Tab("<div class=\"title\">", "")); builder.Append("<a href=\"" + Utils.getUrl("forumts.aspx?forumid=" + forumid + "") + "\">专题</a>>" + ForumtsName + ""); builder.Append(Out.Tab("</div>", "<br />")); int pageIndex; int recordCount; int pageSize = Convert.ToInt32(ub.Get("SiteListNo")); string strWhere = string.Empty; string strOrder = string.Empty; string[] pageValUrl = { "act", "forumid", "id", "backurl" }; pageIndex = Utils.ParseInt(Request.QueryString["page"]); if (pageIndex == 0) { pageIndex = 1; } //查询条件 strWhere += "ForumId=" + forumid + " and TsID=" + id + " and IsDel=0"; //排序条件 strOrder = "ID Desc"; // 开始读取列表 IList <BCW.Model.Text> listText = new BCW.BLL.Text().GetTextsMe(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("topic.aspx?forumid=" + forumid + "&bid={0}&backurl=" + Utils.PostPage(1) + "") + "\">{1}.{2}</a>", n.ID, (pageIndex - 1) * pageSize + k, n.Title); k++; builder.Append(Out.Tab("</div>", "")); } // 分页 builder.Append(BasePage.ForumMultiPage(pageIndex, pageSize, recordCount, Utils.getPageUrl(), pageValUrl, "page", 0)); builder.Append(Out.Tab("", "<br />")); strText = ",,,,,"; strName = "keyword,forumid,act,backurl"; strType = "stext,hidden,hidden,hidden"; strValu = "'" + forumid + "'forumsave'" + Utils.PostPage(1) + ""; strEmpt = "false,false,false,false"; strIdea = ""; strOthe = "搜专题帖,/search.aspx,post,3,red"; builder.Append(Out.wapform(strText, strName, strType, strValu, strEmpt, strIdea, strOthe)); } 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.getUrl("forum.aspx?forumid=" + forumid + "") + "\">上级</a>-"); builder.Append("<a href=\"" + Utils.getUrl("forumts.aspx?forumid=" + forumid + "") + "\">专题</a>"); builder.Append(Out.Tab("</div>", "")); }
private void ReloadPage(int forumid, int bid, int id) { int meid = new BCW.User.Users().GetUsId(); if (meid == 0) { Utils.Login(); } string GsDemoID = ub.GetSub("BbsGsDemoID", xmlPath); if (GsDemoID != "") { if (!("#" + GsDemoID + "#").Contains("#" + meid + "#")) { Utils.Error("此功能内测中,您的ID不在内测ID里", ""); } } BCW.Model.Text modelT = new BCW.BLL.Text().GetText(bid); if (modelT.IsOver == 1) { Utils.Error("本帖已结,请另开新帖增加期数", ""); } if (id > 0) { BCW.Model.Forumvote model = new BCW.BLL.Forumvote().GetForumvote(id); if (model == null) { Utils.Error("不存在的记录", ""); } if (model.UsID != meid) { Utils.Error("不存在的记录", ""); } } else { if (modelT == null) { Utils.Error("不存在的记录", ""); } if (modelT.UsID != meid) { Utils.Error("不存在的记录", ""); } } if (new BCW.User.ForumInc().IsForumGSIDS(forumid) == true) { DateTime GsStopTime = Utils.ParseTime(ub.GetSub("BbsGsStopTime", xmlPath)); int GsqiNum = Utils.ParseInt(ub.GetSub("BbsGsqiNum", xmlPath)); if (GsqiNum == 0) { Utils.Error("本期尚未设置", ""); } if (GsStopTime < DateTime.Now) { Utils.Error("本期第" + GsqiNum + "期已截止发表,截止时间" + GsStopTime + "", ""); } builder.Append(Out.Tab("<div class=\"title\">", "")); if (id > 0) { Master.Title = "修改参赛内容"; builder.Append("修改参赛内容"); } else { Master.Title = "添加参赛内容"; builder.Append("添加参赛内容"); } builder.Append(Out.Tab("</div>", "<br />")); string ac = Utils.GetRequest("ac", "post", 1, "", ""); string Choose = Utils.GetRequest("Choose", "post", 1, "", ""); string Choose2 = Utils.GetRequest("Choose2", "post", 1, "", ""); if (new BCW.User.ForumInc().IsForum113(forumid) == true || new BCW.User.ForumInc().IsForum116(forumid) == true) { if (ac != "" && ac != "[删]") { if (Choose != "") { Choose += "," + Utils.ToSChinese(ac); } else { Choose = Utils.ToSChinese(ac); } } string show1 = ""; string show2 = ""; string show3 = ""; string show4 = ""; string show5 = ""; string show6 = ""; string show7 = ""; string show8 = ""; string show9 = ""; string show10 = ""; string show11 = ""; string show12 = ""; int cNum = Utils.GetStringNum(Choose, ","); if ((new BCW.User.ForumInc().IsForum113(forumid) == true && cNum == 5) || (new BCW.User.ForumInc().IsForum116(forumid) == true && ac != "" && ac != "[删]")) { show1 = "$"; show2 = "$"; show3 = "$"; show4 = "$"; show5 = "$"; show6 = "$"; show7 = "$"; show8 = "$"; show9 = "$"; show10 = "$"; show11 = "$"; show12 = "$"; } else { if (Choose.Contains("鼠")) { show1 = "$"; } if (Choose.Contains("牛")) { show2 = "$"; } if (Choose.Contains("虎")) { show3 = "$"; } if (Choose.Contains("兔")) { show4 = "$"; } if (Choose.Contains("龙")) { show5 = "$"; } if (Choose.Contains("蛇")) { show6 = "$"; } if (Choose.Contains("马")) { show7 = "$"; } if (Choose.Contains("羊")) { show8 = "$"; } if (Choose.Contains("猴")) { show9 = "$"; } if (Choose.Contains("鸡")) { show10 = "$"; } if (Choose.Contains("狗")) { show11 = "$"; } if (Choose.Contains("猪")) { show12 = "$"; } } string sx = "" + show1 + "鼠|" + show2 + "牛|" + show3 + "虎|" + show4 + "兔|" + show5 + "龙|" + show6 + "蛇/|" + show7 + "马|" + show8 + "羊|" + show9 + "猴|" + show10 + "鸡|" + show11 + "狗|" + show12 + "猪"; builder.Append(Out.Tab("<div>", "")); builder.Append("选择要推荐的生肖:"); builder.Append(Out.Tab("</div>", Out.Hr())); builder.Append(Out.Tab("<div>", "")); strName = "Choose,forumid,bid,id,act,info"; strValu = "" + Choose + "'" + forumid + "'" + bid + "'" + id + "'view'ok"; strOthe = "" + sx + ",Gsedit.aspx,post,3,other|other|other|other|other|other|other|other|other|other|other|other"; builder.Append(Out.wapform(strName, strValu, strOthe)); builder.Append(Out.Tab("</div>", "")); if (Choose != "") { builder.Append(Out.Tab("<div>", "<br />")); builder.Append("=选中的生肖=<br />"); string[] cTemp = Choose.Split(','); for (int i = 0; i < cTemp.Length; i++) { builder.Append("" + cTemp[i] + ""); strName = "Choose,forumid,bid,id,act,info"; if (i == 0) { strValu = "" + Choose.Replace(cTemp[i] + ",", "").Replace(cTemp[i], "") + "'" + forumid + "'" + bid + "'" + id + "'view'ok"; } else { strValu = "" + Choose.Replace("," + cTemp[i], "").Replace(cTemp[i], "") + "'" + forumid + "'" + bid + "'" + id + "'view'ok"; } strOthe = "[删],Gsedit.aspx,post,3,other"; builder.Append(Out.wapform(strName, strValu, strOthe)); } builder.Append(Out.Tab("</div>", "")); } } else if (new BCW.User.ForumInc().IsForum114(forumid) == true) { string showA1 = ""; string showA2 = ""; string showA3 = ""; string showB1 = ""; string showB2 = ""; string showB3 = ""; string showB4 = ""; string showB5 = ""; string showB6 = ""; if (ac != "" && ac != "[删]" && !ac.Contains("单") && !ac.Contains("双")) { if (Choose != "") { Choose += "," + Utils.ToSChinese(ac); } else { Choose = Utils.ToSChinese(ac); } int cNum = Utils.GetStringNum(Choose, ","); if (cNum >= 1) { showA1 = "$"; showA2 = "$"; showA3 = "$"; } showB1 = "$"; showB2 = "$"; showB3 = "$"; showB4 = "$"; showB5 = "$"; showB6 = "$"; } if (ac != "" && ac != "[删]" && (ac.Contains("单") || ac.Contains("双"))) { if (Choose2 != "") { Choose2 += "," + Utils.ToSChinese(ac); } else { Choose2 = Utils.ToSChinese(ac); } int cNum = Utils.GetStringNum(Choose2, ","); if (cNum >= 3) { showB1 = "$"; showB2 = "$"; showB3 = "$"; showB4 = "$"; showB5 = "$"; showB6 = "$"; } showA1 = "$"; showA2 = "$"; showA3 = "$"; } if (Choose.Contains("红波")) { showA1 = "$"; } if (Choose.Contains("蓝波")) { showA2 = "$"; } if (Choose.Contains("绿波")) { showA3 = "$"; } if (Choose2.Contains("红单")) { showB1 = "$"; } if (Choose2.Contains("蓝单")) { showB2 = "$"; } if (Choose2.Contains("绿单")) { showB3 = "$"; } if (Choose2.Contains("红双")) { showB4 = "$"; } if (Choose2.Contains("蓝双")) { showB5 = "$"; } if (Choose2.Contains("绿双")) { showB6 = "$"; } string bs = "" + showA1 + "红波|" + showA2 + "蓝波|" + showA3 + "绿波"; string bs2 = "" + showB1 + "红单|" + showB2 + "蓝单|" + showB3 + "绿单/|" + showB4 + "红双|" + showB5 + "蓝双|" + showB6 + "绿双"; builder.Append(Out.Tab("<div>", Out.RHr())); builder.Append("=选择要推荐的波色="); builder.Append(Out.Tab("</div>", "<br />")); builder.Append(Out.Tab("<div>", "")); strName = "Choose,forumid,bid,id,act,info"; strValu = "" + Choose + "'" + forumid + "'" + bid + "'" + id + "'view'ok"; strOthe = "" + bs + ",Gsedit.aspx,post,3,other|other|other"; builder.Append(Out.wapform(strName, strValu, strOthe)); builder.Append(Out.Tab("</div>", "")); builder.Append(Out.Tab("<div>", Out.Hr())); builder.Append("=选择要推荐的半波="); builder.Append(Out.Tab("</div>", "<br />")); builder.Append(Out.Tab("<div>", "")); strName = "Choose2,forumid,bid,id,act,info"; strValu = "" + Choose2 + "'" + forumid + "'" + bid + "'" + id + "'view'ok"; strOthe = "" + bs2 + ",Gsedit.aspx,post,3,other|other|other|other|other|other"; builder.Append(Out.wapform(strName, strValu, strOthe)); builder.Append(Out.Tab("</div>", "")); if (Choose != "") { builder.Append(Out.Tab("<div>", "<br />")); builder.Append("=选中的波色=<br />"); string[] cTemp = Choose.Split(','); for (int i = 0; i < cTemp.Length; i++) { builder.Append("" + cTemp[i] + ""); strName = "Choose,forumid,bid,id,act,info"; if (i == 0) { strValu = "" + Choose.Replace(cTemp[i] + ",", "").Replace(cTemp[i], "") + "'" + forumid + "'" + bid + "'" + id + "'view'ok"; } else { strValu = "" + Choose.Replace("," + cTemp[i], "").Replace(cTemp[i], "") + "'" + forumid + "'" + bid + "'" + id + "'view'ok"; } strOthe = "[删],Gsedit.aspx,post,3,other"; builder.Append(Out.wapform(strName, strValu, strOthe)); } builder.Append(Out.Tab("</div>", "")); } if (Choose2 != "") { builder.Append(Out.Tab("<div>", "<br />")); builder.Append("=选中的半波=<br />"); string[] cTemp = Choose2.Split(','); for (int i = 0; i < cTemp.Length; i++) { builder.Append("" + cTemp[i] + ""); strName = "Choose2,forumid,bid,id,act,info"; if (i == 0) { strValu = "" + Choose2.Replace(cTemp[i] + ",", "").Replace(cTemp[i], "") + "'" + forumid + "'" + bid + "'" + id + "'view'ok"; } else { strValu = "" + Choose2.Replace("," + cTemp[i], "").Replace(cTemp[i], "") + "'" + forumid + "'" + bid + "'" + id + "'view'ok"; } strOthe = "[删],Gsedit.aspx,post,3,other"; builder.Append(Out.wapform(strName, strValu, strOthe)); } builder.Append(Out.Tab("</div>", "")); Choose = Choose2; } } else if (new BCW.User.ForumInc().IsForum117(forumid) == true) { if (ac != "" && ac != "[删]") { if (Choose != "") { Choose += "," + Utils.ToSChinese(ac); } else { Choose = Utils.ToSChinese(ac); } } string show1 = ""; string show2 = ""; string show3 = ""; string show4 = ""; string show5 = ""; string show6 = ""; string show7 = ""; string show8 = ""; string show9 = ""; string show10 = ""; string show11 = ""; string show12 = ""; string show13 = ""; string show14 = ""; string show15 = ""; string show16 = ""; string show17 = ""; string show18 = ""; string show19 = ""; string show20 = ""; string show21 = ""; string show22 = ""; string show23 = ""; string show24 = ""; string show25 = ""; string show26 = ""; string show27 = ""; string show28 = ""; string show29 = ""; string show30 = ""; string show31 = ""; string show32 = ""; string show33 = ""; string show34 = ""; string show35 = ""; string show36 = ""; string show37 = ""; string show38 = ""; string show39 = ""; string show40 = ""; string show41 = ""; string show42 = ""; string show43 = ""; string show44 = ""; string show45 = ""; string show46 = ""; string show47 = ""; string show48 = ""; string show49 = ""; int cNum = Utils.GetStringNum(Choose, ","); if (cNum == 4) { show1 = "$"; show2 = "$"; show3 = "$"; show4 = "$"; show5 = "$"; show6 = "$"; show7 = "$"; show8 = "$"; show9 = "$"; show10 = "$"; show11 = "$"; show12 = "$"; show13 = "$"; show14 = "$"; show15 = "$"; show16 = "$"; show17 = "$"; show18 = "$"; show19 = "$"; show20 = "$"; show21 = "$"; show22 = "$"; show23 = "$"; show24 = "$"; show25 = "$"; show26 = "$"; show27 = "$"; show28 = "$"; show29 = "$"; show30 = "$"; show31 = "$"; show32 = "$"; show33 = "$"; show34 = "$"; show35 = "$"; show36 = "$"; show37 = "$"; show38 = "$"; show39 = "$"; show40 = "$"; show41 = "$"; show42 = "$"; show43 = "$"; show44 = "$"; show45 = "$"; show46 = "$"; show47 = "$"; show48 = "$"; show49 = "$"; } else { if (Choose.Contains("01")) { show1 = "$"; } if (Choose.Contains("02")) { show2 = "$"; } if (Choose.Contains("03")) { show3 = "$"; } if (Choose.Contains("04")) { show4 = "$"; } if (Choose.Contains("05")) { show5 = "$"; } if (Choose.Contains("06")) { show6 = "$"; } if (Choose.Contains("07")) { show7 = "$"; } if (Choose.Contains("08")) { show8 = "$"; } if (Choose.Contains("09")) { show9 = "$"; } if (Choose.Contains("10")) { show10 = "$"; } if (Choose.Contains("11")) { show11 = "$"; } if (Choose.Contains("12")) { show12 = "$"; } if (Choose.Contains("13")) { show13 = "$"; } if (Choose.Contains("14")) { show14 = "$"; } if (Choose.Contains("15")) { show15 = "$"; } if (Choose.Contains("16")) { show16 = "$"; } if (Choose.Contains("17")) { show17 = "$"; } if (Choose.Contains("18")) { show18 = "$"; } if (Choose.Contains("19")) { show19 = "$"; } if (Choose.Contains("20")) { show20 = "$"; } if (Choose.Contains("21")) { show21 = "$"; } if (Choose.Contains("22")) { show22 = "$"; } if (Choose.Contains("23")) { show23 = "$"; } if (Choose.Contains("24")) { show24 = "$"; } if (Choose.Contains("25")) { show25 = "$"; } if (Choose.Contains("26")) { show26 = "$"; } if (Choose.Contains("27")) { show27 = "$"; } if (Choose.Contains("28")) { show28 = "$"; } if (Choose.Contains("29")) { show29 = "$"; } if (Choose.Contains("30")) { show30 = "$"; } if (Choose.Contains("31")) { show31 = "$"; } if (Choose.Contains("32")) { show32 = "$"; } if (Choose.Contains("33")) { show33 = "$"; } if (Choose.Contains("34")) { show34 = "$"; } if (Choose.Contains("35")) { show35 = "$"; } if (Choose.Contains("36")) { show36 = "$"; } if (Choose.Contains("37")) { show37 = "$"; } if (Choose.Contains("38")) { show38 = "$"; } if (Choose.Contains("39")) { show39 = "$"; } if (Choose.Contains("40")) { show40 = "$"; } if (Choose.Contains("41")) { show41 = "$"; } if (Choose.Contains("42")) { show42 = "$"; } if (Choose.Contains("43")) { show43 = "$"; } if (Choose.Contains("44")) { show44 = "$"; } if (Choose.Contains("45")) { show45 = "$"; } if (Choose.Contains("46")) { show46 = "$"; } if (Choose.Contains("47")) { show47 = "$"; } if (Choose.Contains("48")) { show48 = "$"; } if (Choose.Contains("49")) { show49 = "$"; } } string sNum = "" + show1 + "01|" + show2 + "02|" + show3 + "03|" + show4 + "04|" + show5 + "05|" + show6 + "06|" + show7 + "07/|" + show8 + "08|" + show9 + "09|" + show10 + "10|" + show11 + "11|" + show12 + "12|" + show13 + "13|" + show14 + "14/|" + show15 + "15|" + show16 + "16|" + show17 + "17|" + show18 + "18|" + show19 + "19|" + show20 + "20|" + show21 + "21/|" + show22 + "22|" + show23 + "23|" + show24 + "24|" + show25 + "25|" + show26 + "26|" + show27 + "27|" + show28 + "28/|" + show29 + "29|" + show30 + "30|" + show31 + "31|" + show32 + "32|" + show33 + "33|" + show34 + "34|" + show35 + "35/|" + show36 + "36|" + show37 + "37|" + show38 + "38|" + show39 + "39|" + show40 + "40|" + show41 + "41|" + show42 + "42/|" + show43 + "43|" + show44 + "44|" + show45 + "45|" + show46 + "46|" + show47 + "47|" + show48 + "48|" + show49 + "49"; builder.Append(Out.Tab("<div>", "")); builder.Append("选择要推荐的5个数字:"); builder.Append(Out.Tab("</div>", Out.Hr())); builder.Append(Out.Tab("<div>", "")); strName = "Choose,forumid,bid,id,act,info"; strValu = "" + Choose + "'" + forumid + "'" + bid + "'" + id + "'view'ok"; strOthe = "" + sNum + ",Gsedit.aspx,post,3,other|other|other|other|other|other|other|other|other|other|other|other|other|other|other|other|other|other|other|other|other|other|other|other|other|other|other|other|other|other|other|other|other|other|other|other|other|other|other|other|other|other|other|other|other|other|other|other|other"; builder.Append(Out.wapform(strName, strValu, strOthe)); builder.Append(Out.Tab("</div>", "")); if (Choose != "") { builder.Append(Out.Tab("<div>", "<br />")); builder.Append("=选中的数字=<br />"); string[] cTemp = Choose.Split(','); for (int i = 0; i < cTemp.Length; i++) { builder.Append("" + cTemp[i] + ""); strName = "Choose,forumid,bid,id,act,info"; if (i == 0) { strValu = "" + Choose.Replace(cTemp[i] + ",", "").Replace(cTemp[i], "") + "'" + forumid + "'" + bid + "'" + id + "'view'ok"; } else { strValu = "" + Choose.Replace("," + cTemp[i], "").Replace(cTemp[i], "") + "'" + forumid + "'" + bid + "'" + id + "'view'ok"; } strOthe = "[删],Gsedit.aspx,post,3,other"; builder.Append(Out.wapform(strName, strValu, strOthe)); } builder.Append(Out.Tab("</div>", "")); } } else if (new BCW.User.ForumInc().IsForum119(forumid) == true) { if (ac != "" && ac != "[删]") { if (Choose != "") { Choose += "," + Utils.ToSChinese(ac); } else { Choose = Utils.ToSChinese(ac); } } string show1 = ""; string show2 = ""; string show3 = ""; string show4 = ""; string show5 = ""; string show6 = ""; string show7 = ""; string show8 = ""; string show9 = ""; string show10 = ""; int cNum = Utils.GetStringNum(Choose, ","); if (cNum == 4) { show1 = "$"; show2 = "$"; show3 = "$"; show4 = "$"; show5 = "$"; show6 = "$"; show7 = "$"; show8 = "$"; show9 = "$"; show10 = "$"; } else { if (Choose.Contains("0尾")) { show1 = "$"; } if (Choose.Contains("1尾")) { show2 = "$"; } if (Choose.Contains("2尾")) { show3 = "$"; } if (Choose.Contains("3尾")) { show4 = "$"; } if (Choose.Contains("4尾")) { show5 = "$"; } if (Choose.Contains("5尾")) { show6 = "$"; } if (Choose.Contains("6尾")) { show7 = "$"; } if (Choose.Contains("7尾")) { show8 = "$"; } if (Choose.Contains("8尾")) { show9 = "$"; } if (Choose.Contains("9尾")) { show10 = "$"; } } string ws = "" + show1 + "0尾|" + show2 + "1尾|" + show3 + "2尾|" + show4 + "3尾|" + show5 + "4尾/|" + show6 + "5尾|" + show7 + "6尾|" + show8 + "7尾|" + show9 + "8尾|" + show10 + "9尾"; builder.Append(Out.Tab("<div>", "")); builder.Append("选择要推荐的5个尾数:"); builder.Append(Out.Tab("</div>", Out.Hr())); builder.Append(Out.Tab("<div>", "")); strName = "Choose,forumid,bid,id,act,info"; strValu = "" + Choose + "'" + forumid + "'" + bid + "'" + id + "'view'ok"; strOthe = "" + ws + ",Gsedit.aspx,post,3,other|other|other|other|other|other|other|other|other|other"; builder.Append(Out.wapform(strName, strValu, strOthe)); builder.Append(Out.Tab("</div>", "")); if (Choose != "") { builder.Append(Out.Tab("<div>", "<br />")); builder.Append("=选中的特尾=<br />"); string[] cTemp = Choose.Split(','); for (int i = 0; i < cTemp.Length; i++) { builder.Append("" + cTemp[i] + ""); strName = "Choose,forumid,bid,id,act,info"; if (i == 0) { strValu = "" + Choose.Replace(cTemp[i] + ",", "").Replace(cTemp[i], "") + "'" + forumid + "'" + bid + "'" + id + "'view'ok"; } else { strValu = "" + Choose.Replace("," + cTemp[i], "").Replace(cTemp[i], "") + "'" + forumid + "'" + bid + "'" + id + "'view'ok"; } strOthe = "[删],Gsedit.aspx,post,3,other"; builder.Append(Out.wapform(strName, strValu, strOthe)); } builder.Append(Out.Tab("</div>", "")); } } else if (new BCW.User.ForumInc().IsForum115(forumid) == true) { if (ac != "" && ac != "[删]") { if (Choose != "") { Choose += "," + Utils.ToSChinese(ac); } else { Choose = Utils.ToSChinese(ac); } } string show1 = ""; string show2 = ""; if (ac != "" && ac != "[删]") { show1 = "$"; show2 = "$"; } else { if (Choose.Contains("大数")) { show1 = "$"; } if (Choose.Contains("小数")) { show2 = "$"; } } string acType = "" + show1 + "大数|" + show2 + "小数"; builder.Append(Out.Tab("<div>", "")); builder.Append("选择要推荐的大小:"); builder.Append(Out.Tab("</div>", Out.Hr())); builder.Append(Out.Tab("<div>", "")); strName = "Choose,forumid,bid,id,act,info"; strValu = "" + Choose + "'" + forumid + "'" + bid + "'" + id + "'view'ok"; strOthe = "" + acType + ",Gsedit.aspx,post,3,other|other|other|other|other|other|other|other|other|other"; builder.Append(Out.wapform(strName, strValu, strOthe)); builder.Append(Out.Tab("</div>", "")); if (Choose != "") { builder.Append(Out.Tab("<div>", "<br />")); builder.Append("=选中的大小=<br />"); string[] cTemp = Choose.Split(','); for (int i = 0; i < cTemp.Length; i++) { builder.Append("" + cTemp[i] + ""); strName = "Choose,forumid,bid,id,act,info"; if (i == 0) { strValu = "" + Choose.Replace(cTemp[i] + ",", "").Replace(cTemp[i], "") + "'" + forumid + "'" + bid + "'" + id + "'view'ok"; } else { strValu = "" + Choose.Replace("," + cTemp[i], "").Replace(cTemp[i], "") + "'" + forumid + "'" + bid + "'" + id + "'view'ok"; } strOthe = "[删],Gsedit.aspx,post,3,other"; builder.Append(Out.wapform(strName, strValu, strOthe)); } builder.Append(Out.Tab("</div>", "")); } } else if (new BCW.User.ForumInc().IsForum121(forumid) == true) { if (ac != "" && ac != "[删]") { if (Choose != "") { Choose += "," + Utils.ToSChinese(ac); } else { Choose = Utils.ToSChinese(ac); } } string show1 = ""; string show2 = ""; if (ac != "" && ac != "[删]") { show1 = "$"; show2 = "$"; } else { if (Choose.Contains("单数")) { show1 = "$"; } if (Choose.Contains("双数")) { show2 = "$"; } } string acType = "" + show1 + "单数|" + show2 + "双数"; builder.Append(Out.Tab("<div>", "")); builder.Append("选择要推荐的单双:"); builder.Append(Out.Tab("</div>", Out.Hr())); builder.Append(Out.Tab("<div>", "")); strName = "Choose,forumid,bid,id,act,info"; strValu = "" + Choose + "'" + forumid + "'" + bid + "'" + id + "'view'ok"; strOthe = "" + acType + ",Gsedit.aspx,post,3,other|other|other|other|other|other|other|other|other|other"; builder.Append(Out.wapform(strName, strValu, strOthe)); builder.Append(Out.Tab("</div>", "")); if (Choose != "") { builder.Append(Out.Tab("<div>", "<br />")); builder.Append("=选中的单双=<br />"); string[] cTemp = Choose.Split(','); for (int i = 0; i < cTemp.Length; i++) { builder.Append("" + cTemp[i] + ""); strName = "Choose,forumid,bid,id,act,info"; if (i == 0) { strValu = "" + Choose.Replace(cTemp[i] + ",", "").Replace(cTemp[i], "") + "'" + forumid + "'" + bid + "'" + id + "'view'ok"; } else { strValu = "" + Choose.Replace("," + cTemp[i], "").Replace(cTemp[i], "") + "'" + forumid + "'" + bid + "'" + id + "'view'ok"; } strOthe = "[删],Gsedit.aspx,post,3,other"; builder.Append(Out.wapform(strName, strValu, strOthe)); } builder.Append(Out.Tab("</div>", "")); } } else if (new BCW.User.ForumInc().IsForum122(forumid) == true) { if (ac != "" && ac != "[删]") { if (Choose != "") { Choose += "," + Utils.ToSChinese(ac); } else { Choose = Utils.ToSChinese(ac); } } string show1 = ""; string show2 = ""; if (ac != "" && ac != "[删]") { show1 = "$"; show2 = "$"; } else { if (Choose.Contains("家禽")) { show1 = "$"; } if (Choose.Contains("野兽")) { show2 = "$"; } } string acType = "" + show1 + "家禽|" + show2 + "野兽"; builder.Append(Out.Tab("<div>", "")); builder.Append("选择要推荐的家野:"); builder.Append(Out.Tab("</div>", Out.Hr())); builder.Append(Out.Tab("<div>", "")); strName = "Choose,forumid,bid,id,act,info"; strValu = "" + Choose + "'" + forumid + "'" + bid + "'" + id + "'view'ok"; strOthe = "" + acType + ",Gsedit.aspx,post,3,other|other|other|other|other|other|other|other|other|other"; builder.Append(Out.wapform(strName, strValu, strOthe)); builder.Append(Out.Tab("</div>", "")); if (Choose != "") { builder.Append(Out.Tab("<div>", "<br />")); builder.Append("=选中的家野=<br />"); string[] cTemp = Choose.Split(','); for (int i = 0; i < cTemp.Length; i++) { builder.Append("" + cTemp[i] + ""); strName = "Choose,forumid,bid,id,act,info"; if (i == 0) { strValu = "" + Choose.Replace(cTemp[i] + ",", "").Replace(cTemp[i], "") + "'" + forumid + "'" + bid + "'" + id + "'view'ok"; } else { strValu = "" + Choose.Replace("," + cTemp[i], "").Replace(cTemp[i], "") + "'" + forumid + "'" + bid + "'" + id + "'view'ok"; } strOthe = "[删],Gsedit.aspx,post,3,other"; builder.Append(Out.wapform(strName, strValu, strOthe)); } builder.Append(Out.Tab("</div>", "")); } } strText = ",,,,"; strName = "Choose,forumid,bid,id,act"; strType = "hidden,hidden,hidden,hidden,hidden"; strValu = "" + Choose + "'" + forumid + "'" + bid + "'" + id + "'save"; strEmpt = "false,false,false,false,false"; if (id > 0) { strOthe = "/>确定修改,Gsedit.aspx,post,0,red"; } else { strOthe = "/>确定添加,Gsedit.aspx,post,0,red"; } if (id > 0) { strText += ",主题(" + ub.GetSub("BbsThreadMax", xmlPath) + "字内):,内容(" + ub.GetSub("BbsContentMax", xmlPath) + "字内):/"; strName += ",Title,Content"; strType += ",text,big"; strValu += "'" + modelT.Title + "'" + modelT.Content + ""; strEmpt += ",false,false"; } builder.Append(Out.wapform(strText, strName, strType, strValu, strEmpt, strIdea, strOthe)); builder.Append(Out.Tab("<div class=\"title\">", Out.Hr())); builder.Append("<a href=\"" + Utils.getUrl("topic.aspx?forumid=" + forumid + "&bid=" + bid + "") + "\">返回上一级</a>"); builder.Append(Out.Tab("</div>", "")); } }
protected void Page_Load(object sender, EventArgs e) { Master.Title = "帖子心情"; int forumid = int.Parse(Utils.GetRequest("forumid", "all", 2, @"^[0-9]\d*$", "论坛ID错误")); int bid = int.Parse(Utils.GetRequest("bid", "all", 2, @"^[0-9]\d*$", "帖子ID错误")); if (!new BCW.BLL.Forum().Exists2(forumid)) { Utils.Success("访问论坛", "该论坛不存在或已暂停使用", Utils.getUrl("forum.aspx"), "1"); } if (!new BCW.BLL.Text().Exists2(bid, forumid)) { Utils.Error("帖子不存在或已被删除", ""); } int meid = new BCW.User.Users().GetUsId(); if (meid == 0) { Utils.Login(); } builder.Append(Out.Tab("<div class=\"title\">", "")); builder.Append("看了本帖的心情"); builder.Append(Out.Tab("</div>", "")); DataSet ds = new BCW.BLL.Text().GetList("ReStats,ReList", "ID=" + bid + ""); string ReStats = ds.Tables[0].Rows[0]["ReStats"].ToString(); string ReList = "|" + ds.Tables[0].Rows[0]["ReList"].ToString() + "|"; int v = int.Parse(Utils.GetRequest("v", "get", 1, @"^[0-9]\d*$", "0"));//4 // int v = int.Parse(Utils.GetRequest("v", "get", 1, @"^[0-9]\d*$", "0"));// 2 if (string.IsNullOrEmpty(ReStats)) { ReStats = "0|0|0|0|0"; } string sStats = string.Empty; // #region 修改 bool temp = false; //判断修改标志 默认不可以修改 string jungle = meid.ToString(); string[] list = ds.Tables[0].Rows[0]["ReList"].ToString().Split('|'); for (int i = 0; i < list.Length; i++) { // builder.Append("list:"+jungle + "-"); if (jungle.Trim() == list[i].Trim()) //如果包含meid { temp = false; //设置为不可以修改 } else//如果不包含meid { temp = true; //设置为可以修改 } } bool test = !("|" + ReList + "|").Contains("|" + meid + "|"); #endregion //结束 if (v != 0 && temp && test) //不包含这个ID { if (v >= 1 && v <= 5) //限定 V 的取值在 1-5之间才能修改数据 { string[] arrReStats = ReStats.Split("|".ToCharArray()); for (int i = 0; i < arrReStats.Length; i++) //5 { if ((v - 1) == i) { sStats += "|" + Convert.ToInt32(Convert.ToInt32(arrReStats[i]) + 1);//重写数据 } else { sStats += "|" + arrReStats[i];//原有数据 } } sStats = Utils.Mid(sStats, 1, sStats.Length); string result = string.Empty; if (string.IsNullOrEmpty(ds.Tables[0].Rows[0]["ReList"].ToString()))//判断是否为空 { result = ds.Tables[0].Rows[0]["ReList"].ToString() + meid; } else { result = ds.Tables[0].Rows[0]["ReList"].ToString() + "|" + meid; } //builder.Append(ds.Tables[0].Rows[0]["ReList"].ToString() + "<br/>"); //builder.Append(result + " 写入数据库的数据result"); // ReList = Utils.Mid(ReList + "|" + meid, 1, (ReList + "|" + meid).Length); new BCW.BLL.Text().UpdateReStats(bid, sStats, result); } } else { sStats = ReStats; } string ReText = "快乐|伤心|幽默|好帖"; string[] arrText = ReText.Split("|".ToCharArray()); string[] arrsStats = sStats.Split("|".ToCharArray()); for (int i = 0; i < arrsStats.Length - 1; i++) { builder.Append(Out.Tab("<div>", "<br />")); // builder.Append(i+"<br/>"); builder.Append("<a href=\"" + Utils.getUrl("mood.aspx?forumid=" + forumid + "&bid=" + bid + "&v=" + (i + 1) + "&backurl=" + Utils.getPage(0) + "") + "\"><img src=\"/files/face/em" + i + ".gif\" alt=\"load\"/>" + arrText[i] + "(" + arrsStats[i] + ")</a>"); builder.Append(Out.Tab("</div>", "")); } builder.Append(Out.Tab("<div class=\"title\">", Out.Hr())); builder.Append("<a href=\"" + Utils.getUrl("topic.aspx?forumid=" + forumid + "&bid=" + bid + "&backurl=" + Utils.getPage(0) + "") + "\">>返回主题帖</a>"); builder.Append(Out.Tab("</div>", "")); builder.Append(Out.Tab("<div>", "<br />")); builder.Append("注:同心情超5人次,帖子将会出现心情图标"); builder.Append(Out.Tab("</div>", "")); }
private void ReloadPage() { int forumid = int.Parse(Utils.GetRequest("forumid", "all", 2, @"^[0-9]\d*$", "论坛ID错误")); if (!new BCW.BLL.Forum().Exists2(forumid)) { Utils.Success("访问论坛", "该论坛不存在或已暂停使用", Utils.getUrl("forum.aspx"), "1"); } if (new BCW.User.ForumInc().IsForumGSIDS(forumid) == true) { } else { Utils.Error("不存在的记录", ""); } int meid = new BCW.User.Users().GetUsId(); if (meid == 0) { Utils.Login(); } int ptype = int.Parse(Utils.GetRequest("ptype", "get", 1, @"^[0-2]$", "0")); Master.Title = "高手排行榜"; builder.Append(Out.Tab("<div class=\"title\">", "")); string ForumTitle = new BCW.BLL.Forum().GetTitle(forumid); builder.Append("" + ForumTitle + "-排行榜"); builder.Append(Out.Tab("</div>", "<br />")); builder.Append(Out.Tab("<div class=\"text\">", "")); if (ptype == 0) { builder.Append("连中榜|"); } else { builder.Append("<a href=\"" + Utils.getUrl("Gstoplist.aspx?forumid=" + forumid + "&ptype=0&backurl=" + Utils.getPage(0) + "") + "\">连中榜</a>|"); } if (ptype == 1) { builder.Append("月中榜|"); } else { builder.Append("<a href=\"" + Utils.getUrl("Gstoplist.aspx?forumid=" + forumid + "&ptype=1&backurl=" + Utils.getPage(0) + "") + "\">月中榜</a>|"); } if (ptype == 2) { builder.Append("历史"); } else { builder.Append("<a href=\"" + Utils.getUrl("Gstoplist.aspx?forumid=" + forumid + "&ptype=2&backurl=" + Utils.getPage(0) + "") + "\">历史</a>"); } builder.Append("|<a href=\"" + Utils.getUrl("Gstoplist.aspx?act=centlist&forumid=" + forumid + "&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 strOrder = string.Empty; string[] pageValUrl = { "act", "forumid", "ptype", "backurl" }; pageIndex = Utils.ParseInt(Request.QueryString["page"]); if (pageIndex == 0) { pageIndex = 1; } strWhere = "ForumId=" + forumid + " and Types=8"; if (ptype == 0) { strWhere += " and Glznum>0"; strOrder = "Glznum DESC"; } else if (ptype == 1) { strWhere += " and Gmnum>0"; strOrder = "Gmnum DESC"; } else if (ptype == 2) { strWhere += " and Gwinnum>0"; strOrder = "Gwinnum DESC"; } string GsAdminID = ub.GetSub("BbsGsAdminID", xmlPath); // 开始读取列表 IList <BCW.Model.Text> listText = new BCW.BLL.Text().GetTextsGs(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.Append("" + ((pageIndex - 1) * pageSize + k) + ".<a href=\"" + Utils.getUrl("uinfo.aspx?uid=" + n.UsID + "&backurl=" + Utils.PostPage(1) + "") + "\">" + n.UsName + "</a>"); if (ptype == 0) { builder.Append("连中" + n.Glznum + ""); } else if (ptype == 1) { builder.Append("月中" + n.Gmnum + ""); } else { builder.Append("" + n.Gaddnum + "中" + n.Gwinnum + ""); } builder.Append("<a href=\"" + Utils.getUrl("topic.aspx?forumid=" + n.ForumId + "&bid=" + n.ID + "&backurl=" + Utils.PostPage(1) + "") + "\">" + n.Title + "</a>"); if (("#" + GsAdminID + "#").Contains("#" + meid + "#")) { builder.Append("|<a href=\"" + Utils.getUrl("Gstoplist.aspx?act=cent&forumid=" + n.ForumId + "&bid=" + n.ID + "&backurl=" + Utils.PostPage(1) + "") + "\">奖励</a>"); } k++; builder.Append(Out.Tab("</div>", "")); } // 分页 builder.Append(BasePage.ForumMultiPage(pageIndex, pageSize, recordCount, Utils.getPageUrl(), pageValUrl, "page", 0)); } else { builder.Append(Out.Div("div", "没有相关记录..")); } builder.Append(Out.Tab("<div class=\"text\">", Out.Hr())); builder.Append("<a href=\"" + Utils.getUrl("Gstoplist.aspx?act=top&backurl=" + Utils.getPage(0) + "") + "\">【各坛排行记录】</a><br />"); builder.Append("<a href=\"" + Utils.getUrl("Gstoplist.aspx?act=top2&backurl=" + Utils.getPage(0) + "") + "\">【各坛奖励记录】</a>"); builder.Append(Out.Tab("</div>", "")); builder.Append(Out.Tab("<div class=\"title\">", "<br />")); builder.Append("<a href=\"" + Utils.getUrl("/default.aspx") + "\">首页</a>-"); builder.Append("<a href=\"" + Utils.getPage("uinfo.aspx?backurl=" + Utils.getPage(0) + "") + "\">上级</a>-"); builder.Append("<a href=\"" + Utils.getUrl("forum.aspx?forumid=" + forumid + "") + "\">论坛</a>"); builder.Append(Out.Tab("</div>", "")); }
private void ReloadPage() { string Date = DateTime.Now.ToString("yyyyMMdd"); string str = new BCW.Service.GetNews().GetNewsXML(Date); //builder.Append(str); string[] Temp = Regex.Split(str, @"\],\["); for (int i = 1; i < Temp.Length; i++) { string Title = ""; string strUrl = ""; DateTime AddTime = DateTime.Now; int nid = 0; string[] temp = Regex.Split(Temp[i], ",\""); nid = Convert.ToInt32(temp[0]); Title = temp[1].Replace("\"", ""); strUrl = temp[2].Replace("\"", ""); AddTime = Convert.ToDateTime("" + DateTime.Now.Year + "/" + temp[3].Replace("\"", "").Replace("]", "")); //1,"遭中俄反对 美防长称未确定在东亚何地部署萨德","http://news.sohu.com/20150411/n411104811.shtml","04/11 01:13" //builder.Append("" + nid + "<br />"); //builder.Append("" + Title + "<br />"); //builder.Append("" + strUrl + "<br />"); //builder.Append("" + AddTime + "<br />"); //国内0 //国际1 //社会2 //国际财经3 //军事4 //体育5 //娱乐6 //文化7 //汽车8 int Types = Convert.ToInt32(ub.GetSub("NewsTypes", xmlPath));//导入文章栏目还是帖子 //ID对应文章分类ID int NodeId = 0; //发布的ID(导入帖子时用到) int meid = 0; NodeId = Convert.ToInt32(ub.GetSub("NewsID" + nid + "", xmlPath)); if (Types == 1) { meid = Convert.ToInt32(ub.GetSub("NewsIDb" + nid + "", xmlPath)); } if (!strUrl.Contains("http://pic.") && strUrl.Contains(".shtml")) { //抓取N分钟内的News int min = 1440; if (AddTime > DateTime.Now.AddMinutes(-min)) { //if (Types == 0) //{ // if (!new BCW.BLL.Detail().Exists(Title)) // { // BCW.Model.Detail model = new BCW.Model.Detail(); // model.Title = Title; // model.KeyWord = Out.CreateKeyWord(Title, 2); // model.Model = ""; // model.IsAd = true; // model.Types = 11; // model.NodeId = NodeId; // model.Content = strUrl; // model.TarText = ""; // model.LanText = ""; // model.SafeText = ""; // model.LyText = ""; // model.UpText = ""; // model.IsVisa = 0; // model.AddTime = AddTime; // model.Readcount = 0; // model.Recount = 0; // model.Cent = 0; // model.BzType = 0; // model.Hidden = 0; // model.UsID = -1;//采集的标识 // new BCW.BLL.Detail().Add(model); // } //} //else //{ string mename = new BCW.BLL.User().GetUsName(meid); DataSet ds = new BCW.BLL.Text().GetList("ID", "ForumId=" + NodeId + " and UsID=" + meid + " and Title='" + Title + "'"); if (ds == null || ds.Tables[0].Rows.Count == 0) { int Price = 0; int Prices = 0; int IsSeen = 0; string PayCi = string.Empty; BCW.Model.Text addmodel = new BCW.Model.Text(); addmodel.ForumId = NodeId; addmodel.Types = 0; addmodel.Title = Title; addmodel.Content = strUrl; addmodel.HideContent = ""; addmodel.UsID = meid; addmodel.UsName = mename; addmodel.Price = Price; addmodel.Prices = Prices; addmodel.BzType = 0; addmodel.HideType = 9; //采集的标识 addmodel.PayCi = PayCi; addmodel.IsSeen = IsSeen; addmodel.AddTime = DateTime.Now; addmodel.ReTime = DateTime.Now; new BCW.BLL.Text().Add(addmodel); } //} } } } Master.Title = "采集新闻列表"; Master.Refresh = 60; Master.Gourl = Utils.getUrl("go.aspx"); builder.Append("采集完成,间隔60秒再次自动启动..."); }
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}&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}&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 + "&bid={0}&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("&?", "?") + "\">返回上级</a>"); builder.Append(Out.Tab("</div>", "")); }
private void ReloadPage() { int uid = int.Parse(Utils.GetRequest("uid", "all", 1, @"^[0-9]\d*$", "0")); int ptype = int.Parse(Utils.GetRequest("ptype", "all", 1, @"^[0-6]$", "0")); string sName = "帖子管理"; if (ptype == 6) { sName = "帖子回收站"; } Master.Title = sName; if (uid > 0) { if (!new BCW.BLL.User().Exists(uid)) { Utils.Error("会员ID不存在", ""); } } builder.Append(Out.Tab("<div class=\"title\">", "")); builder.Append(sName); builder.Append(Out.Tab("</div>", "<br />")); builder.Append(Out.Tab("<div class=\"text\">", "")); if (ptype != 6) { if (ptype == 0) { builder.Append("全部|"); } else { builder.Append("<a href=\"" + Utils.getUrl("thread.aspx?ptype=0") + "\">全部</a>|"); } if (ptype == 1) { builder.Append("精华|"); } else { builder.Append("<a href=\"" + Utils.getUrl("thread.aspx?uid=" + uid + "&ptype=1") + "\">精华</a>|"); } if (ptype == 2) { builder.Append("推荐|"); } else { builder.Append("<a href=\"" + Utils.getUrl("thread.aspx?uid=" + uid + "&ptype=2") + "\">推荐</a>|"); } if (ptype == 3) { builder.Append("置顶|"); } else { builder.Append("<a href=\"" + Utils.getUrl("thread.aspx?uid=" + uid + "&ptype=3") + "\">置顶</a>|"); } if (ptype == 4) { builder.Append("锁定|"); } else { builder.Append("<a href=\"" + Utils.getUrl("thread.aspx?uid=" + uid + "&ptype=4") + "\">锁定</a>|"); } if (ptype == 5) { builder.Append("固底"); } else { builder.Append("<a href=\"" + Utils.getUrl("thread.aspx?uid=" + uid + "&ptype=5") + "\">固底</a>"); } } else { builder.Append("<a href=\"" + Utils.getUrl("thread.aspx?ptype=0") + "\">全部</a>|帖子回收"); } builder.Append(Out.Tab("</div>", "<br />")); int pageIndex; int recordCount; int pageSize = Convert.ToInt32(ub.Get("SiteListNo")); string strWhere = string.Empty; string strOrder = string.Empty; string[] pageValUrl = { "uid", "ptype" }; pageIndex = Utils.ParseInt(Request.QueryString["page"]); if (pageIndex == 0) { pageIndex = 1; } //查询条件 if (uid > 0) { strWhere += "UsID=" + uid + " and "; } if (ptype == 0) { strWhere += " IsDel=0 "; } else if (ptype == 1) { strWhere += " IsGood=1 and IsDel=0"; } else if (ptype == 2) { strWhere += " IsRecom=1 and IsDel=0"; } else if (ptype == 3) { strWhere += " IsTop>=1 and IsDel=0"; } else if (ptype == 4) { strWhere += " IsLock=1 and IsDel=0"; } else if (ptype == 5) { strWhere += " IsTop=-1 and IsDel=0"; } else if (ptype == 6) { strWhere += "IsDel=1"; } 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.Append("<a href=\"" + Utils.getUrl("thread.aspx?act=edit&id=" + n.ID + "&backurl=" + Utils.PostPage(1) + "") + "\">[管理]></a>"); builder.AppendFormat("<a href=\"" + Utils.getUrl("/bbs/topic.aspx?forumid=" + n.ForumId + "&bid={0}&backurl=" + Utils.PostPage(1) + "") + "\">{1}</a>{2}", n.ID, n.Title, "(" + DT.FormatDate(n.AddTime, 2) + ")"); builder.Append("<a href=\"" + Utils.getUrl("forumlog.aspx?act=bview&bid=" + n.ID + "&backurl=" + Utils.PostPage(1) + "") + "\">日志</a>."); builder.Append("<a href=\"" + Utils.getUrl("thread.aspx?act=del&id=" + n.ID + "&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", "没有相关记录..")); } string strText = "输入用户ID:/,"; string strName = "uid,ptype"; string strType = "num,hidden"; string strValu = "'" + ptype + ""; string strEmpt = "true,false"; string strIdea = "/"; string strOthe = "搜帖子,thread.aspx,post,1,red"; builder.Append(Out.wapform(strText, strName, strType, strValu, strEmpt, strIdea, strOthe)); builder.Append(Out.Tab("<div class=\"hr\"></div>", Out.Hr())); builder.Append(Out.Tab("<div>", "")); if (ptype == 6) { builder.Append("<a href=\"" + Utils.getUrl("thread.aspx?act=clearrecycl") + "\">清空回收站</a><br />"); } else { builder.Append("<a href=\"" + Utils.getUrl("thread.aspx?ptype=6") + "\">帖子回收站</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 />")); }
/// <summary> /// 论坛首页 /// </summary> private void ReloadPage() { int id = int.Parse(Utils.GetRequest("id", "all", 1, @"^[0-9]\d*$", "0")); string strWhere = string.Empty; int meid = new BCW.User.Users().GetUsId(); if (id != 0) { if (!new BCW.BLL.Topics().ExistsIdLeibie(id, 2)) { Utils.Error("不存在的记录", ""); } if (meid == 0) { strWhere = "NodeId=" + id + " AND Hidden=0 ORDER BY Paixu ASC"; } else { strWhere = "NodeId=" + id + " AND Hidden<=1 ORDER BY Paixu ASC"; } BCW.Model.Topics model = new BCW.BLL.Topics().GetTopics(id); Master.Title = model.Title; //----------------业务处理开始 bool IsTs = false; if (model.Cent != 0) { if (model.SellTypes == 0)//按次收费 { string payIDs = "|" + model.PayId + "|"; if (payIDs.IndexOf("|" + meid + "|") == -1) { IsTs = true; } } else if (model.SellTypes == 1 || model.SellTypes == 2)//包周包月 { if (!new BCW.BLL.Order().Exists(id, meid, DateTime.Now)) { IsTs = true; } } } if (model.VipLeven != 0) { if (meid == 0) { Utils.Login();//显示登录 } int VipLeven = BCW.User.Users.VipLeven(meid); if (VipLeven < model.VipLeven) { Utils.Error("本页面限VIP等级" + model.VipLeven + "级进入<br />您的VIP等级为<a href=\"" + Utils.getUrl("/bbs/finance.aspx?act=addvip") + "\">" + VipLeven + "级</a>", ""); } } if (IsTs == true) { if (meid == 0) { Utils.Login();//显示登录 } long Cent = Convert.ToInt64(model.Cent); //取用户信息 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 act = Utils.GetRequest("act", "get", 1, "", ""); if (act != "ok") { new Out().head(Utils.ForWordType("温馨提示")); Response.Write(Out.Tab("<div class=\"text\">", "")); if (model.SellTypes == 0) { Response.Write("本页内容收费" + Cent + "" + Bz + ",扣费一次,永久浏览"); } else if (model.SellTypes == 1) { Response.Write("本页内容为包周业务,,如果您是此内容的包周会员,可以免费进入,否则将扣除您的" + Cent + "" + Bz + ",您将免费浏览本页面为一周时间"); } else if (model.SellTypes == 2) { Response.Write("本页内容为包月业务,,如果您是此内容的包月会员,可以免费进入,否则将扣除您的" + 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("forum.aspx?act=ok&id=" + id + "") + "\">马上进入浏览</a><br />"); Response.Write("<a href=\"" + Utils.getUrl("forum.aspx") + "\">返回上级</a>"); Response.Write(Out.Tab("</div>", "")); Response.Write(new Out().foot()); Response.End(); } //支付安全提示 string[] p_pageArr = { "act", "id" }; BCW.User.PaySafe.PaySafePage(meid, Utils.getPageUrl(), p_pageArr, "get"); if (model.SellTypes == 0)//按次收费 { string payIDs = "|" + model.PayId + "|"; if (payIDs.IndexOf("|" + meid + "|") == -1) { if (megold < Cent) { Utils.Error("您的" + Bz + "不足", Utils.getUrl("default.aspx?id=" + id + "")); } //扣币 if (model.BzType == 0) { new BCW.BLL.User().UpdateiGold(meid, -Cent, "浏览收费页面"); } else { new BCW.BLL.User().UpdateiMoney(meid, -Cent, "浏览收费页面"); } //更新 payIDs = model.PayId + "|" + meid; new BCW.BLL.Topics().UpdatePayId(id, payIDs); } } else if (model.SellTypes == 1 || model.SellTypes == 2)//包周包月 { int iDays = 0; if (model.SellTypes == 1) { iDays = 7; } else { iDays = 30; } if (!new BCW.BLL.Order().Exists(id, meid, DateTime.Now)) { if (megold < Cent) { Utils.Error("您的" + Bz + "不足", ""); } //扣币 if (model.BzType == 0) { new BCW.BLL.User().UpdateiGold(meid, -Cent, "浏览收费页面"); } else { new BCW.BLL.User().UpdateiMoney(meid, -Cent, "浏览收费页面"); } //增加/更新 BCW.Model.Order modelorder = new BCW.Model.Order(); modelorder.UsId = meid; modelorder.UsName = new BCW.BLL.User().GetUsName(meid); modelorder.TopicId = id; modelorder.SellTypes = model.SellTypes; modelorder.Title = model.Title; modelorder.AddTime = DateTime.Now; modelorder.ExTime = DateTime.Now.AddDays(iDays); if (!new BCW.BLL.Order().Exists(id, meid)) { new BCW.BLL.Order().Add(modelorder); } else { new BCW.BLL.Order().Update(modelorder); } } } } //----------------业务处理结束 //----------------密码访问开始 string pwd = Utils.GetRequest("pwd", "post", 1, "", ""); if (!string.IsNullOrEmpty(model.InPwd) && pwd != model.InPwd) { new Out().head(Utils.ForWordType("温馨提示")); Response.Write(Out.Tab("<div class=\"title\">", "")); Response.Write("本页面内容已加密"); Response.Write(Out.Tab("</div>", "")); string strText = "输入密码:/,,"; string strName = "pwd,id,backurl"; string strType = "password,hidden,hidden,hidden"; string strValu = "'" + id + "'" + Utils.getPage(0) + ""; string strEmpt = "false,false,false"; string strIdea = "/"; string strOthe = "确认访问,forum.aspx,post,1,red"; Response.Write(Out.wapform(strText, strName, strType, strValu, strEmpt, strIdea, strOthe)); Response.Write(Out.Tab("<div>", "")); Response.Write(" <a href=\"" + Utils.getUrl("default.aspx") + "\">取消</a>"); Response.Write(Out.Tab("</div>", "")); Response.Write(new Out().foot()); Response.End(); } //----------------密码访问结束 //----------------限制手机访问开始 if (model.IsPc == 1) { if (!Utils.IsMobileUa()) { Utils.Error("请使用手机访问本页", ""); } } //----------------限制手机访问结束 //builder.Append(Out.Tab("<div class=\"title\">" + model.Title + "</div>", "")); //全区滚动 BCW.Model.Text flow = new BCW.BLL.Text().GetTextFlow(); if (flow != null) { builder.Append(Out.Tab("<div>", "")); builder.Append("<a href=\"" + Utils.getUrl("manager.aspx?act=flow&forumid=" + flow.ForumId + "&bid=" + flow.ID + "&backurl=" + Utils.PostPage(1) + "") + "\">" + Out.USB(TrueStrLength.cutTrueLength(flow.Title, 20, "…")) + "</a> "); builder.Append(Out.Tab("</div>", "<br />")); } } else { if (meid == 0) { strWhere = "NodeId=0 AND Leibie=2 AND Hidden=0 ORDER BY Paixu ASC"; } else { strWhere = "NodeId=0 AND Leibie=2 AND Hidden<=1 ORDER BY Paixu ASC"; } Master.Title = ub.Get("SiteforumName"); string Logo = ub.Get("SiteforumLogo"); if (!string.IsNullOrEmpty(Logo) && Utils.IsMobileUa() == true) { builder.Append(Out.Tab("<div>", "")); builder.Append("<img src=\"" + Logo + "\" alt=\"load\"/>"); builder.Append(Out.Tab("</div>", "<br />")); } //拾物随机 builder.Append(BCW.User.Game.GiftFlows.ShowGiftFlows(1)); //顶部滚动 builder.Append(BCW.User.Master.OutTopRand(2)); //全区滚动 BCW.Model.Text flow = new BCW.BLL.Text().GetTextFlow(); if (flow != null) { builder.Append(Out.Tab("<div>", "")); builder.Append("<a href=\"" + Utils.getUrl("manager.aspx?act=flow&forumid=" + flow.ForumId + "&bid=" + flow.ID + "&backurl=" + Utils.PostPage(1) + "") + "\">" + Out.USB(TrueStrLength.cutTrueLength(flow.Title, 20, "…")) + "</a> "); builder.Append(Out.Tab("</div>", "<br />")); } } DataSet ds = new BCW.BLL.Topics().GetList(strWhere); if (ds == null || ds.Tables[0].Rows.Count == 0) { if (id != 0) { builder.Append(Out.Div("div", "没有相关记录..")); } else { builder.Append(Out.Div("div", "论坛正在建设中..")); } } for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { string ID = ds.Tables[0].Rows[i]["ID"].ToString(); string Types = ds.Tables[0].Rows[i]["Types"].ToString(); string Title = ds.Tables[0].Rows[i]["Title"].ToString(); string Content = ds.Tables[0].Rows[i]["Content"].ToString(); string IsBr = ds.Tables[0].Rows[i]["IsBr"].ToString(); int VipLeven = Utils.ParseInt(ds.Tables[0].Rows[i]["VipLeven"].ToString()); string Br = string.Empty; if (IsBr == "0" && IsVipSeen(meid, VipLeven) == true) { Br = Convert.ToChar(10).ToString(); } switch (Types) { case "1": builderIndex.Append("<a href=\"" + Utils.getUrl("forum.aspx?id=" + ID + "&backurl=" + Utils.PostPage(1) + "") + "\">" + Title + "</a>"); break; case "2": if (IsVipSeen(meid, VipLeven)) { builderIndex.Append(BCW.User.AdminCall.AdminUBB(Out.SysUBB(Content))); } break; case "3": if (IsVipSeen(meid, VipLeven)) { builderIndex.Append("<img src=\"" + Content + "\" alt=\"load\"/>"); } break; case "4": if (IsVipSeen(meid, VipLeven)) { builderIndex.Append("<a href=\"" + BCW.User.AdminCall.AdminUBB(Utils.SetUrl(Content)) + "\">" + Title + "</a>"); } break; case "5": if (IsVipSeen(meid, VipLeven)) { builderIndex.Append(Out.WmlDecode(Content)); } break; case "6": builderIndex.Append("<a href=\"" + Utils.getUrl("forum.aspx?forumid=" + Content + "&backurl=" + Utils.PostPage(1) + "") + "\">" + Title + "</a>"); break; case "10": builderIndex.Append(BCW.User.AdminCall.ShowAdvert()); break; default: builderIndex.Append(""); break; } builderIndex.Append(Br); } if (!Utils.Isie()) { builder.Append(builderIndex.ToString().Replace((Convert.ToChar(10).ToString()), "<br />")); } else { string[] txtIndex = builderIndex.ToString().Split((Convert.ToChar(10).ToString()).ToCharArray()); for (int i = 0; i < txtIndex.Length; i++) { // 输出列表的格式 if (txtIndex[i].IndexOf("</div>") == -1) { if ((i + 1) % 2 == 0) { builder.Append(Out.Tab("<div class=\"text\">", "")); } else { builder.Append(Out.Tab("<div>", "")); } } builder.Append(txtIndex[i].ToString()); if (txtIndex[i].IndexOf("</div>") == -1) { builder.Append(Out.Tab("</div>", "")); } } } if (id != 0) { builder.Append(Out.Tab("<div class=\"hr\"></div>", Out.Hr())); builder.Append(Out.Tab("<div>", "")); int NodeId = new BCW.BLL.Topics().GetNodeId(id); if (NodeId != 0) { builder.Append("<a href=\"" + Utils.getUrl("forum.aspx?id=" + NodeId + "") + "\">返回栏目</a><br />"); } if (Utils.getPage(1) != "") { builder.Append("<a href=\"" + Utils.getPage(1) + "\">>返回上一级</a>"); } else { builder.Append("<a href=\"" + Utils.getUrl("forum.aspx") + "\">>返回上一级</a>"); } builder.Append(Out.Tab("</div>", "")); } }
/// <summary> /// 论坛版面 /// </summary> private void ListPage(int forumid) { if (!new BCW.BLL.Forum().Exists2(forumid)) { Utils.Success("访问论坛", "该论坛不存在或已暂停使用", Utils.getUrl("forum.aspx"), "1"); } int meid = new BCW.User.Users().GetUsId(); BCW.Model.Forum model = new BCW.BLL.Forum().GetForum(forumid); BCW.Model.Group modelgr = null; if (model.GroupId > 0) { if (meid == 0) { Utils.Login(); } modelgr = new BCW.BLL.Group().GetGroupMe(model.GroupId); if (modelgr == null) { Utils.Error("不存在的" + ub.GetSub("GroupName", "/Controls/group.xml") + "", ""); } else if (DT.FormatDate(modelgr.ExTime, 0) != "1990-01-01 00:00:00" && modelgr.ExTime < DateTime.Now) { Utils.Error("" + ub.GetSub("GroupName", "/Controls/group.xml") + "已过期", ""); } if (modelgr.ForumStatus == 2) { Utils.Error("" + ub.GetSub("GroupName", "/Controls/group.xml") + "论坛已关闭", ""); } string GroupId = new BCW.BLL.User().GetGroupId(meid); if (modelgr.ForumStatus == 1) { bool Isvi = false; //能够穿透的ID string CTID = "#" + ub.GetSub("GroupCTID", "/Controls/group.xml") + "#"; if (CTID.IndexOf("#" + meid + "#") != -1) { Isvi = true; } if (GroupId.IndexOf("#" + model.GroupId + "#") == -1 && Isvi == false) { Utils.Error("非成员不能访问" + ub.GetSub("GroupName", "/Controls/group.xml") + "论坛!<br /><a href=\"" + Utils.getUrl("/bbs/group.aspx?act=addin&id=" + model.GroupId + "&backurl=" + Utils.PostPage(1) + "") + "\">加入本" + ub.GetSub("GroupName", "/Controls/group.xml") + "</a>", ""); } } int VipLeven = BCW.User.Users.VipLeven(meid); if (VipLeven == 0) { int DqNum = (Utils.GetStringNum(GroupId.Replace("##", "#"), "#") - 1); if (DqNum > 5) { Utils.Error("您的VIP会员已过期,请进行续费才能同时加入5个以上的" + ub.GetSub("GroupName", "/Controls/group.xml") + ",否则只能同时加入5个才可以使用" + ub.GetSub("GroupName", "/Controls/group.xml") + "<br /><a href=\"" + Utils.getUrl("finance.aspx?act=addvip&backurl=" + Utils.PostPage(1) + "") + "\">>>我现在要续费VIP</a><br /><a href=\"" + Utils.getUrl("group.aspx?act=me&backurl=" + Utils.PostPage(1) + "") + "\"><<我要退出一些圈子</a>", ""); } } } BCW.User.Users.ShowForumLimit(meid, model.Gradelt, model.Visitlt, model.VisitId, model.IsPc); Master.Title = model.Title; //个性设置 int FsPageSize = 10; if (meid > 0) { string ForumSet = new BCW.BLL.User().GetForumSet(meid); FsPageSize = BCW.User.Users.GetForumSet(ForumSet, 0); } int pageIndex; int recordCount; int pageSize = FsPageSize; string strWhere = string.Empty; string strOrder = string.Empty; string[] pageValUrl = { "forumid", "backurl" }; pageIndex = Utils.ParseInt(Request.QueryString["page"]); if (pageIndex == 0) { pageIndex = 1; } if (pageIndex == 1) { if (!string.IsNullOrEmpty(model.Logo) && Utils.IsMobileUa() == true) { builder.Append(Out.Tab("<div>", "")); builder.Append("<img src=\"" + model.Logo + "\" alt=\"load\"/>"); builder.Append(Out.Tab("</div>", "<br />")); } //拾物随机 builder.Append(BCW.User.Game.GiftFlows.ShowGiftFlows(1)); //顶部滚动 builder.Append(BCW.User.Master.OutTopRand(3)); if (!string.IsNullOrEmpty(model.TopUbb)) { builder.Append(Out.Tab("<div>", "")); builder.Append(BCW.User.AdminCall.AdminUBB(Out.SysUBB(model.TopUbb))); builder.Append(Out.Tab("</div>", "<br />")); } //全区滚动 BCW.Model.Text flow = new BCW.BLL.Text().GetTextFlow(); if (flow != null) { builder.Append(Out.Tab("<div>", "")); builder.Append("<a href=\"" + Utils.getUrl("manager.aspx?act=flow&forumid=" + flow.ForumId + "&bid=" + flow.ID + "&backurl=" + Utils.PostPage(1) + "") + "\">" + Out.USB(TrueStrLength.cutTrueLength(flow.Title, 20, "…")) + "</a> "); builder.Append(Out.Tab("</div>", "<br />")); } builder.Append(Out.Tab("<div class=\"title\">", "")); builder.Append("<a href=\"" + Utils.getUrl("/bbs/addThread.aspx?forumid=" + forumid + "") + "\">发帖</a> "); builder.Append("<a href=\"" + Utils.getUrl("/bbs/manwork.aspx?forumid=" + forumid + "") + "\">版务</a> "); builder.Append("<a href=\"" + Utils.getUrl("/bbs/sktype.aspx?forumid=" + forumid + "") + "\">精华</a> "); builder.Append("<a href=\"" + Utils.getUrl("/bbs/forumts.aspx?forumid=" + forumid + "") + "\">专题</a> "); builder.Append("<a href=\"" + Utils.getUrl("/search.aspx?act=forum&forumid=" + forumid + "") + "\">搜索</a> "); if (new BCW.User.ForumInc().IsForumGSIDS(forumid) == true) { builder.Append("<a href=\"" + Utils.getUrl("/bbs/Gstoplist.aspx?forumid=" + forumid + "&backurl=" + Utils.PostPage(1) + "") + "\">高手</a>"); } builder.Append(Out.Tab("</div>", "")); if (model.GroupId > 0) { builder.Append(Out.Tab("<div class=\"text\">", "<br />")); builder.Append("<a href=\"" + Utils.getUrl("/bbs/group.aspx?act=info&id=" + model.GroupId + "&backurl=" + Utils.PostPage(1) + "") + "\">主页</a> "); builder.Append("<a href=\"" + Utils.getUrl("/bbs/group.aspx?act=fund&id=" + model.GroupId + "&backurl=" + Utils.PostPage(1) + "") + "\">基金</a> "); builder.Append("<a href=\"" + Utils.getUrl("/bbs/group.aspx?act=view&id=" + model.GroupId + "&backurl=" + Utils.PostPage(1) + "") + "\">资料</a> "); builder.Append("<a href=\"" + Utils.getUrl("/bbs/group.aspx?act=groupid&id=" + model.GroupId + "&backurl=" + Utils.PostPage(1) + "") + "\">成员列表</a> "); builder.Append(Out.Tab("</div>", "")); } //本版滚动 flow = new BCW.BLL.Text().GetTextFlow(forumid); if (flow != null) { builder.Append(Out.Tab("<div>", "<br />")); builder.Append("<a href=\"" + Utils.getUrl("manwork.aspx?act=flow&forumid=" + forumid + "&bid=" + flow.ID + "&backurl=" + Utils.PostPage(1) + "") + "\">" + Out.USB(TrueStrLength.cutTrueLength(flow.Title, 20, "…")) + "</a> "); builder.Append(Out.Tab("</div>", "")); } } //查询条件 //string strWhe = "=" + forumid + ""; //是否显示下级版块帖子 //if (model.ShowType == 1) //{ // if (!string.IsNullOrEmpty(model.DoNode)) // { // strWhe = "in (" + forumid + "," + model.DoNode + ")"; // } //} //strWhere = "IsDel=0 and (ForumId " + strWhe + " OR IsTop=2)"; //查询条件 strWhere = "ForumId =" + forumid + " and IsDel=0 and IsTop=0"; //排序条件 strOrder = "ReTime Desc";//Istop Desc, // 开始读取列表 IList <BCW.Model.Text> listText = new BCW.BLL.Text().GetTexts(pageIndex, pageSize, strWhere, strOrder, out recordCount); if (listText.Count > 0) { if (pageIndex != 1) { //算出总页数 int pageTotal = BasePage.CalcPageCount(recordCount, pageSize, ref pageIndex); builder.Append(Out.Tab("<div class=\"title\">", "")); if (pageTotal > pageIndex) { builder.Append("<a href=\"" + Utils.getUrl("/bbs/forum.aspx?forumid=" + forumid + "&page=" + (pageIndex + 1) + "&backurl=" + Utils.getPage(0) + "") + "\">下一页</a>|"); } builder.Append("<a href=\"" + Utils.getUrl("/bbs/forum.aspx?forumid=" + forumid + "&page=1&backurl=" + Utils.getPage(0) + "") + "\">返回首页</a> "); builder.Append(Out.Tab("</div>", "")); } else { //全区置顶帖子 int j = 1; DataSet dsTop = new BCW.BLL.Text().GetList("Top 3 ID,ForumId,Title,UsID,UsName,ReplyNum,ReadNum", "IsTop=2 and IsDel=0 ORDER BY NEWID()"); if (dsTop != null && dsTop.Tables[0].Rows.Count > 0) { for (int i = 0; i < dsTop.Tables[0].Rows.Count; i++) { if (j % 2 == 0) { builder.Append(Out.Tab("<div class=\"text\">", "<br />")); } else { builder.Append(Out.Tab("<div>", "<br />")); } builder.AppendFormat("<i><b>[顶]</b></i><a href=\"" + Utils.getUrl("/bbs/topic.aspx?forumid={0}&bid={1}&backurl=" + Utils.PostPage(1) + "") + "\">{2}", dsTop.Tables[0].Rows[i]["ForumId"].ToString(), dsTop.Tables[0].Rows[i]["ID"].ToString(), Out.TitleUBB(dsTop.Tables[0].Rows[i]["Title"].ToString())); builder.Append("</a><br />" + dsTop.Tables[0].Rows[i]["UsName"].ToString()); builder.AppendFormat("/阅{0}/回<a href=\"" + Utils.getUrl("/bbs/reply.aspx?forumid={1}&bid={2}&backurl=" + Utils.PostPage(1) + "") + "\">{3}</a>", dsTop.Tables[0].Rows[i]["ReadNum"].ToString(), dsTop.Tables[0].Rows[i]["ForumId"].ToString(), dsTop.Tables[0].Rows[i]["ID"].ToString(), dsTop.Tables[0].Rows[i]["ReplyNum"].ToString()); j++; builder.Append(Out.Tab("</div>", "")); } } //本坛置顶帖子 j = 1; dsTop = new BCW.BLL.Text().GetList("Top 5 ID,ForumId,Title,UsID,UsName,ReplyNum,ReadNum", "ForumId=" + forumid + " and IsTop=1 and IsDel=0 ORDER BY ReTime Desc"); if (dsTop != null && dsTop.Tables[0].Rows.Count > 0) { for (int i = 0; i < dsTop.Tables[0].Rows.Count; i++) { if (j % 2 == 0) { builder.Append(Out.Tab("<div class=\"text\">", "<br />")); } else { builder.Append(Out.Tab("<div>", "<br />")); } builder.AppendFormat("<b>[顶]</b><a href=\"" + Utils.getUrl("/bbs/topic.aspx?forumid={0}&bid={1}&backurl=" + Utils.PostPage(1) + "") + "\">{2}", dsTop.Tables[0].Rows[i]["ForumId"].ToString(), dsTop.Tables[0].Rows[i]["ID"].ToString(), Out.TitleUBB(dsTop.Tables[0].Rows[i]["Title"].ToString())); builder.Append("</a><br />" + dsTop.Tables[0].Rows[i]["UsName"].ToString()); builder.AppendFormat("/阅{0}/回<a href=\"" + Utils.getUrl("/bbs/reply.aspx?forumid={1}&bid={2}&backurl=" + Utils.PostPage(1) + "") + "\">{3}</a>", dsTop.Tables[0].Rows[i]["ReadNum"].ToString(), dsTop.Tables[0].Rows[i]["ForumId"].ToString(), dsTop.Tables[0].Rows[i]["ID"].ToString(), dsTop.Tables[0].Rows[i]["ReplyNum"].ToString()); j++; builder.Append(Out.Tab("</div>", "")); } } } int k = 1; foreach (BCW.Model.Text n in listText) { if (k % 2 == 0) { builder.Append(Out.Tab("<div class=\"text\">", "<br />")); } else { builder.Append(Out.Tab("<div>", "<br />")); } builder.Append(BCW.User.AppCase.CaseIsTop(n.IsTop)); builder.Append(BCW.User.AppCase.CaseIsGood(n.IsGood)); builder.Append(BCW.User.AppCase.CaseIsRecom(n.IsRecom)); builder.Append(BCW.User.AppCase.CaseIsLock(n.IsLock)); builder.Append(BCW.User.AppCase.CaseIsOver(n.IsOver)); // builder.Append(BCW.User.AppCase.CaseText(n.Types)); //派币 if (n.Types == 3) { builder.Append("<img src=\"/files/face/money.gif\" width=\"20\" height=\"25\" alt=\"load\"/>"); //派币 } else { builder.Append(BCW.User.AppCase.CaseText(n.Types)); //派币/附件 } string TextTab = string.Empty; if (n.IsTop != 2) { TextTab = BCW.User.AppCase.CaseLabel(n.LabelId, model.Label); } builder.AppendFormat("<a href=\"" + Utils.getUrl("/bbs/topic.aspx?forumid={0}&bid={1}&backurl=" + Utils.PostPage(1) + "") + "\">{2}.{3}{4}", n.ForumId, n.ID, (pageIndex - 1) * pageSize + k, TextTab, n.Title); if (n.Types == 8) { builder.Append("[" + n.Gaddnum + "中" + n.Gwinnum + "]"); } builder.Append("</a><br />" + n.UsName); builder.AppendFormat("/阅{0}/回<a href=\"" + Utils.getUrl("/bbs/reply.aspx?forumid={1}&bid={2}&backurl=" + Utils.PostPage(1) + "") + "\">{3}</a>", n.ReadNum, n.ForumId, n.ID, n.ReplyNum); k++; builder.Append(Out.Tab("</div>", "")); } // 分页 builder.Append(BasePage.ForumMultiPage(pageIndex, pageSize, recordCount, Utils.getPageUrl(), pageValUrl, "page", 0)); } else { builder.Append(Out.Tab("", "<br />")); builder.Append(Out.Div("div", "没有相关记录..")); } builder.Append(Out.Tab("<div class=\"text\">", "<br />")); builder.Append("<a href=\"" + Utils.getUrl("/bbs/addThread.aspx?forumid=" + forumid + "") + "\">发帖</a>|"); builder.Append("<a href=\"" + Utils.getUrl("/bbs/sktype.aspx?act=text&forumid=" + forumid + "") + "\">我帖</a>|"); builder.Append("<a href=\"" + Utils.getUrl("/bbs/sktype.aspx?forumid=" + forumid + "") + "\">模式</a>|"); builder.Append("<a href=\"" + Utils.getUrl("/bbs/forumstat.aspx?act=top&forumid=" + forumid + "") + "\">排行</a>"); builder.Append(Out.Tab("</div>", "")); if (!string.IsNullOrEmpty(model.Notes)) { builder.Append(Out.Tab("<div>", "<br />")); builder.Append(model.Notes); builder.Append(Out.Tab("</div>", "")); } //更新版块在线人数 if (pageIndex == 1) { new BCW.BLL.User().UpdateEndForumID(meid, forumid); int ForumLine = new BCW.BLL.User().GetForumNum(forumid); if (ForumLine != model.Line) { new BCW.BLL.Forum().UpdateLine(forumid, ForumLine); } } builder.Append(Out.Tab("<div>", "")); if (ub.GetSub("BbsIsOnline", "/Controls/bbs.xml") == "0") { builder.Append(Out.Tab("", "<br />")); builder.Append("<a href=\"" + Utils.getUrl("/bbs/online.aspx?forumid=" + forumid + "&backurl=" + Utils.PostPage(1) + "") + "\">在线" + model.Line + "人.最高" + model.TopLine + "人</a>"); } //下级版块 builder.Append(BCW.User.Users.ShowForumNode(model.IsNode, forumid)); builder.Append(Out.Tab("</div>", "")); builder.Append(Out.Tab("<div class=\"title\">", Out.Hr())); builder.Append("<a href=\"" + Utils.getUrl("/default.aspx") + "\">首页</a>-"); if (model.GroupId > 0) { builder.Append("<a href=\"" + Utils.getUrl("/bbs/group.aspx?act=info&id=" + model.GroupId + "") + "\">" + ub.GetSub("GroupName", "/Controls/group.xml") + "主页</a>"); } else { builder.Append("<a href=\"" + Utils.getUrl("/bbs/forum.aspx?forumid=" + model.NodeId + "") + "\">上级论坛</a>"); } builder.Append(Out.Tab("</div>", "")); if (!string.IsNullOrEmpty(model.FootUbb)) { builder.Append(Out.Tab("<div>", "<br />")); builder.Append(BCW.User.AdminCall.AdminUBB(Out.SysUBB(model.FootUbb))); builder.Append(Out.Tab("</div>", "")); } }
private void DelFilePage(int uid, int forumid, int bid, int reid) { Master.Title = "删除附件"; int id = int.Parse(Utils.GetRequest("id", "all", 2, @"^[1-9]\d*$", "ID错误")); BCW.Model.Upfile model = new BCW.BLL.Upfile().GetUpfileMe(id); if (model == null || model.BID != bid) { Utils.Error("不存在的记录", ""); } if (model.UsID != uid && !new BCW.User.Role().IsUserRole(BCW.User.Role.enumRole.Role_DelFile, uid, forumid)) { Utils.Error("你的权限不足", ""); } string info = Utils.GetRequest("info", "all", 1, "", ""); if (info != "ok") { builder.Append(Out.Tab("<div class=\"title\">", "")); builder.Append("确定删除此附件吗"); builder.Append(Out.Tab("</div>", "")); if (model.UsID != uid) { strText = "理由:,,,,,,"; strName = "Why,forumid,bid,reid,id,act,info,backurl"; strType = "text,hidden,hidden,hidden,hidden,hidden,hidden,hidden"; strValu = "'" + forumid + "'" + bid + "'" + reid + "'" + id + "'delfile'ok'" + Utils.getPage(0) + ""; strEmpt = "true,false,false,false,false,false,false,false"; strIdea = "/"; strOthe = "确定删除,filelist.aspx,post,1,red"; builder.Append(Out.wapform(strText, strName, strType, strValu, strEmpt, strIdea, strOthe)); builder.Append(Out.Tab("<div>", "")); builder.Append("<a href=\"" + Utils.getUrl("filelist.aspx?act=file&forumid=" + forumid + "&bid=" + bid + "&reid=" + reid + "&id=" + id + "&backurl=" + Utils.getPage(0) + "") + "\">取消</a>"); builder.Append(Out.Tab("</div>", "")); } else { builder.Append(Out.Tab("<div>", "<br />")); builder.Append("<a href=\"" + Utils.getUrl("filelist.aspx?info=ok&act=delfile&forumid=" + forumid + "&bid=" + bid + "&reid=" + reid + "&id=" + id + "&backurl=" + Utils.getPage(0) + "") + "\">确定删除</a><br />"); builder.Append("<a href=\"" + Utils.getUrl("filelist.aspx?act=file&forumid=" + forumid + "&bid=" + bid + "&reid=" + reid + "&backurl=" + Utils.getPage(0) + "") + "\">先留着吧..</a>"); builder.Append(Out.Tab("</div>", "")); } } else { new BCW.BLL.Upfile().Delete(id); //删除文件 BCW.Files.FileTool.DeleteFile(model.Files); if (!string.IsNullOrEmpty(model.PrevFiles)) { BCW.Files.FileTool.DeleteFile(model.PrevFiles); } string strRe = string.Empty; //减去文件数 if (reid > 0) { new BCW.BLL.Reply().UpdateFileNum(reid, -1); strRe = "(回复ID:" + reid + ")"; } else { new BCW.BLL.Text().UpdateFileNum(bid, -1); int FileNum = new BCW.BLL.Text().GetFileNum(bid); if (FileNum == 0) { //去掉附件帖标识 new BCW.BLL.Text().UpdateTypes(bid, 0); } } //记录日志 string Why = Utils.GetRequest("Why", "post", 3, @"^[^\^]{1,20}$", "理由限20字内,可留空"); string strLog = string.Empty; if (model.UsID != uid) { strLog = "[url=/bbs/uinfo.aspx?uid=" + model.UsID + "]" + new BCW.BLL.User().GetUsName(model.UsID) + "[/url]的主题[url=/bbs/topic.aspx?forumid=" + forumid + "&bid=" + bid + "]《" + new BCW.BLL.Text().GetTitle(bid) + "》[/url]" + strRe + "附件被[url=/bbs/uinfo.aspx?uid=" + model.UsID + "]" + new BCW.BLL.User().GetUsName(uid) + "[/url]删除!"; } else { strLog = "[url=/bbs/uinfo.aspx?uid=" + model.UsID + "]" + new BCW.BLL.User().GetUsName(model.UsID) + "[/url]自删主题[url=/bbs/topic.aspx?forumid=" + forumid + "&bid=" + bid + "]《" + new BCW.BLL.Text().GetTitle(bid) + "》[/url]的" + strRe + "附件!"; } new BCW.BLL.Forumlog().Add(7, forumid, strLog); Utils.Success("删除附件", "删除附件成功,正在返回..", Utils.getUrl("filelist.aspx?act=file&forumid=" + forumid + "&bid=" + bid + "&reid=" + reid + "&backurl=" + Utils.getPage(0) + ""), "1"); } }
protected void Page_Load(object sender, EventArgs e) { int uid = int.Parse(Utils.GetRequest("uid", "all", 1, @"^[0-9]\d*$", "0")); int meid = new BCW.User.Users().GetUsId(); if (meid == 0) { Utils.Login(); } if (uid == 0) { uid = meid; } int ptype = int.Parse(Utils.GetRequest("ptype", "all", 1, @"^[1-3]\d*$", "1")); int showtype = int.Parse(Utils.GetRequest("showtype", "all", 1, @"^[0-9]\d*$", "0")); int ordertype = int.Parse(Utils.GetRequest("ordertype", "all", 1, @"^[0-9]\d*$", "1")); if (ptype == 1) { builder.Append(Out.Tab("<div class=\"title\">", "")); builder.Append("<a href=\"" + Utils.getUrl("uinfo.aspx?uid=" + uid + "") + "\">Ta的空间</a>>帖子"); builder.Append(Out.Tab("</div>", "<br />")); Master.Title = "查看主题帖子"; //string strText = "排序:,,,,"; //string strName = "ordertype,ptype,uid,showtype,backurl"; //string strType = "select,hidden,hidden,hidden,hidden"; //string strValu = "" + ordertype + "'" + ptype + "'" + uid + "'" + showtype + "'" + Utils.getPage(0) + ""; //string strEmpt = "1|按发帖时间|2|按最后跟贴|3|按帖子浏览量|4|按帖子跟贴量,,,,"; //string strIdea = ""; //string strOthe = "确定,moreThread.aspx,post,3,red"; //builder.Append(Out.wapform(strText, strName, strType, strValu, strEmpt, strIdea, strOthe)); int pageIndex; int recordCount; int pageSize = Convert.ToInt32(ub.Get("SiteListNo")); string strWhere = string.Empty; string strOrder = string.Empty; string[] pageValUrl = { "uid", "ptype", "showtype", "ordertype", "backurl" }; pageIndex = Utils.ParseInt(Request.QueryString["page"]); if (pageIndex == 0) { pageIndex = 1; } //查询条件 strWhere = "UsID=" + uid + ""; if (showtype == 1) { strWhere += " and IsGood=1"; } else if (showtype == 2) { strWhere += " and IsRecom=1"; } strWhere += " and IsDel=0"; //if (ordertype == 1) strOrder = "AddTime Desc"; //else if (ordertype == 2) // strOrder = "ReTime Desc"; //else if (ordertype == 3) // strOrder = "ReadNum Desc"; //else if (ordertype == 4) // strOrder = "ReplyNum Desc"; // 开始读取列表 IList <BCW.Model.Text> listText = new BCW.BLL.Text().GetTextsMe(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("topic.aspx?forumid=" + n.ForumId + "&bid={0}&backurl=" + Utils.PostPage(1) + "") + "\">{1}.{2}</a>{3}", n.ID, (pageIndex - 1) * pageSize + k, n.Title, DT.FormatDate(n.AddTime, 2)); k++; builder.Append(Out.Tab("</div>", "")); } // 分页 builder.Append(BasePage.ForumMultiPage(pageIndex, pageSize, recordCount, Utils.getPageUrl(), pageValUrl, "page", 0)); } else { builder.Append(Out.Div("div", "没有相关记录..")); } builder.Append(Out.Tab("<div class=\"text\">", "<br />")); if (showtype != 0) { builder.Append("<a href=\"" + Utils.getUrl("moreThread.aspx?ptype=" + ptype + "&uid=" + uid + "&backurl=" + Utils.getPage(0) + "") + "\">全部帖</a> "); } if (showtype != 1) { builder.Append("<a href=\"" + Utils.getUrl("moreThread.aspx?ptype=" + ptype + "&uid=" + uid + "&showtype=1&backurl=" + Utils.getPage(0) + "") + "\">精华帖</a> "); } if (showtype != 2) { builder.Append("<a href=\"" + Utils.getUrl("moreThread.aspx?ptype=" + ptype + "&uid=" + uid + "&showtype=2&backurl=" + Utils.getPage(0) + "") + "\">推荐帖</a>"); } 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("uinfo.aspx?uid=" + uid + "") + "\">上级</a>-"); builder.Append("<a href=\"" + Utils.getUrl("moreThread.aspx?ptype=2&uid=" + uid + "&backurl=" + Utils.getPage(0) + "") + "\">回帖</a>"); builder.Append(Out.Tab("</div>", "")); } else if (ptype == 2) { Master.Title = "查看回帖"; int pageIndex; int recordCount; int pageSize = Convert.ToInt32(ub.Get("SiteListNo")); string strWhere = string.Empty; string strOrder = string.Empty; string[] pageValUrl = { "uid", "ptype", "forumid", "backurl" }; pageIndex = Utils.ParseInt(Request.QueryString["page"]); if (pageIndex == 0) { pageIndex = 1; } builder.Append(Out.Tab("<div class=\"title\">", "")); builder.Append("<a href=\"" + Utils.getUrl("uinfo.aspx?uid=" + uid + "") + "\">Ta的空间</a>>回帖"); builder.Append(Out.Tab("</div>", "<br />")); //查询条件 strWhere = "UsID=" + uid + ""; if (meid != uid) { strWhere += " and ForumId<>88 and ForumId<>100 and ForumId<>14 and ForumId<>99 and ForumId<>77"; } strWhere += " and IsDel=0"; strOrder = "ID Desc"; // 开始读取列表 IList <BCW.Model.Reply> listReply = new BCW.BLL.Reply().GetReplysMe(pageIndex, pageSize, strWhere, strOrder, out recordCount); if (listReply.Count > 0) { int k = 1; foreach (BCW.Model.Reply n in listReply) { 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("reply.aspx?act=view&forumid=" + n.ForumId + "&bid=" + n.Bid + "&reid=" + n.Floor + "&backurl=" + Utils.PostPage(1) + "") + "\">{1}.{2}</a>{3}", n.ID, (pageIndex - 1) * pageSize + k, Out.USB(TrueStrLength.cutTrueLength(n.Content, 20, "…")), DT.FormatDate(n.AddTime, 2)); k++; builder.Append(Out.Tab("</div>", "")); } // 分页 builder.Append(BasePage.ForumMultiPage(pageIndex, pageSize, recordCount, Utils.getPageUrl(), pageValUrl, "page", 0)); } else { builder.Append(Out.Div("div", "没有相关记录..")); } builder.Append(Out.Tab("<div class=\"text\">", "<br />")); builder.Append("<a href=\"" + Utils.getUrl("moreThread.aspx?ptype=3&uid=" + uid + "&backurl=" + Utils.getPage(0) + "") + "\">按论坛查看回帖>></a>"); 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("uinfo.aspx?uid=" + uid + "") + "\">上级</a>-"); builder.Append("<a href=\"" + Utils.getUrl("moreThread.aspx?ptype=2&uid=" + uid + "&backurl=" + Utils.getPage(0) + "") + "\">回帖</a>"); builder.Append(Out.Tab("</div>", "")); } else if (ptype == 3) { Master.Title = "查看回帖"; int pageIndex; int recordCount; int pageSize = 4; string strWhere = "IsActive=0"; string strOrder = string.Empty; string[] pageValUrl = { "uid", "ptype", "forumid", "backurl" }; pageIndex = Utils.ParseInt(Request.QueryString["page"]); if (pageIndex == 0) { pageIndex = 1; } int forumid = int.Parse(Utils.GetRequest("forumid", "get", 1, @"^[0-9]\d*$", "0")); if (forumid == 0) { builder.Append(Out.Tab("<div class=\"title\">", "")); builder.Append("<a href=\"" + Utils.getUrl("uinfo.aspx?uid=" + uid + "") + "\">Ta的空间</a>>回帖"); builder.Append(Out.Tab("</div>", "<br />")); // 开始读取论坛 IList <BCW.Model.Forum> listForum = new BCW.BLL.Forum().GetForums(pageIndex, pageSize, strWhere, out recordCount); if (listForum.Count > 0) { int k = 1; foreach (BCW.Model.Forum n in listForum) { 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("moreThread.aspx?ptype=" + ptype + "&uid=" + uid + "&forumid={0}&backurl=" + Utils.getPage(0) + "") + "\">[{1}]</a>", n.ID, n.Title); builder.Append("<br />参与" + new BCW.BLL.Reply().GetCount(uid, n.ID) + "回帖"); k++; builder.Append(Out.Tab("</div>", "")); } // 分页 builder.Append(BasePage.MultiPage(pageIndex, pageSize, recordCount, Utils.getPageUrl(), pageValUrl, "page", 0)); } else { builder.Append(Out.Div("text", "没有相关记录")); } builder.Append(Out.Tab("<div class=\"title\">", Out.Hr())); builder.Append("<a href=\"" + Utils.getUrl("/default.aspx") + "\">首页</a>-"); builder.Append("<a href=\"" + Utils.getPage("uinfo.aspx?uid=" + uid + "") + "\">上级</a>-"); builder.Append("<a href=\"" + Utils.getUrl("moreThread.aspx?ptype=1&uid=" + uid + "&backurl=" + Utils.getPage(0) + "") + "\">帖子</a>"); builder.Append(Out.Tab("</div>", "")); } else { pageSize = Convert.ToInt32(ub.Get("SiteListNo")); string BbsName = new BCW.BLL.Forum().GetTitle(forumid); if (BbsName == "") { Utils.Error("不存在的论坛", ""); } builder.Append(Out.Tab("<div class=\"title\">", "")); builder.Append("<a href=\"" + Utils.getUrl("uinfo.aspx?uid=" + uid + "") + "\">Ta的空间</a>>" + BbsName + "回帖"); builder.Append(Out.Tab("</div>", "<br />")); //查询条件 strWhere = "UsID=" + uid + " and forumid=" + forumid + ""; if (meid != uid) { strWhere += " and ForumId<>88 and ForumId<>100 and ForumId<>14 and ForumId<>99 and ForumId<>77"; } if (showtype == 1) { strWhere += " and IsGood=1"; } strWhere += " and IsDel=0"; strOrder = "ID Desc"; // 开始读取列表 IList <BCW.Model.Reply> listReply = new BCW.BLL.Reply().GetReplysMe(pageIndex, pageSize, strWhere, strOrder, out recordCount); if (listReply.Count > 0) { int k = 1; foreach (BCW.Model.Reply n in listReply) { 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("reply.aspx?act=view&forumid=" + forumid + "&bid=" + n.Bid + "&reid=" + n.Floor + "&backurl=" + Utils.PostPage(1) + "") + "\">{1}.{2}</a>{3}", n.ID, (pageIndex - 1) * pageSize + k, n.Content, DT.FormatDate(n.AddTime, 2)); k++; builder.Append(Out.Tab("</div>", "")); } // 分页 builder.Append(BasePage.ForumMultiPage(pageIndex, pageSize, recordCount, Utils.getPageUrl(), pageValUrl, "page", 0)); } else { builder.Append(Out.Div("div", "没有相关记录..")); } builder.Append(Out.Tab("<div class=\"text\">", "<br />")); builder.Append("<a href=\"" + Utils.getUrl("moreThread.aspx?ptype=" + ptype + "&uid=" + uid + "&forumid=" + forumid + "&backurl=" + Utils.getPage(0) + "") + "\">全部回帖</a> "); builder.Append("<a href=\"" + Utils.getUrl("moreThread.aspx?ptype=" + ptype + "&uid=" + uid + "&forumid=" + forumid + "&showtype=1&backurl=" + Utils.getPage(0) + "") + "\">精华回帖</a> "); 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("uinfo.aspx?uid=" + uid + "") + "\">上级</a>-"); builder.Append("<a href=\"" + Utils.getUrl("moreThread.aspx?ptype=2&uid=" + uid + "&backurl=" + Utils.getPage(0) + "") + "\">回帖</a>"); builder.Append(Out.Tab("</div>", "")); } } }
/// <summary> /// 点赞统计列表 /// </summary> /// <param name="act"></param> /// <param name="uid"></param> /// <param name="forumid"></param> private void PraiseTopListPage(string act, int uid, int forumid) { string ForumName = "论坛"; if (forumid > 0) { ForumName = new BCW.BLL.Forum().GetTitle(forumid); } Master.Title = "" + ForumName + "TOP100"; int ptype = int.Parse(Utils.GetRequest("ptype", "get", 1, @"^[1-6]$", "5"));// 获取失败时 默认为1 int showtype = int.Parse(Utils.GetRequest("showtype", "get", 1, @"^[1-7]$", "6")); builder.Append(Out.Tab("<div class=\"title\">", "")); if (showtype == 6) { builder.Append("主题论坛"); } else if (showtype == 7) { builder.Append("圈子论坛"); } if (ptype == 5) { builder.Append("本月"); } else if (ptype == 6) { builder.Append("本年"); } builder.Append("排行"); builder.Append(Out.Tab("</div>", "<br />")); int pageIndex; int recordCount; int pageSize = Convert.ToInt32(ub.Get("SiteListNo")); string strWhere = string.Empty; string strOrder = string.Empty; string[] pageValUrl = { "act", "forumid", "ptype", "showtype", "backurl" }; pageIndex = Utils.ParseInt(Request.QueryString["page"]); if (pageIndex == 0) { pageIndex = 1; } //查询条件 if (showtype == 6) //判断是主题还是圈子 { strWhere = "(Select GroupId FROM tb_Forum where ID=ForumID)=0"; } else if (showtype == 7) { strWhere = "(Select GroupId FROM tb_Forum where ID=ForumID)<>0"; } if (forumid > 0) { strWhere += " and forumid=" + forumid + ""; } //if (ptype == 5) strOrder = "sum(Praise)"; //修改strOrder ="sum(pTotal)"; // 开始读取列表 IList <BCW.Model.Text> listForumstat = new BCW.BLL.Text().GetForumstats(pageIndex, pageSize, strWhere, strOrder, ptype, out recordCount); if (listForumstat.Count > 0) { int k = 1; foreach (BCW.Model.Text n in listForumstat) { 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("{0}.", (pageIndex - 1) * pageSize + k); builder.Append("<a href=\"" + Utils.getUrl("uinfo.aspx?uid=" + n.UsID + "&backurl=" + Utils.PostPage(1) + "") + "\">" + BCW.User.Users.SetUser(n.UsID) + "(" + n.UsID + ")(" + n.Praise + "个点赞)</a>"); k++; builder.Append(Out.Tab("</div>", "")); } // 分页 builder.Append(BasePage.ForumMultiPage(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>-"); if (forumid > 0) { builder.Append("<a href=\"" + Utils.getPage("forum.aspx?forumid=" + forumid + "") + "\">上级</a>"); } else { builder.Append("<a href=\"" + Utils.getPage("uinfo.aspx") + "\">上级</a>"); } builder.Append("-<a href=\"" + Utils.getUrl("forumstat.aspx?act=top&forumid=" + forumid + "") + "\">排行榜</a>"); builder.Append(Out.Tab("</div>", "")); }
/// <summary> /// 陈志基 20160816 /// 修改保存属性改变触发事件 /// </summary> private void EditSavePage() { int id = int.Parse(Utils.GetRequest("id", "post", 2, @"^[1-9]\d*$", "帖子ID错误")); string Title = Utils.GetRequest("Title", "post", 2, @"^[^\^]{1,50}$", "标题限1-50字"); string Content = Utils.GetRequest("Content", "post", 2, @"^[^\^]{1,50000}$", "请输入不超50000的内容"); int LabelId = int.Parse(Utils.GetRequest("LabelId", "post", 2, @"^[0-9]\d*$", "类型选择错误")); int UsID = int.Parse(Utils.GetRequest("UsID", "post", 2, @"^[1-9]\d*$", "用户ID错误")); string UsName = Utils.GetRequest("UsName", "post", 2, @"^[^\^]{1,50}$", "昵称不超50字"); int ReadNum = int.Parse(Utils.GetRequest("ReadNum", "post", 2, @"^[0-9]\d*$", "阅读数填写错误")); int IsGood = int.Parse(Utils.GetRequest("IsGood", "post", 2, @"^[0-1]$", "精华选择错误")); string GoodSmallIcon = Utils.GetRequest("GoodSmallIcon", "post", 1, "", ""); int IsRecom = int.Parse(Utils.GetRequest("IsRecom", "post", 2, @"^[0-1]$", "推荐选择错误")); int IsTop = int.Parse(Utils.GetRequest("IsTop", "post", 2, @"^-1|0|1|2$", "置顶选择错误")); int IsLock = int.Parse(Utils.GetRequest("IsLock", "post", 2, @"^[0-1]$", "锁定选择错误")); int IsOver = int.Parse(Utils.GetRequest("IsOver", "post", 2, @"^[0-1]$", "结束选择错误")); int IsDel = int.Parse(Utils.GetRequest("IsDel", "post", 2, @"^[0-1]$", "删除选择错误")); DateTime ReTime = Utils.ParseTime(Utils.GetRequest("ReTime", "post", 2, DT.RegexTime, "回帖时间填写出错")); int ForumID = int.Parse(Utils.GetRequest("ForumID", "post", 2, @"^[1-9]\d*$", "推荐选择错误")); if (!new BCW.BLL.Text().Exists(id)) { Utils.Error("不存在的帖子记录", ""); } if (!new BCW.BLL.User().Exists(UsID)) { Utils.Error("不存在的用户ID", ""); } BCW.Model.Text model2 = new BCW.BLL.Text().GetText(id); if (model2.IsDel != IsDel)//触发事件 { if (IsDel == 1) { new BCW.BLL.Forumstat().Update2(1, UsID, model2.ForumId, model2.AddTime);//更新统计表发帖 } else { new BCW.BLL.Forumstat().Update3(1, UsID, model2.ForumId, model2.AddTime);//更新统计表发帖 } } BCW.Model.Text model = new BCW.Model.Text(); model.ID = id; model.Title = Title; model.Content = Content; model.LabelId = LabelId; model.UsID = UsID; model.UsName = UsName; model.ReadNum = ReadNum; model.IsGood = IsGood; model.GoodSmallIcon = GoodSmallIcon; model.IsRecom = IsRecom; model.IsTop = IsTop; model.IsLock = IsLock; model.IsOver = IsOver; model.IsDel = IsDel; model.ReTime = ReTime; model.ForumId = ForumID; new BCW.BLL.Text().Update2(model); if (!ForumID.Equals(model2.ForumId))//触发事件 { //去掉精华和推荐再转移 if (model2.IsGood == 1) { new BCW.BLL.Text().UpdateIsGood(id, 0); } if (model2.IsRecom == 1) { new BCW.BLL.Text().UpdateIsRecom(id, 0); } //重新进行原论坛回复统计 DataSet ds = new BCW.BLL.Reply().GetList("ID,AddTime,UsID,IsDel,UsName", "forumid=" + model2.ForumId + " and bid=" + id + ""); { if (ds != null && ds.Tables[0].Rows.Count > 0) { for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { if (int.Parse(ds.Tables[0].Rows[i]["IsDel"].ToString()) == 0)//如果回帖没有删除 { //减少对旧论坛回帖用户的回帖统计 new BCW.BLL.Forumstat().Update2(2, int.Parse(ds.Tables[0].Rows[i]["UsID"].ToString()), model2.ForumId, DateTime.Parse(ds.Tables[0].Rows[i]["AddTime"].ToString())); //增加对新论坛回帖用户的回帖统计 new BCW.BLL.Forumstat().Update3(2, int.Parse(ds.Tables[0].Rows[i]["UsID"].ToString()), ForumID, DateTime.Parse(ds.Tables[0].Rows[i]["AddTime"].ToString())); // BCW.User.Users.UpdateForumStat(2, int.Parse(ds.Tables[0].Rows[i]["UsID"].ToString()), ds.Tables[0].Rows[i]["UsName"].ToString(), ForumID); } //更新回帖中的论坛ID new BCW.BLL.Reply().UpdateForumID(int.Parse(ds.Tables[0].Rows[i]["ID"].ToString()), ForumID); // new BCW.BLL.Forumstat().Update2(2, model.UsID, forumid, DateTime.Parse(ds.Tables[0].Rows[i]["AddTime"].ToString())); // BCW.User.Users.UpdateForumStat(2, model.UsID, model.UsName, newid); // new BCW.BLL.Reply().UpdateForumID(int.Parse(ds.Tables[0].Rows[i]["ID"].ToString()), newid); } } } //转移的原论坛帖子统计 new BCW.BLL.Forumstat().Update2(1, model2.UsID, model2.ForumId, model2.AddTime); //转移的新论坛帖子统计 // BCW.User.Users.UpdateForumStat(1, model2.UsID, model2.UsName, ForumID); new BCW.BLL.Forumstat().Update3(1, model.UsID, ForumID, model.AddTime); } Utils.Success("编辑帖子", "编辑帖子成功..", Utils.getUrl("thread.aspx?act=edit&id=" + id + "&backurl=" + Utils.getPage(0) + ""), "1"); }
private void DelpagePage() { Master.Title = "删除本页文件"; int ptype = int.Parse(Utils.GetRequest("ptype", "get", 2, @"^[1-3]\d*$", "类型错误")); int page = int.Parse(Utils.GetRequest("page", "get", 1, @"^[1-9]\d*$", "页面ID错误")); string info = Utils.GetRequest("info", "get", 1, "", ""); if (info != "ok") { builder.Append(Out.Tab("<div class=\"title\">", "")); builder.Append("确定删除本页文件吗"); builder.Append(Out.Tab("</div>", "<br />")); builder.Append(Out.Tab("<div>", "")); builder.Append("<a href=\"" + Utils.getUrl("albums.aspx?act=delpage&info=ok&ptype=" + ptype + "&page=" + page + "&backurl=" + Utils.getPage(0) + "") + "\">确定删除</a><br />"); builder.Append("<a href=\"" + Utils.getPage("albums.aspx?ptype=" + ptype + "") + "\">再看看吧..</a>"); builder.Append(Out.Tab("</div>", "<br />")); builder.Append(Out.Tab("<div>", "")); builder.Append("<a href=\"" + Utils.getUrl("albums.aspx?ptype=" + ptype + "") + "\">返回上一级</a>"); builder.Append(Out.Tab("</div>", "<br />")); } else { int pageIndex; int recordCount; int pageSize = 5; string strWhere = ""; pageIndex = page; if (pageIndex == 0) { pageIndex = 1; } if (ptype == 1) { strWhere = "Types=1"; } else { strWhere = "Types>1"; } // 开始读取列表 IList <BCW.Model.Upfile> listUpfile = new BCW.BLL.Upfile().GetUpfiles(pageIndex, pageSize, strWhere, out recordCount); if (listUpfile.Count > 0) { foreach (BCW.Model.Upfile n in listUpfile) { int id = n.ID; BCW.Model.Upfile model = new BCW.BLL.Upfile().GetUpfile(id); if (model != null) { //删除 new BCW.BLL.Upfile().Delete(id); new BCW.BLL.FComment().Delete(model.Types, id); //删除文件 BCW.Files.FileTool.DeleteFile(model.Files); if (!string.IsNullOrEmpty(model.PrevFiles)) { BCW.Files.FileTool.DeleteFile(model.PrevFiles); } //关联帖子回帖减去文件数 if (model.ReID > 0) { new BCW.BLL.Reply().UpdateFileNum(model.ReID, -1); } else if (model.BID > 0) { new BCW.BLL.Text().UpdateFileNum(model.BID, -1); int FileNum = new BCW.BLL.Text().GetFileNum(model.BID); if (FileNum == 0) { //去掉附件帖标识 new BCW.BLL.Text().UpdateTypes(model.BID, 0); } } } } } Utils.Success("删除本页文件", "删除本页文件成功,正在返回..", Utils.getUrl("albums.aspx"), "1"); } }
private void FlowPage() { int meid = new BCW.User.Users().GetUsId(); int forumid = int.Parse(Utils.GetRequest("forumid", "get", 1, @"^[1-9]\d*$", "0")); int bid = int.Parse(Utils.GetRequest("bid", "get", 1, @"^[1-9]\d*$", "0")); Master.Title = "社区滚动列表"; int ptype = int.Parse(Utils.GetRequest("ptype", "get", 1, @"^[0-1]$", "0")); builder.Append(Out.Tab("<div class=\"title\">", "")); builder.Append("社区滚动列表"); builder.Append(Out.Tab("</div>", "<br />")); bool IsFlow = IsGdID(meid); if (bid > 0) { BCW.Model.Text flow = new BCW.BLL.Text().GetText(bid); if (flow != null) { if (flow.IsFlow == 2 && flow.ForumId == forumid) { builder.Append(Out.Tab("<div class=\"text\">", "")); builder.Append("<a href=\"" + Utils.getUrl("topic.aspx?forumid=" + flow.ForumId + "&bid=" + bid + "&backurl=" + Utils.PostPage(1) + "") + "\">" + Out.TitleUBB(flow.Title) + "</a>"); if (IsFlow) { builder.Append("[<a href=\"" + Utils.getUrl("textmanage.aspx?act=delflow&forumid=" + flow.ForumId + "&bid=" + bid + "&backurl=" + Utils.PostPage(1) + "") + "\">撤</a>]"); } builder.Append(Out.Tab("</div>", Out.Hr())); } } } int pageIndex; int recordCount; int pageSize = Convert.ToInt32(ub.Get("SiteListNo")); string strWhere = ""; string strOrder = ""; string[] pageValUrl = { "act", "ptype", "backurl" }; pageIndex = Utils.ParseInt(Request.QueryString["page"]); if (pageIndex == 0) { pageIndex = 1; } //查询条件 if (ptype == 1 && IsFlow == true) { strWhere = "IsFlow=1"; } else { strWhere = "IsFlow=2 and FlowTime>'" + DateTime.Now + "'"; } strOrder = "AddTime 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.Append("<a href=\"" + Utils.getUrl("topic.aspx?forumid=" + n.ForumId + "&bid=" + n.ID + "") + "&backurl=" + Utils.PostPage(1) + "\">" + ((pageIndex - 1) * pageSize + k) + "." + n.Title + "</a>"); if (ptype == 1 && IsFlow == true) { builder.Append("[<a href=\"" + Utils.getUrl("textmanage.aspx?act=flowset&forumid=" + n.ForumId + "&bid=" + n.ID + "&backurl=" + Utils.PostPage(1) + "") + "\">设</a>]"); } else { if (IsFlow) { builder.Append("[<a href=\"" + Utils.getUrl("textmanage.aspx?act=delflow&forumid=" + n.ForumId + "&bid=" + n.ID + "&backurl=" + Utils.PostPage(1) + "") + "\">撤</a>]"); } } k++; builder.Append(Out.Tab("</div>", "")); } // 分页 builder.Append(BasePage.MultiPage(pageIndex, pageSize, recordCount, Utils.getPageUrl(), pageValUrl, "page", 0)); } else { if (ptype == 1 && IsFlow == true) { builder.Append(Out.Div("div", "没有任何版块滚动可以选择..")); } else { builder.Append(Out.Div("div", "没有相关记录..")); } } if (IsFlow) { builder.Append(Out.Tab("<div class=\"text\">", Out.Hr())); if (ptype == 1 && IsFlow == true) { builder.Append("<a href=\"" + Utils.getUrl("manager.aspx?act=flow") + "\">>>返回社区滚动</a>"); } else { builder.Append("<a href=\"" + Utils.getUrl("manager.aspx?act=flow&ptype=1") + "\">设置社区滚动>></a>"); } 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("<a href=\"" + Utils.getUrl("manager.aspx") + "\">管理</a>"); builder.Append(Out.Tab("</div>", "")); }
private void OpenSavePage(int forumid) { int meid = new BCW.User.Users().GetUsId(); if (meid == 0) { Utils.Login(); } string GsAdminID = ub.GetSub("BbsGsAdminID", xmlPath); if (!("#" + GsAdminID + "#").Contains("#" + meid + "#")) { Utils.Error("权限不足", ""); } DateTime GsStopTime = Utils.ParseTime(ub.GetSub("BbsGsStopTime", xmlPath)); int GsqiNum = Utils.ParseInt(ub.GetSub("BbsGsqiNum", xmlPath)); if (GsqiNum == 0) { Utils.Error("本期尚未设置", ""); } if (GsStopTime > DateTime.Now) { //Utils.Error("本期第" + GsqiNum + "期截止时间" + GsStopTime + ",截止时间未到不能开奖", ""); } string qiNum = Utils.GetRequest("qiNum", "post", 2, @"^[0-9]\d*$", "期数错误"); string sNum = Utils.GetRequest("sNum", "post", 2, @"^(0)?[1-9]$|^[1-4]([0-9])?$", "特别号码填写错误"); string pNum1 = Utils.GetRequest("pNum1", "post", 2, @"^(0)?[1-9]$|^[1-4]([0-9])?$", "平.码1填写错误"); string pNum2 = Utils.GetRequest("pNum2", "post", 2, @"^(0)?[1-9]$|^[1-4]([0-9])?$", "平.码2填写错误"); string pNum3 = Utils.GetRequest("pNum3", "post", 2, @"^(0)?[1-9]$|^[1-4]([0-9])?$", "平.码3填写错误"); string pNum4 = Utils.GetRequest("pNum4", "post", 2, @"^(0)?[1-9]$|^[1-4]([0-9])?$", "平.码4填写错误"); string pNum5 = Utils.GetRequest("pNum5", "post", 2, @"^(0)?[1-9]$|^[1-4]([0-9])?$", "平.码5填写错误"); string pNum6 = Utils.GetRequest("pNum6", "post", 2, @"^(0)?[1-9]$|^[1-4]([0-9])?$", "平.码6填写错误"); DataSet ds = null; //ID,Types,qiNum,ForumID,BID,UsID,UsName,Notes,AddTime,IsWin,state if (new BCW.User.ForumInc().IsForum113(forumid) == true) //六肖 { ds = new BCW.BLL.Forumvote().GetList("ID,BID,UsID,UsName,Notes", "ForumID=" + forumid + " and qiNum=" + qiNum + " and state=0 and ','+Notes+',' Like '%," + GetSX(sNum) + ",%'"); } else if (new BCW.User.ForumInc().IsForum114(forumid) == true)//波色 { ds = new BCW.BLL.Forumvote().GetList("ID,BID,UsID,UsName,Notes", "ForumID=" + forumid + " and qiNum=" + qiNum + " and state=0"); } else if (new BCW.User.ForumInc().IsForum115(forumid) == true)//大小 { ds = new BCW.BLL.Forumvote().GetList("ID,BID,UsID,UsName,Notes", "ForumID=" + forumid + " and qiNum=" + qiNum + " and state=0 and Notes='" + GetDX(sNum) + "'"); } else if (new BCW.User.ForumInc().IsForum121(forumid) == true)//单双 { ds = new BCW.BLL.Forumvote().GetList("ID,BID,UsID,UsName,Notes", "ForumID=" + forumid + " and qiNum=" + qiNum + " and state=0 and Notes='" + GetDS(sNum) + "'"); } else if (new BCW.User.ForumInc().IsForum122(forumid) == true)//家野 { ds = new BCW.BLL.Forumvote().GetList("ID,BID,UsID,UsName,Notes", "ForumID=" + forumid + " and qiNum=" + qiNum + " and state=0 and Notes='" + GetQS(sNum) + "'"); } else if (new BCW.User.ForumInc().IsForum116(forumid) == true)//平特一肖 { ds = new BCW.BLL.Forumvote().GetList("ID,BID,UsID,UsName,Notes", "ForumID=" + forumid + " and qiNum=" + qiNum + " and state=0 and (Notes='" + GetSX(sNum) + "' OR Notes='" + GetSX(pNum1) + "' OR Notes='" + GetSX(pNum2) + "' OR Notes='" + GetSX(pNum3) + "' OR Notes='" + GetSX(pNum4) + "' OR Notes='" + GetSX(pNum5) + "' OR Notes='" + GetSX(pNum6) + "')"); } else if (new BCW.User.ForumInc().IsForum117(forumid) == true)//五不中 { ds = new BCW.BLL.Forumvote().GetList("ID,BID,UsID,UsName,Notes", "ForumID=" + forumid + " and qiNum=" + qiNum + " and state=0"); } else if (new BCW.User.ForumInc().IsForum119(forumid) == true)//五尾 { ds = new BCW.BLL.Forumvote().GetList("ID,BID,UsID,UsName,Notes", "ForumID=" + forumid + " and qiNum=" + qiNum + " and state=0"); } if (ds != null && ds.Tables[0].Rows.Count > 0) { for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { int ID = int.Parse(ds.Tables[0].Rows[i]["ID"].ToString()); int BID = int.Parse(ds.Tables[0].Rows[i]["BID"].ToString()); int UsID = int.Parse(ds.Tables[0].Rows[i]["UsID"].ToString()); string UsName = ds.Tables[0].Rows[i]["UsName"].ToString(); string Notes = ds.Tables[0].Rows[i]["Notes"].ToString(); bool IsWin = false; if (new BCW.User.ForumInc().IsForum113(forumid) == true)//六肖 { IsWin = true; } else if (new BCW.User.ForumInc().IsForum114(forumid) == true)//波色 { string bs = ""; if (Notes.Contains("波")) { bs = GetBS(sNum); } else { bs = GetBBS(sNum); } if (Notes.Contains(bs)) { IsWin = true; } } else if (new BCW.User.ForumInc().IsForum115(forumid) == true)//大小 { IsWin = true; } else if (new BCW.User.ForumInc().IsForum121(forumid) == true)//单双 { IsWin = true; } else if (new BCW.User.ForumInc().IsForum122(forumid) == true)//家野 { IsWin = true; } else if (new BCW.User.ForumInc().IsForum116(forumid) == true)//平特一肖 { IsWin = true; } else if (new BCW.User.ForumInc().IsForum117(forumid) == true)//五不中 { IsWin = true; string BVote = "," + Convert.ToInt32(sNum) + "," + Convert.ToInt32(pNum1) + "," + Convert.ToInt32(pNum2) + "," + Convert.ToInt32(pNum3) + "," + Convert.ToInt32(pNum4) + "," + Convert.ToInt32(pNum5) + "," + Convert.ToInt32(pNum6) + ","; string[] temp = Notes.Split(','); for (int k = 0; k < temp.Length; k++) { if (BVote.Contains("," + Convert.ToInt32(temp[k]) + ",")) { IsWin = false; break; } } } else if (new BCW.User.ForumInc().IsForum119(forumid) == true)//五尾 { string ws = Utils.Right(sNum, 1) + "尾"; if (("," + Notes + ",").Contains("," + ws + ",")) { IsWin = true; } } //------------公共部分--------------- if (IsWin) { int glznum = 1; //if (new BCW.BLL.Forumvote().Exists(forumid, BID, UsID)) //{ // glznum = 1; //} //更新中奖 new BCW.BLL.Forumvote().UpdateIsWin(ID, 1); //增加总中奖记录数和连中、月中 int MonthCount = new BCW.BLL.Forumvote().GetMonthCount(forumid, BID, UsID); new BCW.BLL.Text().UpdategGsNum(BID, 1, glznum, MonthCount); } //------------5连中或近6期中5加精,近6期错2取消精华------------ int winnum = 0; int lostnum = 0; DataSet ds2 = new BCW.BLL.Forumvote().GetList("TOP 6 IsWin", "ForumID=" + forumid + " and BID=" + BID + " and UsID=" + UsID + " order by id desc"); if (ds2 != null && ds2.Tables[0].Rows.Count > 0) { for (int k = 0; k < ds2.Tables[0].Rows.Count; k++) { int iswin = int.Parse(ds2.Tables[0].Rows[k]["IsWin"].ToString()); if (iswin == 1) { winnum++; } else { lostnum++; } } } //帖子加精状态 int IsGood = new BCW.BLL.Text().GetIsGood(BID); //加精操作,前提是非精华的帖子 if (IsGood == 0) { int Getglznum = new BCW.BLL.Text().Getglznum(BID); if (Getglznum >= 5 || winnum >= 5) { new BCW.BLL.Text().UpdateIsGood(BID, 1); //new BCW.User.Cent().UpdateCent(BCW.User.Cent.enumRole.Cent_GoodText, UsID); string strLog = "主题[url=/bbs/topic.aspx?forumid=" + forumid + "&bid=" + BID + "]《" + new BCW.BLL.Text().GetTitle(BID) + "》[/url]6期中5,被系统加为精华!"; new BCW.BLL.Forumlog().Add(1, forumid, BID, "[url=/bbs/uinfo.aspx?uid=" + UsID + "]" + UsName + "[/url]的" + strLog); new BCW.BLL.Guest().Add(0, UsID, UsName, "您的" + strLog); } } else { //去精操作 if (lostnum >= 2) { new BCW.BLL.Text().UpdateIsGood(BID, 0); string strLog = "主题[url=/bbs/topic.aspx?forumid=" + forumid + "&bid=" + BID + "]《" + new BCW.BLL.Text().GetTitle(BID) + "》[/url]6期错2,被系统去掉精华!"; new BCW.BLL.Forumlog().Add(1, forumid, BID, "[url=/bbs/uinfo.aspx?uid=" + UsID + "]" + UsName + "[/url]的" + strLog); new BCW.BLL.Guest().Add(0, UsID, UsName, "您的" + strLog); } } //------------5连中或近6期中5加精,近6期错2取消精华------------ } } //更新本论坛本期全部开奖结束 string stat = "特" + sNum + ",平" + pNum1 + "-" + pNum2 + "-" + pNum3 + "-" + pNum4 + "-" + pNum5 + "-" + pNum6 + ""; new BCW.BLL.Forumvote().UpdateState(Convert.ToInt32(qiNum), forumid, 1, stat); Utils.Success("开奖", "本坛开奖成功..", Utils.getUrl("Gsopen.aspx?forumid=" + forumid + ""), "1"); }
private void TXTPage() { Master.Title = "采集新闻txt入库"; Master.Refresh = 5; Master.Gourl = Utils.getUrl("go.aspx?act=txt"); int Types = Convert.ToInt32(ub.GetSub("NewsTypes", xmlPath));//导入文章栏目还是帖子 //if (Types == 0) //{ // DataSet ds = new BCW.BLL.Detail().GetList("ID,Content", "Types=11 and UsID=-1 and Istxt=0"); // if (ds != null && ds.Tables[0].Rows.Count > 0) // { // int id = int.Parse(ds.Tables[0].Rows[0]["ID"].ToString()); // string Content = ds.Tables[0].Rows[0]["Content"].ToString(); // //builder.Append(Content + "|"+id+"<br />"); // try // { // if (Content.Contains("sohu.com")) // { // BCW.Collec.Collec Cn = new BCW.Collec.Collec(); // string NewsNextUrl = Content; // while (NewsNextUrl.Length > 0) // { // string str2 = new BCW.Service.GetNews().GetNewsXML2(NewsNextUrl); // string str = str2; // //取图片 // string photoUrl = ""; // string Pic = "/files/Cache/pic/"; // string WebUrl = "http://photocdn.sohu.com"; // ArrayList bodyArray = Cn.ReplaceSaveRemoteFile(3, str, Pic, WebUrl, "1"); // if (bodyArray.Count == 2) // { // photoUrl = bodyArray[1].ToString(); // } // //更新图片地址到数据库 // new BCW.BLL.Detail().UpdatePics(id, photoUrl); // string NextPageRegex = @"(?:<a class=""pages-wd"" href=""[\s\S]+?"">上一页</a>[\s\S]+?)?<a class=""pages-wd"" href=""([\s\S]+?)"">下一页</a>"; // NewsNextUrl = Cn.GetRegValue(NextPageRegex, str2); // } // } // builder.Append("ID" + id + "采集结束,正在采集下一条..."); // } // catch // { // builder.Append("出现错误,请告知技术员"); // } // } // else // { // builder.Append("采集完成,请等待对方网站更新..."); // } //} //else //{ DataSet ds = new BCW.BLL.Text().GetList("ID,Content,UsID,ForumID", "HideType=9 and Istxt=0"); if (ds != null && ds.Tables[0].Rows.Count > 0) { int id = int.Parse(ds.Tables[0].Rows[0]["ID"].ToString()); int UsID = int.Parse(ds.Tables[0].Rows[0]["UsID"].ToString()); int ForumID = int.Parse(ds.Tables[0].Rows[0]["ForumID"].ToString()); string Content = ds.Tables[0].Rows[0]["Content"].ToString(); //builder.Append(Content + "|"+id+"<br />"); try { if (Content.Contains("sohu.com")) { BCW.Collec.Collec Cn = new BCW.Collec.Collec(); string NewsNextUrl = Content; while (NewsNextUrl.Length > 0) { string str2 = new BCW.Service.GetNews().GetNewsXML2(NewsNextUrl); string str = str2; //取图片 string photoUrl = ""; string Pic = "/files/Cache/pic/"; string WebUrl = "http://photocdn.sohu.com"; ArrayList bodyArray = Cn.ReplaceSaveRemoteFile(3, str, Pic, WebUrl, "1"); if (bodyArray.Count == 2) { photoUrl = bodyArray[1].ToString(); string[] fTemp = Regex.Split(photoUrl, "#"); int kk = 0; int width = Convert.ToInt32(ub.GetSub("UpaWidth", "/Controls/upfile.xml")); int height = Convert.ToInt32(ub.GetSub("UpaHeight", "/Controls/upfile.xml")); for (int i = 0; i < fTemp.Length; i++) { BCW.Model.Upfile modelf = new BCW.Model.Upfile(); modelf.FileExt = System.IO.Path.GetExtension(fTemp[i]).ToLower(); string rep = modelf.FileExt.Replace(".", "s."); string prevPath = System.Web.HttpContext.Current.Request.MapPath(fTemp[i].Replace(modelf.FileExt, rep)); try { new BCW.Graph.ImageHelper().ResizeImage(System.Web.HttpContext.Current.Request.MapPath(fTemp[i]), prevPath, width, height, true); modelf.PrevFiles = fTemp[i].Replace(modelf.FileExt, rep); } catch { modelf.PrevFiles = fTemp[i]; } modelf.Types = 1; modelf.NodeId = 0; modelf.UsID = UsID; modelf.ForumID = ForumID; modelf.BID = id; modelf.ReID = 0; modelf.Files = fTemp[i]; modelf.Content = ""; modelf.FileSize = BCW.Files.FileTool.GetFileLength(fTemp[i]); modelf.DownNum = 0; modelf.Cent = 0; modelf.IsVerify = 0; modelf.AddTime = DateTime.Now; new BCW.BLL.Upfile().Add(modelf); kk++; } //更新帖子文件数 new BCW.BLL.Text().UpdateFileNum(id, kk); } //更新已更新标识 new BCW.BLL.Text().UpdateIstxt(id, 1); string NextPageRegex = @"(?:<a class=""pages-wd"" href=""[\s\S]+?"">上一页</a>[\s\S]+?)?<a class=""pages-wd"" href=""([\s\S]+?)"">下一页</a>"; NewsNextUrl = Cn.GetRegValue(NextPageRegex, str2); } } builder.Append("ID" + id + "采集结束,正在采集下一条..."); } catch { builder.Append("出现错误,请告知技术员"); } } else { builder.Append("采集完成,请等待对方网站更新..."); } //} }
private void ReloadPage(int forumid) { int meid = new BCW.User.Users().GetUsId(); if (meid == 0) { Utils.Login(); } string GsAdminID = ub.GetSub("BbsGsAdminID", xmlPath); if (!("#" + GsAdminID + "#").Contains("#" + meid + "#")) { Utils.Error("权限不足", ""); } int qiNum = int.Parse(Utils.GetRequest("qiNum", "all", 1, @"^[0-9]\d*$", "0")); if (qiNum == 0) { qiNum = Utils.ParseInt(ub.GetSub("BbsGsqiNum", xmlPath)); } builder.Append(Out.Tab("<div class=\"title\">", "")); builder.Append("<a href=\"" + Utils.getUrl("forum.aspx?forumid=" + forumid + "") + "\">" + new BCW.BLL.Forum().GetTitle(forumid) + "</a>"); builder.Append(">>高手"); builder.Append(Out.Tab("</div>", "<br />")); builder.Append(Out.Tab("<div class=\"text\">", "")); builder.Append("<b>本期第" + qiNum + "期,截止时间" + ub.GetSub("BbsGsStopTime", xmlPath) + "</b>"); string sNum = new BCW.BLL.Forumvote().GetsNum(forumid, qiNum); if (sNum != "") { builder.Append("<br />本期已开奖:" + sNum + ""); } else { builder.Append("<br /><a href=\"" + Utils.getUrl("Gsopen.aspx?act=open&forumid=" + forumid + "&qiNum=" + qiNum + "") + "\">马上开奖>></a>"); } builder.Append(Out.Tab("</div>", "")); builder.Append(Out.Tab("<div class=\"text\">", "<br />")); builder.Append("==第" + qiNum + "期参赛帖子=="); builder.Append(Out.Tab("</div>", "")); int pageIndex; int recordCount; int pageSize = 10; string strWhere = string.Empty; string strOrder = string.Empty; string[] pageValUrl = { "forumid", "qiNum", "backurl" }; pageIndex = Utils.ParseInt(Request.QueryString["page"]); if (pageIndex == 0) { pageIndex = 1; } //查询条件 strWhere = "Forumid=" + forumid + " and Types=8 and IsDel=0 and Gqinum=" + qiNum + ""; //排序条件 strOrder = "Istop Desc,ReTime 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 { builder.Append(Out.Tab("<div>", "<br />")); } builder.Append(BCW.User.AppCase.CaseIsTop(n.IsTop)); builder.Append(BCW.User.AppCase.CaseIsGood(n.IsGood)); builder.Append(BCW.User.AppCase.CaseIsRecom(n.IsRecom)); builder.Append(BCW.User.AppCase.CaseIsLock(n.IsLock)); builder.Append(BCW.User.AppCase.CaseIsOver(n.IsOver)); builder.Append(BCW.User.AppCase.CaseText(n.Types)); string TextTab = string.Empty; builder.AppendFormat("<a href=\"" + Utils.getUrl("/bbs/topic.aspx?forumid={0}&bid={1}&backurl=" + Utils.PostPage(1) + "") + "\">{2}.{3}{4}</a><br />", n.ForumId, n.ID, (pageIndex - 1) * pageSize + k, TextTab, n.Title); builder.Append("" + n.UsName); builder.AppendFormat("/阅{0}/回<a href=\"" + Utils.getUrl("/bbs/reply.aspx?forumid={1}&bid={2}&backurl=" + Utils.PostPage(1) + "") + "\">{3}</a>", n.ReadNum, n.ForumId, n.ID, n.ReplyNum); k++; builder.Append(Out.Tab("</div>", "")); } // 分页 builder.Append(BasePage.ForumMultiPage(pageIndex, pageSize, recordCount, Utils.getPageUrl(), pageValUrl, "page", 0)); } else { builder.Append(Out.Div("div", "<br />没有相关记录..")); } builder.Append(Out.Tab("<div class=\"title\">", Out.Hr())); builder.Append("<a href=\"" + Utils.getUrl("manwork.aspx?forumid=" + forumid + "") + "\"><<返回版务</a>"); builder.Append(Out.Tab("</div>", "")); }
private void CentPage() { int forumid = int.Parse(Utils.GetRequest("forumid", "all", 2, @"^[0-9]\d*$", "论坛ID错误")); if (!new BCW.BLL.Forum().Exists2(forumid)) { Utils.Success("访问论坛", "该论坛不存在或已暂停使用", Utils.getUrl("forum.aspx"), "1"); } if (new BCW.User.ForumInc().IsForumGSIDS(forumid) == true) { } else { Utils.Error("不存在的记录", ""); } Master.Title = "奖励会员"; int meid = new BCW.User.Users().GetUsId(); if (meid == 0) { Utils.Login(); } string GsAdminID = ub.GetSub("BbsGsAdminID", xmlPath); if (!("#" + GsAdminID + "#").Contains("#" + meid + "#")) { Utils.Error("权限不足", ""); } int bid = int.Parse(Utils.GetRequest("bid", "all", 2, @"^[0-9]\d*$", "ID错误")); if (!new BCW.BLL.Text().Exists2(bid, forumid)) { Utils.Error("帖子不存在或已被删除", ""); } BCW.Model.Text model = new BCW.BLL.Text().GetText(bid); string info = Utils.GetRequest("info", "post", 1, "", ""); if (info != "") { string Content = Utils.GetRequest("Content", "post", 2, @"^[\s\S]{1,50}$", "奖励原因限1-50字内,不能留空"); long Gold = Int64.Parse(Utils.GetRequest("iGold", "post", 1, @"^[0-9]\d*$", "0")); long Money = Int64.Parse(Utils.GetRequest("iMoney", "post", 1, @"^[0-9]\d*$", "0")); long Score = Int64.Parse(Utils.GetRequest("iScore", "post", 1, @"^[0-9]\d*$", "0")); int Vip = int.Parse(Utils.GetRequest("iVip", "post", 1, @"^[0-3]$", "0")); string LogText = "" + Content + ""; if (Gold > 0) { LogText += "/奖" + Gold + "" + ub.Get("SiteBz") + ""; } if (Money > 0) { LogText += "/奖" + Money + "" + ub.Get("SiteBz2") + ""; } if (Score > 0) { LogText += "/奖" + Score + "积分"; } if (Vip > 0) { LogText += "/奖VIP" + Vip + "月"; } if (info == "ok") { builder.Append(Out.Tab("<div class=\"text\">", "")); builder.Append("奖励对象:<a href=\"" + Utils.getUrl("uinfo.aspx?uid=" + model.UsID + "&backurl=" + Utils.PostPage(1) + "") + "\">" + model.UsName + "(" + model.UsID + ")</a>"); builder.Append(Out.Tab("</div>", "<br />")); builder.Append(Out.Tab("<div class=\"text\">", "")); builder.Append("奖励并生成日志:" + LogText + ""); builder.Append(Out.Tab("</div>", "<br />")); string strName = "Content,iGold,iMoney,iScore,iVip,forumid,bid,act,info,backurl"; string strValu = "" + Content + "'" + Gold + "'" + Money + "'" + Score + "'" + Vip + "'" + forumid + "'" + bid + "'cent'ok2'" + Utils.getPage(0) + "'"; string strOthe = "确认奖励,Gstoplist.aspx,post,0,red"; builder.Append(Out.wapform(strName, strValu, strOthe)); } else { if (Gold > 0) { new BCW.BLL.User().UpdateiGold(model.UsID, model.UsName, Gold, Content); } if (Money > 0) { new BCW.BLL.User().UpdateiMoney(model.UsID, model.UsName, Money, Content); } if (Score > 0) { new BCW.BLL.User().UpdateiScore(model.UsID, Score); } if (Vip > 0) { string xmlPathvip = "/Controls/bbs.xml"; int VipGrow1 = Utils.ParseInt(ub.GetSub("VipGrow1", xmlPathvip)); int VipGrow2 = Utils.ParseInt(ub.GetSub("VipGrow2", xmlPathvip)); int VipGrow3 = Utils.ParseInt(ub.GetSub("VipGrow3", xmlPathvip)); int VipGrow4 = Utils.ParseInt(ub.GetSub("VipGrow4", xmlPathvip)); int Grow = 0; int Day = 0; if (Vip == 1) { Grow = VipGrow1; Day = 30; } else if (Vip == 2) { Grow = VipGrow2; Day = 90; } else if (Vip == 3) { Grow = VipGrow3; Day = 180; } BCW.Model.User model2 = new BCW.BLL.User().GetVipData(model.UsID); try { if (model2.VipDate != null && model2.VipDate > DateTime.Now) { new BCW.BLL.User().UpdateVipData(model.UsID, Grow, model2.VipDate.AddDays(Day)); } else { new BCW.BLL.User().UpdateVipData(model.UsID, Grow, DateTime.Now.AddDays(Day)); } } catch { new BCW.BLL.User().UpdateVipData(model.UsID, Grow, DateTime.Now.AddDays(Day)); } //清缓存 string CacheKey = CacheName.App_UserVip(model.UsID); DataCache.RemoveByPattern(CacheKey); } //记录日志 BCW.Model.Forumvotelog m = new BCW.Model.Forumvotelog(); m.UsID = model.UsID; m.UsName = model.UsName; m.AdminId = meid; m.BID = bid; m.ForumId = forumid; m.Title = model.Title; m.Notes = LogText; m.AddTime = DateTime.Now; new BCW.BLL.Forumvotelog().Add(m); Utils.Success("奖励会员", "恭喜,奖励成功,正在返回..", Utils.getPage("Gstoplist.aspx?forumid=" + forumid + ""), "2"); } } else { builder.Append(Out.Tab("<div class=\"title\">", "")); builder.Append("主题:<a href=\"" + Utils.getUrl("topic.aspx?forumid=" + model.ForumId + "&bid=" + bid + "&backurl=" + Utils.PostPage(1) + "") + "\">" + model.Title + "</a>"); builder.Append(Out.Tab("</div>", "<br />")); builder.Append(Out.Tab("<div class=\"text\">", "")); builder.Append("奖励对象:<a href=\"" + Utils.getUrl("uinfo.aspx?uid=" + model.UsID + "&backurl=" + Utils.PostPage(1) + "") + "\">" + model.UsName + "(" + model.UsID + ")</a><br />"); builder.Append("<a href=\"" + Utils.getUrl("Gstoplist.aspx?act=centlist&forumid=" + model.ForumId + "&hid=" + model.UsID + "&backurl=" + Utils.PostPage(1) + "") + "\">查看奖励记录>></a>"); builder.Append(Out.Tab("</div>", "")); string strText = "奖励原因(如填写:2013001期5连中):/,奖" + ub.Get("SiteBz") + ":/,奖" + ub.Get("SiteBz2") + ":/,奖积分:/,奖VIP:/,,,,,,"; string strName = "Content,iGold,iMoney,iScore,iVip,forumid,bid,act,info,backurl"; string strType = "textarea,num,num,num,select,hidden,hidden,hidden,hidden,hidden"; string strValu = "''''0'" + forumid + "'" + bid + "'cent'ok'" + Utils.getPage(0) + ""; string strEmpt = "true,true,true,true,0|不赠送|1|1个月|2|3个月|3|6个月,false,false,false,false,false"; string strIdea = "/"; string strOthe = "确定奖励,Gstoplist.aspx,post,1,red"; builder.Append(Out.wapform(strText, strName, strType, strValu, strEmpt, strIdea, strOthe)); builder.Append(Out.Tab("<div class=\"title\">", "<br />")); builder.Append("<a href=\"" + Utils.getPage("Gstoplist.aspx?forumid=" + forumid + "") + "\"><<返回上级</a>"); builder.Append(Out.Tab("</div>", "")); builder.Append(Out.Tab("<div class=\"title\">", "<br />")); builder.Append("<a href=\"" + Utils.getUrl("/default.aspx") + "\">首页</a>-"); builder.Append("<a href=\"" + Utils.getUrl("uinfo.aspx?backurl=" + Utils.getPage(0) + "") + "\">上级</a>-"); builder.Append("<a href=\"" + Utils.getUrl("forum.aspx?forumid=" + forumid + "") + "\">论坛</a>"); builder.Append(Out.Tab("</div>", "")); } }
private void ReloadPage(int forumid, int bid) { int meid = new BCW.User.Users().GetUsId(); if (meid == 0) { Utils.Login(); } int hid = int.Parse(Utils.GetRequest("hid", "all", 1, @"^[0-9]\d*$", "0")); if (hid == 0) { hid = meid; } builder.Append(Out.Tab("<div class=\"title\">", "")); builder.Append("查看参赛记录"); builder.Append(Out.Tab("</div>", "<br />")); BCW.Model.Text model = new BCW.BLL.Text().GetText(bid); builder.Append(Out.Tab("<div class=\"text\">", "")); builder.Append("<b>记录:连中" + model.Glznum + "期,月中" + model.Gmnum + "期,历史" + model.Gaddnum + "中" + model.Gwinnum + "</b>"); builder.Append(Out.Tab("</div>", "<br />")); int pageIndex; int recordCount; int pageSize = 10; string strWhere = string.Empty; string[] pageValUrl = { "forumid", "bid", "hid", "backurl" }; pageIndex = Utils.ParseInt(Request.QueryString["page"]); if (pageIndex == 0) { pageIndex = 1; } //查询条件 strWhere = "Forumid=" + forumid + " and BID=" + bid + " and UsID=" + hid + ""; // 开始读取列表 IList <BCW.Model.Forumvote> listForumvote = new BCW.BLL.Forumvote().GetForumvotes(pageIndex, pageSize, strWhere, out recordCount); if (listForumvote.Count > 0) { int k = 1; foreach (BCW.Model.Forumvote n in listForumvote) { 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.Append("[" + n.qiNum + "]期:" + n.Notes + ""); if (n.state == 0) { builder.Append("[开?]"); } else { if (n.IsWin == 0) { builder.Append("[未中]"); } else { builder.Append("[中]"); } } k++; builder.Append(Out.Tab("</div>", "")); } // 分页 builder.Append(BasePage.ForumMultiPage(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("topic.aspx?forumid=" + forumid + "&bid=" + bid + "") + "\"><<返回主題</a>"); builder.Append(Out.Tab("</div>", "")); }
/// <summary> /// 上传文件页面 /// </summary> private void UploadPage(int forumid, int bid) { string ac = Utils.ToSChinese(Utils.GetRequest("ac", "post", 1, "", "")); int meid = new BCW.User.Users().GetUsId(); if (meid == 0) { Utils.Login(); } if (ac != "发表文本") { BCW.User.Users.ShowVerifyRole("f", meid); //非验证会员提示 new BCW.User.Limits().CheckUserLimit(BCW.User.Limits.enumRole.Role_Upfile, meid); //会员上传权限 } //论坛限制性 BCW.Model.Forum Forummodel = new BCW.BLL.Forum().GetForum(forumid); //圈子限制性 BCW.Model.Group modelgr = null; if (Forummodel.GroupId > 0) { modelgr = new BCW.BLL.Group().GetGroupMe(Forummodel.GroupId); if (modelgr == null) { Utils.Error("不存在的" + ub.GetSub("GroupName", "/Controls/group.xml") + "", ""); } else if (DT.FormatDate(modelgr.ExTime, 0) != "1990-01-01 00:00:00" && modelgr.ExTime < DateTime.Now) { Utils.Error("" + ub.GetSub("GroupName", "/Controls/group.xml") + "已过期", ""); } if (modelgr.ForumStatus == 2) { Utils.Error("" + ub.GetSub("GroupName", "/Controls/group.xml") + "论坛已关闭", ""); } if (modelgr.ForumStatus == 1) { if (meid == 0) { Utils.Login(); } string GroupId = new BCW.BLL.User().GetGroupId(meid); if (GroupId.IndexOf("#" + Forummodel.GroupId + "#") == -1 && IsCTID(meid) == false) { Utils.Error("非成员不能访问" + ub.GetSub("GroupName", "/Controls/group.xml") + "论坛!<br /><a href=\"" + Utils.getUrl("/bbs/group.aspx?act=addin&id=" + Forummodel.GroupId + "&backurl=" + Utils.PostPage(1) + "") + "\">加入本" + ub.GetSub("GroupName", "/Controls/group.xml") + "</a>", ""); } } } BCW.User.Users.ShowForumLimit(meid, Forummodel.Gradelt, Forummodel.Visitlt, Forummodel.VisitId, Forummodel.IsPc); if (ac == "续传" || bid == 0)//发帖 { //是否刷屏 string appName = "LIGHT_THREAD"; int Expir = Convert.ToInt32(ub.GetSub("BbsThreadExpir", xmlPath2)); BCW.User.Users.IsFresh(appName, Expir); BCW.User.Users.ShowVerifyRole("a", meid); //非验证会员提示 new BCW.User.Limits().CheckUserLimit(BCW.User.Limits.enumRole.Role_Text, meid); //会员本身权限 new BCW.User.FLimits().CheckUserFLimit(BCW.User.FLimits.enumRole.Role_Text, meid, forumid); //版块内权限 BCW.User.Users.ShowAddThread(meid, Forummodel.Postlt); } else//回帖 { //是否刷屏 string appName = "LIGHT_REPLY"; int Expir = Convert.ToInt32(ub.GetSub("BbsReplyExpir", xmlPath2)); BCW.User.Users.IsFresh(appName, Expir); BCW.User.Users.ShowVerifyRole("b", meid); //非验证会员提示 new BCW.User.Limits().CheckUserLimit(BCW.User.Limits.enumRole.Role_Reply, meid); //会员本身权限 new BCW.User.FLimits().CheckUserFLimit(BCW.User.FLimits.enumRole.Role_Reply, meid, forumid); //版块内权限 BCW.User.Users.ShowAddReply(meid, Forummodel.Replylt); } int kk = 0; int reid = 0; int ptype = 5;//标识为附件帖子 if (ac == "续传") { //上传文件 SaveFiles(meid, forumid, bid, reid, out kk); string strOut = string.Empty; if (kk < 0) { if (kk == -999) { kk = 0; } strOut = "部分文件超出今天上传数量导致上传失败,"; kk = Math.Abs(kk); } //更新帖子文件数 new BCW.BLL.Text().UpdateFileNum(bid, kk); new BCW.BLL.Text().UpdateTypes(bid, ptype); //记录日志 string strLog = "[url=/bbs/uinfo.aspx?uid=" + meid + "]" + new BCW.BLL.User().GetUsName(meid) + "[/url]对主题[url=/bbs/topic.aspx?forumid=" + forumid + "&bid=" + bid + "]《" + new BCW.BLL.Text().GetTitle(bid) + "》[/url]追加" + kk + "个文件!"; new BCW.BLL.Forumlog().Add(7, forumid, bid, strLog); Utils.Success("追加文件", "追加" + kk + "个文件成功," + strOut + "正在返回..", ReplaceWap(Utils.getUrl("topic.aspx?forumid=" + forumid + "&bid=" + bid + "")), "2"); } else { string mename = new BCW.BLL.User().GetUsName(meid); string Title = string.Empty; string Content = string.Empty; if (bid == 0) { Title = Utils.GetRequest("Title", "post", 2, @"^[\s\S]{" + ub.GetSub("BbsThreadMin", xmlPath2) + "," + ub.GetSub("BbsThreadMax", xmlPath2) + "}$", "标题限" + ub.GetSub("BbsThreadMin", xmlPath2) + "-" + ub.GetSub("BbsThreadMax", xmlPath2) + "字"); Title = Title.Replace(char.ConvertFromUtf32(10), "").Replace(char.ConvertFromUtf32(13), ""); Content = Utils.GetRequest("Content", "post", 2, @"^[\s\S]{" + ub.GetSub("BbsContentMin", xmlPath2) + "," + ub.GetSub("BbsContentMax", xmlPath2) + "}$", "请输入" + ub.GetSub("BbsContentMin", xmlPath2) + "-" + ub.GetSub("BbsContentMax", xmlPath2) + "字的内容"); } else { Content = Utils.GetRequest("Content", "post", 2, @"^[\s\S]{1," + ub.GetSub("BbsReplyMax", xmlPath2) + "}$", "请输入不超" + ub.GetSub("BbsReplyMax", xmlPath2) + "字的回帖内容"); } if (bid == 0) { int ThreadNum = Utils.ParseInt(ub.GetSub("BbsThreadNum", xmlPath)); if (ThreadNum > 0) { int ToDayCount = new BCW.BLL.Forumstat().GetCount(meid, 1);//今天发布帖子数 if (ToDayCount >= ThreadNum) { Utils.Error("系统限每天每ID限发帖子" + ThreadNum + "帖", ""); } } int Price = 0; int Prices = 0; int HideType = 0; int IsSeen = 0; string PayCi = string.Empty; BCW.Model.Text addmodel = new BCW.Model.Text(); addmodel.ForumId = forumid; addmodel.Types = ptype; addmodel.Title = Title; addmodel.Content = Content; addmodel.HideContent = ""; addmodel.UsID = meid; addmodel.UsName = mename; addmodel.Price = Price; addmodel.Prices = Prices; addmodel.HideType = HideType; addmodel.PayCi = PayCi; addmodel.IsSeen = IsSeen; addmodel.AddTime = DateTime.Now; addmodel.ReTime = DateTime.Now; bid = new BCW.BLL.Text().Add(addmodel); //上传文件 SaveFiles(meid, forumid, bid, reid, out kk); string strOut = string.Empty; if (kk < 0) { if (kk == -999) { kk = 0; } strOut = "部分文件超出今天上传数量导致上传失败,"; kk = Math.Abs(kk); } //更新帖子文件数 new BCW.BLL.Text().UpdateFileNum(bid, kk); //论坛统计 BCW.User.Users.UpdateForumStat(1, meid, mename, forumid); int GroupId = new BCW.BLL.Forum().GetGroupId(forumid); //动态记录 if (GroupId == 0) { new BCW.BLL.Action().Add(-1, 0, meid, mename, "在" + Forummodel.Title + "发表了文件帖子[URL=/bbs/topic.aspx?forumid=" + forumid + "&bid=" + bid + "]" + Title + "[/URL]"); } else { new BCW.BLL.Action().Add(-2, 0, meid, mename, "在圈坛-" + Forummodel.Title + "发表了文件帖子[URL=/bbs/topic.aspx?forumid=" + forumid + "&bid=" + bid + "]" + Title + "[/URL]"); } //积分操作/论坛统计/圈子论坛不进行任何奖励 if (GroupId == 0) { new BCW.User.Cent().UpdateCent2(BCW.User.Cent.enumRole.Cent_Text, meid, true); } else { if (!Utils.GetDomain().Contains("th")) { new BCW.User.Cent().UpdateCent2(BCW.User.Cent.enumRole.Cent_Text, meid, false); } } if (kk == 0) { new BCW.BLL.Text().UpdateTypes(bid, 0);//去掉附件帖标识 } #region 这里开始修改提醒ID 发内线 string remind = ub.GetSub("remindid" + forumid, "/Controls/bbs.xml"); //获取XML的值 if (remind != "") //如果有提醒ID { string[] IDS = remind.Split('#'); for (int i = 0; i < IDS.Length; i++) { if (GroupId != 0) { new BCW.BLL.Guest().Add(0, int.Parse(IDS[i]), new BCW.BLL.User().GetUsName(int.Parse(IDS[i])), "请注意!用户[url=/bbs/uinfo.aspx?uid=" + meid + "]" + mename + "(" + meid + ")[/url]在圈坛-" + Forummodel.Title + "发表了[URL=/bbs/topic.aspx?forumid=" + forumid + "&bid=" + bid + "]" + Title + "[/URL]的帖子"); } else { new BCW.BLL.Guest().Add(0, int.Parse(IDS[i]), new BCW.BLL.User().GetUsName(int.Parse(IDS[i])), "请注意!用户[url=/bbs/uinfo.aspx?uid=" + meid + "]" + mename + "(" + meid + ")[/url]在" + Forummodel.Title + "发表了[URL=/bbs/topic.aspx?forumid=" + forumid + "&bid=" + bid + "]" + Title + "[/URL]的帖子"); } } } #endregion Utils.Success("上传文件", "上传" + kk + "个文件成功," + strOut + "正在返回..", ReplaceWap(Utils.getPage("forum.aspx?forumid=" + forumid + "")), "2"); } else { int ReplyNum = Utils.ParseInt(ub.GetSub("BbsReplyNum", xmlPath)); if (ReplyNum > 0) { int ToDayCount = new BCW.BLL.Forumstat().GetCount(meid, 2);//今天发布回帖数 if (ToDayCount >= ReplyNum) { Utils.Error("系统限每天每ID限回帖" + ReplyNum + "次", ""); } } int Floor = new BCW.BLL.Reply().GetFloor(bid); //派币帖 string CentText = string.Empty; string PbCent = string.Empty; int iTypes = new BCW.BLL.Text().GetTypes(bid); if (iTypes == 3) { BCW.Model.Text p = new BCW.BLL.Text().GetPriceModel(bid); if (p.Prices - p.Pricel > 0) { string bzText = string.Empty; if (p.BzType == 0) { bzText = ub.Get("SiteBz"); } else { bzText = ub.Get("SiteBz2"); } long zPrice = 0; if (p.Price2 > 0) { zPrice = Convert.ToInt64(new Random().Next(p.Price, (p.Price2 + 1)));//随机得到奖币值 } else { zPrice = Convert.ToInt64(p.Price); } long GetPrice = 0; if (p.Prices - p.Pricel < zPrice) { GetPrice = p.Prices - p.Pricel; } else { GetPrice = zPrice; } if (p.PayCi == "0") { if (("#" + p.ReplyID + "#").IndexOf("#" + meid + "#") == -1) { if (p.BzType == 0) { new BCW.BLL.User().UpdateiGold(meid, mename, GetPrice, "派币帖回帖获得"); } else { new BCW.BLL.User().UpdateiMoney(meid, mename, GetPrice, "派币帖回帖获得"); } //更新已派 new BCW.BLL.Text().UpdatePricel(bid, GetPrice); CentText = "" + GetPrice + "" + bzText + ""; PbCent = "楼主派" + GetPrice + "" + bzText + ""; } } else { if (("#" + p.PayCi + "#").IndexOf("#" + Utils.Right(Floor.ToString(), 1) + "#") != -1) { if (p.BzType == 0) { new BCW.BLL.User().UpdateiGold(meid, mename, GetPrice, "派币帖回帖获得"); } else { new BCW.BLL.User().UpdateiMoney(meid, mename, GetPrice, "派币帖回帖获得"); } //更新已派 new BCW.BLL.Text().UpdatePricel(bid, GetPrice); CentText = "" + GetPrice + "" + bzText + ""; PbCent = "踩中楼层" + Utils.Right(Floor.ToString(), 1) + "尾,楼主派" + GetPrice + "" + bzText + ""; } } } } BCW.Model.Reply model = new BCW.Model.Reply(); model.Floor = Floor; model.ForumId = forumid; model.Bid = bid; model.UsID = meid; model.UsName = mename; model.Content = Content; model.FileNum = 0; model.ReplyId = 0; model.AddTime = DateTime.Now; model.CentText = CentText; reid = new BCW.BLL.Reply().Add(model); //更新回复ID string sPayID = new BCW.BLL.Text().GetReplyID(bid); if (("#" + sPayID + "#").IndexOf("#" + meid + "#") == -1) { string ReplyID = string.Empty; if (string.IsNullOrEmpty(sPayID)) { ReplyID = meid.ToString(); } else { ReplyID = sPayID + "#" + meid; } new BCW.BLL.Text().UpdateReplyID(bid, ReplyID); } //更新回复数 new BCW.BLL.Text().UpdateReplyNum(bid, 1); //上传文件 SaveFiles(meid, forumid, bid, reid, out kk); string strOut = string.Empty; if (kk < 0) { if (kk == -999) { kk = 0; } strOut = "部分文件超出今天上传数量导致上传失败!"; kk = Math.Abs(kk); } //更新回复文件数 new BCW.BLL.Reply().UpdateFileNum(reid, kk); //论坛统计 BCW.User.Users.UpdateForumStat(2, meid, mename, forumid); int GroupId = new BCW.BLL.Forum().GetGroupId(forumid); //动态记录 if (GroupId == 0) { new BCW.BLL.Action().Add(-1, 0, meid, mename, "在" + Forummodel.Title + "回复帖子[URL=/bbs/topic.aspx?forumid=" + forumid + "&bid=" + bid + "]" + new BCW.BLL.Text().GetTitle(bid) + "[/URL]"); } else { new BCW.BLL.Action().Add(-2, 0, meid, mename, "在圈坛-" + Forummodel.Title + "回复帖子[URL=/bbs/topic.aspx?forumid=" + forumid + "&bid=" + bid + "]" + new BCW.BLL.Text().GetTitle(bid) + "[/URL]"); } //积分操作/论坛统计/圈子论坛不进行任何奖励 if (GroupId == 0) { new BCW.User.Cent().UpdateCent2(BCW.User.Cent.enumRole.Cent_Reply, meid, true); } else { if (!Utils.GetDomain().Contains("th")) { new BCW.User.Cent().UpdateCent2(BCW.User.Cent.enumRole.Cent_Reply, meid, false); } } Utils.Success("文件回帖", "回复" + kk + "个文件成功!" + strOut + "" + PbCent + "<br /><a href=\"" + ReplaceWap(Utils.getUrl("topic.aspx?forumid=" + forumid + "&bid=" + bid + "")) + "\">返回主题</a><br /><a href=\"" + ReplaceWap(Utils.getUrl("reply.aspx?forumid=" + forumid + "&bid=" + bid + "")) + "\">回复列表</a>", ReplaceWap(Utils.getUrl("reply.aspx?forumid=" + forumid + "&bid=" + bid + "")), "2"); } } }
private void TopListPage() { int forumid = int.Parse(Utils.GetRequest("forumid", "get", 1, @"^[0-9]\d*$", "0")); int ptype = int.Parse(Utils.GetRequest("ptype", "get", 1, @"^[0-2]$", "0")); Master.Title = "高手排行榜"; builder.Append(Out.Tab("<div class=\"title\">", "")); string ForumTitle = new BCW.BLL.Forum().GetTitle(forumid); builder.Append("" + ForumTitle + "-排行榜"); builder.Append(Out.Tab("</div>", "<br />")); builder.Append(Out.Tab("<div class=\"text\">", "")); if (ptype == 0) { builder.Append("连中榜|"); } else { builder.Append("<a href=\"" + Utils.getUrl("Gsadmin.aspx?act=toplist&forumid=" + forumid + "&ptype=0") + "\">连中榜</a>|"); } if (ptype == 1) { builder.Append("月中榜|"); } else { builder.Append("<a href=\"" + Utils.getUrl("Gsadmin.aspx?act=toplist&forumid=" + forumid + "&ptype=1") + "\">月中榜</a>|"); } if (ptype == 2) { builder.Append("历史"); } else { builder.Append("<a href=\"" + Utils.getUrl("Gsadmin.aspx?act=toplist&forumid=" + forumid + "&ptype=2") + "\">历史</a>"); } builder.Append(Out.Tab("</div>", "<br />")); int pageIndex; int recordCount; int pageSize = Convert.ToInt32(ub.Get("SiteListNo")); string strWhere = string.Empty; string strOrder = string.Empty; string[] pageValUrl = { "act", "forumid", "ptype", "backurl" }; pageIndex = Utils.ParseInt(Request.QueryString["page"]); if (pageIndex == 0) { pageIndex = 1; } strWhere = "ForumId=" + forumid + " and Types=8"; if (ptype == 0) { strWhere += " and Glznum>0"; strOrder = "Glznum DESC"; } else if (ptype == 1) { strWhere += " and Gmnum>0"; strOrder = "Gmnum DESC"; } else if (ptype == 2) { strWhere += " and Gwinnum>0"; strOrder = "Gwinnum DESC"; } // 开始读取列表 IList <BCW.Model.Text> listText = new BCW.BLL.Text().GetTextsGs(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.Append("" + ((pageIndex - 1) * pageSize + k) + ".<a href=\"" + Utils.getUrl("../uinfo.aspx?uid=" + n.UsID + "&backurl=" + Utils.PostPage(1) + "") + "\">" + n.UsName + "</a>"); if (ptype == 0) { builder.Append("连中" + n.Glznum + ""); } else if (ptype == 1) { builder.Append("月中" + n.Gmnum + ""); } else { builder.Append("" + n.Gaddnum + "中" + n.Gwinnum + ""); } builder.Append("<a href=\"" + Utils.getUrl("/bbs/topic.aspx?forumid=" + n.ForumId + "&bid=" + n.ID + "&backurl=" + Utils.PostPage(1) + "") + "\">" + n.Title + "</a>"); builder.Append("|<a href=\"" + Utils.getUrl("Gsadmin.aspx?act=centlist&forumid=" + n.ForumId + "&hid=" + n.UsID + "&backurl=" + Utils.PostPage(1) + "") + "\">奖励记录</a>"); k++; builder.Append(Out.Tab("</div>", "")); } // 分页 builder.Append(BasePage.ForumMultiPage(pageIndex, pageSize, recordCount, Utils.getPageUrl(), pageValUrl, "page", 0)); } else { builder.Append(Out.Div("div", "没有相关记录..")); } builder.Append(Out.Tab("<div class=\"hr\"></div>", Out.Hr())); builder.Append(Out.Tab("<div>", " ")); builder.Append("<a href=\"" + Utils.getUrl("Gsadmin.aspx?act=top") + "\">返回上级</a><br />"); builder.Append("<a href=\"" + Utils.getUrl("default.aspx") + "\">应用中心</a>"); builder.Append(Out.Tab("</div>", "<br />")); builder.Append(Out.Tab("<div class=\"title\">", "")); builder.Append("<a href=\"" + Utils.getUrl("../default.aspx") + "\">返回管理中心</a>"); builder.Append(Out.Tab("</div>", "<br />")); }
private void ReloadPage(string act, int forumid, int uid) { int ptype = int.Parse(Utils.GetRequest("ptype", "get", 1, @"^[1-5]\d*$", "1")); if (forumid > 0) { Master.Title = "查看模式"; builder.Append(Out.Tab("<div class=\"title\">查看模式</div>", "")); } else { Master.Title = "查看帖子"; builder.Append(Out.Tab("<div class=\"title\">查看帖子</div>", "")); } builder.Append(Out.Tab("<div class=\"text\">", "")); if (forumid > 0) { if (act != "text") { if (ptype == 1) { builder.Append("精华|"); } else { builder.Append("<a href=\"" + Utils.getUrl("sktype.aspx?forumid=" + forumid + "&ptype=1&backurl=" + Utils.getPage(0) + "") + "\">精华</a>|"); } if (ptype == 2) { builder.Append("推荐|"); } else { builder.Append("<a href=\"" + Utils.getUrl("sktype.aspx?forumid=" + forumid + "&ptype=2&backurl=" + Utils.getPage(0) + "") + "\">推荐</a>|"); } if (ptype == 3) { builder.Append("新帖|"); } else { builder.Append("<a href=\"" + Utils.getUrl("sktype.aspx?forumid=" + forumid + "&ptype=3&backurl=" + Utils.getPage(0) + "") + "\">新帖</a>|"); } if (ptype == 4) { builder.Append("锁定|"); } else { builder.Append("<a href=\"" + Utils.getUrl("sktype.aspx?forumid=" + forumid + "&ptype=4&backurl=" + Utils.getPage(0) + "") + "\">锁定</a>|"); } if (ptype == 5) { builder.Append("固底"); } else { builder.Append("<a href=\"" + Utils.getUrl("sktype.aspx?forumid=" + forumid + "&ptype=5&backurl=" + Utils.getPage(0) + "") + "\">固底</a>"); } } else { builder.Append("本版发贴|<a href=\"" + Utils.getUrl("sktype.aspx?act=reply&forumid=" + forumid + "&backurl=" + Utils.getPage(0) + "") + "\">本版回帖</a>"); } } else { if (ptype == 1 || ptype == 5) { builder.Append("精华|"); } else { builder.Append("<a href=\"" + Utils.getUrl("sktype.aspx?ptype=1&backurl=" + Utils.getPage(0) + "") + "\">精华</a>|"); } if (ptype == 2) { builder.Append("推荐|"); } else { builder.Append("<a href=\"" + Utils.getUrl("sktype.aspx?ptype=2&backurl=" + Utils.getPage(0) + "") + "\">推荐</a>|"); } if (ptype == 3) { builder.Append("新帖|"); } else { builder.Append("<a href=\"" + Utils.getUrl("sktype.aspx?ptype=3&backurl=" + Utils.getPage(0) + "") + "\">新帖</a>|"); } if (ptype == 4) { builder.Append("热门"); } else { builder.Append("<a href=\"" + Utils.getUrl("sktype.aspx?ptype=4&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 strOrder = string.Empty; string[] pageValUrl = { "act", "forumid", "tsid", "ptype", "backurl" }; pageIndex = Utils.ParseInt(Request.QueryString["page"]); if (pageIndex == 0) { pageIndex = 1; } strWhere = "IsDel=0 and HideType<>9"; //查询条件 if (forumid > 0) { if (act == "text") { strWhere += " and UsID=" + uid + ""; } strWhere += " and ForumId=" + forumid + ""; } if (act != "text") { strWhere += " and "; if (ptype == 1) { strWhere += "IsGood=1"; } else if (ptype == 2) { strWhere += "IsRecom=1"; } if (ptype == 3) { strWhere += "AddTime>='" + DateTime.Now.AddDays(-2) + "'"; } else if (ptype == 4) { strWhere += "IsLock=1"; } else if (ptype == 5) { strWhere += "IsTop=-1"; } } //排序条件 strOrder = "ID Desc"; if (forumid == 0) { if (ptype == 4 || ptype == 5) { strWhere = ""; } if (ptype == 4) { strOrder = "ReadNum 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.Append(BCW.User.AppCase.CaseIsTop(n.IsTop)); builder.Append(BCW.User.AppCase.CaseIsGood(n.IsGood)); builder.Append(BCW.User.AppCase.CaseIsRecom(n.IsRecom)); builder.Append(BCW.User.AppCase.CaseIsLock(n.IsLock)); builder.Append(BCW.User.AppCase.CaseIsOver(n.IsOver)); builder.Append(BCW.User.AppCase.CaseText(n.Types)); builder.AppendFormat("<a href=\"" + Utils.getUrl("/bbs/topic.aspx?forumid=" + n.ForumId + "&bid={0}&backurl=" + Utils.PostPage(1) + "") + "\">{1}.{2}</a><br />", n.ID, (pageIndex - 1) * pageSize + k, n.Title); builder.Append("" + n.UsName); builder.AppendFormat("/阅{0}/回<a href=\"" + Utils.getUrl("/bbs/reply.aspx?forumid=" + n.ForumId + "&bid={1}&backurl=" + Utils.PostPage(1) + "") + "\">{2}</a>", n.ReadNum, n.ID, n.ReplyNum); k++; builder.Append(Out.Tab("</div>", "")); } // 分页 builder.Append(BasePage.ForumMultiPage(pageIndex, pageSize, recordCount, Utils.getPageUrl(), pageValUrl, "page", 0)); } else { builder.Append(Out.Div("div", "没有相关记录..")); } builder.Append(Out.Tab("<div>", Out.Hr())); if (forumid > 0) { builder.Append("<a href=\"" + Utils.getUrl("forum.aspx?forumid=" + forumid + "") + "\">返回" + new BCW.BLL.Forum().GetTitle(forumid) + "</a><br />"); } builder.Append("<a href=\"" + Utils.getUrl("moreThread.aspx?ptype=1&backurl=" + Utils.PostPage(1) + "") + "\">我的帖子</a>-"); builder.Append("<a href=\"" + Utils.getPage("moreThread.aspx?ptype=2&backurl=" + Utils.PostPage(1) + "") + "\">回帖</a>"); builder.Append(Out.Tab("</div>", "<br />")); builder.Append(Out.Tab("<div class=\"title\">", "")); builder.Append("<a href=\"" + Utils.getUrl("/default.aspx") + "\">首页</a>-"); builder.Append("<a href=\"" + Utils.getPage("default.aspx") + "\">上级</a>-"); builder.Append("<a href=\"" + Utils.getUrl("forumstat.aspx?act=top&forumid=" + forumid + "") + "\">排行榜</a>"); builder.Append(Out.Tab("</div>", "")); }
private void SavePage(int forumid, int bid, int id) { int meid = new BCW.User.Users().GetUsId(); if (meid == 0) { Utils.Login(); } string GsDemoID = ub.GetSub("BbsGsDemoID", xmlPath); if (GsDemoID != "") { if (!("#" + GsDemoID + "#").Contains("#" + meid + "#")) { Utils.Error("此功能内测中,您的ID不在内测ID里", ""); } } DateTime GsStopTime = Utils.ParseTime(ub.GetSub("BbsGsStopTime", xmlPath)); int GsqiNum = Utils.ParseInt(ub.GetSub("BbsGsqiNum", xmlPath)); if (GsqiNum == 0) { Utils.Error("本期尚未设置", ""); } if (GsStopTime < DateTime.Now) { Utils.Error("本期第" + GsqiNum + "期已截止发表,截止时间" + GsStopTime + "", ""); } if (id > 0) { BCW.Model.Forumvote model = new BCW.BLL.Forumvote().GetForumvote(id); if (model == null) { Utils.Error("不存在的记录", ""); } if (model.UsID != meid) { Utils.Error("不存在的记录", ""); } } else { BCW.Model.Text modelT = new BCW.BLL.Text().GetText(bid); if (modelT == null) { Utils.Error("不存在的记录", ""); } if (modelT.UsID != meid) { Utils.Error("不存在的记录", ""); } if (GsqiNum == modelT.Gqinum) { Utils.Error("本期已参赛过了", ""); } } if (new BCW.User.ForumInc().IsForumGSIDS(forumid) == true) { string Choose = ""; Choose = Utils.GetRequest("Choose", "post", 2, @"^[^\,]{1,50}(?:\,[^\,]{1,50}){0,500}$", "参赛内容选择出错"); int cNum = Utils.GetStringNum(Choose, ","); if (new BCW.User.ForumInc().IsForum113(forumid) == true) { if (cNum != 5) { Utils.Error("请选择6个生肖", ""); } } else if (new BCW.User.ForumInc().IsForum114(forumid) == true) { if (Choose.Contains("单") || Choose.Contains("双")) { if (cNum != 3) { Utils.Error("选择半波参赛时,请选择4个半波", ""); } } else { if (cNum != 1) { Utils.Error("选择波色参赛时,请选择2个波色", ""); } } } else if (new BCW.User.ForumInc().IsForum116(forumid) == true) { if (cNum != 0) { Utils.Error("请选择1个生肖", ""); } } if (new BCW.User.ForumInc().IsForum117(forumid) == true) { if (cNum != 4) { Utils.Error("请选择5个数字", ""); } } if (new BCW.User.ForumInc().IsForum119(forumid) == true) { if (cNum != 4) { Utils.Error("请选择5个尾数", ""); } } if (new BCW.User.ForumInc().IsForum115(forumid) == true || new BCW.User.ForumInc().IsForum121(forumid) == true || new BCW.User.ForumInc().IsForum122(forumid) == true) { if (cNum != 0) { Utils.Error("参数选择错误", ""); } } string mename = new BCW.BLL.User().GetUsName(meid); if (id > 0) { string Title = Utils.GetRequest("Title", "post", 2, @"^[\s\S]{1," + ub.GetSub("BbsThreadMax", xmlPath) + "}$", "标题限1-50字"); string Content = Utils.GetRequest("Content", "post", 2, @"^[\s\S]{1," + ub.GetSub("BbsContentMax", xmlPath) + "}$", "请输入不超" + ub.GetSub("BbsContentMax", xmlPath) + "字的内容"); BCW.Model.Text model2 = new BCW.Model.Text(); model2.ID = bid; model2.Title = Title; model2.Content = Content; new BCW.BLL.Text().Update(model2); new BCW.BLL.Forumvote().UpdateNotes(id, Choose); //记录日志 string strLog = "[url=/bbs/uinfo.aspx?uid=" + meid + "]" + mename + "[/url]修改了参赛内容!主题[url=/bbs/topic.aspx?forumid=" + forumid + "&bid=" + bid + "]《" + new BCW.BLL.Text().GetTitle(bid) + "》[/url]"; new BCW.BLL.Forumlog().Add(7, forumid, bid, strLog); } else { BCW.Model.Forumvote f = new BCW.Model.Forumvote(); f.Types = 0; f.ForumID = forumid; f.BID = bid; f.Notes = Choose; f.state = 0; f.qiNum = GsqiNum; f.IsWin = 0; f.AddTime = DateTime.Now; f.UsID = meid; f.UsName = mename; new BCW.BLL.Forumvote().Add(f); //更新期数进主题记录并加历史次数 new BCW.BLL.Text().UpdateGqinum(bid, GsqiNum); } Utils.Success("参赛", "操作成功,正在进入参赛帖...", Utils.getUrl("topic.aspx?forumid=" + forumid + "&bid=" + bid + ""), "2"); } }