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.

When are CSS classes .Read and .Unread applied?

I'm trying to understand when the CSS classes .Read and .Unread are applied.
My understanding was that once a discussion was opened it is changed from .Unread to .Read.
The local test installation I'm running only switches from .Unread to .Read when I manually select "mark as read".
Is that on purpose or am I missing something?
Thanks!

Tagged:

Comments

  • the allviewed plugin? no css all it does is update the "new" notice and counts .

    I'm running only switches from .Unread to .Read when I manually select "mark as read"Is that on purpose

    Yes ,That is on purpose so it can unmark a the "new" post.

  • Sorry don't want to be a pest but I don't understand your last sentence. The "mark as read" function does switch from .Unread to .Read. What I thought was that the classes get switched from .Unread to .Read by just visiting a thread with unread messages.

    The allviewed plugin does not switch threads/categories from .Unread to .Read. At least that didn't happen when I tried it a couple of hours ago. Will try again to make sure.

    What I want to achieve is to show categories with unread messages in a different color. I thought that's what .Unread/.Read is there for. Maybe there is a different class to differentiate between those two states?

  • edited January 2013

    The whole point of having a button to mark as read is because you must click it to mark as read.The way it marks it read, is by removing the "new" from the post. It does not add "read" to the post. There is not a plugin that I know of that will automatically mark it read for you when you visit the thread.The "new" count is what changes automatically when you visit the thread. If you want to affect the color of the link you have visited, you can add to the custom.css

    a:visited { color:red;}

    Or whatever color you want. Then it will look that color once you have visited the link.

    where did you see these?

    I thought that's what .Unread/.Read is there for.

    In any event, lets say you have these in the custom.css, then you would just add style to them.

    .Unread{ color:blue;background:yellow;}

    .Read{color:red;background:blue;}

  • I saw these here:

    My guess is that modifying the visited-pseudoclass wouldn't work because the category/thread-links wouldn't "unvisit" themselves when a new message is posted in there (e.g. example.com/forum/categories/example-category would always be visited once I was in there - regardless of new messages).

  • edited January 2013

    sure you can change the style for anything as long as it is written the way it is.

    the class or id is applied to the div or to the li or ul etc. the containers are the ones given the class or id of the specific area or object.

    div class="ItemContent Category Read" = div.ItemContent.Category.Read or

    li class="Item Depth1 Alt Category-architecture Read"= li.Item.Depth1.Alt.Category-architecture.Read

    (if you use a specific selector like above, you can style using a different color for every category and discussion.For those read and unread in general, use the one below )

    li.Item.Category.Read{color:red;} or

    div.ItemContent.Category.Read{color:red;}

  • I realise that it's possible to do that and I already did that.

    My question is about my seemingly wrong presumption that after visiting one of those .Unreads that it is afterwards switched to .Read because, well, I read it. But that does not happen.

    So I am wondering about three things:

    1) What do those .Unread/.Read classes mean if it's obviously not about the "there is something you did not read in there"?

    2) If it is indeed about the status of "there is something unread in here" then how/when does it switch from .Unread to .Read?

    3) Is there another class besides the two mentioned already that do signify that there is something unread in there because I want to use them to color those differently.

  • edited January 2013

    how/when does it switch from .Unread to .Read?

    in your database. Could Look something like this:

      CREATE TABLE `article_views`(
          `id` INT(11) UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT
         ,`article` INT(11) UNSIGNED NOT NULL COMMENT 'id of article`
         ,`user` INT(11) UNSIGNED NOT NULL COMMENT 'id of user who viewed post'
         ,`time` DATETIME NOT NULL COMMENT 'date/time when user viewed article'
      )
    

    What do those .Unread/.Read classes mean

    it is only about 0 and 1 states, on or off, read un-read.

    Is there another class besides the two mentioned already that do signify that there is something unread in there because I want to use them to color those differently.

    If there is you would find it the same way you found those two :)

  • That's where the switch would be noted logically. But what triggers the switch? Which action needs to be done to get it to switch from unread to read?

  • it uses your database (mySql) javascript and/or JSON functions which generally do not include style or colors. My question is, do you want to change the function or just the colors?

  • I am already able to change the colors.

    My issue is that I don't see what .Unread/.Read signify since it has nothing to do with me having read the thread or not.

    That's also the reason why I am confused about where to look for a function that would potentially be able to help me with that.

    Thanks for putting up with me so far!

  • where to look for a function that would potentially be able to help me with that.

    That is what plugins are supposed to do for you. The all-viewed plugin is supposed to mark the post viewed . Even if you did not view it. It is the user who would decide if he wants to mark it read even if it is unread.

    You can use a plugin to alert of new posts , like LatestPostList, MostPopular, OnlyRead,UnreadDiscussion,Unread Icon,Who read the Conversation, or make your own or ask a developer here to make one for you.

  • The all-viewed plugin didn't work but I'm going to try again. I also already looked at the alternatives you mentioned but will look at them again.

    What puzzles me is that I do already have those CSS classes .Unread and .Read which I didn't put there (neither manually nor did they appear after I installed some kind of plugin - but I'm going to check that again as well). So I thought there is some existing mechanism/functionality in vanilla vanilla which does that.

    Thanks for your help!

Sign In or Register to comment.