/// <summary> /// 获取访问过的版块信息 /// </summary> /// <returns></returns> public static SimpleForumInfo[] GetVisitedForums() { string visitedForums = Utils.GetCookie("visitedforums"); if (visitedForums == "") return new SimpleForumInfo[0]; List<SimpleForumInfo> simpleForumList = new List<SimpleForumInfo>(); foreach (string fid in visitedForums.Split(',')) { foreach (ForumInfo forumInfo in Forums.GetForumList()) { if (forumInfo.Fid.ToString() == fid) { SimpleForumInfo simpleForumInfo = new SimpleForumInfo(); simpleForumInfo.Fid = forumInfo.Fid; simpleForumInfo.Name = Utils.RemoveHtml(forumInfo.Name); //如果不过滤掉HTML代码,则如果版块名称中存在html代码,会出现js错误,并且快速发帖出显示也不正常 simpleForumInfo.Url = Urls.ShowForumAspxRewrite(forumInfo.Fid, 1, forumInfo.Rewritename); simpleForumInfo.Postbytopictype = forumInfo.Postbytopictype; simpleForumInfo.Topictypes = forumInfo.Topictypes; simpleForumList.Add(simpleForumInfo); break; } } } return simpleForumList.ToArray(); }
/// <summary> /// 获取最后发帖版块信息 /// </summary> /// <returns></returns> public static SimpleForumInfo GetLastPostedForum() { string lastPostedForum = Utils.GetCookie("lastpostedforum"); if (lastPostedForum == "") return null; foreach (ForumInfo forumInfo in Forums.GetForumList()) { if (forumInfo.Fid.ToString() == lastPostedForum) { SimpleForumInfo simpleForumInfo = new SimpleForumInfo(); simpleForumInfo.Fid = forumInfo.Fid; simpleForumInfo.Name = Utils.RemoveHtml(forumInfo.Name); //如果不过滤掉HTML代码,则如果版块名称中存在html代码,会出现js错误,并且快速发帖出显示也不正常 simpleForumInfo.Url = Urls.ShowForumAspxRewrite(forumInfo.Fid, 1, forumInfo.Rewritename); simpleForumInfo.Postbytopictype = forumInfo.Postbytopictype; simpleForumInfo.Topictypes = forumInfo.Topictypes; return simpleForumInfo; } } return null; }
/// <summary> /// 获取最后发帖版块信息 /// </summary> /// <returns></returns> public static SimpleForumInfo GetLastPostedForum() { string lastPostedForum = Utils.GetCookie("lastpostedforum"); if (lastPostedForum == "") return null; foreach (ForumInfo forumInfo in Forums.GetForumList()) { if (forumInfo.Fid.ToString() == lastPostedForum) { SimpleForumInfo simpleForumInfo = new SimpleForumInfo(); simpleForumInfo.Fid = forumInfo.Fid; simpleForumInfo.Name = forumInfo.Name; simpleForumInfo.Url = Urls.ShowForumAspxRewrite(forumInfo.Fid, 1, forumInfo.Rewritename); simpleForumInfo.Postbytopictype = forumInfo.Postbytopictype; simpleForumInfo.Topictypes = forumInfo.Topictypes; return simpleForumInfo; } } return null; }