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)
-   -   Forum Headers Hack (https://vborg.vbsupport.ru/showthread.php?t=42745)

FASherman 08-24-2002 10:00 PM

Forum Headers Hack
 
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/foru...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/foru....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.

Neo 08-26-2002 10:22 AM

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

Quote:

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

Quote:

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 !

Neo 08-27-2002 01:10 PM

look at this

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


Quote:

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/showthrea...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:
Quote:

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:
Quote:

FIND:
-----------
$DB_site->query("INSERT INTO forum
This: 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

Quote:

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/forumd...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:
Quote:

$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)."','".adds lashes($description)."','$isactive','$displayorder ','$parentid',
'','$allowposting','$cancontainthreads','".addslas hes($iconimg)."',
'$daysprune','".addslashes($newpostemail)."','".ad dslashes($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?

N9ne 10-18-2002 07:52 PM

Dark Waltz: yes you can.

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


All times are GMT. The time now is 04:46 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.01445 seconds
  • Memory Usage 1,821KB
  • 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
  • (7)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