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.
Options

[2.1b1] Is there a 'mark all viewed' solution for PMs/conversations?

ZhaanZhaan Professional fool ✭✭
edited April 2013 in Vanilla 2.0 - 2.8

Having just upgraded to 2.1b1, the forum now thinks I have 305 unread personal messages. I'd like to clear my notifications without having to re-read every single one of them.. do any of you have a solution?

Thanks in advance.

Comments

  • Options

    Solution should be an SQL statement. Mark 1 as read and check your 'conversations' table what changed. Based on that you can make an update statement for all those other messages.

    There was an error rendering this rich post.

  • Options
    hgtonighthgtonight ∞ · New MVP

    The way Vanilla marks conversations as viewed is similar to that of discussions. It places a new row in the UserConversations with the userID, the conversationID, and the date viewed. To mark all conversations as viewed (through SQL) will require you to enumerate enumerate all the possibilities of your userID, the conversation IDs you are in, and a current date.

    As you can imagine, this would be tedious.

    I would suggest modifying the All Viewed plugin (that comes with the standard Vanilla download) to work for conversations in addition to just discussions.

    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.

  • Options
    ZhaanZhaan Professional fool ✭✭
    edited April 2013

    I was also thinking of modifying the All Viewed plugin, but I'm not skilled enough to do it. Thanks for your input though, both of you.

  • Options
    SrggamerSrggamer HardCore Gamer ✭✭✭

    @Zhaan said:
    I was also thinking of modifying the All Viewed plugin, but I'm not skilled enough to do it. Thanks for your input though, both of you.

    Never hurts to try.

  • Options
    whu606whu606 I'm not a SuperHero; I just like wearing tights... MVP

    @Zhaan

    I was looking to do this, and found this conversation.

    For future reference, a workable, if not ideal, solution I found was this (using phpMyAdmin):

    Go to your forum database.

    Make a backup! (At the very least, back up the table gdn_userconversation)

    1. Identify the largest value in the column CountMessages in gdn_conversation

    2. view the gdn_userconversation table.

    Click the SQL tab and paste the following:

    UPDATE `gdn_userconversation` SET `CountReadMessages`="VALUE"

    changing VALUE to the highest value of the CountMessages column.

    This will effectively mark all conversations as read, even if they hadn't been.

    Users will only see the new Inbox count once they have gone to their Inbox, and clicked on any message (read or not).

    Where there are ongoing conversations, users will only get notification of new posts once they have added a new comment to the conversation.

    I have no doubt there are more efficient ways of doing this, but at least this shows how it can be done.

  • Options
    whu606whu606 I'm not a SuperHero; I just like wearing tights... MVP
    edited May 2013

    @Zhann

    There is indeed a more efficient way to do this.

    In phpMyAdmin run either

    UPDATE gdn_userconversation uc, gdn_conversation c
       SET uc.CountReadMessages = c.CountMessages
     WHERE uc.ConversationID = c.ConversationID
    

    or

    UPDATE GDN_UserConversation uc, GDN_Conversation c
       SET uc.CountReadMessages = c.CountMessages
     WHERE uc.ConversationID = c.ConversationID
    

    depending on how your tables are named.

    This simply replaces the value in the CountReadMessages column with the value of the CountMessages column.

    NOTE

    This will mark all messages as 'read' for all users.

  • Options
    ZhaanZhaan Professional fool ✭✭

    You are wonderful. Thank you.

  • Options
    whu606whu606 I'm not a SuperHero; I just like wearing tights... MVP

    No problem.

    I had to work it out for myself, so figured it was only fair to share.

Sign In or Register to comment.