Exemple #1
0
 /// <summary>
 /// 修改表情
 /// </summary>
 /// <param name="id">表情Id</param>
 /// <param name="displayorder">显示顺序</param>
 /// <param name="type">分类</param>
 /// <param name="code">快捷编码</param>
 /// <param name="url">图片地址</param>
 /// <param name="adminUid">管理员Id</param>
 /// <param name="adminUserName">管理员用户名</param>
 /// <param name="adminUserGruopId">管理员用户组Id</param>
 /// <param name="adminUserGroupTitle">管理员用户组名称</param>
 /// <param name="adminIp">管理员IP</param>
 public static void UpdateSmilies(int id, int displayOrder, int type, string code, string url, int adminUid, string adminUserName, int adminUserGruopId,
                                  string adminUserGroupTitle, string adminIp)
 {
     Discuz.Data.Smilies.UpdateSmilies(id, displayOrder, type, code);
     ResetCacheObjectAboutSmilies();
     AdminVistLogs.InsertLog(adminUid, adminUserName, adminUserGruopId, adminUserGroupTitle, adminIp, "表情文件修改", code);
 }
Exemple #2
0
 /// <summary>
 /// 创建表情
 /// </summary>
 /// <param name="displayorder">显示顺序</param>
 /// <param name="type">分类</param>
 /// <param name="code">快捷编码</param>
 /// <param name="url">图片地址</param>
 /// <param name="adminUid">管理员Id</param>
 /// <param name="adminUserName">管理员用户名</param>
 /// <param name="adminUserGruopId">管理员用户组Id</param>
 /// <param name="adminUserGroupTitle">管理员用户组名称</param>
 /// <param name="adminIp">管理员IP</param>
 public static void CreateSmilies(int displayOrder, int type, string code, string url, int adminUid, string adminUserName, int adminUserGruopId,
                                  string adminUserGroupTitle, string adminIp)
 {
     Discuz.Data.Smilies.CreateSmilies(Smilies.GetMaxSmiliesId(), displayOrder, type, code, url);
     ResetCacheObjectAboutSmilies();
     AdminVistLogs.InsertLog(adminUid, adminUserName, adminUserGruopId, adminUserGroupTitle, adminIp, "表情文件添加", code);
 }
Exemple #3
0
        //public static DataTable GetUnauditNewTopic()
        //{
        //    return Discuz.Data.Topics.GetUnauditNewTopic();
        //}

        /// <summary>
        /// 获取未审核的帖子
        /// </summary>
        /// <param name="currentPostTableId">分表ID</param>
        /// <returns></returns>
        //public static DataTable GetUnauditPost(int currentPostTableId)
        //{
        //    return Discuz.Data.Posts.GetUnauditPost(currentPostTableId);
        //}

        /// <summary>
        /// 批量移动主题
        /// </summary>
        /// <param name="tidList">移动的主题Id列表</param>
        /// <param name="targetForumId">目标版块Id</param>
        /// <param name="adminUid">管理员Uid</param>
        /// <param name="adminUserName">管理员用户名</param>
        /// <param name="adminUserGroupId">管理员用户组Id</param>
        /// <param name="adminUserGroupTitle">管理员用户组名称</param>
        /// <param name="adminIp">管理员Ip</param>
        public static void BatchMoveTopics(string tidList, int targetForumId, int adminUid, string adminUserName, int adminUserGroupId, string adminUserGroupTitle, string adminIp)
        {
            //先找出当前主题列表中所属的FID
            foreach (DataRow olddr in Data.Topics.GetTopicFidByTid(tidList).Rows)
            {
                string oldtidlist = "0";
                //以FID和列表为条件列出在当前FID下的主题列表
                foreach (DataRow mydr in Data.Topics.GetTopicTidByFid(tidList, int.Parse(olddr["fid"].ToString())).Rows)
                {
                    oldtidlist += "," + mydr["tid"].ToString();
                }
                //调用前台操作函数,后台暂时不支持移动主题定义主题分类
                TopicAdmins.MoveTopics(oldtidlist, targetForumId, Convert.ToInt16(olddr["fid"].ToString()), 0);
            }
            AdminVistLogs.InsertLog(adminUid, adminUserName, adminUserGroupId, adminUserGroupTitle, adminIp, "批量移动主题", "主题ID:" + tidList + " <br />目标论坛fid:" + targetForumId);
        }
Exemple #4
0
        /// <summary>
        /// 向版块列表中插入新的版块信息
        /// </summary>
        /// <param name="foruminfo"></param>
        /// <param name="moderatorsInfo">版主信息</param>
        /// <param name="adminUid">管理员Id</param>
        /// <param name="adminUserName">管理员用户名</param>
        /// <param name="adminUserGruopId">管理员用户组Id</param>
        /// <param name="adminUserGroupTitle">管理员用户组名称</param>
        /// <param name="adminIp">管理员IP</param>
        /// <returns></returns>
        public static int CreateForums(ForumInfo forumInfo, out string moderatorsInfo, int adminUid, string adminUserName, int adminUserGruopId, string adminUserGroupTitle, string adminIp)
        {
            int fid = Data.Forums.CreateForumInfo(forumInfo);

            SetForumsPathList();
            moderatorsInfo = SetForumsModerators(fid.ToString(), forumInfo.Moderators, forumInfo.Inheritedmod).Replace("'", "’");
            DNTCache.GetCacheService().RemoveObject("/Forum/UI/ForumListBoxOptions");
            DNTCache.GetCacheService().RemoveObject("/Forum/ForumList");
            DNTCache.GetCacheService().RemoveObject("/Aggregation/HotForumList");
            DNTCache.GetCacheService().RemoveObject("/Aggregation/ForumHotTopicList");
            DNTCache.GetCacheService().RemoveObject("/Aggregation/ForumNewTopicList");
            DNTCache.GetCacheService().RemoveObject("/Forum/DropdownOptions");
            DNTCache.GetCacheService().RemoveObject("/Forum/ForumListMenuDiv");
            AdminVistLogs.InsertLog(adminUid, adminUserName, adminUserGruopId, adminUserGroupTitle, adminIp, "添加论坛版块", "添加论坛版块,名称为:" + forumInfo.Name);
            return(fid);
        }
        /// <summary>
        /// 将模板从数据库中移除
        /// </summary>
        /// <param name="templateIdList">要移除的模板Id列表</param>
        /// <param name="uid">操作者的Uid</param>
        /// <param name="userName">操作者的用户名</param>
        /// <param name="groupId">操作者的组Id</param>
        /// <param name="groupTitle">操作者的组名称</param>
        /// <param name="ip">操作者的Ip</param>
        public static void RemoveTemplateInDB(string templateIdList, int uid, string userName, int groupId, string groupTitle, string ip)
        {
            #region 移除模板
            GeneralConfigInfo configInfo = GeneralConfigs.GetConfig();
            if (("," + templateIdList + ",").IndexOf("," + configInfo.Templateid + ",") >= 0) //当要删除的模板是系统的默认模板时
            {
                configInfo.Templateid = 1;
            }

            GeneralConfigs.Serialiaze(configInfo, Utils.GetMapPath("../../config/general.config"));

            Data.Forums.UpdateForumAndUserTemplateId(templateIdList);
            Data.Templates.DeleteTemplateItem(templateIdList);

            Discuz.Cache.DNTCache.GetCacheService().RemoveObject("/Forum/TemplateList");
            Discuz.Cache.DNTCache.GetCacheService().RemoveObject("/Forum/TemplateIDList");
            Discuz.Cache.DNTCache.GetCacheService().RemoveObject("/Forum/UI/TemplateListBoxOptionsForForumIndex");
            Discuz.Cache.DNTCache.GetCacheService().RemoveObject("/Forum/UI/TemplateListBoxOptions");
            AdminVistLogs.InsertLog(uid, userName, groupId, groupTitle, ip, "从数据库中删除模板文件", "ID为:" + templateIdList);
            #endregion
        }
 public static void DeleteTemplate(string templateIdList, int uid, string userName, int groupId, string groupTitle, string ip)
 {
     RemoveTemplateInDB(templateIdList, uid, userName, groupId, groupTitle, ip);
     foreach (string templateid in templateIdList.Split(','))
     {
         string foldername = DNTRequest.GetString("temp" + templateid);
         if (foldername == "")
         {
             continue;
         }
         string folderpath = Utils.GetMapPath(@"..\..\templates\" + foldername);
         if (Directory.Exists(folderpath))
         {
             Directory.Delete(folderpath, true);
         }
         string folderaspx = Utils.GetMapPath(@"..\..\aspx\" + templateid);
         if (Directory.Exists(folderaspx))
         {
             Directory.Delete(folderaspx, true);
         }
     }
     AdminVistLogs.InsertLog(uid, userName, groupId, groupTitle, ip, "从模板库中删除模板文件", "ID为:" + templateIdList);
 }
Exemple #7
0
 /// <summary>
 /// 批量删除主题附件
 /// </summary>
 /// <param name="tidList">主题Id列表</param>
 /// <param name="adminUid">管理员Uid</param>
 /// <param name="adminUserName">管理员用户名</param>
 /// <param name="adminUserGroupId">管理员用户组Id</param>
 /// <param name="adminUserGroupTitle">管理员用户组名称</param>
 /// <param name="adminIp">管理员Ip</param>
 public static void BatchDeleteTopicAttachs(string tidList, int adminUid, string adminUserName, int adminUserGroupId, string adminUserGroupTitle, string adminIp)
 {
     Attachments.DeleteAttachmentByTid(tidList);
     AdminVistLogs.InsertLog(adminUid, adminUserName, adminUserGroupId, adminUserGroupTitle, adminIp, "删除主题中的附件", "主题ID:" + tidList);
 }
Exemple #8
0
 /// <summary>
 /// 批量设置主题精华
 /// </summary>
 /// <param name="tidList">主题Id列表</param>
 /// <param name="digestLevel">精华级别</param>
 /// <param name="adminUid">管理员Uid</param>
 /// <param name="adminUserName">管理员用户名</param>
 /// <param name="adminUserGroupId">管理员用户组Id</param>
 /// <param name="adminUserGroupTitle">管理员用户组名称</param>
 /// <param name="adminIp">管理员Ip</param>
 public static void BatchChangeTopicsDigest(string tidList, int digestLevel, int adminUid, string adminUserName, int adminUserGroupId, string adminUserGroupTitle, string adminIp)
 {
     TopicAdmins.SetDigest(tidList, digestLevel);
     AdminVistLogs.InsertLog(adminUid, adminUserName, adminUserGroupId, adminUserGroupTitle, adminIp, "批量加精主题", "主题ID:" + tidList + "<br /> 加精级为:" + digestLevel);
 }
Exemple #9
0
 /// <summary>
 /// 批量主题置顶
 /// </summary>
 /// <param name="tidList">主题Id列表</param>
 /// <param name="displayOrder">置顶级别</param>
 /// <param name="adminUid">管理员Uid</param>
 /// <param name="adminUserName">管理员用户名</param>
 /// <param name="adminUserGroupId">管理员用户组Id</param>
 /// <param name="adminUserGroupTitle">管理员用户组名称</param>
 /// <param name="adminIp">管理员Ip</param>
 public static void BatchChangeTopicsDisplayOrderLevel(string tidList, int displayOrderLevel, int adminUid, string adminUserName, int adminUserGroupId, string adminUserGroupTitle, string adminIp)
 {
     Data.Topics.SetDisplayorder(tidList, displayOrderLevel);
     AdminVistLogs.InsertLog(adminUid, adminUserName, adminUserGroupId, adminUserGroupTitle, adminIp, "批量置顶主题", "主题ID:" + tidList + "<br /> 置顶级为:" + displayOrderLevel);
 }
Exemple #10
0
 /// <summary>
 /// 批量删除主题
 /// </summary>
 /// <param name="tidList">主题Id列表</param>
 /// <param name="isChagePostNumAndCredits">是否要更新用户的主题数与积分</param>
 /// <param name="adminUid">管理员Uid</param>
 /// <param name="adminUserName">管理员用户名</param>
 /// <param name="adminUserGroupId">管理员用户组Id</param>
 /// <param name="adminUserGroupTitle">管理员用户组名称</param>
 /// <param name="adminIp">管理员Ip</param>
 public static void BatchDeleteTopics(string tidList, bool isChagePostNumAndCredits, int adminUid, string adminUserName, int adminUserGroupId, string adminUserGroupTitle, string adminIp)
 {
     DeleteTopics(tidList, isChagePostNumAndCredits ? 1 : 0, false);
     Attachments.UpdateTopicAttachment(tidList);
     AdminVistLogs.InsertLog(adminUid, adminUserName, adminUserGroupId, adminUserGroupTitle, adminIp, "批量删除主题", "主题ID:" + tidList);
 }
Exemple #11
0
 /// <summary>
 /// 删除表情
 /// </summary>
 /// <param name="idList">表情Id列表</param>
 /// <param name="adminUid">管理员Id</param>
 /// <param name="adminUserName">管理员用户名</param>
 /// <param name="adminUserGruopId">管理员用户组Id</param>
 /// <param name="adminUserGroupTitle">管理员用户组名称</param>
 /// <param name="adminIp">管理员IP</param>
 public static void DeleteSmilies(string idList, int adminUid, string adminUserName, int adminUserGruopId, string adminUserGroupTitle, string adminIp)
 {
     Discuz.Data.Smilies.DeleteSmilies(idList);
     ResetCacheObjectAboutSmilies();
     AdminVistLogs.InsertLog(adminUid, adminUserName, adminUserGruopId, adminUserGroupTitle, adminIp, "表情文件删除", "ID:" + idList);
 }