Beispiel #1
0
 /// <summary>
 /// 编辑主题(简易方法,客户端不适用)
 /// </summary>
 /// <param name="tid">帖子ID</param>
 /// <param name="topic">Topic类型的对象</param>
 /// <returns></returns>
 public TopicEditResponse EditTopic(int tid, Topic topic)
 {
     return EditTopic(tid, Util.RemoveJsonNull(Newtonsoft.Json.JavaScriptConvert.SerializeObject(topic)));
 }
Beispiel #2
0
        /// <summary>
        /// 创建主题
        /// </summary>
        /// <param name="uid">指定用户ID,0为当前登录用户ID</param>
        /// <param name="title">标题</param>
        /// <param name="fid">版块ID</param>
        /// <param name="message">主题内容</param>
        /// <param name="icon_id">图标编号</param>
        /// <param name="tags">标签,半角逗号分隔</param>
        /// <returns></returns>
        public TopicCreateResponse CreateTopic(int uid, string title, int fid, string message, int icon_id, string tags, int typeid)
        {

            Topic topic = new Topic();

            topic.UId = uid == 0 ? (int)session_info.UId : uid;
            topic.Title = title;
            topic.Fid = fid;
            topic.Message = message;
            topic.Iconid = icon_id;
            topic.Tags = tags;
            topic.Typeid = typeid;

            List<DiscuzParam> param_list = new List<DiscuzParam>();

            if (uid == 0)
            {
                param_list.Add(DiscuzParam.Create("session_key", session_info.SessionKey));
            }

            param_list.Add(DiscuzParam.Create("topic_info", Newtonsoft.Json.JavaScriptConvert.SerializeObject(topic)));
            TopicCreateResponse tcr = util.GetResponse<TopicCreateResponse>("topics.create", param_list.ToArray());
            return tcr;
        }