Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Design and Graphics Discussions
  #1  
Old 09-30-2013, 08:47 AM
Set3sh's Avatar
Set3sh Set3sh is offline
 
Join Date: Jan 2013
Location: Romania
Posts: 35
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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
Reply With Quote
  #2  
Old 09-30-2013, 09:36 AM
ozzy47's Avatar
ozzy47 ozzy47 is offline
 
Join Date: Jul 2009
Location: USA
Posts: 10,929
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is [Accepted], [Rejected], [Pending] Thread Prefixes, that you assign to threads based on some criteria, or is it some text you add to them?
Reply With Quote
  #3  
Old 09-30-2013, 11:45 AM
Set3sh's Avatar
Set3sh Set3sh is offline
 
Join Date: Jan 2013
Location: Romania
Posts: 35
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Those tags are prefixes to whom only administrators have access.
Reply With Quote
  #4  
Old 09-30-2013, 08:13 PM
ozzy47's Avatar
ozzy47 ozzy47 is offline
 
Join Date: Jul 2009
Location: USA
Posts: 10,929
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok I think I may be able to do something, I'll get back to you when I have a chance to play around.
Reply With Quote
  #5  
Old 09-30-2013, 09:38 PM
Jordan S Smith Jordan S Smith is offline
 
Join Date: Feb 2013
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 ^^
Reply With Quote
  #6  
Old 09-30-2013, 09:42 PM
ozzy47's Avatar
ozzy47 ozzy47 is offline
 
Join Date: Jul 2009
Location: USA
Posts: 10,929
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

He wants the thread title to change color also, if I understand correctly.
Reply With Quote
  #7  
Old 09-30-2013, 09:46 PM
tbworld tbworld is offline
 
Join Date: Oct 2008
Posts: 2,126
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Waiting -- I have a feeling @Ozzy47 is already working on this. If he is not (and I would be surprised) I will jump in.
Reply With Quote
  #8  
Old 09-30-2013, 09:54 PM
ozzy47's Avatar
ozzy47 ozzy47 is offline
 
Join Date: Jul 2009
Location: USA
Posts: 10,929
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
Благодарность от:
CAG CheechDogg
  #9  
Old 10-01-2013, 09:46 AM
Set3sh's Avatar
Set3sh Set3sh is offline
 
Join Date: Jan 2013
Location: Romania
Posts: 35
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #10  
Old 10-01-2013, 10:54 AM
ozzy47's Avatar
ozzy47 ozzy47 is offline
 
Join Date: Jul 2009
Location: USA
Posts: 10,929
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:59 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.03977 seconds
  • Memory Usage 2,235KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_html
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (10)post_thanks_box
  • (1)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete