View Full Version : Forum Headers Hack
FASherman
08-24-2002, 10:00 PM
The idea for this hack came from the desire to increase forum traffic. What I wanted to do was subscribe individual forums into webrings. The problem was each forum would have to have the webring code within that forum page.
So I began writing this with the idea of just enabling webrings for a forum, but saw that it would just as easily be useful for adding custom HTML headers to individual forums.
What this hack does is allow you to specify an HTML code as a header for a specific forum. From the Admin CP, you specify whether a forum should have a forum header, if it should be guest only or not (I didn't want to bother registeres users with the webring banner), and then a text box for entering in the HTML
You can view a sample forum header at my site:
http://www.fasherman.com/forums/forumdisplay.php?forumid=27
I've also included a screen shot of AdminCP
FASherman
08-25-2002, 09:21 PM
Here is the screenshot of AdminCP
Ninth Dimension
08-25-2002, 10:25 PM
OK, I like this idea, it would allow you to add any type of customised content to the headers in your forums, cool idea, very cool.
I might have to install this one soon. (useful for sponsors messages :):):))
FASherman
08-26-2002, 12:13 AM
Here's another example of how I'm using this:
http://www.fasherman.com/forums/forumdisplay.php?forumid=4
When you hit that forum, you'll see the webring graphs (pending), but registered users don't see it. They have no idea that I'm adding the forums to webrings to increase traffic.
The idea could easily be adapted to use/limit banner adds for user classes.
trainer
08-26-2002, 01:00 AM
i run a big site with 10,000 members, will this put alot of extra load on the server?
FASherman
08-26-2002, 02:33 AM
I would imagine not significantly more than is already typical. It adds only one query to forumdisplay.php, so really no more than an additional thread being added.
I believe PPN already released something like this.
FASherman
08-26-2002, 11:28 AM
I don't think so. Remember, this isn't designed for banner ads. You can use it that way, but the HTML code will have to handle aging, rotating, etc.
All this hack does is add a customer header and footer to each forum. I just updated the install file to include adding footers too.
It gives anyone the ability to do what http://www.sitepointforums.com/ has done without having to do it as a template hack that makes each forum the same.
kmfdm_kid2000
08-26-2002, 11:38 AM
I think I'll be installing this one when I get back home, I can add more (And Varied) Meta tags, and have different main banners for each forum, correct?? If so, this would be something I'd be interested in, but I just don't tust hacking when I'm away from home... :) But I'll click install anyway, b/c this is a definite hack I'd like...
FASherman
08-26-2002, 11:43 AM
Originally posted by kmfdm_kid2000
I think I'll be installing this one when I get back home, I can add more (And Varied) Meta tags, and have different main banners for each forum, correct??
Thats correct. I updated the sample forum to show a footer as well.
thedvs
08-26-2002, 03:26 PM
followed it to the letter (including the sanity bit heh)
got this error... from the admin panel...
Invalid SQL: UPDATE forum
SET
styleid='1', title='Chit Chat', description='General Discussion, board news, news, discuss anything you want in here.',
active='1', displayorder='3', iconimg='', parentid='6', parentlist='8,6,-1',
allowposting='1', cancontainthreads='1', daysprune='30',
newpostemail='', newthreademail='',
moderatenew='0', allowhtml='1', allowbbcode='1',
allowimages='1', allowsmilies='0', allowicons='0',
styleoverride='1', allowratings='1', countposts='1',
moderateattach='0',forumnewsid='',
enableheader='1',guestonlyheader='0',forumheader=' THIS IS A TEST HEADER'
WHERE forumid='8'
mysql error: Unknown column 'iconimg' in 'field list'
mysql error number: 1054
FASherman
08-26-2002, 04:20 PM
If you don't have the forum icons hack, you won't have the iconimg field in your forums table.
Thats why I mentioned that line would need som sanity checking to make sure it was consistant with your site.
Smoothie
08-26-2002, 04:31 PM
step 9 says: In forumdisplay.php
FIND:
-----------
updateuserforum($forumid);
-----------
Then your code. Does it go before or after?
FASherman
08-26-2002, 05:20 PM
Originally posted by Smoothie
step 9 says: In forumdisplay.php
FIND:
-----------
updateuserforum($forumid);
-----------
Then your code. Does it go before or after?
Add after. I fixed the install file. Thanks for the feedback!
thedvs
08-26-2002, 08:33 PM
installed perfectly!
ive been waiting for a hack like this all damn year
Vinney
08-26-2002, 09:02 PM
amazing ! cant wait too install it !
look at this
https://vborg.vbsupport.ru/showthread.php?s=&threadid=36093
Originally posted by FASherman
I don't think so. Remember, this isn't designed for banner ads. You can use it that way, but the HTML code will have to handle aging, rotating, etc.
All this hack does is add a customer header and footer to each forum. I just updated the install file to include adding footers too.
It gives anyone the ability to do what http://www.sitepointforums.com/ has done without having to do it as a template hack that makes each forum the same.
FASherman
08-27-2002, 07:49 PM
Not even close to being the same. Why would you create a template per forum when you can just enter HTML directly into a text box via the ACP, keep the data in the database and have it protecting with backups?
Also nothing about footer or restricting the headers and footers individually to just guests.
Would you suggest two additional templates per forum to have both a header and a footer? Not to mention the headache of having to check forumid's before modifying a template if you have several forums. Or having to remember to delete templates if a forum gets deleted.
This is a much more managable, elegant solution. You want to edit the header/footer of a particular forum, you edit the forum. You want to limit either the header or footer to just guests, select that option as you edit the forum. You delete the forum, the header/footer info goes away at the same time. Whats the cost? One SQL querie, same as adding a new thread.
What exactly are you objecting to?
FASherman
08-27-2002, 08:12 PM
Here is one that is actually quite similar in approach but more limited in functionality. I came up in the list as I was checking this thread.
https://vborg.vbsupport.ru/showthread.php?s=&threadid=26818
I'm going to link to is because if all you want is banners and the ability to set time limits, this is a better approach. You display a picture, not actual HTML.
If you want HTML headers and footers and would rather have control based on user level, this is the better approach.
Smoothie
08-27-2002, 08:46 PM
Question. Step 5:The following FIND/REPLACE will require some sanity checking,
depending if you have installed hacks that have added fields.
Still in admin/forums.php Here:FIND:
-----------
$DB_site->query("INSERT INTO forumThis: iconimg, and this: forumnewsid are not in my code. I know they are in your's because of hacks you have installed that I don't. Do I eliminate them from the code that I replace? Wouldn't it have been better to supply the clean code to find and replace? It's a bit confusing. :(
Smoothie
08-27-2002, 08:51 PM
Maybe you could post the code to find and replace without those 2 bits of code in there. That would be appreciated.
FASherman
08-28-2002, 12:06 AM
Originally posted by Smoothie
Maybe you could post the code to find and replace without those 2 bits of code in there. That would be appreciated.
I will certainly do that. You'll have to forgive me. I've only been running VB for two weeks. Most of the things I wanted to do, I found here. This was something I wanted but didn't find, so I wrote it and posted it mostly as a way to pay back those who poted the other hacks I used. Giving back to the community, so to speak. But mostly, I'm still new to this.
thedvs
08-28-2002, 11:14 AM
godamnit, i installed the header version fine, but when i reinstalled to include the footer too, only the footer shows up and not both! help
FASherman
08-28-2002, 11:17 AM
What do your changed areas of code look like now?
thedvs
08-28-2002, 11:26 AM
exactly as yours in the install text, except without the forumnewsid stuff in forum.php
i followed it exactly
FASherman
08-28-2002, 11:28 AM
Okay, lets start with the low hanging fruit...
Are the header options Yes (to using) and No (to just guests)?
thedvs
08-28-2002, 11:30 AM
ok its all fixed, i forgot to change the template DOH (slaps head)
apologies.
GREAT HACK, well done for all your work
FASherman
08-28-2002, 11:30 AM
Post your url. I'd like to see how you used it!
fonzerelli_79
08-30-2002, 04:18 PM
great hack:)
ive placed the header just under the announcement
have a peek ;)
http://www.affiliate-talk.com/forumdisplay.php?forumid=12
basically ive used it to give an explanation of each forum
:nervous:
fonzerelli_79
08-31-2002, 06:53 AM
is there a way to place ' in the header or footer as at present it cant update the table with any links with a ' in it
:)
Smoothie
08-31-2002, 08:12 AM
FASherman-
Any chance of getting that code posted? :)
Dean C
08-31-2002, 07:37 PM
this is awesome.. didn't realise what this did til now :D
*goes to install*
Smoothie
08-31-2002, 10:52 PM
Find: $DB_site->query("INSERT INTO forum
(forumid,styleid,title,description,active,displayo rder,parentid,
parentlist,allowposting,cancontainthreads,iconimg,
daysprune,newpostemail,newthreademail,
moderatenew,allowhtml,allowbbcode,allowimages,allo wsmilies,allowicons,
styleoverride,allowratings,countposts,moderateatta ch,forumnewsid)
VALUES
(NULL,'$styleset','".addslashes($title)."','".addslashes($description)."','$isactive','$displayorder','$parentid',
'','$allowposting','$cancontainthreads','".addslashes($iconimg)."',
'$daysprune','".addslashes($newpostemail)."','".addslashes($newthreademail)."',
'$moderatenew','$aallowhtmlcode','$aallowbbcode',' $aallowimgcode','$aallowsmilies','$aallowicons',
'$styleoverride','$allowratings','$countposts','$m oderateattach','$forumnewsid')");Ok this part I can find in my admin/forums.php, but not all of what's above is there, specifically: iconimg, forumnewsid, '".addslashes($iconimg) and this '$forumnewsid')"); Same with step 7. Can someone help? i know that these need to be removed from the repace part, but what exactly should the replace code look like? Need step 5 and step 7 replace code. thanks!
Dark Waltz
10-18-2002, 04:35 AM
can I use this to add a different logo to each forum on my board?
floridaideal
10-19-2002, 12:12 AM
How can I add a different vb logo on each of the forums please? This would complete the great hack, just installed it and had to remove a little extra code but its working great now.
Just need to know how to edid the logo and buttons.
Thanks
Stu
ricoche
11-15-2002, 03:00 PM
Hi there,
Today I just finished installing this hack and I must say I'm very impressed and excited about it. It works very well and I've already created a layout in the header for my Flash Gallery Menu and Forum Jump links. It works beautifully. Thanks so much for a nice hack. It really allows me to create and experiment with new things.
I did encounter one strange thing that I apparently fixed. On my site I run multiple themes, such as Ravio, Ekko, Emerge etc. When I installed this I used the Ravio and Ravio Blue skins to test the hack. I found that when using image files for category headers it leaked into to other category headers in the forum and in my vbportal. The background images had the same name "catbg.gif" but were in different folders and were different images. So I just renamed them to different names and it corrected the problem. Sorry, but that might be difficult to understand <LOL>
Anyway, great hack. I'm really going to enjoy this. I attached a screen shot if anyone wants to see how I started using this hack for my site.
Thanks again,
Ricoche :bunny:
gynot67
12-05-2002, 05:10 AM
Ok, first off, fantastic work!!
This is one step away from being exactly what I needed.
Got it all installed and running beautifully, however does anyone know how I can go about making this javascript friendly?
I'm looking to stick a banner rotation in a particular forum
Figment
01-20-2003, 06:41 AM
Wow!!!
firas
03-16-2003, 05:50 AM
i like it but i don't have the icon hack so would you please tell me what to do exactly
Imprezer
04-10-2003, 08:56 PM
What is Forum Icon hack? I cannot find it. Please help!
GZ_Tanis
04-11-2003, 02:21 AM
Ok I went in and took out all that sanity check stuff. I am presently using this on my 2.3.0 board and it is working perfectly.
Imprezer
04-11-2003, 04:06 AM
Thank you! I will try that as I am getting some errors.
floridaideal
04-11-2003, 04:32 PM
Can anyone please tell me if its possible for this hack to add a 'vb logo' for each forum? That would be so cool if it could.
Also when I installed this I found if any of the text I included had a ' in it then it would cause a database error....just something some of you might want to look out for.
Thanks
Stu
GZ_Tanis
04-11-2003, 08:31 PM
Today at 12:26 PM floridaideal said this in Post #44 (https://vborg.vbsupport.ru/showthread.php?postid=380656#post380656)
Can anyone please tell me if its possible for this hack to add a 'vb logo' for each forum? That would be so cool if it could.
Also when I installed this I found if any of the text I included had a ' in it then it would cause a database error....just something some of you might want to look out for.
Thanks
Stu
Florida I know some people have posted examples but I didnt quite understand what this really did until I finally go tthis hack to work on my boards if you want to see what it does just after an install you can go here to this board and see what it adds. First go to our main page www.gzleagues.com/forum and see the top banner it says GZLeagues Private forum now go to this forum
http://gzleagues.com/forum/forumdisplay.php?s=&forumid=17
as you can see the top banner has changed into the Mechwarrior 4 banner. I had to go in and redo some coding to make just that banner show but I think you can get an idea of what this can do.
Threshold
06-16-2003, 06:54 PM
04-10-03 at 11:21 PM GZ_Tanis said this in Post #42 (https://vborg.vbsupport.ru/showthread.php?postid=380435#post380435)
Ok I went in and took out all that sanity check stuff. I am presently using this on my 2.3.0 board and it is working perfectly.
Thanks!
I am assuming your version of this hack is one based on "clean" code then?
Okiewan
12-18-2003, 07:27 PM
Any idea what would make 2 headers/footers show up? Meaning, the main header is still there, with the forum specific header inside it... ??? It won't remove the original header/footer.
Maybe I'm misunderstanding the purpose... I'm assuming this was intended to replace the header/footer ... seems more like it just allows you to enter some info in the forumdisplay... my bad.
I'm looking for something to assign different styles (header/footer) the "complete" header and footer.
Basically, if this hack could be modified to remove $header and $footer from forumdisplay IF a custom header and footer is inserted in the specific forum edit, it would be killer.
stamos2003
02-23-2004, 05:52 PM
gives me an error when i try to post complex html headers:
mysql error number: 1064
Invalid SQL: UPDATE forum
SET and here follows the html code i want to put.
any ideas ?!
when i set the same html code through phpmyadmin then it works.....
stamos2003
02-28-2004, 05:30 PM
4get, was a hacking error ;)
pdatoon
08-13-2004, 01:02 AM
I'm not quite sure to understand if this hack will allow me to have customize categories headers? Like this : http://www.homedigitalandco.com/pdaforum/
Or this is just customized headers for each forum category?
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.