Exemple #1
0
        public IActionResult GuestShow()
        {
            int GID = DataConverter.CLng(RequestEx["GID"]);

            if (GID < 1)
            {
                return(WriteErr("没有传入留言ID"));
            }
            M_GuestBook info = guestBll.SelReturnModel(GID);
            M_UserInfo  mu   = buser.GetLogin();

            if (info.IsNull || info.ParentID > 0 || info.Status == -1)
            {
                return(WriteErr("留言信息不存在!"));
            }
            if (info.Status == 0 && info.UserID != mu.UserID)
            {
                return(WriteErr("该留言未通过审核,无法查看详情"));
            }
            M_GuestBookCate cateMod = cateBll.SelReturnModel(info.CateID);

            ViewBag.mu      = mu;
            ViewBag.cateMod = cateMod;
            ViewBag.GTitle  = info.Title;
            ViewBag.cateDt  = cateBll.SelByGuest();
            PageSetting setting = B_GuestBook.SelPage(CPage, 20, new F_Guest()
            {
                gid = GID
            });

            return(View(setting));
        }
Exemple #2
0
        //单个留言详情,弹窗
        public IActionResult MsgShow()
        {
            M_GuestBook msgMod = guestBll.SelReturnModel(Mid);

            if (msgMod.IsNull)
            {
                return(WriteErr("指定的留言不存在"));
            }

            return(View("MsgShow", msgMod));
        }
Exemple #3
0
    protected void PostMsg_Btn_Click(object sender, EventArgs e)
    {
        M_UserInfo mu = tpuser_Bll.GetLogin();//barBll.GetUser();

        if (mu.Status != 0)
        {
            function.WriteErrMsg("您的账户已被锁定,无法进行发帖、回复等操作!");
        }
        M_Guest_Bar     lastMod   = barBll.SelLastModByUid(mu);
        M_GuestBookCate catemod   = guestBll.GetCate(CateID);
        BarOption       baroption = GuestConfig.GuestOption.BarOption.Find(v => v.CateID == CateID);
        int             usertime  = baroption == null ? 120 : baroption.UserTime;
        int             sendtime  = baroption == null?5:baroption.SendTime;

        if (!ZoomlaSecurityCenter.VCodeCheck(Request.Form["VCode_hid"], VCode.Text.Trim()))
        {
            function.WriteErrMsg("验证码不正确", "/" + B_Guest_Bar.CreateUrl(1, CateID, CPage));
        }
        else if (catemod.IsBarOwner(mu.UserID))
        {
        }
        else if (mu.UserID > 0 && (DateTime.Now - mu.RegTime).TotalMinutes < usertime)//匿名用户不受此限
        {
            int minute = usertime - (int)(DateTime.Now - mu.RegTime).TotalMinutes;
            function.WriteErrMsg("新注册用户" + usertime + "分钟内不能发贴,你还需要" + minute + "分钟", "javascript:history.go(-1);");
        }
        else if (lastMod != null && (DateTime.Now - lastMod.CDate).TotalMinutes < sendtime)
        {
            int minute = sendtime - (int)(DateTime.Now - lastMod.CDate).TotalMinutes;
            function.WriteErrMsg("你发贴太快了," + minute + "分钟后才能再次发贴", "javascript:history.go(-1);");
        }
        string msg = MsgContent_T.Text;

        GetSubTitle(ref msg);
        catemod = guestBll.SelReturnModel(CateID);
        barMod  = FillMsg(MsgTitle_T.Text, msg, catemod);
        int id = barBll.Insert(barMod);

        if (catemod.Status == 1 && mu.UserID > 0) //是否需审核
        {
            if (catemod.IsPlat == 1)              //分享到能力中心
            {
                string siteurl = "http://" + Request.Url.Authority + "/";
                string url     = B_Guest_Bar.CreateUrl(2, id);
                string cateurl = B_Guest_Bar.CreateUrl(1, catemod.CateID);
                msgBll.InsertMsg(string.Format(forwardTlp, barMod.Title, siteurl + url, siteurl + url, catemod.CateName, siteurl + cateurl));
            }
            buser.ChangeVirtualMoney(mu.UserID, new M_UserExpHis()
            {
                score     = catemod.SendScore,
                ScoreType = (int)M_UserExpHis.SType.Point,
                detail    = string.Format("{0} {1}在版面:{2}发表主题:{3},赠送{4}分", DateTime.Now, mu.UserName, catemod.CateName, MsgTitle_T.Text.Trim(), catemod.SendScore)
            });
            Response.Redirect("/" + B_Guest_Bar.CreateUrl(2, id));
        }
        else
        {
            Response.Redirect("/" + B_Guest_Bar.CreateUrl(1, CateID));
        }
    }