PDA

View Full Version : different header per subforum


iogames
02-20-2010, 08:21 PM
Hi...

I was upgrading a forum, and I needed to place an image or logo per each forum or subforum and I had a solution that doesn't work on vB4...

for starters, where can I find:

<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center" style="border-bottom-width:0px">

it was moved out from forumdisplay?

there's a new solution to use a different header for each subforum?

Lynne
02-21-2010, 02:47 AM
The new style is based on divs, not tables, so you won't find that table line in the code any longer. A basic condition based on the forumid should still work in vB4. You may want to look in the vB4 articles forum and read some articles on the new syntax used in the templates.

iogames
02-21-2010, 03:35 PM
Thanks Missy Lynne (I will name my first baby-girl Lynne)

well this was the old solution for ForumDisplay:

Find:
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center" style="border-bottom-width:0px">


Replace:
<table cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center" style="border-bottom-width:0px">


And find:
<td class="tcat" width="100%">$vbphrase[subforums]<span class="normal">

And replace:
<td x width="100%" align="center"><span class="normal">
<if condition="in_array($foruminfo['forumid'], array(1,2,3,4,5))">
<img src="images/catalogs/$foruminfo[forumid].png" align="center" alt="IOGAMES" border="0" />
</if>


Can someone pinpoint the new solution?

Lynne
02-21-2010, 07:46 PM
Did you try just adding this code where you want it?
<vb:if condition="in_array($forum['forumid'], array(1,2,3,4,5))">
<img src="images/catalogs/{vb:raw forum.forumid}.png" align="center" alt="IOGAMES" border="0" />
</vb:if>

You didn't say what template, so I'm not sure the variable name is correct, but it would be something like that.

iogames
02-22-2010, 11:16 AM
ForumDisplay I use on vB 3.8.x :rolleyes:

any?

Lynne
02-22-2010, 10:07 PM
OK, so where did you try it in FORUMDISPLAY for vB4? You need to post your code and tell us what the result was in order for us to help.

iogames
02-22-2010, 11:02 PM
Well Miss Lynne... I noticed that you're becoming a little tough as Moderator... allow me to send you a strawberry cake made by my Mom and a Cactus for your desktop...

First I sold my board, I was wrong about the scope of vB... second I'm helping someone... I pulled out the code from my HDD, tried to implement it and 'Voil?'... I couldn't find where to place it... so I've derailed 2 days from my work, which I love... and facing again the community indifference... :(

What about a vacation everything paid to Cancun? ;)

Lynne
02-23-2010, 12:51 AM
The problem is, even if you add that line into the template, most likely there will need to be some CSS written to make it look correct. That is why I was kinda hoping to see exactly what is being added and perhaps get a link to see it working. I really have no clear picture of what you are wanting to do. I could throw an image onto my test site somewhere, but it isn't necessarily where someone else would put it and so it's real hard to know what the end result would be. You haven't even posted an image to show what you are trying to achieve.

The stuff I posted is probably correct and you would add it into the same template you were adding it before.

There may even be a mod written to do whatever you want to do.

iogames
02-23-2010, 12:15 PM
Let's say:

- an image 800px x 150px
- centered
- working as Header for the Subforum
- between forum navbits and 'new thread' button

:o

Lynne
02-23-2010, 08:40 PM
Just add it below the navbar in the FORUMDISPLAY template. You actually have to use foruminfo, instead of forum:

<vb:if condition="in_array($foruminfo['forumid'], array(1,2,3,4,5))">
<div align="center"><img src="images/catalogs/{vb:raw foruminfo.forumid}.png" align="center" alt="IOGAMES" border="0" width="800" height="150" /></div>
</vb:if>

And it isn't community indifference, it was lack of details given. Instead of talking about what used to be the code, it would have helped to just say what you wanted - give us an image of what you want.

mmoore5553
02-24-2010, 02:17 AM
not to say you are not all knowing lynn and i know you are ... trust me ..you have helped me more times than i can count ..and hope you still do ..but just seen issue.

just seen an error in what you wrote

<vb:if condition="in_array($GLOBALS['forumid'], array(7,3,8,9,10))">
<div align="center"> <img src="images/catalogs/{vb:raw $GLOBALS.forumid}.png" align="center" alt="Wolf" border="0" /> </div>
</vb:if>

should be GLOBALS



Also lynn in this thread you taught me how to use arrays in VB ...could never get them right ..I just used multiple if statements ..so i bow before the all knowing lynn.

I just know i had to use globals when doing the multiply if statements ...

well you can teach an old dog new tricks . ..


woof woof

:D