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)
-   -   Can this be done, or do I need a mod? (https://vborg.vbsupport.ru/showthread.php?t=177573)

legionofangels 04-30-2008 01:49 AM

Can this be done, or do I need a mod?
 
Hello,

Planning a new site, if I can acquire some information here first.

Is it possible to make each forum under a category on the main index page, have a different bg, as shown in the graphic:

Rough sketch here of course:

http://img.photobucket.com/albums/v3...666/tester.jpg

Again, very rough, and just meant to show the difference of colors. Can that be done perhaps in the templates, or with an array? Plus, can it be done with images and not just HTML colors?

davide101 04-30-2008 03:06 PM

You could use conditionals in the templates based upon the category to insert a background image or color. But this would be a pain if you are always adding or removing forums. Personally, I wouldn't recommend it unless your site is going to be fairly static.

Lynne 04-30-2008 04:24 PM

Someone was posting about something else and we talked about a plugin that would check:

Code:

$background = "backgroud".$forumid.jpg;
if (!$background)
  $background = default.jpg;

So basically, you add to your images/whatever/folder/ a bunch of backgrounds with the forumid at the end - ie. background23.jpg for forumid 23, backround14.jpg for forumid 14, etc. If there is no background14 for forumid, then it uses default.jpg instead.

Then in the template, for the row, just add "style="background: url(/images/whatever/folder/$background);" to the row.

(That is probably totally messed up. I can't code just by writing, I am a trial and error person, but perhaps you understand what I'm saying.)

legionofangels 04-30-2008 05:18 PM

First of all, no...forums would never change, aside from more being added is all.

Two, Lynne that was exactly what I was thinking. I remember Jake gave me the information for the images in front of our forum categories, with an array based upon forum ID. So I was thinking why can't I do an array with the forum id's and use backgrounds as well.

Reference:

http://www.vbulletin.com/forum/showthread.php?t=114545

Lynne 04-30-2008 06:29 PM

Using that thread as an example, this is from the template "forumhome_forumbit_level1_nopost" (around the sixth line):
HTML Code:

        <td class="tcat" colspan="<if condition="$vboptions[showmoderatorcolumn]">6<else />5</if>">
            <if condition="$childforumbits">
            <a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('forumbit_$forumid')"><img id="collapseimg_forumbit_$forumid" src="$stylevar[imgdir_button]/collapse_tcat{$collapseimg_forumid}.gif" alt="" border="0" /></a>
            </if>
            <a href="forumdisplay.php?$session[sessionurl]f=$forum[forumid]">$forum[title]</a>

I *think* you could add a style to the td tag like this:

HTML Code:

<if condition="in_array($forum['forumid'], array(X,Y,Z))">
        <td class="tcat" colspan="<if condition="$vboptions[showmoderatorcolumn]">6<else />5</if>" style="background: url(/images/folder/background$forum[forumid].gif)
repeat-x;"
>

<else />
        <td class="tcat" colspan="<if condition="$vboptions[showmoderatorcolumn]">6<else />5</if>">
</if>

If that doesn't work, then I would add at the top of the template:
HTML Code:

<style type="text/css">
 td.cat$forum[forumid] {background: url(/images/folder/background$forum[forumid].gif repeat-x;}
</style>

And then for the td tag (along with the conditional from above):
HTML Code:

        <td class="tcat cat$forum[forumid]" colspan="<if condition="$vboptions[showmoderatorcolumn]">6<else />5</if>" >
And, again I'll say you may have to play with it as I'm a trial and error coder. :)


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