Ejemplo n.º 1
0
        /// <summary>
        /// 更新当前已设置为指定版块版主的相关用户信息.
        /// </summary>
        /// <param name="moderators">相关要设置的版主名称(注:用","号分割)</param>
        /// <returns>返回不存在用户的字符串</returns>
        public static string UpdateUserInfoWithModerator(string moderators)
        {
            moderators = moderators == null ? "" : moderators;
            string    usernamenoexsit = "";
            DataTable dt = new DataTable();

            foreach (string moderator in moderators.Split(','))
            {
                if (moderator != "")
                {
                    //当用户名是系统保留的用户名,请您输入其它的用户名
                    if (PrivateMessages.SystemUserName == moderator)
                    {
                        continue;
                    }

                    dt = DatabaseProvider.GetInstance().GetModeratorInfo(moderator);
                    if (dt.Rows.Count > 0)
                    {
                        int groupid = Convert.ToInt32(dt.Rows[0]["groupid"].ToString());
                        if ((groupid <= 3) && (groupid > 0))
                        {
                            continue;                                                          //当为管理员,超级版主,版主时
                        }
                        else
                        {
                            int radminid = DatabaseProvider.GetInstance().GetRadminidByGroupid(groupid);
                            if (radminid <= 0)
                            {
                                DatabaseProvider.GetInstance().SetModerator(moderator);
                            }
                            else
                            {
                                continue;
                            }
                        }
                    }
                    else
                    {
                        usernamenoexsit = usernamenoexsit + moderator + ",";
                    }
                }
            }

            AdminCaches.ReSetModeratorList();

            return(usernamenoexsit);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 向版主列表中插入相关的版主信息
 /// </summary>
 /// <param name="fid">指定的论坛版块</param>
 /// <param name="moderators">相关要设置的版主名称(注:用","号分割)</param>
 /// <param name="displayorder">显示顺序</param>
 /// <param name="inherited">是否使用继承机制</param>
 public static void InsertForumsModerators(string fid, string moderators, int displayorder, int inherited)
 {
     moderators = moderators == null ? "" : moderators;
     DatabaseProvider.GetInstance().InsertForumsModerators(fid, moderators, displayorder, inherited);
     AdminCaches.ReSetModeratorList();
 }