vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Design and Graphics Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=168)
-   -   Row (background) color based on prefix (https://vborg.vbsupport.ru/showthread.php?t=250845)

Areku 09-20-2010 08:33 AM

Row (background) color based on prefix
 
Hi

I want to color the background of every thread's row based on its prefix.

Ie. PREFIX A is red, PREFIX B is green, PREFIX C is yellow

Hence, having threads

A thread 1
A thread 2
B thread 3
C thread 4
A thread 5

would result in threads' rows colored as

A red thread 1
A red thread 2
B green thread 3
C yellow thread 4
A red thread 5


instead of the alternate default bluish colors ;)


Ideas?


Thanks!

Lynne 09-20-2010 01:49 PM

Change the class of the background row based on the prefix and then define the classes in the CSS to be different for each color.

Areku 09-20-2010 02:12 PM

Which translates into...?? ;)

(Sorry I just dont know where to start ;) are there IF clauses for the CSS??)

Thanks!!

BigJohnny 09-22-2010 11:00 AM

you will need an if statement for the prefixid's I believe.

<if condition="$prefixid[id-goes-here]" OR $prefixid[other-id-goes-here]> (I'm fairly certain I have mangled that statement, but it's only an example as I don't know the exact code for prefixes)

then you would put your if statements around the code that builds the tables and rows, and it would check prefixes (IDs) and apply your changes.

You would also have to change the class of the tables based on the prefix, so you would need to make a variable for the class, and add multi css entries.

Lynne, am I way off here or am I at least in the ballpark?

Lynne 09-22-2010 01:50 PM

You are going in the direction I would go (I'm sure there are many ways to do this). I'd find the row and add
HTML Code:

class="<if condition="$threadinfo[prefixid]==xx">class1<if>"
And then in the Main CSS area, I'd define class1:
HTML Code:

.class1 {background:pink;}

Areku 09-23-2010 08:05 AM

Thaaats it, ;) thanks!!!

^SuiCyde^ 07-28-2013 05:38 AM

Quote:

Originally Posted by Lynne (Post 2101836)
You are going in the direction I would go (I'm sure there are many ways to do this). I'd find the row and add
HTML Code:

class="<if condition="$threadinfo[prefixid]==xx">class1<if>"
And then in the Main CSS area, I'd define class1:
HTML Code:

.class1 {background:pink;}

I'm very interested in this, and I realize it was a long time ago that it was posted. I apologize!

How would I go about "finding the row" to add that entry?


All times are GMT. The time now is 11:53 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.01062 seconds
  • Memory Usage 1,727KB
  • 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
  • (4)bbcode_html_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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