public override string OnMouduleLoad(string content) { UserPrefsSaved userprefs = new UserPrefsSaved(this.Module.UserPref); int topiccount = Utils.StrToInt(userprefs.GetValueByName("topiccount"), 10); bool iselite = Utils.StrToInt(userprefs.GetValueByName("iselite"), 0) > 0; DataTable topics = Focuses.GetTopicList(topiccount, 0, 0, "", TopicTimeType.All, TopicOrderType.ID, iselite, 30, false); StringBuilder sb = new StringBuilder(StaticFileProvider.GetContent(jsFile).Replace("${forumpath}", BaseConfigs.GetForumPath).Replace("${themepath}", this.SpaceConfig.ThemePath)); GeneralConfigInfo config = GeneralConfigs.GetConfig(); sb.Append("\r\n<div class='dnt-theme'><ul>\r\n"); foreach (DataRow r in topics.Rows) { string img = string.Format("<img onerror='this.src=\"{0}space/modules/builtin/forum/images/item_extend.gif\";' src='{0}space/skins/themes/{1}/images/item_extend.gif' id='imgButton_{2}' onclick='showtree({2},10);' title='展开' alt='展开' style='cursor:pointer;'/>", BaseConfigs.GetForumPath, this.SpaceConfig.ThemePath, r["tid"]); if (Utils.StrToInt(r["replies"], 0) < 1) { img = string.Format("<img onerror='this.src=\"{0}space/modules/builtin/forum/images/item_collapsed.gif\";' src='{0}space/skins/themes/{1}/images/item_collapsed.gif' />", BaseConfigs.GetForumPath, this.SpaceConfig.ThemePath); } if (config.Aspxrewrite == 1) { sb.AppendFormat("<li>{0}<a href='" + BaseConfigs.GetForumPath + "showtopic-{1}.aspx' title='{2}' target='_blank'>{2}</a></li>", img, r["tid"], r["title"]); } else { sb.AppendFormat("<li>{0}<a href='" + BaseConfigs.GetForumPath + "showtopic.aspx?topicid={1}' title='{2}' target='_blank'>{2}</a></li>", img, r["tid"], r["title"]); } sb.AppendFormat("<div id='divTopic{0}'></div>", r["tid"]); } sb.Append("\r\n</ul></div>\r\n"); content = sb.ToString(); return(base.OnMouduleLoad(content)); }
public EntityList <Topic> GetForumTopicList(int count, int views, int forumid, TopicTimeType timeType, TopicOrderType orderType, bool isDigest, bool onlyImg) { return(Focuses.GetTopicList(count, views, forumid, "", timeType, orderType, isDigest, 5, onlyImg, "")); }
/// <summary> /// 获取论坛主题列表 /// </summary> /// <param name="count">主题数</param> /// <param name="views">浏览量</param> /// <param name="forumid">版块ID</param> /// <param name="timetype">时间类型</param> /// <param name="ordertype">排序字段</param> /// <param name="isdigest">是否精化</param> /// <param name="onlyimg">是否包含附件</param> /// <returns></returns> public DataTable GetForumTopicList(int count, int views, int forumid, TopicTimeType timetype, TopicOrderType ordertype, bool isdigest, bool onlyimg) { return(Focuses.GetTopicList(count, views, forumid, timetype, ordertype, isdigest, 5, onlyimg)); }