Log in

View Full Version : Css thread color style


Set3sh
09-30-2013, 07:47 AM
I would like to do this:
If a thread title contains [Accepted] I would like that the threads title color to change to green, if it contains [Rejected] to change the color to red and if contains the tag [Pending] to change to yellow.
I was thinking to do it like this in additional.css:
a switch: case 1 [Accepted] a.title {color:green;} | case 2 [Rejected] a.title {color:red;} | case 3 [Pending] a.title {color:yellow;}

I know it's php/css and that c/c++ doesn't quite fit here, but I'm open to suggestions.

Thank you :)

ozzy47
09-30-2013, 08:36 AM
Is [Accepted], [Rejected], [Pending] Thread Prefixes, that you assign to threads based on some criteria, or is it some text you add to them?

Set3sh
09-30-2013, 10:45 AM
Those tags are prefixes to whom only administrators have access.

ozzy47
09-30-2013, 07:13 PM
Ok I think I may be able to do something, I'll get back to you when I have a chance to play around.

Jordan S Smith
09-30-2013, 08:38 PM
Actually it's easier than you think. Go into the ACP>Thread Prefixes>Thread Prefix Manager now either make a new prefix or edit an old one.

Once you reach the screen where you set the ID, title, etc, you should see a link below the two title's. Note, you'll need to save the prefix first and to this screen if you're creating a new one. Click on the link beneath Title (Rich Text). It'll popup a tab/page called Phrase Manager. Here you can use Html code to stylize your prefix.

For instance, if you wanted a green colored [Accepted] prefix, you would use the html code:
<span style="color: green;">[Accepted]</span>

Note that all code must go in the text box just above the save and reset buttons.
Also note you'll have to add the prefix title manually like I did in the code. It replaces the generic title with the colored version.

If you know html and the style property you can make some pretty amazing prefixes. I used backgrounds on the ones I made. Theoretically, I haven't tried it myself, you could even use images as a prefix.

Hope this helped ^^

ozzy47
09-30-2013, 08:42 PM
He wants the thread title to change color also, if I understand correctly.

tbworld
09-30-2013, 08:46 PM
Waiting :) -- I have a feeling @Ozzy47 is already working on this. If he is not (and I would be surprised) I will jump in.

ozzy47
09-30-2013, 08:54 PM
I am just dabbling at the moment, if you want to play, feel free. :)

--------------- Added 30 Sep 2013 at 18:27 ---------------

It does not appear to be as easy as I assumed, unless my brain is fried and I can't think right. :(

Set3sh
10-01-2013, 08:46 AM
Yes you understood corectly.
I want the entire thread title to change color depending the prefix it has.
I might provide a work-around, but I think it's not safe: <font color="red">[Rejected] etc. And leave the html tags unclosed.
From my perspective unclosed html tags can be a vulnerability add to a software.

ozzy47
10-01-2013, 09:54 AM
I doubt that would work, and probably would break the display, coloring things it should not.