vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Unique Forum Header Including Parent Forums (https://vborg.vbsupport.ru/showthread.php?t=36093)

Scott MacVicar 03-12-2002 10:00 PM

Unique Forum Header Including Parent Forums
 
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.

Dade 03-13-2002 06:22 PM

Excellent hack oh master of hacking ;)

Do you by any chance have a demo or screenshot available? :D

Scott MacVicar 03-13-2002 06:30 PM

em there is no demo :P

it would just change the header at the top....

Floris 03-13-2002 09:06 PM

I can't imagine how this would look, but I do not wish to alter any files prior to the hack, could anybody who applied this please post a screenshot?

This hack sounds like one I am looking for, just wanna be sure :)

Psychdrone 03-13-2002 10:07 PM

well my guess is it would look like Vb, header

notice how it switches between banners;)

Thanks so much Pnn, this is simpile but grand!!

Scott MacVicar 03-14-2002 05:47 AM

PPN!!!!!!!!!!!!!!!!!!!!! :D

**hits Psychdrone**

drives fast 03-14-2002 06:53 PM

I accomplished this same thing by creating (more than one) new templates and naming them whatever. The parsed them and then edited the appropriate templates replacing $header with the new template names.

A bit more time consuming but effective

great job folks

Lionel 03-14-2002 10:36 PM

I think it is good to have the flexibility to customize forums individually. You could theme an entire forum. Great hack. that was the only functionality that I was missing from UBB.

Psychdrone 03-14-2002 10:49 PM

Quote:

Originally posted by PPN
PPN!!!!!!!!!!!!!!!!!!!!! :D

**hits Psychdrone**

right.........PPn
In my book you will always be Pnn :)

Lionel 03-16-2002 09:57 AM

can this hack be extended to include showthread.php for that particular forum? The idea is to sell the new header to a sponsor, but with all the different news hacks or the different ways to access a thread directly without having to enter forum, some people will never see the new header.

trainer 03-16-2002 02:39 PM

Sponsor ad rotation in header with text - already in use (post #1)

Sponsor ad rotation in header with text - already in use. how did they do it? can any experts help out and let me know how to do this.


clcik here for example

hit reload a couple of times and the sponsor in the header changes each time. the extra text in the header would be great for getting and keeping sponsors

any help? does this exist already and i just can't find it? does this hack/addon fill this request?

thanks for the help.

trainer 03-17-2002 03:13 PM

PPN have a small request/edit on this hack. i am sure it probably won't take much but i am not that great iwth computers.

could you edit this hack so it would rotate between 4-5 different headers. instead of taking the # from the forumid could it be setup to just totate over 4-5 different #'s (headers)

i would like to set this up as a sponsor ads setp.

thanks

Lionel 03-17-2002 03:20 PM

Quote:

Originally posted by trainer
Sponsor ad rotation in header with text - already in use (post #1)

Sponsor ad rotation in header with text - already in use. how did they do it? can any experts help out and let me know how to do this.


clcik here for example

hit reload a couple of times and the sponsor in the header changes each time. the extra text in the header would be great for getting and keeping sponsors

any help? does this exist already and i just can't find it? does this hack/addon fill this request?

thanks for the help.

it should be very easy to add banner rotation. Just place the code as an image tag.

Lionel 03-17-2002 03:24 PM

How can I make showtread.php display the same header of the forum?

trainer 03-19-2002 10:56 PM

PPN,

could this be setup so that there are 4-5 headers that are rotated thru. i would like to use this so i can put a banner ad along with some text in the headers. like on webhosting.com has done. i really dont know how to do this or i would do it myself.

i really need something to add some text and image ads in order to keep my site alive. right now with just banners it isn't cutting it. i have been asked by a couple sponsors for something like that. it would be perfect.

thanks for your time

trainer 03-20-2002 04:10 AM

oh come on PPN i know you are probably laughing at how easy this would be to do :)

trainer 03-20-2002 07:33 PM

can anyone help?

c-pr0mpt 03-21-2002 03:52 AM

Was this at all influenced by my hack?

Scott MacVicar 03-21-2002 02:59 PM

Nope it wasn't, I never noticed it before, anyway its alot different it changes it for each forum and inherits its parent forum header if none is set.

Trainer to set this for threads as well involves a little bit of modification, at the moment i'm away out to work. I'll post the code when i get back. It involves checking if its showthread.php and changing what id is used to get the info.

Warlord 03-23-2002 10:06 PM

I would love to get this hack working, but I'm a bit confused as to what the template is supposed to look like.

I just type in something like this?

forumid=1<img src=http://whateverTHEurlIStoTHEimage.jpg>

Warlord 03-23-2002 10:13 PM

Ok, well that didn't work... I'll keep trying, but it'd much more fun for me if one of you geniouses would just let me in on the secret, lol. ;)

Warlord 03-23-2002 10:30 PM

Ok, I'm actually starting to wonder if this is what I'm even looking for. Does this give you the option to give each forum a banner? Or do you have to install this hack on top of itself for each forum you want a new banner for?

Warlord 03-24-2002 12:42 AM

*wonders if people realize I have the mentality of a 3 year old and will keep posting until somebody helps me, lol :)*

Warlord 03-24-2002 03:16 AM

You thought I was kidding, didn't you? ;)

Scott MacVicar 03-24-2002 09:59 AM

create a template called
forumdisplay_header1
put in some stuff
then in forumdisplay with id one you get that header

Warlord 03-24-2002 12:54 PM

Oooook... "put in some stuff" isn't exacly what I was looking for, but the way this sounds I would have to make a template for each forum I wanted to have a different banner in, right? Not really the hack I'm looking for I guess.

Anyone know of a hack like this?

https://vborg.vbsupport.ru/showthrea...threadid=36482

Warlord 03-24-2002 10:31 PM

bump

Warlord 03-25-2002 01:34 AM

Ok, I figured out what you were talking about and installed the hack. Works good, but it doesn't show the forum banner when viewing a thread in that forum.. it defaults back to the origional banner.. how do I change that?

Warlord 03-25-2002 02:00 AM

Ok, I would assume I have to add showthread.php in global.php somewhere like forumdisplay.php is.. but where do I add it?

Scott MacVicar 03-25-2002 10:45 AM

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

M.Smith 03-25-2002 03:50 PM

Quote:

Originally posted by PPN
PPN!!!!!!!!!!!!!!!!!!!!! :D
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:)

trainer 03-25-2002 08:37 PM

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!!! ;)

Warlord 03-26-2002 01:24 AM

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. :(

Warlord 03-26-2002 09:25 PM

bump

trainer 03-27-2002 01:45 AM

bump

Warlord 03-28-2002 02:19 AM

THWACK!

Warlord 03-29-2002 12:05 AM

THWACK!!!

Scott MacVicar 03-30-2002 02:56 PM

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

ladyfyre 03-30-2002 08:58 PM

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!!!!!

Warlord 04-01-2002 01:56 AM

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! :D Been looking for this from day one.


All times are GMT. The time now is 04:48 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.01387 seconds
  • Memory Usage 1,851KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_php_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete