Set comment read or unread for different users

Discussion in 'PHP' started by Prignesh, Mar 13, 2013.

  1. #1
    i have more than one users in my system. And everyone can update status and comment. So how can i set comment as unread for particular users if he diid not see comment. like everyone have same notification in them dashboard but if particular user see comment then comment text will display in black color other not seen then it will display in red color . This thing is like every users.

    Let me know how can i make this thing in php coding.

    looking forward your help.

    Thanks
    PHP Development
     
    Last edited: Mar 13, 2013
    Prignesh, Mar 13, 2013 IP
  2. EricBruggema

    EricBruggema Well-Known Member

    Messages:
    1,740
    Likes Received:
    28
    Best Answers:
    13
    Trophy Points:
    175
    #2
    Normaly you just send all users the same message but that's not handy if you have more then 10.000 users as the preformance will get slower and slower ;)

    If you have global messages that you want to display to all users but doesn't want to display it to users that already have seen them, try to add another table to your database that will hold data towards those messages.

    For example a table
    message_id (for global messages)
    user_id (to connect the user)
    readdate (date when user has read this message).

    If the message expires you can remove all the data from that table.

    Hope you get my idea.
     
    EricBruggema, Mar 13, 2013 IP
  3. VideoWhisper.com

    VideoWhisper.com Well-Known Member

    Messages:
    330
    Likes Received:
    6
    Best Answers:
    2
    Trophy Points:
    113
    Digital Goods:
    2
    #3
    All comments are unread for everybody when created.

    Then you can mark read comments for each user in 2 ways:
    1. on server in a table or file, you need a record with comment id and user id that shows it was read
    2. save a cookie with comment id on that user's computer (unreliable but easier)
     
    VideoWhisper.com, Mar 17, 2013 IP