starter topic gets the wrong class
It is all about this function (applications\vanilla\views\discussions\helper_functions.php)
if (!function_exists('NewComments')): function NewComments($Discussion) { if (!Gdn::Session()->IsValid()) return ''; if ($Discussion->CountUnreadComments === TRUE) { $Title = htmlspecialchars(T("You haven't read this yet.")); return ' <strong class="HasNew JustNew NewCommentCount" title="'.$Title.'">'.T('new discussion', 'new').'</strong>'; } elseif ($Discussion->CountUnreadComments > 0) { $Title = htmlspecialchars(Plural($Discussion->CountUnreadComments, "%s new comment since you last read this.", "%s new comments since you last read this.")); return ' <strong class="HasNew NewCommentCount" title="'.$Title.'">'.Plural($Discussion->CountUnreadComments, '%s new', '%s new plural', BigPlural($Discussion->CountUnreadComments, '%s new', '%s new plural')).'</strong>'; } return ''; } endif;
First of all: i translated T('new discussion', 'new') to T('new discussion', 'New Topic')...ofcourse in the locale.php
What happens: person A starts a new topic. Person B sees this topic as "New Topic". He gives a comment on that topic.
Person A sees this comment as "New Topic". That's wrong. He is the starter of the topic and for him it is not anymore a "New Topic".
Person A reads the comment. Person B writes another comment in the same topic. At this time, Person A sees "1 new" at the topic.
But that "1 new" should appear immediately after posting the first comment in that topic.
So there should be something like this in the code above:if ($Discussion->CountUnreadComments === TRUE || $Discussion->Starter != $you) {
How can i realise that?
Note: ofcourse this was not a real issue if i did not translate new to New Topic, but i want to make difference between a new topic and an existing topic with a new comment; so i gave the class JustNew a green background-color and HasNew a blue bg-color
Comments
I would consider this a bug. Could you file it on github?
Create a new plugin with an empty classbody and add the function to the end of the file to override it.
Your code above would be
My themes: pure | minusbaseline - My plugins: CSSedit | HTMLedit | InfiniteScroll | BirthdayModule | [all] - PM me about customizations
VanillaSkins.com - Plugins, Themes and Graphics for Vanillaforums OS
@Bleistivt
the code you mentioned does not work properly; now all new comments are seen as "new Topics"
I did not check your logic, I just implemented your pseudocode. Try && instead of ||
My themes: pure | minusbaseline - My plugins: CSSedit | HTMLedit | InfiniteScroll | BirthdayModule | [all] - PM me about customizations
VanillaSkins.com - Plugins, Themes and Graphics for Vanillaforums OS
Ofcourse, it should be and instead of or. My logic was wrong.
This works fine now! Thanks @Bleistivt