View Full Version : Can this be done, or do I need a mod?
legionofangels
04-30-2008, 02:49 AM
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/v318/scorpion_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, 04: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, 05:24 PM
Someone was posting about something else and we talked about a plugin that would check:
$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, 06: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, 07:29 PM
Using that thread as an example, this is from the template "forumhome_forumbit_level1_nopost" (around the sixth line):
<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:
<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:
<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):
<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. :)
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.