private void Delpage2Page() { Master.Title = "删除本页评论"; int ptype = int.Parse(Utils.GetRequest("ptype", "all", 1, @"^[1-2]\d*$", "1")); int uid = int.Parse(Utils.GetRequest("uid", "all", 1, @"^[0-9]\d*$", "0")); 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("commentary.aspx?act=delpage2&info=ok&ptype=" + ptype + "&uid=" + uid + "&page=" + page + "&backurl=" + Utils.getPage(0) + "") + "\">确定删除</a><br />"); builder.Append("<a href=\"" + Utils.getPage("commentary.aspx?act=fcomment&ptype=" + ptype + "") + "\">再看看吧..</a>"); builder.Append(Out.Tab("</div>", "<br />")); } else { int pageIndex; int recordCount; int pageSize = Convert.ToInt32(ub.Get("SiteListNo")); string strWhere = ""; pageIndex = page; if (pageIndex == 0) { pageIndex = 1; } //查询条件 if (ptype == 1) { strWhere += "Types=0"; } else { strWhere += "Types>0"; } if (uid != 0) { if (strWhere == "") { strWhere += "usid=" + uid + ""; } else { strWhere += "and usid=" + uid + ""; } } // 开始读取列表 IList <BCW.Model.FComment> listFComment = new BCW.BLL.FComment().GetFComments(pageIndex, pageSize, strWhere, out recordCount); if (listFComment.Count > 0) { foreach (BCW.Model.FComment n in listFComment) { //删除 new BCW.BLL.FComment().Delete(n.ID); } } Utils.Success("删除本页评论", "删除本页评论成功,正在返回..", Utils.getUrl("commentary.aspx?act=fcomment&ptype=" + ptype + ""), "1"); } }
private void ReplyListPage(int leibie) { int meid = new BCW.User.Users().GetUsId(); if (meid == 0) { Utils.Login(); } int id = int.Parse(Utils.GetRequest("id", "get", 2, @"^[1-9]\d*$", "ID错误")); int uid = 0; if (leibie == 0) { uid = new BCW.BLL.Diary().GetUsID(id); } else { uid = new BCW.BLL.Upfile().GetUsID(id); } if (uid == 0) { Utils.Error("不存在的记录", ""); } string strLeibie = BCW.User.AppCase.CaseAlbums(leibie); Master.Title = "" + strLeibie + "评论"; builder.Append(Out.Tab("<div class=\"title\">查看" + strLeibie + "评论</div>", "")); int pageIndex; int recordCount; int pageSize = Convert.ToInt32(ub.Get("SiteListNo")); string strWhere = ""; string[] pageValUrl = { "act", "leibie", "id", "backurl" }; pageIndex = Utils.ParseInt(Request.QueryString["page"]); if (pageIndex == 0) { pageIndex = 1; } //查询条件 strWhere = "Types=" + leibie + " and DetailId=" + id + ""; // 开始读取列表 IList <BCW.Model.FComment> listFComment = new BCW.BLL.FComment().GetFComments(pageIndex, pageSize, strWhere, out recordCount); if (listFComment.Count > 0) { int k = 1; foreach (BCW.Model.FComment n in listFComment) { 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}楼.{1}(<a href=\"" + Utils.getUrl("uinfo.aspx?uid={2}&backurl=" + Utils.PostPage(1) + "") + "\">{3}</a>/{4})", recordCount - (((pageIndex - 1) * pageSize) + (k - 1)), Out.SysUBB(n.Content), n.UsID, n.UsName, DT.FormatDate(n.AddTime, 1)); if (!string.IsNullOrEmpty(n.ReText)) { builder.Append(Out.Tab("<font color=\"red\">", "")); builder.Append("<br />★主人回复:" + n.ReText + ""); builder.Append(Out.Tab("</font>", "")); } bool flag = false; if (leibie == 0) { if (new BCW.User.Role().IsUserRole(BCW.User.Role.enumRole.Role_Diary, meid)) { flag = true; } } else { if (new BCW.User.Role().IsUserRole(BCW.User.Role.enumRole.Role_Albums, meid)) { flag = true; } } if (uid.Equals(meid)) { builder.Append("<a href=\"" + Utils.getUrl("fcomment.aspx?act=reok&leibie=" + leibie + "&detailid=" + n.DetailId + "&id=" + n.ID + "&backurl=" + Utils.PostPage(1) + "") + "\">[回复]</a>"); } if (uid.Equals(meid) || flag == true) { builder.Append("<a href=\"" + Utils.getUrl("fcomment.aspx?act=delreply&leibie=" + leibie + "&detailid=" + n.DetailId + "&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 ReplyValu = string.Empty; DataSet ds = new BCW.BLL.Submit().GetList("TOP 1 Content", "UsID=" + meid + " and Types=0 ORDER BY NEWID()"); if (ds != null && ds.Tables[0].Rows.Count > 0) { ReplyValu = ds.Tables[0].Rows[0]["Content"].ToString(); } builder.Append(Out.Tab("", "<br />")); strText = ",,,,,"; strName = "Content,id,leibie,backurl,act"; strType = "stext,hidden,hidden,hidden,hidden"; strValu = "" + ReplyValu + "'" + id + "'" + leibie + "'" + Utils.PostPage(1) + "'replysave"; strEmpt = "true,false,false,false,false"; strIdea = ""; strOthe = "快速评论,fcomment.aspx,post,3,red"; builder.Append(Out.wapform(strText, strName, strType, strValu, strEmpt, strIdea, strOthe)); builder.Append(Out.Tab("<div>", "<br />")); builder.Append("<a href=\"" + Utils.getUrl("fcomment.aspx?act=reply&leibie=" + leibie + "&id=" + id + "&backurl=" + Utils.PostPage(1) + "") + "\">>>我要评论</a>"); builder.Append(Out.Tab("</div>", "")); builder.Append(Out.Tab("<div class=\"text\">", "<br />")); if (meid == uid) { builder.Append("我的:"); } else { builder.Append("主人:"); } builder.Append("<a href=\"" + Utils.getUrl("albums.aspx?uid=" + uid + "") + "\">日记</a>"); if (leibie != 1) { builder.Append("-<a href=\"" + Utils.getUrl("albums.aspx?leibie=1&uid=" + uid + "") + "\">相册</a>"); } if (leibie != 2) { builder.Append("-<a href=\"" + Utils.getUrl("albums.aspx?leibie=2&uid=" + uid + "") + "\">音乐</a>"); } if (leibie != 3) { builder.Append("-<a href=\"" + Utils.getUrl("albums.aspx?leibie=3&uid=" + uid + "") + "\">视频</a>"); } if (leibie != 4) { builder.Append("-<a href=\"" + Utils.getUrl("albums.aspx?leibie=4&uid=" + uid + "") + "\">资源</a>"); } builder.Append(Out.Tab("</div>", "")); builder.Append(Out.Tab("<div class=\"title\">", Out.Hr())); builder.Append("<a href=\"" + Utils.getUrl("default.aspx") + "\">首页</a>-"); if (leibie == 0) { builder.Append("<a href=\"" + Utils.getPage("diary.aspx?act=view&id=" + id + "") + "\">上级</a>"); } else { builder.Append("<a href=\"" + Utils.getPage("albums.aspx?act=view&leibie=" + leibie + "&id=" + id + "") + "\">上级</a>"); } builder.Append(Out.Tab("</div>", "")); }
private void FCommentPage(string act) { int ptype = int.Parse(Utils.GetRequest("ptype", "all", 1, @"^[1-2]\d*$", "1")); int uid = int.Parse(Utils.GetRequest("uid", "all", 1, @"^[0-9]\d*$", "0")); builder.Append(Out.Tab("<div class=\"title\">", "")); builder.Append("社区评论管理"); builder.Append(Out.Tab("</div>", "<br />")); builder.Append(Out.Tab("<div class=\"text\">", "")); if (ptype == 1) { builder.Append("日记评论|"); } else { builder.Append("<a href=\"" + Utils.getUrl("commentary.aspx?act=" + act + "&uid=" + uid + "&ptype=1&backurl=" + Utils.getPage(0) + "") + "\">日记</a>|"); } if (ptype == 2) { builder.Append("相册评论"); } else { builder.Append("<a href=\"" + Utils.getUrl("commentary.aspx?act=" + act + "&uid=" + uid + "&ptype=2&backurl=" + Utils.getPage(0) + "") + "\">相册</a>"); } builder.Append(Out.Tab("</div>", "<br />")); int pageIndex; int recordCount; int pageSize = Convert.ToInt32(ub.Get("SiteListNo")); string strWhere = string.Empty; string arrId = string.Empty; string[] pageValUrl = { "act", "ptype", "uid", "backurl" }; pageIndex = Utils.ParseInt(Request.QueryString["page"]); if (pageIndex == 0) { pageIndex = 1; } //查询条件 if (ptype == 1) { strWhere += "Types=0"; } else { strWhere += "Types>0"; } if (uid != 0) { if (strWhere == "") { strWhere += "usid=" + uid + ""; } else { strWhere += "and usid=" + uid + ""; } } // 开始读取列表 IList <BCW.Model.FComment> listFComment = new BCW.BLL.FComment().GetFComments(pageIndex, pageSize, strWhere, out recordCount); if (listFComment.Count > 0) { int k = 1; foreach (BCW.Model.FComment n in listFComment) { 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("commentary.aspx?act=del2&id={0}&backurl=" + Utils.PostPage(1) + "") + "\">[删]</a>{1}.{2}:{3}({4})", n.ID, (pageIndex - 1) * pageSize + k, n.UsName, n.Content, DT.FormatDate(n.AddTime, 1)); 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>", "")); string strText = "输入用户ID:/,,"; string strName = "uid,ptype,act"; string strType = "num,hidden,hidden"; string strValu = "'" + ptype + "'fcomment"; string strEmpt = "true,false,false"; string strIdea = "/"; string strOthe = "搜评论,commentary.aspx,post,1,red"; builder.Append(Out.wapform(strText, strName, strType, strValu, strEmpt, strIdea, strOthe)); builder.Append(Out.Tab("</div>", "")); builder.Append(Out.Tab("<div class=\"hr\"></div>", Out.Hr())); builder.Append(Out.Tab("<div>", "")); builder.Append("<a href=\"" + Utils.getUrl("commentary.aspx?act=delpage2&ptype=" + ptype + "&uid=" + uid + "&page=" + pageIndex + "&backurl=" + Utils.PostPage(1) + "") + "\">删除本页评论</a><br />"); builder.Append("<a href=\"" + Utils.getUrl("commentary.aspx") + "\">返回评论管理</a><br />"); builder.Append(Out.Tab("</div><div class=\"title\"><a href=\"" + Utils.getUrl("default.aspx") + "\">返回管理中心</a>", "<a href=\"" + Utils.getUrl("default.aspx") + "\">返回管理中心</a>")); builder.Append(Out.Tab("</div>", "<br />")); }
private void ReOkPage(int leibie) { int meid = new BCW.User.Users().GetUsId(); if (meid == 0) { Utils.Login(); } int detailid = int.Parse(Utils.GetRequest("detailid", "all", 2, @"^[1-9]\d*$", "ID错误")); int id = int.Parse(Utils.GetRequest("id", "all", 2, @"^[1-9]\d*$", "ID错误")); if (!new BCW.BLL.FComment().Exists(id, detailid)) { Utils.Error("不存在的记录", ""); } int uid = 0; if (leibie == 0) { uid = new BCW.BLL.Diary().GetUsID(detailid); } else { uid = new BCW.BLL.Upfile().GetUsID(detailid); } bool flag = false; if (leibie == 0) { if (new BCW.User.Role().IsUserRole(BCW.User.Role.enumRole.Role_Diary, meid)) { flag = true; } } else { if (new BCW.User.Role().IsUserRole(BCW.User.Role.enumRole.Role_Albums, meid)) { flag = true; } } if (!uid.Equals(meid) && !flag) { Utils.Error("你的权限不足", ""); } string info = Utils.GetRequest("info", "post", 1, "", ""); BCW.Model.FComment model = new BCW.BLL.FComment().GetFComment(id); if (model == null) { Utils.Error("不存在的记录", ""); } if (info == "ok") { string Content = Utils.GetRequest("Content", "post", 3, @"^[\s\S]{1,500}$", "回复内容限1-500字内"); new BCW.BLL.FComment().UpdateReText(id, Content); //内线通知留言者 if (meid != model.UsID) { new BCW.BLL.Guest().Add(0, model.UsID, model.UsName, "[url=/bbs/uinfo.aspx?uid=" + meid + "]" + new BCW.BLL.User().GetUsName(meid) + "[/url]回复了你您在TA空间" + BCW.User.AppCase.CaseAlbums(leibie) + "的评论啦,快去[url=/bbs/fcomment.aspx?leibie=" + leibie + "&id=" + detailid + "]看看吧[/url]!"); } Utils.Success("回复留言", "回复留言成功,正在返回..", Utils.getPage("fcomment.aspx?leibie=" + leibie + "&id=" + detailid + ""), "1"); } else { Master.Title = "回复留言"; builder.Append(Out.Tab("<div class=\"title\">", "")); builder.Append("回复留言"); builder.Append(Out.Tab("</div>", "")); string strText, strName, strType, strValu, strEmpt, strIdea, strOthe; strText = "回复内容:/,,,,,,"; strType = "textarea,hidden,hidden,hidden,hidden,hidden,hidden"; strName = "Content,id,detailid,leibie,act,info,backurl"; strValu = "" + model.ReText + "'" + id + "'" + detailid + "'" + leibie + "'reok'ok'" + Utils.getPage(0) + ""; strEmpt = "true,false,false,false,false,false,false"; strIdea = "/"; strOthe = "确定回复|reset,fcomment.aspx,post,1,red|blue"; builder.Append(Out.wapform(strText, strName, strType, strValu, strEmpt, strIdea, strOthe)); builder.Append(Out.Tab("<div>", "<br />")); builder.Append("<a href=\"" + Utils.getPage("fcomment.aspx?leibie=" + leibie + "&id=" + detailid + "") + "\">>返回上一级</a>"); builder.Append(Out.Tab("</div>", "")); } }