/// <summary> /// 删除回收站过期的主题 /// </summary> /// <param name="recycleDay">过期天数</param> public static void DeleteRecycleTopic(int recycleDay) { string topicList = ""; DataTable dt = Data.Topics.GetTidForModeratorManageLogByPostDateTime(DateTime.Now.AddDays(-recycleDay)); if (dt.Rows.Count > 0) { foreach (DataRow dr in dt.Rows) { topicList += dr["tid"].ToString() + ","; } TopicAdmins.DeleteTopics(topicList.Trim(','), 0, false); } }
//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); }
/// <summary> /// 加载主题列表附加信息 /// </summary> /// <param name="fid">板块ID</param> /// <param name="autocloseTime">自动关闭时间</param> /// <param name="topicTypePrefix">主题分类前缀</param> /// <param name="list">主题列表</param> private static void LoadTopicListExtraInfo(int autoCloseTime, int topicTypePrefix, int newMinutes, int hotReplyNumber, Discuz.Common.Generic.List <TopicInfo> list) { SortedList <int, string> topicTypeList = Caches.GetTopicTypeArray(); StringBuilder closedIds = new StringBuilder(); foreach (TopicInfo topic in list) { if (topic.Closed == 0 && autoCloseTime > 0 && Utils.StrDateDiffHours(topic.Postdatetime, autoCloseTime * 24) > 0) { closedIds.Append(topic.Tid.ToString()); closedIds.Append(","); } LoadTopicFolder(autoCloseTime, newMinutes, hotReplyNumber, topic); LoadTopicHighlightTitle(topic); LoadTopicType(topicTypePrefix, topicTypeList, topic); } if (closedIds.Length > 0) { TopicAdmins.SetClose(closedIds.ToString().TrimEnd(','), 1); } }
/// <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); }