Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • James Shute 5 posts 84 karma points
    Nov 04, 2017 @ 11:54
    James Shute
    0

    Dialogue Forum - Getting number of all comments and latest update stats from individual category

    Hi,

    I'm building a Forum using the Dialogue package (which it is my first time using it) and I'm trying to get the number of all comments from all the topics of the Dialogue Category pages and display them on the main Dialogue page for those categories, does anyone know how to get those results?

    And I'm trying to get the last post date and member name results of the Dialogue Category pages and display them on the main Dialogue page as well, any ideas how to do it please?

    @using Dialogue.Logic.Application
    @using Dialogue.Logic.Models.ViewModels
    @inherits UmbracoViewPage<Dialogue.Logic.Models.DialogueForum>
    @{
    Layout = "~/Views/Root.cshtml";
    
    var forumCategoryList = new List<string>();
    foreach (var cat in Model.MainCategories.Where(s => s.HasValue("boardCategory")))
    {
        forumCategoryList.AddRange(cat.GetPropertyValue<IEnumerable<string>>("boardCategory"));
    }
    }
    
    
    @*<div class="openingtext">
        <h1>@Model.MainHeading</h1>
        @Html.Raw(Model.MainContent)
    </div>*@
    
    
    <div id="boardMain">
    <div class="pw">
        <div class="fw">
            @Html.Partial("PageComponents/top-page-component")
            <div class="forum-widget">
                @if (!User.Identity.IsAuthenticated)
                {
                    if (Html.Settings().SuspendRegistration != true)
                    {
                        <a class="btn" href="@Urls.GenerateUrl(Urls.UrlType.Register)"><h5>@Html.Lang("Layout.Nav.Register")</h5></a>
                    }
                    <a class="btn" href="@Urls.GenerateUrl(Urls.UrlType.Login)"><h5>@Html.Lang("Layout.Nav.Logon")</h5></a>
                }
                @if (User.Identity.IsAuthenticated)
                            {
                    @Html.Action("CreateTopicButton", "DialogueTopicSurface")
                }
            </div>
    
            @foreach (var cat in forumCategoryList)
            {
                <div class="f-categories">
                    <div class="category-board">
                        <header class="category-title">
                            <h3>@cat</h3>
                            <div class="c-details">
                                <div class="c-detail">
                                    <h5>Topics</h5>
                                </div>
                                <div class="c-detail">
                                    <h5>Replies</h5>
                                </div>
                                <div class="c-detail">
                                    <h5>Last Post</h5>
                                </div>
                            </div>
                        </header>
                    </div>
                    @foreach (var categories in Model.MainCategories.Where(s => s.GetPropertyValue<IEnumerable<string>>("boardCategory").Distinct().Contains(cat)))
                    {
                        var category = new ViewCategoryViewModel(categories);
    
                        <div class="f-category">
                            <span class="cat-head">
                                <h5><a href="@category.Url">@category.Name</a></h5>
                            </span>
                            <div class="c-details">
                                <span class="count">
                                    <h5>@Convert.ToInt32(category.Topics)</h5>
                                </span>
                                <span class="count">
                                    <h5></h5>
                                </span>
                                <span class="count">
    
                                </span>
                            </div>
                        </div>
                    }
                </div>
            }
    
    
    
        </div>
    

Please Sign in or register to post replies

Write your reply to:

Draft