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.

How can I show only unread discussions for users?

rkneschkerkneschke New
edited April 2012 in Vanilla 2.0 - 2.8

Hello,

I am wondering if this is possible:
How can I show only unread discussions?

Since every user has read different discussions so far, this page would look different for each user.

I am also not refering to new comments, but discussions only?

Thanks in advance,
Robert

Best Answers

  • peregrineperegrine MVP
    Answer ✓

    @rkneschke

    I hope you don't want a mod, but if you find a bug let me know.
    Let me know if it works as advertised.

    http://vanillaforums.org/addon/onlyread-plugin-1.0

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

  • peregrineperegrine MVP
    edited April 2012 Answer ✓

    rkneschke said:
    @peregrine: Many thanks, it does work as advertised!

    I hope I am not too picky, but I would love to change/add two things:
    1. The language of the button (since my forum readers are German)

    around line 23 in default.php
    
        echo '<input type="button"  class="Button" id="toggleButton" value="Read+-" />';
    
        echo '<input type="button"  class="Button" id="toggleButton" value="Fahrvergnügen+-" />';
    
    1. I would like to additionally put a link in the top menu (where "dashboard" and "activities" are located) that leads to the "only unread discussions" view.

    I'll ponder on it, can't promise. If I can easily, I will, check back in a few weeks, if I can I will update plugin.

    PS: On a minor note: Maybe the plugin title "OnlyRead" is a bit misleading? In my understanding "Show_OnlyUnread" or similar would hit the mark more accurately?

    You are correct, unfortunately there is no way to change the name and replace with new version, without getting somebody to help on the vanilla forum side.

    Think of it this way "Only Read" discussions are hidden" :)

    But anyway: Thanks again for your fast and helpful reply.

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

Answers

  • peregrineperegrine MVP
    edited April 2012

    You could write a jquery
    to filter on CommentCount and hide or remove the class ItemContent that contains CommentCount doesn't contain the word "new"

    <span class="CommentCount">2 comments</span>
    <strong>2 new</strong>
    

    or you could go into discussion/helper_functions.php
    and put a conditional to skip if new is found.

    I don't have time to write the exact code but these are two examples of how to.

    if it doesn't contain the word new than hide it.
    below would be hidden above wouldn't.

    <div class="ItemContent Discussion">
    <a href="/vanilla/discussion/1/my-first-discussion" class="Title">
    My first discussion
    </a>
    <div class="Meta">
    <span class="CommentCount">
    2 comments
    </span>
    

    on second thought filter on <strong> tag if it appears you know its new so you would keep it.

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

  • You could also use the commentwatch or unread variables and calcualte where you are.

    I might it would be a very bad idea. because the user could never get to a discussion they read.

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

  • Hm, I was afraid that it would take some programming work. Since I have no clue about .php, it sounds like a difficult task (at least for me).

  • peregrineperegrine MVP
    edited April 2012

    I'll write you a plug-in to get you started if and only if you install this plug-in report back whether this plug-in works correctly doing what he requested with an explanation of what it did.

    http://vanillaforums.org/discussion/19849/hide-catagory-posts-from-all-discussions-page#Item_11

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

  • Thanks in advance, I will give it a try in the next days...

  • @peregrine:

    Okay, I managed to try it.
    What I did:

    • Download "Hide Category" plugin (v 1.0)
    • uploaded it to server and activated it
    • added the line
      $Configuration['Plugins']['HideCategory']['NoCat'] = 'Interne Forum-Diskussion';
      to my config.php

    • now the category "interne forum-diskussion" is not shown in the "All Discussions" page.

    It seems that it works like requested...

  • I'll try to get you what i said if you want it, but I don't know if it will cause a problem with page counting. Do you want to go through the bother?

    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 am not sure what you mean by causing problems with "page counting".

    I got many request from my forum users that the frequent users want to have a page where they are able to see with a quick look only the discussions that have been added (read: are new) after their last visit. I wanted to add a link in my forum titled "unread discussions" (roughly translated since my forum is in German) where they can see the new discussions.

  • I will see what I can come up with. give me some time - a week or two and I'll let you know.
    I've got a few other things occupying my time. Is it ok to pm you? instead of here.

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

  • @rkneske when you look in your admin section, how is your 'homepage' set up? with categories? with categories and discussions?

    There was an error rendering this rich post.

  • peregrineperegrine MVP
    edited April 2012

    @rkneske I have a solution that works with your initial question
    with two lines of changes in the helper functions file in v 2.0.18.4.
    However this would change the behavior of the whole discussions viewing.

    I have to look in to creating an application that would add another link to your page, to do either all discussions or only unread.

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

  • @UnderDog: My homepage is set to "discussions".

    I know that it is similar, but if you have a lot of discussions and you view some of the latest, the earlier "unread" discussions at the bottom tend to be overlooked, so my forum users asked for a more "compact" view.

    @peregrine: Sure, you can PM me, I really appreciate your voluntary helping me so I am not in a position to rush you or anything.

    Thanks in advance.

  • peregrineperegrine MVP
    Answer ✓

    @rkneschke

    I hope you don't want a mod, but if you find a bug let me know.
    Let me know if it works as advertised.

    http://vanillaforums.org/addon/onlyread-plugin-1.0

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

  • @peregrine: Many thanks, it does work as advertised!

    I hope I am not too picky, but I would love to change/add two things:
    1. The language of the button (since my forum readers are German)
    2. I would like to additionally put a link in the top menu (where "dashboard" and "activities" are located) that leads to the "only unread discussions" view.

    PS: On a minor note: Maybe the plugin title "OnlyRead" is a bit misleading? In my understanding "Show_OnlyUnread" or similar would hit the mark more accurately?

    But anyway: Thanks again for your fast and helpful reply.

  • peregrineperegrine MVP
    edited April 2012 Answer ✓

    rkneschke said:
    @peregrine: Many thanks, it does work as advertised!

    I hope I am not too picky, but I would love to change/add two things:
    1. The language of the button (since my forum readers are German)

    around line 23 in default.php
    
        echo '<input type="button"  class="Button" id="toggleButton" value="Read+-" />';
    
        echo '<input type="button"  class="Button" id="toggleButton" value="Fahrvergnügen+-" />';
    
    1. I would like to additionally put a link in the top menu (where "dashboard" and "activities" are located) that leads to the "only unread discussions" view.

    I'll ponder on it, can't promise. If I can easily, I will, check back in a few weeks, if I can I will update plugin.

    PS: On a minor note: Maybe the plugin title "OnlyRead" is a bit misleading? In my understanding "Show_OnlyUnread" or similar would hit the mark more accurately?

    You are correct, unfortunately there is no way to change the name and replace with new version, without getting somebody to help on the vanilla forum side.

    Think of it this way "Only Read" discussions are hidden" :)

    But anyway: Thanks again for your fast and helpful reply.

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

  • peregrineperegrine MVP
    edited April 2012

    @rkneschke

    Today is your lucky day. Because you are exceptionally easy to work with and you seem to define what you are looking for. I think I got .it.

    see version 1.1. check the readme - I've added easier ways to change the menu label and the button.

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

  • @peregrine: Wow, thanks, man, that's even faster than I can install and check it out. I will install and try it tomorrow...

  • rkneschke said:
    @peregrine: Wow, thanks, man, that's even faster than I can install and check it out. I will install and try it tomorrow...

    :)

    Since the approval process is mysterious to me
    If the plugin works for you

    can you click on link

    http://vanillaforums.org/addon/onlyread-plugin

    and add a message at the plugin
    that says "onlyread-plugin v1.1 works for me on version xxx or vanilla.

    tia.

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

  • done.

    thanks, it works as wished for.

Sign In or Register to comment.