예제 #1
0
    private void EditSubPage(string act, int uid)
    {
        string sName = "短语";
        int    itype = 0;

        if (act == "edittemp")
        {
            sName = "草稿";
            itype = 1;
        }
        Master.Title = "编辑" + sName + "";
        int id = int.Parse(Utils.GetRequest("id", "get", 2, @"^[0-9]\d*$", "ID错误"));

        if (!new BCW.BLL.Submit().Exists(id, uid, itype))
        {
            Utils.Error("不存在的记录", "");
        }
        BCW.Model.Submit model = new BCW.BLL.Submit().GetSubmit(id);
        builder.Append(Out.Tab("<div class=\"title\">编辑" + sName + "</div>", ""));
        if (act == "editsub")
        {
            builder.Append(Out.Tab("<div>", ""));
            builder.Append("请输入不超300字的短语:");
            builder.Append(Out.Tab("</div>", ""));
            strText = ",,,,";
            strName = "Content,id,act,backurl";
            strType = "textarea,hidden,hidden,hidden";
            strValu = "" + model.Content + "'" + id + "'savesub'" + Utils.getPage(0) + "";
            strEmpt = "false,false,false,false";
            strIdea = "/";
            strOthe = "&gt;确定,function.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") + "\">上级</a>-");
            builder.Append("<a href=\"" + Utils.getUrl("function.aspx?act=admsub&amp;backurl=" + Utils.getPage(0) + "") + "\">管理短语</a>");
            builder.Append(Out.Tab("</div>", ""));
        }
        else
        {
            builder.Append(Out.Tab("<div>", ""));
            builder.Append("主题(30字内):");
            builder.Append(Out.Tab("</div>", ""));
            strText = ",内容(5000字内):/,,,";
            strName = "Title,Content,id,act,backurl";
            strType = "text,textarea,hidden,hidden,hidden";
            strValu = "" + model.Title + "'" + model.Content + "'" + id + "'savetemp'" + Utils.getPage(0) + "";
            strEmpt = "false,false,false,false,false";
            strIdea = "/";
            strOthe = "&gt;确定,function.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") + "\">上级</a>-");
            builder.Append("<a href=\"" + Utils.getUrl("function.aspx?act=admtemp&amp;backurl=" + Utils.getPage(0) + "") + "\">管理草稿</a>");
            builder.Append(Out.Tab("</div>", ""));
        }
    }
예제 #2
0
    private void AddPage(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\">", ""));
        builder.Append("我要留言");
        builder.Append(Out.Tab("</div>", ""));

        int copy = int.Parse(Utils.GetRequest("copy", "get", 1, @"^[0-1]$", "0"));
        int ff   = int.Parse(Utils.GetRequest("ff", "get", 1, @"^[0-9]\d*$", "-1"));
        int dd   = int.Parse(Utils.GetRequest("dd", "get", 1, @"^[0-9]\d*$", "0"));
        //复制内容
        string Copytemp = string.Empty;

        if (ff >= 0)
        {
            Copytemp += "[F]" + ff + "[/F]";
        }

        if (dd > 0)
        {
            Copytemp += new BCW.BLL.Submit().GetContent(dd, meid);
        }

        if (copy == 1)
        {
            Copytemp += new BCW.BLL.User().GetCopytemp(meid);
        }

        strText = ",,,";
        strName = "Content,hid,act";
        strType = "text,hidden,hidden";
        strValu = "" + Copytemp + "'" + hid + "'save";
        strEmpt = "true,false,false";
        strIdea = "/";
        strOthe = "提交留言,mebook.aspx,post,1,red";
        builder.Append(Out.wapform(strText, strName, strType, strValu, strEmpt, strIdea, strOthe));
        builder.Append(Out.Tab("<div>", "<br />"));
        builder.Append("插入:<a href=\"" + Utils.getUrl("function.aspx?act=admsub&amp;backurl=" + Utils.PostPage(1) + "") + "\">常用短语</a>|");
        builder.Append("<a href=\"" + Utils.getUrl("function.aspx?act=face&amp;backurl=" + Utils.PostPage(1) + "") + "\">表情</a><br />");
        builder.Append("<a href=\"" + Utils.getUrl("mebook.aspx?act=add&amp;hid=" + hid + "&amp;ff=" + ff + "&amp;dd=" + dd + "&amp;copy=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("mebook.aspx?hid=" + hid + "") + "\">上级</a>");
        builder.Append(Out.Tab("</div>", ""));
    }
예제 #3
0
    private void ViewSubPage(string act, int uid)
    {
        string sName  = "短语";
        string acturl = "sub";
        int    itype  = 0;

        if (act == "viewtemp")
        {
            sName  = "草稿";
            itype  = 1;
            acturl = "temp";
        }
        Master.Title = "查看" + sName + "";
        int id = int.Parse(Utils.GetRequest("id", "get", 2, @"^[0-9]\d*$", "ID错误"));

        if (!new BCW.BLL.Submit().Exists(id, uid, itype))
        {
            Utils.Error("不存在的记录", "");
        }
        BCW.Model.Submit model = new BCW.BLL.Submit().GetSubmit(id);

        builder.Append(Out.Tab("<div class=\"title\">查看" + sName + "</div>", ""));
        builder.Append(Out.Tab("<div>", ""));
        builder.Append(model.Content + "<br />");
        string gUrl = Server.UrlDecode(Utils.getPage(0));

        gUrl = gUrl.Replace("&amp;", "&");
        gUrl = Regex.Replace(gUrl, @"([\s\S]+?)[&|?]{0,1}dd=[^&]*&{0,}", @"$1&amp;", RegexOptions.IgnoreCase);
        gUrl = Out.UBB(gUrl);
        if (gUrl.ToLower().Contains("addthread.aspx"))
        {
            builder.Append("<a href=\"" + Utils.getUrl(gUrl + "&amp;dd=" + id + "") + "\">[发表]</a>.");
        }
        else
        {
            if (act == "viewtemp")
            {
                builder.Append("<a href=\"" + Utils.getUrl("addThread.asp?dd=" + id + "") + "\">[发表]</a>.");
            }
        }
        builder.Append("<a href=\"" + Utils.getUrl("function.aspx?act=edit" + acturl + "&amp;id=" + id + "&amp;backurl=" + Utils.getPage(0) + "") + "\">[编辑]</a>.");
        builder.Append("<a href=\"" + Utils.getUrl("function.aspx?act=del" + acturl + "&amp;id=" + id + "&amp;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") + "\">上级</a>-");
        builder.Append("<a href=\"" + Utils.getUrl("function.aspx?act=adm" + acturl + "&amp;backurl=" + Utils.getPage(0) + "") + "\">管理" + sName + "</a>");
        builder.Append(Out.Tab("</div>", ""));
    }
예제 #4
0
    private void AdmSubPage(string act, int uid)
    {
        string sName  = "短语";
        string acturl = "sub";
        int    itype  = 0;

        if (act == "admtemp")
        {
            sName  = "草稿";
            itype  = 1;
            acturl = "temp";
        }

        int    ptype  = int.Parse(Utils.GetRequest("ptype", "get", 1, @"^[0-1]\d*$", "0"));
        string sTitle = string.Empty;

        if (ptype == 1)
        {
            sTitle = "管理" + sName + "";
        }
        else
        {
            sTitle = "选择" + sName + "";
        }
        Master.Title  = sTitle;
        Master.IsFoot = false;
        builder.Append(Out.Tab("<div class=\"title\">" + sTitle + "</div>", ""));
        int    pageIndex;
        int    recordCount;
        int    pageSize = Convert.ToInt32(ub.Get("SiteListNo"));
        string strWhere = "";

        string[] pageValUrl = { "act", "ptype", "id", "backurl" };
        pageIndex = Utils.ParseInt(Request.QueryString["page"]);
        if (pageIndex == 0)
        {
            pageIndex = 1;
        }
        //查询条件

        strWhere = "UsID=" + uid + " and Types=" + itype + "";

        // 开始读取列表
        IList <BCW.Model.Submit> listSubmit = new BCW.BLL.Submit().GetSubmits(pageIndex, pageSize, strWhere, out recordCount);

        if (listSubmit.Count > 0)
        {
            int    k    = 1;
            string gUrl = Server.UrlDecode(Utils.getPage(0));
            gUrl = gUrl.Replace("&amp;", "&");
            gUrl = Regex.Replace(gUrl, @"([\s\S]+?)[&|?]{0,1}dd=[^&]*&{0,}", @"$1&amp;", RegexOptions.IgnoreCase);
            gUrl = Out.UBB(gUrl);
            foreach (BCW.Model.Submit n in listSubmit)
            {
                if (k % 2 == 0)
                {
                    builder.Append(Out.Tab("<div class=\"text\">", "<br />"));
                }
                else
                {
                    if (k == 1)
                    {
                        builder.Append(Out.Tab("<div>", ""));
                    }
                    else
                    {
                        builder.Append(Out.Tab("<div>", "<br />"));
                    }
                }
                string sText = n.Content;
                if (sText.Length > 12)
                {
                    sText = Utils.Left(sText, 12) + "...";
                }
                builder.AppendFormat("[{0}]<a href=\"" + Utils.getUrl("function.aspx?act=view" + acturl + "&amp;id={1}&amp;backurl=" + Utils.PostPage(true) + "") + "\">{2}</a>", (pageIndex - 1) * pageSize + k, n.ID, sText);

                if (gUrl.ToLower().Contains(".aspx"))
                {
                    builder.Append("<a href=\"" + Utils.getUrl(gUrl + "&amp;dd=" + n.ID + "") + "\">[选择]</a>");
                }
                else
                {
                    if (act == "admtemp")
                    {
                        builder.Append("<a href=\"" + Utils.getUrl("addThread.asp?dd=" + n.ID + "") + "\">[发表]</a>");
                    }
                }
                if (ptype == 1)
                {
                    builder.Append("<br /><a href=\"" + Utils.getUrl("function.aspx?act=edit" + acturl + "&amp;id=" + n.ID + "&amp;backurl=" + Utils.getPage(0) + "") + "\">[编辑]</a>.");
                    builder.Append("<a href=\"" + Utils.getUrl("function.aspx?act=del" + acturl + "&amp;id=" + n.ID + "&amp;backurl=" + Utils.getPage(0) + "") + "\">[删除]</a>");
                }
                k++;
                builder.Append(Out.Tab("</div>", ""));
            }

            // 分页
            builder.Append(BasePage.MultiPage(pageIndex, pageSize, recordCount, Utils.getPageUrl(), pageValUrl, "page", 0));
        }
        else
        {
            builder.Append(Out.Div("div", "没有相关记录.."));
        }

        if (ptype == 0)
        {
            builder.Append(Out.Tab("<div>", "<br />"));
            builder.Append("<a href=\"" + Utils.getUrl("function.aspx?act=adm" + acturl + "&amp;ptype=1&amp;backurl=" + Utils.getPage(0) + "") + "\">&gt;切换管理</a>");
            builder.Append(Out.Tab("</div>", ""));
        }
        else
        {
            if (act != "admtemp")
            {
                builder.Append(Out.Tab("<div>", "<br />"));
                builder.Append("<a href=\"" + Utils.getUrl("function.aspx?act=addsub&amp;backurl=" + Utils.getPage(0) + "") + "\">&gt;新建短语</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") + "\">上级</a>");
        builder.Append(Out.Tab("</div>", ""));
    }
예제 #5
0
    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}&amp;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&amp;leibie=" + leibie + "&amp;detailid=" + n.DetailId + "&amp;id=" + n.ID + "&amp;backurl=" + Utils.PostPage(1) + "") + "\">[回复]</a>");
                }
                if (uid.Equals(meid) || flag == true)
                {
                    builder.Append("<a href=\"" + Utils.getUrl("fcomment.aspx?act=delreply&amp;leibie=" + leibie + "&amp;detailid=" + n.DetailId + "&amp;id=" + n.ID + "&amp;backurl=" + Utils.PostPage(1) + "") + "\">[删除]</a>");
                }
                k++;
                builder.Append(Out.Tab("</div>", ""));
            }
            // 分页
            builder.Append(BasePage.MultiPage(pageIndex, pageSize, recordCount, Utils.getPageUrl(), pageValUrl, "page", 0));
        }
        else
        {
            builder.Append(Out.Div("div", "没有相关记录.."));
        }
        //得到随机短语
        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&amp;leibie=" + leibie + "&amp;id=" + id + "&amp;backurl=" + Utils.PostPage(1) + "") + "\">&gt;&gt;我要评论</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&amp;uid=" + uid + "") + "\">相册</a>");
        }
        if (leibie != 2)
        {
            builder.Append("-<a href=\"" + Utils.getUrl("albums.aspx?leibie=2&amp;uid=" + uid + "") + "\">音乐</a>");
        }
        if (leibie != 3)
        {
            builder.Append("-<a href=\"" + Utils.getUrl("albums.aspx?leibie=3&amp;uid=" + uid + "") + "\">视频</a>");
        }
        if (leibie != 4)
        {
            builder.Append("-<a href=\"" + Utils.getUrl("albums.aspx?leibie=4&amp;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&amp;id=" + id + "") + "\">上级</a>");
        }
        else
        {
            builder.Append("<a href=\"" + Utils.getPage("albums.aspx?act=view&amp;leibie=" + leibie + "&amp;id=" + id + "") + "\">上级</a>");
        }

        builder.Append(Out.Tab("</div>", ""));
    }
예제 #6
0
    private void ReplyPage(int leibie)
    {
        Master.Title = "我要评论";
        int id   = int.Parse(Utils.GetRequest("id", "get", 2, @"^[1-9]\d*$", "ID错误"));
        int copy = int.Parse(Utils.GetRequest("copy", "get", 1, @"^[0-1]$", "0"));
        int ff   = int.Parse(Utils.GetRequest("ff", "get", 1, @"^[0-9]\d*$", "-1"));
        int dd   = int.Parse(Utils.GetRequest("dd", "get", 1, @"^[0-9]\d*$", "0"));
        int meid = new BCW.User.Users().GetUsId();

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

        string Title = string.Empty;

        if (leibie == 0)
        {
            Title = new BCW.BLL.Diary().GetTitle(id);
        }
        else
        {
            Title = new BCW.BLL.Upfile().GetTitle(id);
        }

        if (Title == "")
        {
            Utils.Error("不存在的记录", "");
        }
        builder.Append(Out.Tab("<div class=\"title\">", ""));
        if (leibie == 0)
        {
            builder.Append("评论:<a href=\"" + Utils.getUrl("diary.aspx?act=view&amp;id=" + id + "") + "\">" + Title + "</a>");
        }
        else
        {
            builder.Append("评论:<a href=\"" + Utils.getUrl("albums.aspx?act=view&amp;leibie=" + leibie + "&amp;id=" + id + "") + "\">" + Title + "</a>");
        }

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

        string reText = string.Empty;

        if (ff >= 0)
        {
            reText += "[F]" + ff + "[/F]";
        }

        if (dd > 0)
        {
            reText += new BCW.BLL.Submit().GetContent(dd, meid);
        }

        if (copy == 1)
        {
            reText += new BCW.BLL.User().GetCopytemp(meid);
        }

        strText = "内容.300字内:/,,,,";
        strName = "Content,id,leibie,backurl,act";
        strType = "textarea,hidden,hidden,hidden,hidden";
        strValu = "" + reText + "'" + id + "'" + leibie + "'" + Utils.getPage(0) + "'replysave";
        strEmpt = "true,false,false,false,false";
        strIdea = "/";
        strOthe = "发表评论,fcomment.aspx,post,1,red";

        builder.Append(Out.wapform(strText, strName, strType, strValu, strEmpt, strIdea, strOthe));
        builder.Append(Out.Tab("<div>", "<br />"));
        builder.Append("插入:<a href=\"" + Utils.getUrl("function.aspx?act=admsub&amp;backurl=" + Utils.PostPage(1) + "") + "\">常用短语</a>.");
        builder.Append("<a href=\"" + Utils.getUrl("function.aspx?act=face&amp;backurl=" + Utils.PostPage(1) + "") + "\">表情</a>");
        builder.Append("<br /><a href=\"" + Utils.getUrl("fcomment.aspx?act=reply&amp;leibie=" + leibie + "&amp;id=" + id + "&amp;ff=" + ff + "&amp;dd=" + dd + "&amp;copy=1") + "\">[粘贴]</a>");
        builder.Append(Out.Tab("</div>", ""));
        builder.Append(Out.Tab("<div class=\"title\">", Out.Hr()));
        if (leibie == 0)
        {
            builder.Append("<a href=\"" + Utils.getPage("diary.aspx?act=view&amp;id=" + id + "") + "\">取消发表</a>");
        }
        else
        {
            builder.Append("<a href=\"" + Utils.getPage("albums.aspx?act=view&amp;leibie=" + leibie + "&amp;id=" + id + "") + "\">取消发表</a>");
        }

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