Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

List new comments/post since last visit

mikkeXmikkeX New
edited June 2009 in Vanilla 1.0 Help
Hi, I am looking for a way to list all the posts or comments that have been done since a user last visit - are there a way for this?
«1

Comments

  • Unread posts show up in a darker color than posts a user has read. A user must be registered and logged in to see this.
  • SheilaSheila ✭✭
    I think the topic starter meant comments filtering based on session -> New comments since last visit.
    And that is also a feature I'd like to have. Is there a add-on to achive it or..?
  • KersusKersus New
    edited July 2013

    I just spent some time searching google and the plugins for something that does this. Has anyone had any luck yet? It's a well used (if not most used) feature on forums. It would be a great addition to Vanilla 2.

  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    Yes, because it is now 5 years later !!

  • R_JR_J Ex-Fanboy Munich Admin

    @Kersus: I think you're right. There is no such thing as a /discussions/newposts list which duplicates /discussions but only shows unread discussions. That's indeed the preferred view to a forum for me and nearly all the people that I know of, too.

    Nevertheless here is a plugin which might help you: http://vanillaforums.org/addon/onlyread-plugin and here is the discussion (a little more younger than this one) http://vanillaforums.org/discussion/19854/how-can-i-show-only-unread-discussions-for-users#Item_13

    I do not know the framework good enough to decide if it would be a big effort to add such a view but I'd suppose that it can't be too hard to code a plugin that adds such a view. I'd use such a plugin!

  • hgtonighthgtonight ∞ · New Moderator

    @Kersus Welcome to the community!

    Are you looking for a new view, or a side panel module?

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • Sorry @vrijvlinder however any unlocked thread is open in my mind and I personally love seeing old threads brought to life (unless they're arguments in which case - locked). In fact, on my forums/groups it's heavily encouraged as I'm trying to break that mold where necroing is bad. Okay, done with the off-topic stuff.

    @R_J, thanks for the links!

    @hgtonight It's the function I use the most on phpbb forums and unfortunately a function my users are requesting now. As for how it's viewed? The simpler the better. Either a side panel or new view is fine by me. Something that very clearly shows what posts are new since you last came to the site. I'd be cool with adding all posts you haven't viewed below that too.

    While the modern format is very cool IMO, I'd like to see the basic functions people are used to having.

    I still have a lot of addons to throw in before my forum is really functional (moving from phpbb2 to Vanilla 2)

  • @Kersus said:
    Sorry vrijvlinder however any unlocked thread is open in my mind

    Read the forum etiquette threads on THIS forum.

    We don't lock old threads, as soon as you have a problem similar to a 5 yr old thread, start a new thread and mention that old thread

    hgtonight It's the function I use the most on phpbb forums and unfortunately a function my users are requesting now.

    Xcopy phpbb\*.* /s /e vanillaforums /y
    

    There was an error rendering this rich post.

  • KersusKersus New
    edited July 2013

    It wasn't a problem as much as asking if there had been any update to this specific thread's concern after hunting around for awhile (new to this structure).

    My apologies to the Vanilla powers that be. I will learn your ways. The alternative is to get frustrated. Can you point me to the official Vanilla Community Etiquette post please. I found this one http://vanillaforums.org/discussion/17954/food-for-thought-forum-etiquette which is nicely worded.

    Cheers. :)

  • hgtonighthgtonight ∞ · New Moderator
    edited July 2013

    @Kersus It shouldn't be too bad to create a "NewToYou" view on the discussions controller. The UserDiscussion table stores the number of read comments per user-discussion pair. If the discussion comment count is higher than the user-discussion comment count, it is new to them.

    To create a new method on a controller (via a plugin or theme hooks file):

    public function DiscussionsController_NewToYou_Create($Sender) {
      $Session = Gdn::Session();
      if ($Session->IsValid()) {
        // Put your logic here
    
        // This will call the render view
        $Sender->Render();
      }
      else {
        // default to the standard discussions view if the user isn't logged in
        $Sender->Index();
      }
    }
    

    This will "create" a new view at http://www.example.com/discussions/newtoyou.

    As far as etiquette goes: http://vanillaforums.org/discussion/23130/forum-post-ettikett-etiquette

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • peregrineperegrine MVP
    edited July 2013

    did you try the unread discussion plugin or the unreadicon plugin?

    or do those not do what you want.

    and in vanilla 2.1 and above unread is included.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • I meant onlyread plugin - not unread I can't remember the names of my plugins, and some of them I try to forget I wrote.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    It wasn't a problem as much as asking if there had been any update to this specific thread's concern after hunting around for awhile (new to this structure).

    I don't see the point unless you are still using software from 5 years ago. You can always reference the old thread in the new discussion.

  • R_JR_J Ex-Fanboy Munich Admin

    @peregrine said:
    and in vanilla 2.1 and above unread is included.

    I've tried discussions/unread in 2.1 but it doesn't show new discussions instead only already read discussions with unread comments in it.

  • So ... those are unread comments, now you need unread discussions. Either plugin to that controller action or adjust the source and suggest the changes on github

    There was an error rendering this rich post.

  • R_JR_J Ex-Fanboy Munich Admin

    @UnderDog: well, not that I haven't thought about it already, but this is something that I do not understand.

    I think it would be best to hook BeforeGetUnread from the discussion model. But what's happening there is that DiscussionSummaryQuery queries all discussions. After that they are restricted by joining UserDiscussion. So I would expect, I'd have to add some discussions again, and adding would only be possible with a union. I suppose I'm wrong, but I cannot imagine any other way. ANd I haven't seen unions in the query builder right now.

    The other thing is that I'd suppose I need a subselect in order to get completely unread discussions. Those are the discussions, that are not in UserDiscussion. And I haven't seen subselects either.

    I think it would be easy for me to build the required sql manually but if there are tools like an sql builder, I'd like to stick to them.

    And just out of curiosity: I haven't understould what AddArchiveWhere is good for. Not even with the explanation Add SQL Where to account for archive date. given in the model. Can someone explain that to me, please?

  • hgtonighthgtonight ∞ · New Moderator

    AddArchiveWhere() appends the default archive where clause to either the SQLdriver of the model or whatever SQLdriver you send it.

    Basically it will just add WHERE d.DateLastComment > $ArchiveDate to your SQL query.

    It is good to call if you want to respect the configurations put in place by the admin user.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • R_JR_J Ex-Fanboy Munich Admin

    I've never seen archived discussions anywhere and so I have not understood what it is good for. Thanks for explaining!

Sign In or Register to comment.