Displaying topics instead of posts on profile page

NodeBB Development
  • I made a change on profile page, so now instead of posts it displays topics that user created. Like this http://screencast.com/t/8OjPbPkwP1u . But the problem is that if user make another post in his topic or in someone else's, it will show it again and again. Like this http://screencast.com/t/rucvj4rjHo .

    What i need is to show it only once and only when a user create the topic. How to achieve this?

  • @Jelena I think I've done something like what you're asking for.

    What I've done is simply editing home.tpl. This is the bit of code that may help you :

    <!-- BEGIN posts -->
    <div class="post-preview clearfix {categories.unread-class}">
    	<a class="user-picture" style="color: {categories.color};" href="<!-- IF categories.posts.user.userslug -->{relative_path}/user/{categories.posts.user.userslug}<!-- ELSE -->#<!-- ENDIF categories.posts.user.userslug-->">
    		<span class="user-picture small pull-left"><img src="{categories.posts.user.picture}" title="{categories.posts.user.username}" class="user-img"></span>
    	<div class="post-info pull-left">
    		<h5><a href="{relative_path}/topic/{categories.posts.topic.slug}">{categories.posts.topic.title}</a></h5>
    		<a href="{relative_path}/user/{categories.posts.user.username}" class="user">{categories.posts.user.username}</a>
    		<span class="timeago" title="{categories.posts.relativeTime}"></span>
    	<a class="readmore-link pull-right" href="{relative_path}/topic/{categories.posts.topic.slug}<!-- IF categories.posts.index -->/{categories.posts.index}<!-- ENDIF categories.posts.index -->" title="[[global:read_more]]"><i class="fa fa-fw fa-link fa-gradient"></i></a>
    <!-- END posts -->

    I've limited at one topic only but I guess it works with more.

  • Hmm, I think what @Jelena is looking for is on a user's profile page show their most recent topics instead of showing the most recent posts. Am I correct? or am I totally wrong? In any case, thanks @esiao for the reference.

  • @trevor Absolutely I'm wrong. I'll leave it just in case someone is interested.
    @Jelena For what you're asking for I guess it's possible but with a plugin in order to test the JSON with all the posts and remove the duplicates when the tid is the same.

  • @trevor @esiao Yes, I need that for user's profile page, but tnx anyway 🙂 The thing is that I don't know how to make plugins, because I am focused on design for now. Is anyone else interested to help with this? @psychobunny @julian or any other developer?

Suggested Topics