vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Thread Title color code by forum id (https://vborg.vbsupport.ru/showthread.php?t=286264)

BrettJC 08-03-2012 09:46 AM

Thread Title color code by forum id
 
Hi All,

I would like to colour code Thread Titles according to what forum they are posted in.

I have found this which is aimed at color coding threads from specific forumids in search results, will this work for forums in general and if so where do i need to put it?

<vb:if condition="$show['forumlink'] AND in_array($thread['forumid'], array(x,y,z))">style="color: #123456"</vb:if>

Disco_Dave 08-03-2012 09:49 AM

Try this: https://vborg.vbsupport.ru/showthread.php?t=276131

BrettJC 08-03-2012 09:59 AM

This only allows for thread types to be prefixed and color coded, I am wanting to color code thread titles different colors based on what forum they are in for example.

In the For Sale forum I would like all threat titles to be Blue

In the Wanted forum I would like all thread titles to be Red

etc etc

Lynne 08-03-2012 03:19 PM

Just add a class to the title and use CSS.

class="title{vb:raw thread.forumid}"

Then define title1 (title2, title3, etc.) in the additional.css template

edit: Actually, adding the class may not be necessary as the forumid may be already there. A link to your site and the page you want to change the titles on would help.

BrettJC 08-03-2012 09:13 PM

Thanks Lynne,

Can you give me an example of how it should look

Here is the page I want all thread title to appear blue:
http://www.australianreptileforum.co...p?122-Reptiles

and here is the page i want all thread titles to appear Red:
http://www.australianreptileforum.co...php?124-Wanted

Lynne 08-03-2012 10:31 PM

I guess the forumid isn't used as an id on the forumdisplay page. So, modify the FORUMDISPLAY template and add it as a class to the<body> tag - <body class="forum{vb:raw forumid}"> - and then in additional.css you can add something like:
.forum122 .threadbit a.title {color: blue;}
.forum124 .threadbit a.title {color: red;}

BrettJC 08-04-2012 12:50 AM

Thanks Lynne this worked great

Is there a way to make it show the threat colours regardless of where the thread is displayed, e.g in Searches or in a Master Forum where all threads are displayed?

Lynne 08-04-2012 12:57 AM

I would think so, using a similar method to what I outlined. Without a link to the page, and a description of exactly what you want, I can't be more specific.

BrettJC 08-04-2012 01:09 AM

Hi Lynne,

This is the other site I am working on at the moment this is the Master forum using this mod:

https://vborg.vbsupport.ru/showthread.php?t=245839

All forum threads are displayed here I want the For Sale threads to show blue here and the Wanted Threads to show Red etc

http://reptilesdownunder.com/rdu/for...al-Classifieds

Lynne 08-04-2012 01:44 PM

I don't know that mod, but I am guessing you can modify it to put the forumid in there also and then do the CSS like I posted already.

BrettJC 08-04-2012 09:41 PM

Thanks Lynne, I will try and find where I can add the code above to the mod

--------------- Added [DATE]1344124552[/DATE] at [TIME]1344124552[/TIME] ---------------

The Master forum appears as its own forum so this won't work, is there any way to adapt the code above to set title colour by prefix id?

Lynne 08-05-2012 12:24 AM

I honestly don't know since I do not know the code at all. You would need to look and see what the code is like and you may be able to apply a class based on the prefixid which you could then write some CSS for.


All times are GMT. The time now is 06:58 AM.

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.01830 seconds
  • Memory Usage 1,731KB
  • 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
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (12)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