Sticky topics, when read, unbold

Started by J-Rad14, January 14, 2011, 11:59:42 AM

Previous topic - Next topic

J-Rad14

I used the code provided by (F.L.A.M.E.R) in this post to bold new topics, but sticky topics stay bold no matter what. I'm a newbie when it comes to PHP but know this is a simple fix. I almost got it but either ended up duplicating the subject or getting a "1" on the left and right of the subject...

Quote from: (F.L.A.M.E.R) on December 29, 2010, 01:14:13 PM
In the file: ./Themes/default/MessageIndex.template.php

Find:
                     ', $topic['is_sticky'] ? '<strong>' : '', '<span id="msg_' . $topic['first_post']['id'] . '">', $topic['first_post']['link'], (!$context['can_approve_posts'] && !$topic['approved'] ? '&nbsp;<em>(' . $txt['awaiting_approval'] . ')</em>' : ''), '</span>', $topic['is_sticky'] ? '</strong>' : '';



Replace with:
                           ', $topic['is_sticky'] || ($topic['new'] && $context['user']['is_logged']) ? '<strong>' : '', '<span id="msg_' . $topic['first_post']['id'] . '">', $topic['first_post']['link'], (!$context['can_approve_posts'] && !$topic['approved'] ? '&nbsp;<em>(' . $txt['awaiting_approval'] . ')</em>' : ''), '</span>', $topic['is_sticky'] || ($topic['new'] && $context['user']['is_logged']) ? '</strong>' : '' ;

This should make topics with new reply bold when looked in the board.

Tested and working. :) Also added to the users forum.

Marking this as solved.

What bit of code do I need to modify? Currently, non-sticky topics bold when new, and unbold when read, I would like the same to be done for sticky topics, currently they are bold read and unread.


\\\\\\ I would also like this for the board names. Bold new posts. Non-bold no new posts.

\\ Changed first instance of "is_sticky" to "is_approved" and that does what I want. Now off to changing read/unread icons based on purely that and not "my" topics.

Nibogo

Just replace the last code with:

', ($topic['new'] && $context['user']['is_logged']) ? '<strong>' : '', '<span id="msg_' . $topic['first_post']['id'] . '">', $topic['first_post']['link'], (!$context['can_approve_posts'] && !$topic['approved'] ? '&nbsp;<em>(' . $txt['awaiting_approval'] . ')</em>' : ''), '</span>', ($topic['new'] && $context['user']['is_logged']) ? '</strong>' : '' ;

Hope it works :)

Advertisement: