Exemplo n.º 1
0
        /// <summary>
        /// 设置待验证的主题,包括通过,忽略,删除等操作
        /// </summary>
        /// <param name="postTableId">回复表ID</param>
        /// <param name="ignore">忽略的主题列表</param>
        /// <param name="validate">验证通过的主题列表</param>
        /// <param name="delete">删除的主题列表</param>
        /// <param name="fidlist">版块列表</param>
        public static void PassAuditNewTopic(string postTableId, string ignore, string validate, string delete, string fidlist)
        {
            if (!Utils.IsNumeric(postTableId) ||
                (!string.IsNullOrEmpty(ignore) && !Utils.IsNumericList(ignore)) ||
                (!string.IsNullOrEmpty(validate) && !Utils.IsNumericList(validate)) ||
                (!string.IsNullOrEmpty(delete) && !Utils.IsNumericList(delete)) ||
                (!string.IsNullOrEmpty(fidlist) && !Utils.IsNumericList(fidlist)))
            {
                return;
            }
            Data.Topics.PassAuditNewTopic(postTableId, ignore, validate, delete, fidlist);

            //获取验证通过的主题列表信息,为用户增加发主题的扩展积分
            if (!string.IsNullOrEmpty(validate))
            {
                foreach (DataRow topicInfo in Topics.GetTopicList(validate).Rows)
                {
                    CreditsFacade.PostTopic(TypeConverter.ObjectToInt(topicInfo["posterid"]),
                                            Forums.GetForumInfo(TypeConverter.ObjectToInt(topicInfo["fid"])));
                    //ForumInfo forumInfo = Forums.GetForumInfo(TypeConverter.ObjectToInt(topicInfo["fid"]));//获取主题的版块信息
                    //float[] forumPostcredits = Forums.GetValues(forumInfo.Postcredits);
                    //if (forumPostcredits != null) //使用版块内积分
                    //    UserCredits.UpdateUserCreditsByPostTopic(TypeConverter.ObjectToInt(topicInfo["posterid"]), forumPostcredits);
                    //else //使用默认积分
                    //    UserCredits.UpdateUserCreditsByPostTopic(TypeConverter.ObjectToInt(topicInfo["posterid"]));
                }
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 通过待验证的主题
        /// </summary>
        /// <param name="postTableId">当前帖子分表Id</param>
        /// <param name="tid">主题Id</param>
        public static void PassAuditNewTopic(string tidList)
        {
            //string[] tidarray = tidList.Split(',');
            //float[] values = null;
            //ForumInfo forum = null;
            //TopicInfo topic = null;
            //int fid = -1;
            foreach (string tid in tidList.Split(','))
            {
                TopicInfo topic = Topics.GetTopicInfo(int.Parse(tid));    //获取主题信息
                CreditsFacade.PostTopic(topic.Posterid, Forums.GetForumInfo(topic.Fid));
                //if (fid != topic.Fid)    //当上一个和当前主题不在一个版块内时,重新读取版块的积分设置
                //{
                //    fid = topic.Fid;
                //    forum = Discuz.Forum.Forums.GetForumInfo(fid);
                //    if (!forum.Postcredits.Equals(""))
                //    {
                //        int index = 0;
                //        float tempval = 0;
                //        values = new float[8];
                //        foreach (string ext in Utils.SplitString(forum.Postcredits, ","))
                //        {
                //            if (index == 0)
                //            {
                //                if (!ext.Equals("True"))
                //                {
                //                    values = null;
                //                    break;
                //                }
                //                index++;
                //                continue;
                //            }
                //            tempval = Utils.StrToFloat(ext, 0);
                //            values[index - 1] = tempval;
                //            index++;
                //            if (index > 8)
                //            {
                //                break;
                //            }
                //        }
                //    }
                //}

                //if (values != null) //使用版块内积分
                //    UserCredits.UpdateUserCreditsByPostTopic(topic.Posterid, values);
                //else //使用默认积分
                //    UserCredits.UpdateUserCreditsByPostTopic(topic.Posterid);
            }

            Data.Topics.PassAuditNewTopic(PostTables.GetPostTableId(), tidList);
        }