Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 04-12-2008, 06:31 PM
trigatch4 trigatch4 is offline
 
Join Date: Feb 2007
Posts: 90
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Custom Header for each Forum/Sub-Forum

Custom I want each forum to use a different header image... how would I go about doing this? The only way I can currently think of is to copy/re-install the "style" every single time with only a different header image and then choose "custom forum style" in the forum manager.

Obviously, that option ads a lot of unneccessary bulk. Is there a way to right a quick line that will check a certain folder to see if there is a header image named after the particular forum and if so, to display that, and if not, display a default?

An example of what I mean: If you had a "baseball" forum with subforums for each team, each team's sub forum could be branded for that team. Every thread, post, reply template, etc... everything you do under that forum would have the custom header for the designated forum/sub-forum.

I thought the way I suggested sounds like the easiest but I don't code so... who knows? But maybe something like this already exists? Only one I found was from 3 years ago.

Anyways, I'll let you geniuses order me around....

Discuss!
Reply With Quote
  #2  
Old 04-12-2008, 09:10 PM
iogames's Avatar
iogames iogames is offline
 
Join Date: Jan 2007
Location: Las Vegas, NV.
Posts: 1,433
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I've been looking for something like that too... the closest thing I had seen is this:

https://vborg.vbsupport.ru/showthread.php?t=173240

Let's wait for Lynne to pass around here
Reply With Quote
  #3  
Old 04-13-2008, 02:46 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I think you could do something like:
HTML Code:
 <if condition="$foruminfo[forumid] == x">
Insert image code for banner in forum x
<else />
<if condition="$foruminfo[forumid] == y">
Insert image code for banner in forum y
</if>
</if>
I'm pretty sure that would work. I'm not too sure about the 'if the banner exists' part of it though. I think you'd have to use a plugin to test for that. Although, if you used a plugin to test for it, then spitting it out could be pretty easy if you named them all something like headerx.jpg and headery.jpg. I think I'm gonna have to leave it up to the real coders here since I'm more of a keep-trying-until-it-works type of coder.

edit: Found the function we want - file_exists - and I'm assuming the header to use for forum 4 is header4.jpg and the header to use for forum 22 is header22.jpg, etc.
PHP Code:
 $filename '/path/to/header'.$forumid.jpg;

if (!
file_exists($filename)) {
    
$filename "default.jpg";

And then spit out the image $filename in the header template.

That's how I would go about it anyway. But, I'm sure that code has some sort of syntax error cuz they always do when I first type them out.
Reply With Quote
  #4  
Old 04-16-2008, 04:53 PM
trigatch4 trigatch4 is offline
 
Join Date: Feb 2007
Posts: 90
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Lynne thank you SOOOO much for this. I haven't tried it and I'm sure it will take some tinkering but this is a solid, solid start that I can surely get to work.

You are awesome thanks so much!
Reply With Quote
  #5  
Old 04-16-2008, 04:54 PM
iogames's Avatar
iogames iogames is offline
 
Join Date: Jan 2007
Location: Las Vegas, NV.
Posts: 1,433
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Show me the result when you finish
Reply With Quote
  #6  
Old 04-16-2008, 06:31 PM
trigatch4 trigatch4 is offline
 
Join Date: Feb 2007
Posts: 90
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It might be awhile as my list of "things to do" before launch is 2352523 things long. But I'll PM you when it's done.

... BTW... how did you predict that Lynne would come around and save the day?
Reply With Quote
  #7  
Old 04-16-2008, 06:56 PM
iogames's Avatar
iogames iogames is offline
 
Join Date: Jan 2007
Location: Las Vegas, NV.
Posts: 1,433
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Some have 'IT', some just think they have IT
Reply With Quote
  #8  
Old 05-30-2008, 02:01 PM
trigatch4 trigatch4 is offline
 
Join Date: Feb 2007
Posts: 90
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Lynne... your solution works with one problem:

The headers only display if you're on that Forum/Sub-Forum's actual home screen. I want the header to display no matter where within THAT forum you are. So if you're reading a thread, reading a post, replying to post, etc... the custom banner is always there for each forum -not just on the home of that forum/subforum.

Does that make sense? I'm hoping you can be a lifesaver again!
Reply With Quote
  #9  
Old 05-30-2008, 02:52 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Then you may need to change it from this:
HTML Code:
 <if condition="$foruminfo[forumid] == x">
To this:
HTML Code:
 <if condition="$foruminfo[forumid] == x OR $thread[forumid] == x">
Reply With Quote
  #10  
Old 06-03-2008, 03:48 PM
Lee Wallace Lee Wallace is offline
 
Join Date: May 2008
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I like where you guys are going with this, thanks! One question, where does this code go? :^)
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:41 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.04033 seconds
  • Memory Usage 2,257KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_html
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete