PDA

View Full Version : Forum row to indicate new content


GamerPerfection
02-10-2013, 06:21 PM
Right, we all know that most forums have a little icon down the left side that indicates whether there are any new posts or not. Which is great, but I want something different and i've had an idea which i don't know if it will be achievable.

Basically I have my forumrow to change colour when I move the mouse over it. But what I would like instead is for the forumrow to become a different (maybe darker) colour when there are new posts to be read.

I've got an example in my screenshot. Is this at all possible?

http://www.gamerperfection.com/images/forumrow.png

GamerPerfection
02-26-2013, 10:03 AM
No ideas anyone?

BirdOPrey5
02-26-2013, 01:00 PM
It is a heavily customized style so I'm not 100% sure that is "FORUMHOME" AKA forum.php but assuming it is you will want to edit the template

forumhome_forumbit_level2_post

If you look at that template you see that the status icon image (the image that changes depending on new posts or not) is built using the following code:


{vb:raw forum.imageprefix}forum_{vb:raw forum.statusicon}-48.png


Basically this means that {vb:raw forum.statusicon} is equal to "old" when there are no new posts and "new" when there are new posts (if you look at their file names you see they are forum_old-48.png and forum_new-48.png respecfully)

This means we can check the value of the variable in a template conditional and alter the code based on what the value is.

In a default template the code looks like this- it may be different on your custom style, but for me it is the 2nd line of the template


<div class="forumrow table">


Now edit it to look like this:


<div class="forumrow table" <vb:if condition="$forum['statusicon'] == 'new'">style="background-color:yellow;"</vb:if>>


That will make the background of any of the forums with new posts yellow (change the color as you wish as well)

Tested this against a default style.

GamerPerfection
02-26-2013, 01:25 PM
WOW awesome, it works! I love it! And the yellow is pretty cool!

Thank you so much!