Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

[Vanilla 2.1 feature] Show only discussions with unread posts?

edited June 2012 in Vanilla 2.0 - 2.8

My users are asking for a way to view only unread items. I know that Vanilla distinguishes between new discussions and new replies, so I'm looking for a single view that shows a logged-in user a list of all discussions containing unread replies, or discussions with no replies that the user hasn't yet viewed.

Navigating to /discussions/ is a start, but the community feedback is that it presents too much information and isn't as simple as only showing discussions with new replies.

Is there a way I can implement this? My php skills are profoundly lacking, but I'm not afraid to try to get my hands dirty and learn something new.



  • Good question. Bookmarked!

  • LeeHLeeH
    edited July 2012

    Very nice! The new feature works as advertised.

    I'm a little confused about the exact implementation, since for my forum it produces 9-page list of discussions; unread discussions are indeed at the top, but there are two pages of read discussions below that, and pages 3-9 are empty of content.

    Viewing /discussions/all shows that I have 9 actual pages of posts, so I'm guessing that's why, but it seems irrelevant to display that in the unread view. Further, clicking a post to read it removes it from the list entirely, even though there are other posts in the list.

    I'll have to explore the feature further to understand the secondary functionality, but the primary thing is that it works well for displaying unread posts :)

    Edited to add some more info:

    Possibly because my forum has gone through several database updates, and also possibly because I'm using a plugin to give "mark all viewed" functionality, there were ~2 pages of threads in my /discussions/unread listing. All were gray "read" discussions. I clicked through them one by one and they all disappeared, leaving only new posts.

    I'm sure this is functionality that won't be encountered when starting from scratch at 2.1 with this feature, but transitioning to it definitely exposes some weirdness.

  • Found the culprit—discussions marked as read via the AllViewed plugin (by @lincoln). The plugin itself seems to have vanished from the Addons repository here, so I can only assume we're not actually supposed to use it anymore. Which kind of sucks, because my users specifically want to be able to mark unread and unvisited discussions as read without having to actually visit them, in order to keep the "Show unread" view clean and uncluttered.

  • LeeHLeeH
    edited July 2012

    Last comment—/discussions/unread doesn't appear to show NEW discussions, either. That seems like a pretty major oversight! Ideally, /discussions/unread would show previously-visited discussions with new replies and also new discussions. Users who use /discussions/unread as their initial landing page won't see any newly-created discussions!

  • OK, I know I said that was the last comment, but I need to modify the last post.

    /discussions/unread DOES show unvisited discussions with new posts...but it does not show unvisited discussions without any replies.

    So, like, if User A creates a new discussion, and User B visits /discussions/unread, User B will not see User A's new discussion. But if User C posts a reply to User A's discussion, then suddenly User B will see the discussion under /discussions/unread (and it will correctly appear as an unvisited discussion).

    This definitely seems like a bug.

  • TimTim Operations Vanilla Staff
    Answer ✓

    /discussions/unread needs to be re-implemented. as-is, it could kill your server and has bugs as LeeH has mentioned. Don't base anything on it right now.

    Vanilla Forums COO [GitHub, Twitter,]

  • So figure out the SQL that's executed and help the developers by showing the correct SQL in your bug report.

    There was an error rendering this rich post.

  • Definitely above my skill level, unfortunately. I could track down the SQL from inside the php files, but figuring out a way to fix it is beyond me—I just don't know it (or PHP) well enough.

    Still, per @Tim above, it sounds like the feature is being rewritten anyway, so I'm content to sit tight & wait.

  • ToddTodd Chief Product Officer Vanilla Staff

    This is one of those features that's really tough to write. We kind of have two options:

    1. We make significant changes to Vanilla just to support this feature.

    2. We write a "good enough" feature that scales well.

    We just don't want to do option 1 and re-engineer Vanilla just for this one feature. As for option 2? Well, we really get burned when we make concessions for scalability. People with smaller communities notice the feature not working perfectly and then come and report it as a bug. They usually don't understand that we need to do certain things to support larger communities which is our number 1 goal. And dealing with a flood of nit-picks like these is just eats at our bandwidth.

  • Ouch, thanks for that answer, Todd... What would you need to do to re-engineer Vanilla for option 1? Would it be extra table(s) and a per-user entry?

    Is what we have now 'option 2'? Or does it need some work?

    There was an error rendering this rich post.

  • @Todd - I definitely understand, and I'll stomp my feet and actually demand support when I'm actually paying for support :) I know it's not easy to scale a feature from tiny to big, and I'm appreciative that you guys are as responsive to the free community as you are.

    I think the general expectation among the user communities (not from me specifically, but from forum users in general) is that applications like phpbb easily show unread posts since last visit, and so every forum app should do the same. The complexities of Vanilla being a non-traditional forum don't enter into the average user's mind—they just know that they want to click a link & see new posts.

    Since launch, I've had my users making due with a "Show all discussions" link, which simply displays a flat view of all discussions with new & unvisited on top, and that's certainly good enough. As for this specific feature, I'm happy to continue to watch the public release of 2.1 continue to evolve.

  • LincLinc Detroit Admin

    LeeH said:
    Found the culprit—discussions marked as read via the AllViewed plugin (by @lincoln). The plugin itself seems to have vanished from the Addons repository here, so I can only assume we're not actually supposed to use it anymore.

    No, it's because it's in core now, so it's silly to ALSO distribute it as a separate download. As Tim said, /unread still has bugs. In any case, AllViewed just got rewritten a few days ago.

Sign In or Register to comment.