PDA

View Full Version : Unique Forum Header Including Parent Forums


Scott MacVicar
03-12-2002, 10:00 PM
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
eval("\$header .= \"".gettemplate('header')."\";");

replace with

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
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 (http://www.webhostingtalk.com/forumdisplay.php?forumid=2)

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
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 (http://www.webhostingtalk.com/forumdisplay.php?forumid=2)

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/showthread.php?s=&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
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
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
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
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
Originally posted by PPN
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.

Warlord
04-01-2002, 02:20 AM
Question... if that code makes the banner appear when viewing threads, shouldn't this edited code make the banner appear when showing search results?

if (substr($PHP_SELF, -strlen('forumdisplay.php')) == 'forumdisplay.php' || substr($PHP_SELF, -strlen('showthread.php')) == 'showthread.php' || substr($PHP_SELF, -strlen('search.php')) == 'search.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')."\";");
}

It's not working.. I'm not getting any parse errors, it just doesn't show the forum banner when displaying the search results. :( What am I doing wrong?

ladyfyre
04-01-2002, 03:32 AM
PPN, FireFly, ANYONE....please help!!!!

Ok....implemented this...tested it...all was ok....still not quite what I had been looking for, but worked well, and even if it was a bit more work...it was worth it!

However....now there is a MAJOR problem.....

this is throwing wayyyy too many extra queries out....

PPN, you KNOW how many users we have...and it is kicking my servers butt BAD.

Please please please....can ya help me get this streamlined some?

Otherwise I am going to have to re edit each forum, and go back to the old different template per place....

All it would really take it is a call similiar to the one which determines what template set to use, but instead would call and add into the header of the templates the banner file for that forum. For that matter, I would even be happy with using an include right now if you can just help me get the same functionality, without all these extra queries!!!

Scott MacVicar
04-01-2002, 07:57 AM
i'm doing your banner thing you wanted, like a full banner system for vBulletin so other people can use it.

Warlord
04-04-2002, 09:06 PM
You talkin to me or ladyfyre? If you're talkin to me... THANKS! :)

alexwriting
04-14-2002, 01:10 PM
Originally posted by PPN
i'm doing your banner thing you wanted, like a full banner system for vBulletin so other people can use it.

Hi PPN,

Did you have time to do this? It would be just dynamite! :)

Many thanks,

Alex

Warlord
04-14-2002, 10:33 PM
THWACK!

:D

Warlord
04-25-2002, 10:43 PM
THWACK! :D

BrAinZ
05-09-2002, 05:09 PM
I'm a little lost and would REALLY appreciate some help.

I am trying to put a Flash animated banner in the banner position where we normally have a plain jpg or gif picture.

Simply adding it as a banner image doesn't work (obviously), so I was hoping to be able to use this hack to sort the problem..

I have updated the global.php as directed and created a new template with the correct FORUMID, but the forum that I want the "modified" header for, still shows the DEFAULT header :(

Any ideas on what could be going wrong ?

Gaffer
12-01-2002, 02:20 PM
did you embed the flash or just do it as an image

Rich_Z
01-22-2003, 01:59 AM
i'm doing your banner thing you wanted, like a full banner system for vBulletin so other people can use it.

Did this ever happen?

Thanks.