public string GetLastPostInCategory(ForumCategory cat) { var post = cat.LatestForumPost(); if (post != null) { return string.Format(library.GetDictionaryItem("LastPostByTextFormat"), Helpers.GetPrettyDate(post.CreatedOn.ToString()), post.Owner.MemberLoginName); } return "Er zijn nog geen discussies in deze kennisgroep."; }
public string GetLastPostInCategory(ForumCategory cat) { var post = cat.LatestForumPost(); if (post != null) { return string.Format(library.GetDictionaryItem("LastPostByTextFormat"), Helpers.GetPrettyDate(post.CreatedOn.ToString()), post.Owner.MemberLoginName); } var getNa = library.GetDictionaryItem("GetNAText"); return string.Format(library.GetDictionaryItem("LastPostByTextFormat"), getNa, getNa); }
/// <summary> /// Maps an Umbraco 'Examine' Search Result to the ForumCategory type /// </summary> /// <param name="nodetomap"></param> /// <returns></returns> public ForumCategory MapForumCategory(SearchResult nodetomap) { if (nodetomap == null) return null; var fCat = new ForumCategory { Id = nodetomap.Id, Name = CheckFieldExists(nodetomap, "nodeName"), Url = library.NiceUrl(nodetomap.Id), CreatedOn = Convert.ToDateTime(CheckFieldExists(nodetomap, "__Sort_createDate")), ParentId = CheckFieldExists(nodetomap, "parentID").ToInt32(), Description = CheckFieldExists(nodetomap, "forumCategoryDescription"), IsMainCategory = CheckFieldExists(nodetomap, "forumCategoryIsMainCategory") == "1", IsPrivate = CheckFieldExists(nodetomap, "forumCategoryIsPrivate") == "1", KarmaAccessAmount = CheckFieldExists(nodetomap, "forumCategoryPermissionKarmaAmount").ToInt32(), KarmaPostAmount = CheckFieldExists(nodetomap, "forumCategoryPostPermissionKarmaAmount").ToInt32(), ParentCategoryId = CheckFieldExists(nodetomap, "forumCategoryParentID").ToInt32(), SortOrder = CheckFieldExists(nodetomap, "sortOrder").ToInt32() }; return fCat; }
/// <summary> /// Maps an Umbraco 'Category' Node to the ForumCategory type /// </summary> /// <param name="nodetomap"></param> /// <returns></returns> public ForumCategory MapForumCategory(INode nodetomap) { if (nodetomap == null) return null; var fCat = new ForumCategory { Id = nodetomap.Id, CreatedOn = nodetomap.CreateDate, Name = nodetomap.Name, Url = library.NiceUrl(nodetomap.Id), Description = nodetomap.GetProperty("forumCategoryDescription").Value, IsMainCategory = nodetomap.GetProperty("forumCategoryIsMainCategory").Value == "1", IsPrivate = nodetomap.GetProperty("forumCategoryIsPrivate").Value == "1", KarmaAccessAmount = nodetomap.GetProperty("forumCategoryPermissionKarmaAmount").Value.ToInt32(), KarmaPostAmount = nodetomap.GetProperty("forumCategoryPostPermissionKarmaAmount").Value.ToInt32(), ParentId = nodetomap.Parent.Id, ParentCategoryId = nodetomap.GetProperty("forumCategoryParentID").Value.ToInt32(), SortOrder = nodetomap.SortOrder }; return fCat; }
/// <summary> /// Maps an Umbraco 'Examine' Search Result to the ForumCategory type /// </summary> /// <param name="nodetomap"></param> /// <returns></returns> public ForumCategory MapForumCategory(SearchResult nodetomap) { if (nodetomap == null) { return(null); } var fCat = new ForumCategory { Id = nodetomap.Id, Name = CheckFieldExists(nodetomap, "nodeName"), Url = library.NiceUrl(nodetomap.Id), CreatedOn = Convert.ToDateTime(CheckFieldExists(nodetomap, "__Sort_createDate")), ParentId = CheckFieldExists(nodetomap, "parentID").ToInt32(), Description = CheckFieldExists(nodetomap, "forumCategoryDescription"), IsMainCategory = CheckFieldExists(nodetomap, "forumCategoryIsMainCategory") == "1", IsPrivate = CheckFieldExists(nodetomap, "forumCategoryIsPrivate") == "1", KarmaAccessAmount = CheckFieldExists(nodetomap, "forumCategoryPermissionKarmaAmount").ToInt32(), KarmaPostAmount = CheckFieldExists(nodetomap, "forumCategoryPostPermissionKarmaAmount").ToInt32(), ParentCategoryId = CheckFieldExists(nodetomap, "forumCategoryParentID").ToInt32(), SortOrder = CheckFieldExists(nodetomap, "sortOrder").ToInt32() }; return(fCat); }
/// <summary> /// Maps an Umbraco 'Category' Node to the ForumCategory type /// </summary> /// <param name="nodetomap"></param> /// <returns></returns> public ForumCategory MapForumCategory(INode nodetomap) { if (nodetomap == null) { return(null); } var fCat = new ForumCategory { Id = nodetomap.Id, CreatedOn = nodetomap.CreateDate, Name = nodetomap.Name, Url = library.NiceUrl(nodetomap.Id), Description = nodetomap.GetProperty("forumCategoryDescription").Value, IsMainCategory = nodetomap.GetProperty("forumCategoryIsMainCategory").Value == "1", IsPrivate = nodetomap.GetProperty("forumCategoryIsPrivate").Value == "1", KarmaAccessAmount = nodetomap.GetProperty("forumCategoryPermissionKarmaAmount").Value.ToInt32(), KarmaPostAmount = nodetomap.GetProperty("forumCategoryPostPermissionKarmaAmount").Value.ToInt32(), ParentId = nodetomap.Parent.Id, ParentCategoryId = nodetomap.GetProperty("forumCategoryParentID").Value.ToInt32(), SortOrder = nodetomap.SortOrder }; return(fCat); }
private void Initialize() { currentCategory = Mapper.MapForumCategory(CurrentNode); }
private void Initialize() { currentCategory = Mapper.MapForumCategory(CurrentNode); btnShowAll.Visible = !ShowAll; var url = library.NiceUrl(CurrentNode.Id); btnShowAll.NavigateUrl = Helpers.AlternateTemplateUrlFix("/Documenten", url); }
private void GetForumNodes() { Post = Mapper.MapForumPost(new Node(ChildPostNode.ToInt32())); Topic = Post.ParentTopic(); Category = Topic.ParentCategory(); }