Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases

Reply
 
Thread Tools
Unique Forum Header Including Parent Forums Details »»
Unique Forum Header Including Parent Forums
Version: 1.00, by Scott MacVicar Scott MacVicar is offline
Developer Last Online: Mar 2016 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 03-12-2002 Last Update: Never Installs: 5
 
No support by the author.

FireFly told me to post it and its semi based on his code.

it tries to use its own forumid if it doesn't use it then it tries the parent one and so forth and if it doesn't find one then it uses the default one.

open global.php

look for
PHP Code:
eval("\$header .= \"".gettemplate('header')."\";"); 
replace with

PHP Code:
if (substr($PHP_SELF, -strlen('forumdisplay.php')) == 'forumdisplay.php') {
  
$forumid intval($forumid);
  
$foruminfo verifyid('forum',$forumid,1,1);
  
$parentlist explode(","$foruminfo["parentlist"]);
  
$header '';
  for (
$i=0$i<count($parentlist) and empty($header); $i++) {
    eval(
"\$header = \"".gettemplate("forumdisplay_header".$parentlist[$i])."\";");
  }
  if(
$header == '') {
    eval(
"\$header .= \"".gettemplate('header')."\";");
  }
} else {
  eval(
"\$header .= \"".gettemplate('header')."\";");

now create a new template called forumdisplay_headerFORUMID where Forumid is the forumid you wish to have the banner for, though this will also affect child forums unless they have their own.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #32  
Old 03-25-2002, 03:50 PM
M.Smith M.Smith is offline
 
Join Date: Feb 2002
Location: Durham, UK
Posts: 34
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by PPN
PPN!!!!!!!!!!!!!!!!!!!!!
should be TAN :P

sounds like a nice hack, im not gonna use it though because i dont like torturing my members with evel banners
Reply With Quote
  #33  
Old 03-25-2002, 08:37 PM
trainer trainer is offline
 
Join Date: Nov 2001
Posts: 160
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by PPN
I'd have to make changes to the code in global.php which I will get around to doing sometime today, I have support tickets still to answer and to clean my room :O
a little trick i learned is to put everything under your bed. place will look clean in 2-3 minutes!!!
Reply With Quote
  #34  
Old 03-26-2002, 01:24 AM
Warlord's Avatar
Warlord Warlord is offline
 
Join Date: Jan 2002
Location: TN, USA
Posts: 668
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by PPN
I'd have to make changes to the code in global.php which I will get around to doing sometime today, I have support tickets still to answer and to clean my room :O
Well yeah, that's what I meant, you have to insert showthread.php in the global.php file along with the code you posted as the hack. My problem is, I'm not sure where to put it, every time I try one I keep getting parse errors.
Reply With Quote
  #35  
Old 03-26-2002, 09:25 PM
Warlord's Avatar
Warlord Warlord is offline
 
Join Date: Jan 2002
Location: TN, USA
Posts: 668
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

bump
Reply With Quote
  #36  
Old 03-27-2002, 01:45 AM
trainer trainer is offline
 
Join Date: Nov 2001
Posts: 160
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

bump
Reply With Quote
  #37  
Old 03-28-2002, 02:19 AM
Warlord's Avatar
Warlord Warlord is offline
 
Join Date: Jan 2002
Location: TN, USA
Posts: 668
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

THWACK!
Reply With Quote
  #38  
Old 03-29-2002, 12:05 AM
Warlord's Avatar
Warlord Warlord is offline
 
Join Date: Jan 2002
Location: TN, USA
Posts: 668
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

THWACK!!!
Reply With Quote
  #39  
Old 03-30-2002, 02:56 PM
Scott MacVicar Scott MacVicar is offline
 
Join Date: Oct 2001
Location: Glasgow, Scotland
Posts: 1,199
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PHP Code:
if (substr($PHP_SELF, -strlen('forumdisplay.php')) == 'forumdisplay.php' || substr($PHP_SELF, -strlen('showthread.php')) == 'showthread.php') {
  if(
$forumid == '') {;
    
$thread getthreadinfo($threadid);
    
$forumid $thread['forumid'];
  }
  
$foruminfo getforuminfo($forumid);
  
$parentlist explode(","$foruminfo["parentlist"]);
  
$header '';
  for (
$i=0$i<count($parentlist) and empty($header); $i++) {
    eval(
"\$header = \"".gettemplate("forumdisplay_header".$parentlist[$i])."\";");
  }
  if(
$header == '') {
    eval(
"\$header .= \"".gettemplate('header')."\";");
  }
} else {
  eval(
"\$header .= \"".gettemplate('header')."\";");

there you go
Reply With Quote
  #40  
Old 03-30-2002, 08:58 PM
ladyfyre's Avatar
ladyfyre ladyfyre is offline
 
Join Date: Nov 2001
Posts: 151
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PPN, i am gonna have to spank your butt for lying to me!!!!

This isn't quite what i was talking about.....

What i want is this:

1. to be able to create "bannerzones".
2. to be have all forums default to zone1 unless edited.
3. to be able to edit the zone a forum will be in in the "edit forum properties" screen.
4. to be able to create a template for that bannerzone (such as banners_zone1, banners_zone2 etc.)

It really shouldn't be that big of a deal....just have the system look up the bannerzone for the forum when showing a forumview or threadview in that area....kind of like doing a template lookup, only not quite.

This way, the bannerzones could be edited...as well as stacked (So if i have advertisers who run national ads, some running Texas, and some running Houston only, then the banners could be set up so that Houston's bannerzone would look like:

National banners HTML
Texas bannerzone HTML
Houston bannerzone HTML

everytime our ads change, i spend tons of time redoing the headers for each city....and god help me if i actually put in a new hack, because then i have to edit the templates in every city as well.....which is a major pain in the hiney!!!!!
Reply With Quote
  #41  
Old 04-01-2002, 01:56 AM
Warlord's Avatar
Warlord Warlord is offline
 
Join Date: Jan 2002
Location: TN, USA
Posts: 668
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by PPN
PHP Code:
if (substr($PHP_SELF, -strlen('forumdisplay.php')) == 'forumdisplay.php' || substr($PHP_SELF, -strlen('showthread.php')) == 'showthread.php') {
  if(
$forumid == '') {;
    
$thread getthreadinfo($threadid);
    
$forumid $thread['forumid'];
  }
  
$foruminfo getforuminfo($forumid);
  
$parentlist explode(","$foruminfo["parentlist"]);
  
$header '';
  for (
$i=0$i<count($parentlist) and empty($header); $i++) {
    eval(
"\$header = \"".gettemplate("forumdisplay_header".$parentlist[$i])."\";");
  }
  if(
$header == '') {
    eval(
"\$header .= \"".gettemplate('header')."\";");
  }
} else {
  eval(
"\$header .= \"".gettemplate('header')."\";");

there you go


THANK YOU! THANK YOU! THANK YOU!

GREAT HACK! Been looking for this from day one.
Reply With Quote
Reply

Thread Tools

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 07:07 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05005 seconds
  • Memory Usage 2,335KB
  • Queries Executed 25 (?)
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
  • (4)bbcode_php
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)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_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