public string GetFirstPost(ForumTopic topic) { string result = topic.GetLatestPost().Content.StripHTML(); if (result.Length > GlobalConstants.SummaryMaxLength) { result = result.Substring(0, GlobalConstants.SummaryMaxLength) + "..."; } return result; }
/// <summary> /// Gets some pretty info for the topic, and lets the user browse directly to the last post in the topic /// </summary> /// <param name="topic"></param> /// <returns></returns> public string GetLastPostInfo(ForumTopic topic) { var latestPost = topic.GetLatestPost(); if (latestPost != null) { var createlatestpostlink = string.Concat("/getlatestpost.aspx?t=", topic.Id, "&p=", latestPost.Id); return string.Format(library.GetDictionaryItem("LastPostByLinkFormat"), createlatestpostlink, Helpers.GetPrettyDate(latestPost.CreatedOn.ToString()), latestPost.Owner.MemberLoginName); } return library.GetDictionaryItem("ErrorGettingLatestPost"); }