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)
-   -   conditional custom css in specific forum (https://vborg.vbsupport.ru/showthread.php?t=302223)

fxdigi-cash 09-13-2013 01:53 AM

conditional custom css in specific forum
 
Hi,

I was trying to create a custom css for each forum when a specific forum is displayed by user.

This is what i've done do far:

PHP Code:

<vb:if condition="$forumid == 135">
<
style type="text/css">
.
style {background#ff0000; color:#fff}
</style>
</
vb:if> 

Then I decided to change that since it didn't work to a multiple conditional style to see whether it works that way or not:

PHP Code:

<if condition="$forum[forumid] == 135">
<
style type="text/css">
.
style {background#ff0000; color:#fff}
</style>
<
vb:elseif condition="$forum[forumid] == 141">
<
style type="text/css">
.
style {background#000; color:#fff}
</style>
<
vb:elseif condition="$forum[forumid] == 160">
<
style type="text/css">
.
style {background#000; color:#fff}
</style>
</
vb:if> 

after many tried, it still doesn't work :confused: something weird in here...

any idea what wrong in here and how to do the right coding??

Thanks

tbworld 09-13-2013 02:26 AM

Post a couple of lines of template code where you are inserting class 'style'.

It probably is not a problem, but I would stay away from using "style" as a CSS selector.

Zachery 09-13-2013 03:00 AM

Just do individual statements, also, try using $GLOBALS[forumid]

fxdigi-cash 09-13-2013 03:13 AM

Quote:

Originally Posted by tbworld (Post 2445257)
Post a couple of lines of template code where you are inserting class 'style'.

It probably is not a problem, but I would stay away from using "style" as a CSS selector.

I used this codes on af_articlebit in the article forum mod. I don't know if I did the right thing or not, but possibly the location where I used it is not correct, maybe. :o

ok, assume I'm a dump and know nothing, how and where can I insert this code? do I have to create a plugin or just insert the code somewhere in the headinclude template or somewhere else.

Thanks

--------------- Added [DATE]1379045978[/DATE] at [TIME]1379045978[/TIME] ---------------

Quote:

Originally Posted by Zachery (Post 2445259)
Just do individual statements, also, try using $GLOBALS[forumid]

Hi Zachery,

Thanks for the comments. however, do you mean like this:

PHP Code:


<vb:if condition="$GLOBALS[forumid] == 140">
<
style type="text/css">
.
style {background#ff0000; color:#fff}
</style>
</
vb:if> 

should I insert that in any template or headinclude template... I'm using the forum article by the way.

Thanks


All times are GMT. The time now is 05:27 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.01123 seconds
  • Memory Usage 1,732KB
  • 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
  • (3)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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