vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Design and Graphics Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=253)
-   -   Css thread color style (https://vborg.vbsupport.ru/showthread.php?t=302819)

Set3sh 09-30-2013 08:47 AM

Css thread color style
 
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 09: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 11:45 AM

Those tags are prefixes to whom only administrators have access.

ozzy47 09-30-2013 08: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 09: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:
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 09:42 PM

He wants the thread title to change color also, if I understand correctly.

tbworld 09-30-2013 09: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 09: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 09: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 10:54 AM

I doubt that would work, and probably would break the display, coloring things it should not.


All times are GMT. The time now is 10:07 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.01164 seconds
  • Memory Usage 1,725KB
  • 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)bbcode_html_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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