New Posts New Posts RSS Feed - Applying custom banners to the header
  FAQ FAQ  Forum Search   Register Register  Login Login

Applying custom banners to the header

 Post Reply Post Reply
Author
Jano View Drop Down
Newbie
Newbie
Avatar

Joined: 18 Oct 2010
Status: Offline
Points: 3
Post Options Post Options   Quote Jano Quote  Post ReplyReply Direct Link To This Post Topic: Applying custom banners to the header
    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 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


Edited by Jano - 18 Oct 2010 at 11:36pm
Back to Top
Matt View Drop Down
Admin Group
Admin Group


Joined: 07 Feb 2003
Location: Manchester, UK
Status: Offline
Points: 195
Post Options Post Options   Quote Matt Quote  Post ReplyReply Direct Link To This Post 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?

Back to Top
Jano View Drop Down
Newbie
Newbie
Avatar

Joined: 18 Oct 2010
Status: Offline
Points: 3
Post Options Post Options   Quote Jano Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Matt View Drop Down
Admin Group
Admin Group


Joined: 07 Feb 2003
Location: Manchester, UK
Status: Offline
Points: 195
Post Options Post Options   Quote Matt Quote  Post ReplyReply Direct Link To This Post Posted: 03 Nov 2010 at 7:11pm

Will post some code at the weekend
Back to Top
Matt View Drop Down
Admin Group
Admin Group


Joined: 07 Feb 2003
Location: Manchester, UK
Status: Offline
Points: 195
Post Options Post Options   Quote Matt Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
Jano View Drop Down
Newbie
Newbie
Avatar

Joined: 18 Oct 2010
Status: Offline
Points: 3
Post Options Post Options   Quote Jano Quote  Post ReplyReply Direct Link To This Post Posted: 17 Nov 2010 at 10:50am
NP with delay - thanks v. much for this Thumbs Up
Back to Top
Matt View Drop Down
Admin Group
Admin Group


Joined: 07 Feb 2003
Location: Manchester, UK
Status: Offline
Points: 195
Post Options Post Options   Quote Matt Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down



This page was generated in 0.109 seconds.