+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / Forum, # of Visits

Forum, # of Visits

2 posts, 0 answered
  1. John
    John avatar
    1 posts
    Registered:
    26 Sep 2012
    18 Nov 2009
    Link to this post
    Hello,

    yesterday i've downloaded and installed SiteFinity 3.7 Community. I've setup a community project and i'm really surprised by it's possibilites so far! I do have some questions about the forum section though.

    The forums in here show additional information which i cannot seem to retrieve in my project.
    - "Visits"
    - "Started by"

    That information is really valuable and i would like to add those in my project aswell. Any clue how to add this information ? Suggestions are highly appreciated!

    Thanks,

    John Neus
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    18 Nov 2009
    Link to this post
    Hello John,

    Visits - the implementation will require developing whole statistics module ( we will support this functionality from Sitefinity 4.0. Basically each forum and post in a forum has ID (Guid). You need to associate each request with the ID of a post and write the request as integer value in a database table. In this table you should have post ID - primary key, VisitsCount as integer

    "Started by" - In Sitefinity when you create a thread, actually you create a post. You can easily get the name of an user that has created this thread.

    sample:

    ForumManager manager = new ForumManager();
    IForum forum = manager.GetForum(new Guid("24F0759C-2D4B-47ae-9602-57E36F532720"))
    foreach(IPost post in forum.Posts)
    {
       string owner = post.Owner;
       Label1.Text = owner;
    }

    You can use IList AllPosts =  manager.GetForumPosts(forum.ID) as well.

    All the best,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
2 posts, 0 answered