Change the "last message" icon's color when unread

Need some custom code changes to the phpBB core simple enough that you feel doesn't require an extension? Then post your request here so that community members can provide some assistance.

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
TB54
Registered User
Posts: 22
Joined: Wed Apr 06, 2016 10:19 am

Re: Change the "last message" icon's color when unread

Post by TB54 »

Hello !
This change in forumlist_body only retrieves the status of an unread post in the targeted forum. And if you post a new message, it will appear on the index with the red icon even though you have read it (since you wrote it).
Mmm now I'm afraid to miss the obvious, but I just tried to post a message and to go back to the index, and it doesn't appear red.
User avatar
cabot
Registered User
Posts: 689
Joined: Sat Jan 07, 2012 4:16 pm
Contact:

Re: Change the "last message" icon's color when unread

Post by cabot »

Because there are no unread posts in the forum.
TB54
Registered User
Posts: 22
Joined: Wed Apr 06, 2016 10:19 am

Re: Change the "last message" icon's color when unread

Post by TB54 »

I'm note sure to follow you. You wrote:
And if you post a new message, it will appear on the index with the red icon even though you have read it (since you wrote it).

I opened the board on two different browsers, loged in to it with two different accounts.

I posted a message with account 1, and came back to index.

The arrow-icon displayed was grey for account 1, and red for account 2.
User avatar
cabot
Registered User
Posts: 689
Joined: Sat Jan 07, 2012 4:16 pm
Contact:

Re: Change the "last message" icon's color when unread

Post by cabot »

Go into a forum that contains an unread post, create a new topic or reply to a post other than the unread one.
Go back to the index, and you will see that the link to your post is marked with a red icon.

The conditional comment used in forumlist_body is explicit enough not to be mistaken:
if forumrow.S_UNREAD_FORUM
TB54
Registered User
Posts: 22
Joined: Wed Apr 06, 2016 10:19 am

Re: Change the "last message" icon's color when unread

Post by TB54 »

Ok, thanks, I understand now!

That's indeed a problem... And modifying the PHP would be an option? Or it will be too complicated / too problematic?
User avatar
cabot
Registered User
Posts: 689
Joined: Sat Jan 07, 2012 4:16 pm
Contact:

Re: Change the "last message" icon's color when unread

Post by cabot »

An extension would be needed to get with PHP the read/unread status of the messages displayed on the index, in order to create a conditional comment for use in the template file.
TB54
Registered User
Posts: 22
Joined: Wed Apr 06, 2016 10:19 am

Re: Change the "last message" icon's color when unread

Post by TB54 »

Mmm, in fact it's pretty close to an extension I requested not so long ago: viewtopic.php?f=496&t=2601486

So it's seem we're stuck... Thanks for your help anyway!
Post Reply

Return to “phpBB Custom Coding”