Example #1
0
        //public static Int32 GetTopicCount(Int32 fid)
        //{
        //    return BBX.Data.Topics.GetTopicCount(fid);
        //}

        //public static Int32 GetTopicCount(Int32 fid, bool includeClosedTopic, string condition)
        //{
        //    return BBX.Data.Topics.GetTopicCount(fid, includeClosedTopic, condition);
        //}

        //public static Int32 GetTopicCount(string condition)
        //{
        //    return BBX.Data.Topics.GetTopicCount(condition);
        //}

        //public static Int32 UpdateTopicModerated(string topiclist, Int32 moderated)
        //{
        //	return BBX.Data.Topics.UpdateTopicModerated(topiclist, moderated);
        //}

        //public static Int32 UpdateTopic(TopicInfo topicinfo)
        //{
        //    //if (((Topics.mcci != null && Topics.mcci.ApplyMemCached) || (Topics.rci != null && Topics.rci.ApplyRedis)) && topicinfo.Displayorder > 0)
        //    //{
        //    //    if (topicinfo.Displayorder == 1)
        //    //    {
        //    //        DNTCache.Current.RemoveObject("/Forum/ShowTopic/TopList/" + topicinfo.Fid + "/");
        //    //    }
        //    //    else
        //    //    {
        //    //        foreach (ForumInfo current in Forums.GetForumList())
        //    //        {
        //    //            if (current.Layer > 0)
        //    //            {
        //    //                DNTCache.Current.RemoveObject("/Forum/ShowTopic/TopList/" + current.Fid + "/");
        //    //            }
        //    //        }
        //    //    }
        //    //}
        //    if (topicinfo == null)
        //    {
        //        return 0;
        //    }
        //    return BBX.Data.Topics.UpdateTopic(topicinfo);
        //}

        //public static bool InSameForum(string topicidlist, Int32 fid)
        //{
        //	return Utils.SplitString(topicidlist, ",").Length == BBX.Data.Topics.GetTopicCountInForumAndTopicIdList(topicidlist, fid);
        //}

        //public static Int32 UpdateTopicHide(Int32 tid)
        //{
        //    return BBX.Data.Topics.UpdateTopicHide(tid);
        //}

        //public static DataTable GetTopicList(Int32 forumid, Int32 pageid, Int32 tpp)
        //{
        //    return BBX.Data.Topics.GetTopicList(forumid, pageid, tpp);
        //}

        //public static DataTable GetTopicTypeName(DataTable topiclist)
        //{
        //	DataColumn dataColumn = new DataColumn();
        //	dataColumn.ColumnName = "topictypename";
        //	dataColumn.DataType = typeof(String);
        //	dataColumn.DefaultValue = "";
        //	dataColumn.AllowDBNull = true;
        //	topiclist.Columns.Add(dataColumn);
        //	var topicTypeArray = TopicType.GetTopicTypeArray();
        //	foreach (DataRow dataRow in topiclist.Rows)
        //	{
        //		object obj = topicTypeArray[Int32.Parse(dataRow["typeid"].ToString())];
        //		dataRow["topictypename"] = ((obj != null && obj.ToString().IsNullOrEmpty()) ? ("[" + obj.ToString().Trim() + "]") : "");
        //	}
        //	return topiclist;
        //}

        public static List <Topic> GetTopicsByReplyUserId(Int32 userId, Int32 pageIndex, Int32 pageSize, Int32 newmin, Int32 hot)
        {
            if (pageIndex < 1)
            {
                pageIndex = 1;
            }
            var topicListByReplyUserId = Topic.GetTopicListByReplyUserId(userId, pageIndex, pageSize);

            foreach (var current in topicListByReplyUserId)
            {
                //Topics.LoadTopicForumName(current);
                Topics.LoadTopicFolder(0, newmin, hot, current);
                //Topics.LoadTopicHighlightTitle(current);
            }
            return(topicListByReplyUserId);
        }
Example #2
0
        //public static List<TopicInfo> GetUnauditNewTopic(string forumidlist, Int32 tpp, Int32 pageid, Int32 filter)
        //{
        //    List<TopicInfo> unauditNewTopic = BBX.Data.Topics.GetUnauditNewTopic(forumidlist, tpp, pageid, filter);
        //    foreach (TopicInfo current in unauditNewTopic)
        //    {
        //        current.Forumname = Forums.GetForumInfo(current.Fid).Name;
        //    }
        //    return unauditNewTopic;
        //}

        //public static List<TopicInfo> GetMyUnauditTopic(Int32 posterId, Int32 tpp, Int32 pageId, Int32 filter)
        //{
        //	List<TopicInfo> myUnauditTopic = BBX.Data.Topics.GetMyUnauditTopic(posterId, tpp, pageId, filter);
        //	foreach (TopicInfo current in myUnauditTopic)
        //	{
        //		current.Forumname = Forums.GetForumInfo(current.Fid).Name;
        //	}
        //	return myUnauditTopic;
        //}

        //public static Int32 GetAttentionTopicCount(string fidlist, string keyword)
        //{
        //    if (!Utils.IsNumericList(fidlist))
        //    {
        //        return 0;
        //    }
        //    return BBX.Data.Topics.GetAttentionTopicCount(fidlist, keyword);
        //}

        //public static Int32 GetUnauditNewTopicCount(string fidlist, Int32 filter)
        //{
        //    if (!Utils.IsNumericList(fidlist))
        //    {
        //        return 0;
        //    }
        //    return BBX.Data.Topics.GetUnauditNewTopicCount(fidlist, filter);
        //}

        //public static Int32 GetMyUnauditTopicCount(Int32 posterid, Int32 filter)
        //{
        //    return BBX.Data.Topics.GetMyUnauditTopicCount(posterid, filter);
        //}

        public static List <Topic> GetTopicsByUserId(Int32 userId, Int32 pageIndex, Int32 pageSize, Int32 newmin, Int32 hot)
        {
            if (pageIndex < 1)
            {
                pageIndex = 1;
            }
            //var list = BBX.Data.Topics.GetTopicsByUserId(userId, pageIndex, pageSize);
            var list = Topic.FindAllByPosterID(userId, pageIndex, pageSize);

            foreach (var current in list)
            {
                //Topics.LoadTopicForumName(current);
                //Topics.LoadTopicHighlightTitle(current);
                Topics.LoadTopicFolder(0, newmin, hot, current);
            }
            return(list);
        }