vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Forum row to indicate new content (https://vborg.vbsupport.ru/showthread.php?t=294974)

GamerPerfection 02-10-2013 05:21 PM

Forum row to indicate new content
 
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 09:03 AM

No ideas anyone?

BirdOPrey5 02-26-2013 12: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:

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

Code:

        <div class="forumrow table">
Now edit it to look like this:

Code:

        <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 12:25 PM

WOW awesome, it works! I love it! And the yellow is pretty cool!

Thank you so much!


All times are GMT. The time now is 10:32 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01401 seconds
  • Memory Usage 1,716KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete