Print Page | Close Window

Applying custom banners to the header

Printed From: S2H.co.uk
Category: Web Wiz Forums
Forum Name: Tips & Tricks Support
Forum Description: Support for tutorials from S2H on Web Wiz Forums
URL: http://www.s2h.co.uk/forum/forum_posts.asp?TID=189
Printed Date: 27 Mar 2026 at 12:55am


Topic: Applying custom banners to the header
Posted By: Jano
Subject: Applying custom banners to the header
Date Posted: 18 Oct 2010 at 5:45pm
Posting this query on the suggestion of Scotty32. We recently put up some new banners themed to our forums using the tutorial http://www.s2h.co.uk/wwf/tips/look/change-banner-for-forums.asp - HERE  and we're delighted with them - they look v. smart
 
We have a lot of forums on our site - sub-forums too. Is there a method of applying the banners to cascade down from the category level and apply to the forums and the subs within each area? Our site structure has 11 forum categories and at least 2 forums and/or sub-forums within each of them.
 
Now I know the method I can of course sit down and apply it as per the tutorial but it would be nice to find a quicker way to apply the banners to more than 1 area - one of our forums has getting on for 40 subs so it would be good to have a less labour-intensive method


-------------
I found my Dream World here
http://www.dream-worlds.net">



Replies:
Posted By: Matt
Date Posted: 20 Oct 2010 at 8:26pm

Would you want to want to use ones for some forums as well? or purely based off categories?



Posted By: Jano
Date Posted: 30 Oct 2010 at 4:24pm
Sorry - been really busy and forgot all about this. Embarrassed
 
The set of forum headers we have are all category oriented so far, so that's what I want to go for. If we ever get more site traffic then it's possible we might want to allow some  individiualisation within a category (we have a Hobbies/Pastimes category with a dozen or so different and wide-ranging forums for instance) which I can of course alter as per this current system, but our main orientation is for various fandoms (LotR, Discworld and Arthurian/Celtic thus far) and so that could get pretty diverse potentially.
 
I'm happy with what we have but as they're all within the Categories I'd like the option of applying them from the Category level to cascade/drill down to the other 2 levels without having to apply each and every one on the function_common file Smile


-------------
I found my Dream World here
http://www.dream-worlds.net">


Posted By: Matt
Date Posted: 03 Nov 2010 at 7:11pm

Will post some code at the weekend


Posted By: Matt
Date Posted: 16 Nov 2010 at 8:45pm

Sorry for the delay, I dont have much free time lately.

as for the above, It will be more difficult than I expected, as the Category ID is only set on a few pages (making a forum-wide function produce errors on other pages)

In the "functions_common.asp" file add the part in red to the function from the tutorial and also add another block for the Category banners (green). Also remove the "case else" statements and add the part in blue.

Your function should basically look like the function below

Private Function HeaderImage(intForumID,strTitleImage,intCategoryID)
    Dim strOutput


Select Case intCategoryID
Case 1
strOutput = "location to image"
Case 2
strOutput = "location to image"
End Select


Select Case intForumID
Case 1
strOutput = "location to image"
Case 2
strOutput = "location to image"
End Select

if strOutput = "" then
strOutput = strTitleImage
end if


HeaderImage = strOutput

End function


In the "common.asp" file add the following (red) to the end of the file,


Dim intS2HCatID
intS2HCatID = 0


%>


In the header, add the following (again, red) to the function call from the tutorial

<% strTitleImage = HeaderImage(intForumID,strTitleImage, intS2HCatID) %>



Now, you will need to add to the "forum_posts.asp" and the "forum_topics.asp" files.

Look for the headers Title tags (<title>) and add to the end of the ASP tags on a new line (eg before "%>") the following:

intS2HCatID = intCatID



You will now be able to set headers for categories, and also overwrite it for individual forums if you want to



Posted By: Jano
Date Posted: 17 Nov 2010 at 10:50am
NP with delay - thanks v. much for this Thumbs Up

-------------
I found my Dream World here
http://www.dream-worlds.net">


Posted By: Matt
Date Posted: 18 Nov 2010 at 9:09pm

Let me know if you have any issues. you shouldn't, but you never know if untested code



Print Page | Close Window