Example #1
0
        /// <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
        }
Example #2
0
 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);
 }
Example #3
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);
 }
Example #4
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);
 }
Example #5
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);
 }
Example #6
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);
 }
Example #7
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);
 }