private void TopPage(string act, int meid, int hid) { Master.Title = "置顶留言"; if (meid != hid && !new BCW.User.Role().IsUserRole(BCW.User.Role.enumRole.Role_UsBook, meid)) { Utils.Error("你的权限不足", ""); } int id = int.Parse(Utils.GetRequest("id", "get", 2, @"^[1-9]\d*$", "ID错误")); string info = Utils.GetRequest("info", "get", 1, "", ""); if (!new BCW.BLL.Mebook().Exists(id, hid)) { Utils.Error("不存在的记录", ""); } int IsTop = new BCW.BLL.Mebook().GetIsTop(id); string topText = string.Empty; if (IsTop == 0) { topText = "置顶"; } else { topText = "去顶"; } if (info != "ok") { builder.Append(Out.Tab("<div class=\"title\">", "")); builder.Append("确定" + topText + "此留言吗"); builder.Append(Out.Tab("</div>", "<br />")); builder.Append(Out.Tab("<div>", "")); builder.Append("<a href=\"" + Utils.getUrl("mebook.aspx?act=" + act + "&info=ok&hid=" + hid + "&id=" + id + "&backurl=" + Utils.getPage(0) + "") + "\">确定" + topText + "</a><br />"); builder.Append("<a href=\"" + Utils.getUrl("mebook.aspx?act=admin&hid=" + hid + "&id=" + id + "&backurl=" + Utils.getPage(0) + "") + "\">再看看吧..</a>"); builder.Append(Out.Tab("</div>", "<br />")); builder.Append(Out.Tab("<div>", "")); builder.Append("<a href=\"" + Utils.getPage("mebook.aspx?hid=" + hid + "") + "\">>返回上一级</a>"); builder.Append(Out.Tab("</div>", "")); } else { if (IsTop == 0) { new BCW.BLL.Mebook().UpdateIsTop(id, 1); } else { new BCW.BLL.Mebook().UpdateIsTop(id, 0); } Utils.Success("" + topText + "留言", "" + topText + "成功,正在返回..", Utils.getPage("mebook.aspx?hid=" + hid + ""), "1"); } }
private void ReOkPage(int meid, int hid) { BCW.User.Users.ShowVerifyRole("k", meid); //非验证会员提示 new BCW.User.Limits().CheckUserLimit(BCW.User.Limits.enumRole.Role_UsBook, meid); //会员本身权限 int id = int.Parse(Utils.GetRequest("id", "all", 2, @"^[1-9]\d*$", "ID错误")); string info = Utils.GetRequest("info", "post", 1, "", ""); BCW.Model.Mebook model = new BCW.BLL.Mebook().GetMebook(id); if (model == null) { Utils.Error("不存在的记录", ""); } if (model.UsID != meid) { Utils.Error("不存在的记录", ""); } if (info == "ok") { string Content = Utils.GetRequest("Content", "post", 3, @"^[\s\S]{1,500}$", "回复留言内容限1-500字内"); new BCW.BLL.Mebook().UpdateReText(id, Content); //内线通知留言者 if (meid != model.MID) { new BCW.BLL.Guest().Add(3, model.MID, model.MName, "[url=/bbs/uinfo.aspx?uid=" + meid + "]" + new BCW.BLL.User().GetUsName(meid) + "[/url]回复了你您在TA空间的留言啦,快去[url=/bbs/mebook.aspx?hid=" + meid + "]看看吧[/url]!"); } Utils.Success("回复留言", "回复留言成功,正在返回..", Utils.getPage("mebook.aspx?hid=" + hid + ""), "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"; strName = "Content,id,hid,act,info,backurl"; strValu = "" + model.ReText + "'" + id + "'" + hid + "'reok'ok'" + Utils.getPage(0) + ""; strEmpt = "true,false,false,false,false,false"; strIdea = "/"; strOthe = "确定回复|reset,mebook.aspx,post,1,red|blue"; builder.Append(Out.wapform(strText, strName, strType, strValu, strEmpt, strIdea, strOthe)); builder.Append(Out.Tab("<div>", " ")); builder.Append("<a href=\"" + Utils.getUrl("mebook.aspx?act=admin&hid=" + hid + "&id=" + id + "&backurl=" + Utils.getPage(0) + "") + "\">取消</a>"); builder.Append(Out.Tab("</div>", "<br />")); builder.Append(Out.Tab("<div>", "")); builder.Append("<a href=\"" + Utils.getPage("mebook.aspx?hid=" + hid + "") + "\">>返回上一级</a>"); builder.Append(Out.Tab("</div>", "")); } }
private void DelPage(string act, int meid, int hid) { Master.Title = "删除留言"; if (meid != hid && !new BCW.User.Role().IsUserRole(BCW.User.Role.enumRole.Role_UsBook, meid)) { Utils.Error("你的权限不足", ""); } int id = int.Parse(Utils.GetRequest("id", "get", 2, @"^[1-9]\d*$", "ID错误")); string info = Utils.GetRequest("info", "get", 1, "", ""); if (!new BCW.BLL.Mebook().Exists(id, hid)) { Utils.Error("不存在的记录", ""); } if (info != "ok") { builder.Append(Out.Tab("<div class=\"title\">", "")); if (act == "del") { builder.Append("确定删除此留言吗"); } else { builder.Append("确定删除此会员的所有留言吗"); } builder.Append(Out.Tab("</div>", "<br />")); builder.Append(Out.Tab("<div>", "")); builder.Append("<a href=\"" + Utils.getUrl("mebook.aspx?act=" + act + "&info=ok&hid=" + hid + "&id=" + id + "&backurl=" + Utils.getPage(0) + "") + "\">确定删除</a><br />"); builder.Append("<a href=\"" + Utils.getUrl("mebook.aspx?act=admin&hid=" + hid + "&id=" + id + "&backurl=" + Utils.getPage(0) + "") + "\">先留着吧..</a>"); builder.Append(Out.Tab("</div>", "<br />")); builder.Append(Out.Tab("<div>", "")); builder.Append("<a href=\"" + Utils.getPage("mebook.aspx?hid=" + hid + "") + "\">>返回上一级</a>"); builder.Append(Out.Tab("</div>", "")); } else { if (act == "del") { new BCW.BLL.Mebook().Delete(id); } else { //取归属会员ID int MID = new BCW.BLL.Mebook().GetMID(id); new BCW.BLL.Mebook().Delete(meid, MID); } Utils.Success("删除留言", "删除成功,正在返回..", Utils.getPage("mebook.aspx?hid=" + hid + ""), "1"); } }
private void DelpagePage() { Master.Title = "删除本页留言"; 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("mebook.aspx?act=delpage&info=ok&uid=" + uid + "&page=" + page + "&backurl=" + Utils.getPage(0) + "") + "\">确定删除</a><br />"); builder.Append("<a href=\"" + Utils.getPage("mebook.aspx") + "\">再看看吧..</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 (uid != 0) { strWhere += "MID=" + uid + ""; } // 开始读取列表 IList <BCW.Model.Mebook> listMebook = new BCW.BLL.Mebook().GetMebooks(pageIndex, pageSize, strWhere, out recordCount); if (listMebook.Count > 0) { foreach (BCW.Model.Mebook n in listMebook) { //删除 new BCW.BLL.Mebook().Delete(n.ID); } } Utils.Success("删除本页留言", "删除本页留言成功,正在返回..", Utils.getUrl("mebook.aspx"), "1"); } }
private void AdminPage(int meid, int hid) { if (meid != hid && !new BCW.User.Role().IsUserRole(BCW.User.Role.enumRole.Role_UsBook, meid)) { Utils.Error("你的权限不足", ""); } int id = int.Parse(Utils.GetRequest("id", "get", 2, @"^[0-9]\d*$", "ID错误")); BCW.Model.Mebook model = new BCW.BLL.Mebook().GetMebook(id); if (model == null) { Utils.Error("不存在的记录", ""); } Master.Title = "管理留言"; builder.Append(Out.Tab("<div class=\"title\">", "")); builder.Append("管理留言"); builder.Append(Out.Tab("</div>", "<br />")); builder.Append(Out.Tab("<div>", "")); if (new BCW.BLL.Mebook().GetIsTop(id) == 0) { builder.Append("<a href=\"" + Utils.getUrl("mebook.aspx?act=top&hid=" + hid + "&id=" + id + "&backurl=" + Utils.getPage(0) + "") + "\">置顶本条留言</a><br />"); } else { builder.Append("<a href=\"" + Utils.getUrl("mebook.aspx?act=top&hid=" + hid + "&id=" + id + "&backurl=" + Utils.getPage(0) + "") + "\">去顶本条留言</a><br />"); } builder.Append("<a href=\"" + Utils.getUrl("mebook.aspx?act=del&hid=" + hid + "&id=" + id + "&backurl=" + Utils.getPage(0) + "") + "\">删除本条留言</a><br />"); builder.Append("<a href=\"" + Utils.getUrl("mebook.aspx?act=del2&hid=" + hid + "&id=" + id + "&backurl=" + Utils.getPage(0) + "") + "\">删除TA的所有留言</a>"); if (meid == hid) { builder.Append("<br /><a href=\"" + Utils.getUrl("mebook.aspx?act=reok&hid=" + hid + "&id=" + id + "&backurl=" + Utils.getPage(0) + "") + "\">回复本条留言</a>"); builder.Append("<br /><a href=\"" + Utils.getUrl("friend.aspx?act=addblack&hid=" + model.MID + "&backurl=" + Utils.getPage(0) + "") + "\">禁止TA留言</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("mebook.aspx?hid=" + hid + "") + "\">上级</a>"); builder.Append(Out.Tab("</div>", "")); }
private void ReloadPage(int meid, int hid) { string UsName = new BCW.BLL.User().GetUsName(hid); if (UsName == "") { Utils.Error("不存在的会员ID", ""); } Master.Title = "" + UsName + "的留言本"; builder.Append(Out.Tab("<div class=\"title\">" + UsName + "的留言本</div>", "")); builder.Append(Out.Tab("<div>", "")); builder.Append("留言|"); builder.Append("<a href=\"" + Utils.getUrl("visit.aspx?act=list&ptype=1&hid=" + hid + "") + "\">拜访</a>|"); builder.Append("<a href=\"" + Utils.getUrl("visit.aspx?act=list&ptype=2&hid=" + hid + "") + "\">访客</a>|"); builder.Append("<a href=\"" + Utils.getUrl("action.aspx?act=friend&hid=" + hid + "") + "\">好友</a>|"); if (meid == hid) { builder.Append("<a href=\"" + Utils.getUrl("action.aspx?act=fans&hid=" + hid + "") + "\">关注</a>"); } else { builder.Append("<a href=\"" + Utils.getUrl("action.aspx?act=me&hid=" + hid + "") + "\">动态</a>"); } builder.Append(Out.Tab("</div>", "<br />")); builder.Append(Out.Tab("<div>", "")); builder.Append("<a href=\"" + Utils.getUrl("mebook.aspx?act=add&hid=" + hid + "") + "\">我要留言</a>"); if (meid == hid) { builder.Append("|<a href=\"" + Utils.getUrl("myedit.aspx?act=mebook&backurl=" + Utils.PostPage(1) + "") + "\">设置</a>"); } builder.Append(Out.Tab("</div>", "<br />")); int pageIndex; int recordCount; int pageSize = Convert.ToInt32(ub.Get("SiteListNo")); string strWhere = ""; string[] pageValUrl = { "hid", "backurl" }; pageIndex = Utils.ParseInt(Request.QueryString["page"]); if (pageIndex == 0) { pageIndex = 1; } //查询条件 strWhere = "UsID=" + hid + " and type=0";//邵广林 20160524 前台留言为0,农场留言为1001 // 开始读取列表 IList <BCW.Model.Mebook> listMebook = new BCW.BLL.Mebook().GetMebooks(pageIndex, pageSize, strWhere, out recordCount); if (listMebook.Count > 0) { int k = 1; foreach (BCW.Model.Mebook n in listMebook) { 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 />")); } } if (n.IsTop == 1) { builder.Append("[顶]"); } builder.Append("<a href=\"" + Utils.getUrl("uinfo.aspx?uid=" + n.MID + "&backurl=" + Utils.PostPage(1) + "") + "\">" + n.MName + "(" + n.MID + ")</a>"); builder.Append(":" + Out.SysUBB(n.MContent) + "(" + 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>", "")); } if (meid == hid || new BCW.User.Role().IsUserRole(BCW.User.Role.enumRole.Role_UsBook, meid)) { builder.Append("<a href=\"" + Utils.getUrl("mebook.aspx?act=admin&hid=" + hid + "&id=" + n.ID + "&backurl=" + Utils.PostPage(1) + "") + "\">[管理]</a>"); } builder.Append(Out.Tab("", Out.LHr())); 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("", "<br />")); strText = ",,,"; strName = "Content,hid,act"; strType = "stext,hidden,hidden"; strValu = "'" + hid + "'save"; strEmpt = "true,false,false"; strIdea = ""; strOthe = "提交留言,mebook.aspx,post,3,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=" + meid + "") + "\">上级</a>-"); builder.Append("<a href=\"" + Utils.getUrl("mebook.aspx?act=add&hid=" + hid + "") + "\">我要留言</a>"); builder.Append(Out.Tab("</div>", "")); }
private void ReloadPage() { Master.Title = "空间留言管理"; int uid = int.Parse(Utils.GetRequest("uid", "all", 1, @"^[1-9]\d*$", "0")); builder.Append(Out.Tab("<div class=\"title\">", "")); if (uid > 0) { builder.Append("ID:" + uid + ""); } builder.Append("空间留言管理"); builder.Append(Out.Tab("</div>", "<br />")); int pageIndex; int recordCount; int pageSize = Convert.ToInt32(ub.Get("SiteListNo")); string strWhere = ""; string[] pageValUrl = { "uid", "backurl" }; pageIndex = Utils.ParseInt(Request.QueryString["page"]); if (pageIndex == 0) { pageIndex = 1; } //查询条件 if (uid > 0) { strWhere = "MID=" + uid + ""; } // 开始读取列表 IList <BCW.Model.Mebook> listMebook = new BCW.BLL.Mebook().GetMebooks(pageIndex, pageSize, strWhere, out recordCount); if (listMebook.Count > 0) { int k = 1; foreach (BCW.Model.Mebook n in listMebook) { 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("mebook.aspx?act=del&id={0}&backurl=" + Utils.PostPage(1) + "") + "\">[删]</a>{1}.{2}:{3}({4})", n.ID, (pageIndex - 1) * pageSize + k, n.MName, n.MContent, 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", "没有相关记录..")); } string strText = "输入用户ID:/,"; string strName = "uid,backurl"; string strType = "num,hidden"; string strValu = "'" + Utils.getPage(0) + ""; string strEmpt = "true,false"; string strIdea = "/"; string strOthe = "搜空间留言,mebook.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>", "")); builder.Append("<a href=\"" + Utils.getUrl("mebook.aspx?act=delpage&uid=" + uid + "&page=" + pageIndex + "&backurl=" + Utils.PostPage(1) + "") + "\">删除本页留言</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 />")); }