PDA

View Full Version : Thread Title color code by forum id


BrettJC
08-03-2012, 10:46 AM
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, 10:49 AM
Try this: https://vborg.vbsupport.ru/showthread.php?t=276131

BrettJC
08-03-2012, 10: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, 04: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, 10: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.com/arf/forumdisplay.php?122-Reptiles

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

Lynne
08-03-2012, 11: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, 01: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, 01: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, 02: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/forumdisplay.php?1-Australian-Herpetological-Classifieds

Lynne
08-04-2012, 02: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, 10:41 PM
Thanks Lynne, I will try and find where I can add the code above to the mod

--------------- Added 1344124552 at 1344124552 ---------------

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, 01: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.