• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Entity.TopicInfo类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Discuz.Entity.TopicInfo的典型用法代码示例。如果您正苦于以下问题:C# TopicInfo类的具体用法?C# TopicInfo怎么用?C# TopicInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



TopicInfo类属于Discuz.Entity命名空间,在下文中一共展示了TopicInfo类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: SendPostReplyNotice

        /// <summary>
        /// 发送回复通知
        /// </summary>
        /// <param name="postinfo">回复信息</param>
        /// <param name="topicinfo">所属主题信息</param>
        /// <param name="replyuserid">回复的某一楼的作者</param>
        public static void SendPostReplyNotice(PostInfo postinfo, TopicInfo topicinfo, int replyuserid)
        {
            NoticeInfo noticeinfo = new NoticeInfo();

            noticeinfo.Note = Utils.HtmlEncode(string.Format("<a href=\"userinfo.aspx?userid={0}\">{1}</a> 给您回帖, <a href =\"showtopic.aspx?topicid={2}&postid={3}#{3}\">{4}</a>.", postinfo.Posterid, postinfo.Poster, topicinfo.Tid, postinfo.Pid, topicinfo.Title));
            noticeinfo.Type = NoticeType.PostReplyNotice;
            noticeinfo.New = 1;
            noticeinfo.Posterid = postinfo.Posterid;
            noticeinfo.Poster = postinfo.Poster;
            noticeinfo.Postdatetime = Utils.GetDateTime();
            noticeinfo.Fromid = topicinfo.Tid;
            noticeinfo.Uid = replyuserid;

            //当回复人与帖子作者不是同一人时,则向帖子作者发送通知
            if (postinfo.Posterid != replyuserid && replyuserid > 0)
            {
                Notices.CreateNoticeInfo(noticeinfo);
            }

            //当上面通知的用户与该主题作者不同,则还要向主题作者发通知
            if (postinfo.Posterid != topicinfo.Posterid && topicinfo.Posterid != replyuserid && topicinfo.Posterid > 0)
            {
                noticeinfo.Uid = topicinfo.Posterid;
                Notices.CreateNoticeInfo(noticeinfo);
            }
        }
开发者ID:ChalmerLin,项目名称:dnt_v3.6.711,代码行数:32,代码来源:Notices.cs


示例2: CreateTopic

 /// <summary>
 /// 创建新主题
 /// </summary>
 /// <param name="originalTopicInfo">主题信息</param>
 /// <returns>返回主题ID</returns>
 public static int CreateTopic(TopicInfo topicinfo)
 {
     lock (lockHelper)
     {
         return (topicinfo != null ? Data.Topics.CreateTopic(topicinfo) : 0);
     }
 }
开发者ID:Vinna,项目名称:DeepInSummer,代码行数:12,代码来源:Topics.cs


示例3: CloseBonus

        /// <summary>
        /// 结束悬赏并给分
        /// </summary>
        /// <param name="topicinfo">主题信息</param>
        /// <param name="userid">当前执行此操作的用户Id</param>
        /// <param name="postIdArray">帖子Id数组</param>
        /// <param name="winerIdArray">获奖者Id数组</param>
        /// <param name="winnerNameArray">获奖者的用户名数组</param>
        /// <param name="costBonusArray">奖励积分数组</param>
        /// <param name="valuableAnswerArray">有价值答案的pid数组</param>
        /// <param name="bestAnswer">最佳答案的pid</param>
        public static void CloseBonus(TopicInfo topicinfo, int userid, int[] postIdArray, int[] winerIdArray, string[] winnerNameArray, string[] costBonusArray, string[] valuableAnswerArray, int bestAnswer)
        {
            topicinfo.Special = 3;

            Topics.UpdateSpecial(topicinfo);//更新标志位为已结帖状态

            //开始给分和记录
            int winerId = 0, isbest = 0, postid = 0, bonus=0;
            string winnerName = string.Empty;
            for (int i = 0; i < winerIdArray.Length; i++)
            {
                winerId = winerIdArray[i];
                bonus = Utils.StrToInt(costBonusArray[i], 0);
                winnerName = winnerNameArray[i];
                postid = postIdArray[i];

                if (winerId > 0 && bonus > 0)
                {
                    Users.UpdateUserExtCredits(winerId, Scoresets.GetCreditsTrans(), bonus);
                }
                if (Utils.InArray(postid.ToString(), valuableAnswerArray))
                {
                    isbest = 1;
                }
                if (postid == bestAnswer)
                {
                    isbest = 2;
                }


                AddLog(topicinfo.Tid, topicinfo.Posterid, winerId, winnerName, postid, bonus, isbest);
            }
        }
开发者ID:ichari,项目名称:ichari,代码行数:44,代码来源:Bonus.cs


示例4: CreateTopic

        /// <summary>
        /// 创建新主题
        /// </summary>
        /// <param name="topicInfo">主题信息</param>
        /// <returns>返回主题ID</returns>
        public static int CreateTopic(TopicInfo topicInfo)
        {
            topicInfo.Tid = DatabaseProvider.GetInstance().CreateTopic(topicInfo);

            if (appDBCache)
                ITopicService.CreateTopic(topicInfo);

            return topicInfo.Tid;
        }
开发者ID:hanshion,项目名称:DiscuzNt,代码行数:14,代码来源:Topics.cs


示例5: UpdateTopicAllInfo

		/// <summary>
		///
		/// </summary>
		/// <param name="topicinfo"></param>
		/// <returns></returns>
		public static bool UpdateTopicAllInfo(TopicInfo topicinfo)
		{
            try
            {
                Topics.UpdateTopic(topicinfo);
                return true;
            }
            catch
            {
                return false;
            }
		}
开发者ID:ZeroneBit,项目名称:dnt3_src,代码行数:17,代码来源:AdminTopics.cs


示例6: OnTopicCreated

        protected override void OnTopicCreated(TopicInfo topic, PostInfo post, AttachmentInfo[] attachs)
        {
            SpacePostInfo spacepost = new SpacePostInfo();
            spacepost.Author = post.Poster;
            string content = Posts.GetPostMessageHTML(post, attachs);
            spacepost.Category = "";
            spacepost.Content = content;
            spacepost.Postdatetime = DateTime.Now;
            spacepost.PostStatus = 1;
            spacepost.PostUpDateTime = DateTime.Now;
            spacepost.Title = post.Title;
            spacepost.Uid = post.Posterid;

            DbProvider.GetInstance().AddSpacePost(spacepost);
        }
开发者ID:Vinna,项目名称:DeepInSummer,代码行数:15,代码来源:SpacePlugin.cs


示例7: GetRelatedTopicList

        /// <summary>
        /// 根据主题的Tag获取相关主题(游客可见级别的)
        /// </summary>
        /// <param name="topicid">主题Id</param>
        /// <returns></returns>
        public static Discuz.Common.Generic.List<TopicInfo> GetRelatedTopicList(int topicId, int count)
        {
            IDataReader reader = DatabaseProvider.GetInstance().GetRelatedTopics(topicId, count);

            Discuz.Common.Generic.List<TopicInfo> topics = new Discuz.Common.Generic.List<TopicInfo>();
            while (reader.Read())
            {
                TopicInfo topic = new TopicInfo();
                topic.Tid = TypeConverter.ObjectToInt(reader["linktid"]);
                topic.Title = reader["linktitle"].ToString();
                topics.Add(topic);
            }

            reader.Close();
            return topics;
        }
开发者ID:khaliyo,项目名称:DiscuzNT,代码行数:21,代码来源:TopicTagCaches.cs


示例8: CloseBonus

        /// <summary>
        /// 结束悬赏并给分
        /// </summary>
        /// <param name="topicinfo">主题信息</param>
        /// <param name="userid">当前执行此操作的用户Id</param>
        /// <param name="postIdArray">帖子Id数组</param>
        /// <param name="winerIdArray">获奖者Id数组</param>
        /// <param name="winnerNameArray">获奖者的用户名数组</param>
        /// <param name="costBonusArray">奖励积分数组</param>
        /// <param name="valuableAnswerArray">有价值答案的pid数组</param>
        /// <param name="bestAnswer">最佳答案的pid</param>
        public static void CloseBonus(TopicInfo topicinfo, int userid, int[] postIdArray, int[] winerIdArray, string[] winnerNameArray, string[] costBonusArray, string[] valuableAnswerArray, int bestAnswer)
        {
            int isbest = 0, bonus = 0;

            topicinfo.Special = 3;//标示为悬赏主题
            Topics.UpdateTopic(topicinfo);//更新标志位为已结帖状态

            //开始给分和记录
            for (int i = 0; i < winerIdArray.Length; i++)
            {
                bonus = TypeConverter.StrToInt(costBonusArray[i]);
                if (winerIdArray[i] > 0 && bonus > 0)
                    Users.UpdateUserExtCredits(winerIdArray[i], Scoresets.GetBonusCreditsTrans(), bonus);

                if (Utils.InArray(postIdArray[i].ToString(), valuableAnswerArray))
                    isbest = 1;

                if (postIdArray[i] == bestAnswer)
                    isbest = 2;

                Discuz.Data.Bonus.AddLog(topicinfo.Tid, topicinfo.Posterid, winerIdArray[i], winnerNameArray[i], postIdArray[i], bonus, Scoresets.GetBonusCreditsTrans(), isbest);
            }
        }
开发者ID:ZeroneBit,项目名称:dnt3_src,代码行数:34,代码来源:Bonus.cs


示例9: PostReply

 public static bool PostReply(ForumInfo forum, int userid, UserGroupInfo usergroupinfo, TopicInfo topic)
 {
     bool canreply = (usergroupinfo.Radminid == 1);
     //是否有回复的权限
     if (topic.Closed == 0)
     {
         if (userid > -1 && Forums.AllowReplyByUserID(forum.Permuserlist, userid))
         {
             canreply = true;
         }
         else
         {
             if (Utils.StrIsNullOrEmpty(forum.Replyperm)) //权限设置为空时,根据用户组权限判断
             {
                 // 验证用户是否有发表主题的权限
                 if (usergroupinfo.Allowreply == 1)
                     canreply = true;
             }
             else if (Forums.AllowReply(forum.Replyperm, usergroupinfo.Groupid))
                 canreply = true;
         }
     }
     return canreply;
 }
开发者ID:khaliyo,项目名称:DiscuzNT,代码行数:24,代码来源:UserAuthority.cs


示例10: NeedAudit

        /// <summary>
        /// 发回复是否需要审核
        /// </summary>
        /// <param name="forum">主题所在的版块</param>
        /// <param name="useradminid">用户的管理组ID</param>
        ///<param name="topicInfo">所回复的主题信息</param>
        /// <param name="userid">用户ID</param>
        /// <param name="disablepost">是否受灌水限制</param>
        /// <returns>true需要审核;false不需要审核</returns>
        public static bool NeedAudit(ForumInfo forum, int useradminid, TopicInfo topicInfo, int userid, int disablepost, UserGroupInfo userGroup)
        {
            if (useradminid == 1 || Moderators.IsModer(useradminid, userid, forum.Fid))
                return false;
            if (Scoresets.BetweenTime(GeneralConfigs.GetConfig().Postmodperiods))
                return true;
            if (forum.Modnewposts == 1 || userGroup.ModNewPosts == 1)
                return true;
            else if (topicInfo.Displayorder == -2)
                return true;
            return false;

            //bool needaudit = false; //是否需要审核
            //if (Scoresets.BetweenTime(GeneralConfigs.GetConfig().Postmodperiods))
            //{
            //    needaudit = true;
            //}
            //else
            //{
            //    if (forum.Modnewposts == 1 && useradminid != 1)
            //    {
            //        if (useradminid > 1)
            //        {
            //            if (disablepost == 1 && topicInfo.Displayorder != -2)
            //            {
            //                if (useradminid == 3 && !Moderators.IsModer(useradminid, userid, forum.Fid))
            //                    needaudit = true;
            //            }
            //            else
            //                needaudit = true;
            //        }
            //        else
            //            needaudit = true;
            //    }
            //    else if (userGroup.ModNewPosts == 1 && !Moderators.IsModer(useradminid, userid, forum.Fid) && useradminid != 1)
            //        needaudit = true;
            //    else if (useradminid != 1 && topicInfo.Displayorder == -2)
            //        needaudit = true;
            //}
            //return needaudit;
        }
开发者ID:khaliyo,项目名称:DiscuzNT,代码行数:50,代码来源:UserAuthority.cs


示例11: ShowPage

        protected override void ShowPage()
        {
            if (topicid == -1)
            {
                AddErrLine("无效的主题ID");
                return;
            }
            topic = Topics.GetTopicInfo(topicid);
            if (topic == null)
            {
                AddErrLine("不存在的主题ID");
                return;
            }

            topictitle = Utils.StrIsNullOrEmpty(topic.Title) ? "" : topic.Title;
            forumid = topic.Fid;
            ForumInfo forum = Forums.GetForumInfo(forumid);
            pagetitle = Utils.RemoveHtml(forum.Name);
            forumnav = ForumUtils.UpdatePathListExtname(forum.Pathlist.Trim(), config.Extname);

            if (topic.Special != 1)
            {
                AddErrLine("不存在的投票ID");
                return;
            }
            if (usergroupinfo.Allowvote != 1)
            {
                AddErrLine("您当前的身份 \"" + usergroupinfo.Grouptitle + "\" 没有投票的权限");
                return;
            }
            if (Convert.ToDateTime(Polls.GetPollEnddatetime(topic.Tid)).Date < DateTime.Today)
            {
                AddErrLine("投票已经过期");
                return;
            }
            if (userid != -1 && !Polls.AllowVote(topicid, username))
            {
                AddErrLine("你已经投过票");
                return;
            }
            else if (Utils.InArray(topic.Tid.ToString(), ForumUtils.GetCookie("dnt_polled")))
            {
                AddErrLine("你已经投过票");
                return;
            }

            //当未选择任何投票项时
            if(Utils.StrIsNullOrEmpty(DNTRequest.GetString("pollitemid")))
            {
                AddErrLine("您未选择任何投票项!");
                return;
            }
            if (DNTRequest.GetString("pollitemid").Split(',').Length > Polls.GetPollInfo(topicid).Maxchoices)
            {
                AddErrLine("您的投票项多于最大投票数");
                return;
            }
            if (Polls.UpdatePoll(topicid, DNTRequest.GetString("pollitemid"), userid == -1 ? string.Format("{0} [{1}]", usergroupinfo.Grouptitle, DNTRequest.GetIP()) : username) < 0)
            {
                AddErrLine("提交投票信息中包括非法内容");
                return;
            }

            if (userid == -1)  ForumUtils.WriteCookie("dnt_polled", string.Format("{0},{1}", (userid != -1 ? "" : ForumUtils.GetCookie("dnt_polled")), topic.Tid));

            SetUrl(base.ShowTopicAspxRewrite(topicid, 0));
            SetMetaRefresh();
            SetShowBackLink(false);
            MsgForward("poll_succeed");
            AddMsgLine("投票成功, 返回主题");

            CreditsFacade.Vote(userid);
            // 删除主题游客缓存
            ForumUtils.DeleteTopicCacheFile(topicid);           
        }
开发者ID:Vinna,项目名称:DeepInSummer,代码行数:75,代码来源:poll.aspx.cs


示例12: PostTopicSucceed

        /// <summary>
        /// 发帖成功
        /// </summary>
        /// <param name="values">版块积分设置</param>
        /// <param name="topicinfo">主题信息</param>
        /// <param name="topicid">主题ID</param>
        private void PostTopicSucceed(float[] values, TopicInfo topicinfo, int topicid)
        {
            if (values != null) ///使用版块内积分
                UserCredits.UpdateUserExtCredits(userid, values);
            else ///使用默认积分                
                UserCredits.UpdateUserCreditsByPostTopic(userid);

            //当使用伪aspx
            if (config.Aspxrewrite == 1)
                SetUrl(topicinfo.Special == 4 ? ShowDebateAspxRewrite(topicid) : ShowTopicAspxRewrite(topicid, 0));
            else
                SetUrl((topicinfo.Special == 4 ? ShowDebateAspxRewrite(topicid) : ShowTopicAspxRewrite(topicid, 0)) + "&forumpage=" + forumpageid);

            SetMetaRefresh();
            AddMsgLine("发表主题成功, 返回该主题<br />(<a href=\"" + base.ShowForumAspxRewrite(forumid, forumpageid) + "\">点击这里返回 " + forum.Name + "</a>)<br />");
        }
开发者ID:ZeroneBit,项目名称:dnt3_src,代码行数:22,代码来源:posttopic.aspx.cs


示例13: UpdateTopic

		public int UpdateTopic(int tid, TopicInfo __topicinfo)
		{
			IDataParameter[] prams =
						{
							DbHelper.MakeInParam("@tid", (DbType)SqlDbType.Int, 4, tid),
							DbHelper.MakeInParam("@lastpostid", (DbType)SqlDbType.Int, 4, __topicinfo.Lastpostid),
							DbHelper.MakeInParam("@lastposterid", (DbType)SqlDbType.Int, 4, __topicinfo.Lastposterid),
							DbHelper.MakeInParam("@lastpost", (DbType)SqlDbType.DateTime, 8, DateTime.Parse(__topicinfo.Lastpost)),
							DbHelper.MakeInParam("@lastposter", (DbType)SqlDbType.NChar, 20, __topicinfo.Lastposter),
							DbHelper.MakeInParam("@replies", (DbType)SqlDbType.Int, 4, __topicinfo.Replies)
						};
			return DbHelper.ExecuteNonQuery(CommandType.Text, "UPDATE [" + BaseConfigs.GetTablePrefix + "topics] SET [lastpostid] = @lastpostid,[lastposterid] = @lastposterid, [lastpost] = @lastpost, [lastposter] = @lastposter, [replies] = [replies] + @replies WHERE [tid] = @tid", prams);
		}
开发者ID:Vinna,项目名称:DeepInSummer,代码行数:13,代码来源:DataProvider.cs


示例14: ShowPage

        protected override void ShowPage()
        {
            // 获取主题ID
            topicid = DNTRequest.GetInt("topicid", -1);

            forumnav = "";

            // 如果主题ID非数字
            if (topicid == -1)
            {
                AddErrLine("无效的主题ID");

                return;
            }

            // 获取该主题的信息
            topic = Topics.GetTopicInfo(topicid);
            // 如果该主题不存在
            if (topic == null)
            {
                AddErrLine("不存在的主题ID");

                return;
            }

            topictitle = topic.Title;
            forumid = topic.Fid;
            ForumInfo forum = Forums.GetForumInfo(forumid);
            forumname = forum.Name;
            pagetitle = Utils.RemoveHtml(forum.Name);
            forumnav = ForumUtils.UpdatePathListExtname(forum.Pathlist.Trim(), config.Extname);

            if (topic.Special != 1)
            {
                AddErrLine("不存在的投票ID");

                return;
            }

            if (usergroupinfo.Allowvote != 1)
            {
                AddErrLine("您当前的身份 \"" + usergroupinfo.Grouptitle + "\" 没有投票的权限");

                return;
            }

            if (Convert.ToDateTime(Polls.GetPollEnddatetime(topic.Tid)).Date < DateTime.Today)
            {
                AddErrLine("投票已经过期");
                return;
            }
            string polled = string.Empty;
            if (userid != -1)
            {
                if (!Polls.AllowVote(topicid, username))
                {
                    AddErrLine("你已经投过票");

                    return;
                }
            }
            else
            { 
                //写cookie
                polled = ForumUtils.GetCookie(POLLED_COOKIENAME);
                if (Utils.InArray(topic.Tid.ToString(), polled))
                {
                    AddErrLine("你已经投过票");
                    return;
                }                
            }

            //当未选择任何投票项时
            if(Utils.StrIsNullOrEmpty(DNTRequest.GetString("pollitemid")))
            {
                AddErrLine("您未选择任何投票项!");
                return;
            }

            if (Polls.UpdatePoll(topicid, DNTRequest.GetString("pollitemid"), userid == -1 ? string.Format("{0} [{1}]", usergroupinfo.Grouptitle, DNTRequest.GetIP()) : username) < 0)
            {
                AddErrLine("提交投票信息中包括非法内容");
                return;
            }

            if (userid == -1)
            {
                ForumUtils.WriteCookie(POLLED_COOKIENAME, string.Format("{0},{1}", polled, topic.Tid));
            }

            SetUrl(base.ShowTopicAspxRewrite(topicid, 0));
            SetMetaRefresh();
            SetShowBackLink(false);
            if (userid != -1)
            {
                UserCredits.UpdateUserCreditsByVotepoll(userid);
            }
            // 删除主题游客缓存
            ForumUtils.DeleteTopicCacheFile(topicid);

//.........这里部分代码省略.........
开发者ID:ichari,项目名称:ichari,代码行数:101,代码来源:poll.aspx.cs


示例15: CreateTopic

        /// <summary>
        /// 创建主题信息
        /// </summary>
        /// <param name="admininfo"></param>
        /// <param name="postmessage"></param>
        /// <param name="isbonus"></param>
        /// <param name="topicprice"></param>
        /// <returns></returns>
        public TopicInfo CreateTopic(AdminGroupInfo admininfo, string postmessage, bool isbonus, int topicprice)
        {
            TopicInfo topicinfo = new TopicInfo();
            topicinfo.Fid = forumid;
            topicinfo.Iconid = (DNTRequest.GetInt("iconid", 0) < 0 || DNTRequest.GetInt("iconid", 0) > 15) ? 0 :
                                DNTRequest.GetInt("iconid", 0);
            message = Posts.GetPostMessage(usergroupinfo, admininfo, postmessage,
                (TypeConverter.StrToInt(DNTRequest.GetString("htmlon")) == 1));

            topicinfo.Title = (useradminid == 1) ? Utils.HtmlEncode(DNTRequest.GetString("title")) :
                               Utils.HtmlEncode(ForumUtils.BanWordFilter(DNTRequest.GetString("title")));

            if (useradminid != 1 && (ForumUtils.HasBannedWord(topicinfo.Title) || ForumUtils.HasBannedWord(message)))
            {
                AddErrLine("对不起, 您提交的内容包含不良信息, 因此无法提交, 请返回修改!"); return topicinfo;
            }

            topicinfo.Typeid = DNTRequest.GetInt("typeid", 0);
            if (usergroupinfo.Allowsetreadperm == 1)
                topicinfo.Readperm = DNTRequest.GetInt("topicreadperm", 0) > 255 ? 255 : DNTRequest.GetInt("topicreadperm", 0);

            topicinfo.Price = topicprice;
            topicinfo.Poster = username;
            topicinfo.Posterid = userid;
            topicinfo.Postdatetime = curdatetime;
            topicinfo.Lastpost = curdatetime;
            topicinfo.Lastposter = username;
            topicinfo.Displayorder = Topics.GetTitleDisplayOrder(usergroupinfo, useradminid, forum, topicinfo, message, disablepost);

            string htmltitle = DNTRequest.GetString("htmltitle").Trim();
            if (!Utils.StrIsNullOrEmpty(htmltitle) && Utils.HtmlDecode(htmltitle).Trim() != topicinfo.Title)
            {
                //按照  附加位/htmltitle(1位)/magic(3位)/以后扩展(未知位数) 的方式来存储  例: 11001
                topicinfo.Magic = 11000;
            }

            //标签(Tag)操作                
            string tags = DNTRequest.GetString("tags").Trim();
            string[] tagArray = null;
            if (enabletag && !Utils.StrIsNullOrEmpty(tags))
            {
                if (ForumUtils.InBanWordArray(tags))
                {
                    AddErrLine("标签中含有系统禁止词语,请修改");
                    return topicinfo;
                }

                tagArray = Utils.SplitString(tags, " ", true, 2, 10);
                if (tagArray.Length > 0 && tagArray.Length <= 5)
                {
                    if (topicinfo.Magic == 0)
                        topicinfo.Magic = 10000;

                    topicinfo.Magic = Utils.StrToInt(topicinfo.Magic.ToString() + "1", 0);
                }
                else
                {
                    AddErrLine("超过标签数的最大限制或单个标签长度没有介于2-10之间,最多可填写 5 个标签");
                    return topicinfo;
                }
            }

            if (isbonus)
            {
                topicinfo.Special = 2;

                //检查积分是否足够
                if (mybonustranscredits < topicprice && usergroupinfo.Radminid != 1)
                {
                    AddErrLine(string.Format("无法进行悬赏<br /><br />您当前的{0}为 {1} {3}<br/>悬赏需要{0} {2} {3}", bonusextcreditsinfo.Name, mybonustranscredits, topicprice, bonusextcreditsinfo.Unit));
                    return topicinfo;
                }
                else
                    Users.UpdateUserExtCredits(topicinfo.Posterid, Scoresets.GetBonusCreditsTrans(),
                                       -topicprice * (Scoresets.GetCreditsTax() + 1)); //计算税后的实际支付
            }

            if (type == "poll")
                topicinfo.Special = 1;

            if (type == "debate") //辩论帖
                topicinfo.Special = 4;

            if (!Moderators.IsModer(useradminid, userid, forumid))
                topicinfo.Attention = 1;

            if (ForumUtils.IsHidePost(postmessage) && usergroupinfo.Allowhidecode == 1)
                topicinfo.Hide = 1;

            topicinfo.Tid = Topics.CreateTopic(topicinfo);

            canhtmltitle = config.Htmltitle == 1 && Utils.InArray(usergroupid.ToString(), config.Htmltitleusergroup);
//.........这里部分代码省略.........
开发者ID:ZeroneBit,项目名称:dnt3_src,代码行数:101,代码来源:posttopic.aspx.cs


示例16: GetTopicPrice

 /// <summary>
 /// 获取主题价格
 /// </summary>
 /// <param name="topicInfo"></param>
 /// <returns></returns>
 public int GetTopicPrice(TopicInfo topicInfo)
 {
     int price = 0;
     if (topicInfo.Special == 0)//普通主题
     {
         //购买帖子操作
         //判断是否为购买可见帖, price=0为非购买可见(正常), price>0 为购买可见, price=-1为购买可见但当前用户已购买                
         if (topicInfo.Price > 0 && userid != topicInfo.Posterid && ismoder != 1)
         {
             price = topicInfo.Price;
             //时间乘以-1是因为当Configs.GetMaxChargeSpan()==0时,帖子始终为购买帖
             if (PaymentLogs.IsBuyer(topicInfo.Tid, userid) ||
                 (Utils.StrDateDiffHours(topicInfo.Postdatetime, Scoresets.GetMaxChargeSpan()) > 0 &&
                  Scoresets.GetMaxChargeSpan() != 0)) //判断当前用户是否已经购买
             {
                 price = -1;
             }
         }
     }
     return price;
 }
开发者ID:wenysky,项目名称:dnt31-lite,代码行数:26,代码来源:showtopic.aspx.cs


示例17: PostTopicSucceed

        /// <summary>
        /// 发帖成功
        /// </summary>
        /// <param name="values">版块积分设置</param>
        /// <param name="topicinfo">主题信息</param>
        private void PostTopicSucceed(ForumInfo forum, TopicInfo topicinfo)
        {
            CreditsFacade.PostTopic(userid, forum, true);
            int topicid = topicinfo.Tid;

            //当使用伪aspx
            if (config.Aspxrewrite == 1)
                SetUrl(ShowTopicAspxRewrite(topicid, 0));
            else
                SetUrl((ShowTopicAspxRewrite(topicid, 0)) + "&forumpage=" + forumpageid);

            ForumUtils.WriteCookie("postmessage", "");
            ForumUtils.WriteCookie("clearUserdata", "forum");
            SetLastPostedForumCookie();

            SetMetaRefresh();
            MsgForward("posttopic_succeed");
            AddMsgLine("发表主题成功, 返回该主题<br />(<a href=\"" + base.ShowForumAspxRewrite(forumid, forumpageid) + "\">点击这里返回 " + forum.Name + "</a>)<br />");

            //通知应用有新主题
            Sync.NewTopic(topicid.ToString(), topicinfo.Title, topicinfo.Poster, topicinfo.Posterid.ToString(), topicinfo.Fid.ToString(), "");
        }
开发者ID:Vinna,项目名称:DeepInSummer,代码行数:27,代码来源:posttopic.aspx.cs


示例18: ShowPage

        protected override void ShowPage()
        {
            if (postid == -1)
            {
                AddErrLine("无效的帖子ID");
                return;
            }

            // 获取该帖子的信息
            post = Posts.GetPostInfo(topicid, postid);
            if (post == null)
            {
                AddErrLine("不存在的帖子ID");
                return;
            }
            // 获取该主题的信息
            topic = Topics.GetTopicInfo(topicid);
            if (topic == null)
            {
                AddErrLine("不存在的主题ID");
                return;
            }
            if (topicid != post.Tid)
            {
                AddErrLine("主题ID无效");
                return;
            }

            topictitle = topic.Title;
            forumid = topic.Fid;
            forum = Forums.GetForumInfo(forumid);
            forumname = forum.Name;
            pagetitle = string.Format("删除{0}", post.Title);
            forumnav = ShowForumAspxRewrite(forum.Pathlist.Trim(), forumid, forumpageid);

            if (!CheckPermission(post,DNTRequest.GetInt("opinion", -1)))  return;

            if (!allowDelPost)
            {
                AddErrLine("当前不允许删帖");
                return;
            }

            // 通过验证的用户可以删除帖子,如果是主题帖则另处理
            if (post.Layer == 0)
            {
                TopicAdmins.DeleteTopics(topicid.ToString(), byte.Parse(forum.Recyclebin.ToString()), false);
                //重新统计论坛帖数
                Forums.SetRealCurrentTopics(forum.Fid);
                ForumTags.DeleteTopicTags(topicid);
            }
            else
            {
                int reval;
                if (topic.Special == 4)
                {
                    if (DNTRequest.GetInt("opinion", -1) != 1 && DNTRequest.GetInt("opinion", -1) != 2)
                    {
                        AddErrLine("参数错误");
                        return;
                    }
                    reval = Posts.DeletePost(Posts.GetPostTableId(topicid), postid, false, true);
                    Debates.DeleteDebatePost(topicid, DNTRequest.GetInt("opinion", -1), postid);
                }
                else
                    reval = Posts.DeletePost(Posts.GetPostTableId(topicid), postid, false, true);

                Posts.RemoveShowTopicCache(topicid.ToString());

                // 删除主题游客缓存
                ForumUtils.DeleteTopicCacheFile(topicid);
                //再次确保回复数精确
                Topics.UpdateTopicReplyCount(topic.Tid);
                //更新指定版块的最新发帖数信息
                Forums.UpdateLastPost(forum);

                if (reval > 0 && Utils.StrDateDiffHours(post.Postdatetime, config.Losslessdel * 24) < 0)
                    UserCredits.UpdateUserCreditsByPosts(post.Posterid, -1);
            }

            SetUrl(post.Layer == 0 ? base.ShowForumAspxRewrite(post.Fid, 0) : Urls.ShowTopicAspxRewrite(post.Tid, 1));
            SetMetaRefresh();
            SetShowBackLink(false);
            AddMsgLine("删除帖子成功, 返回主题");
        }
开发者ID:wenysky,项目名称:dnt31-lite,代码行数:85,代码来源:delpost.aspx.cs


示例19: BindTitle


//.........这里部分代码省略.........
                        {
                            AddErrLine("您没有选择要评分的帖子.");
                            return false;
                        }
                        poster = postinfo.Poster;
                        if (postinfo.Posterid == userid)
                        {
                            AddErrLine("您不能对自已的帖子评分.");
                            return false;
                        }
                        title = postinfo.Title;
                        topiclist = postinfo.Tid.ToString();
                        break;
                        #endregion
                    }
                case "cancelrate":
                    {
                        #region 取消评分
                        operationtitle = "撤销评分";
                        PostInfo postinfo = Posts.GetPostInfo(Utils.StrToInt(topiclist, 0), Utils.StrToInt(postidlist, 0));
                        if (postinfo == null)
                        {
                            AddErrLine("您没有选择要撤消评分的帖子");
                            return false;
                        }
                        if (!ismoder)
                        {
                            AddErrLine("您的身份 \"" + usergroupinfo.Grouptitle + "\" 没有撤消评分的权限.");
                            return false;
                        }

                        poster = postinfo.Poster;
                        title = postinfo.Title;
                        topiclist = postinfo.Tid.ToString();

                        ratelogcount = AdminRateLogs.RecordCount("pid = " + postidlist);
                        ratelog = AdminRateLogs.LogList(ratelogcount, 1, "pid = " + postidlist);
                        ratelog.Columns.Add("extcreditname", Type.GetType("System.String"));
                        DataTable scorePaySet = Scoresets.GetScoreSet();

                        //绑定积分名称属性
                        foreach (DataRow dr in ratelog.Rows)
                        {
                            int extcredits = Utils.StrToInt(dr["extcredits"].ToString(), 0);
                            if ((extcredits > 0) && (extcredits < 9) || scorePaySet.Columns.Count > extcredits + 1)
                                dr["extcreditname"] = scorePaySet.Rows[0][extcredits + 1].ToString();
                            else
                                dr["extcreditname"] = "";
                        }
                        break;
                        #endregion
                    }
                case "bonus":
                    {
                        #region 悬赏
                        operationtitle = "结帖";
                        int tid = Utils.StrToInt(topiclist, 0);
                        postlist = Posts.GetPostListTitle(tid);
                        if (postlist != null)
                        {
                            if (postlist.Rows.Count > 0)
                            {
                                postlist.Rows[0].Delete();
                                postlist.AcceptChanges();
                            }
                        }

                        if (postlist.Rows.Count == 0)
                        {
                            AddErrLine("无法对没有回复的悬赏进行结帖.");
                            return false;
                        }

                        topicinfo = Topics.GetTopicInfo(tid);
                        if (topicinfo.Special == 3)
                        {
                            AddErrLine("本主题的悬赏已经结束.");
                            return false;
                        }
                        break;
                        #endregion
                    }
                case "delete": operationtitle = "删除主题"; break;
                case "move": operationtitle = "移动主题"; break;
                case "type": operationtitle = "主题分类"; break;
                case "highlight": operationtitle = "高亮显示"; break;
                case "close": operationtitle = "关闭/打开主题"; break;
                case "displayorder": operationtitle = "置顶/解除置顶"; break;
                case "digest": operationtitle = "加入/解除精华 "; break;
                case "copy": operationtitle = "复制主题"; break;
                case "merge": operationtitle = "合并主题"; break;
                case "bump": operationtitle = "提升/下沉主题"; break;
                case "repair": operationtitle = "修复主题"; break;
                case "delposts": operationtitle = "批量删帖"; break;
                case "banpost": operationtitle = "单帖屏蔽"; break;
                case "identify": operationtitle = "鉴定主题"; break;
                default: operationtitle = "未知操作"; break;
            }
            return true;
        }
开发者ID:wenysky,项目名称:dnt31-lite,代码行数:101,代码来源:topicadmin.aspx.cs


示例20: DoBonusOperation

该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Entity.UserGroupInfo类代码示例发布时间:2022-05-24
下一篇:
C# Entity.PostpramsInfo类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap