Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Details »»

Version: , by Admin (Coder) Admin is offline
Developer Last Online: Nov 2024 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 08-28-2001 Last Update: Never Installs: 99
 
No support by the author.

Works with vBulletin v2.2.0!

This hack will allow you to add banners to your categories row (like done on SitePointForum.com - use that as a demo ).
You can add / remove sponsors for any category that exists and also on creation (of category) time.
You can specify the name, banner url and the sponsor's site.
Currently it only supports categories from level 1, and only on forum index. -if you want more please tell and I'll see what I can do.
Umm, that's it I think. Installation is fairly easy (and the hack itself didn't take too much time ), so you shouldn't have any problems.

Feedback from any kind is very appreciated!

First of all, run the following query
Code:
ALTER TABLE forum ADD sponsorname VARCHAR(100) not null AFTER cancontainthreads, ADD sponsorimg VARCHAR(100) not null AFTER sponsorname, ADD sponsorurl VARCHAR(255) not null AFTER sponsorimg
For more info about running queries take a look here or here.

Add a custom template, name it forumhome_forumbit_level1_nopost_sponsor and put the following in it:
Code:
<tr id="cat">
	<td bgcolor="{categorybackcolor}" colspan="2"><a href="forumdisplay.php?s=$session[sessionhash]&forumid=$forum[forumid]"><normalfont color="{categoryfontcolor}"><b>$forum[title]</b></normalfont></a>
	<br><smallfont color="{categoryfontcolor}">$forum[description]</smallfont></td>
	<td bgcolor="{categorybackcolor}" colspan="4"><a href="$forum[sponsorurl]" target="_blank"><img src="{imagesfolder}/$forum[sponsorimg]" border="0" alt="Proudly sponsored by $forum[sponsorname]"></a></td>
</tr>
(You can tweak this for your tables. Playing around with the colspans should be enough though. This is for the default table structure)

In forum.php (under your admin folder) add
PHP Code:
  maketableheader("Sponsors</b> <i>Only supported by categories</i>","",0);

  
makeinputcode("Sponsor name","sponsorname");
  
makeinputcode("Sponsor banner file<br>(your default images folder is added, no need in that)","sponsorimg");
  
makeinputcode("Sponsor full URL","sponsorurl"); 
right after
PHP Code:
  makeyesnocode("Count posts made in this forum towards user post counts?","countposts",1); 
(around line 121)

Still in forum.php, replace
PHP Code:
  $DB_site->query("INSERT INTO forum
                      (forumid,styleid,title,description,active,displayorder,parentid,
                       parentlist,allowposting,cancontainthreads,daysprune,newpostemail,newthreademail,
                       moderatenew,allowhtml,allowbbcode,allowimages,allowsmilies,allowicons,
                       styleoverride,allowratings,countposts,moderateattach)
                   VALUES
                      (NULL,'
$styleset','".addslashes($title)."','".addslashes($description)."','$isactive','$displayorder','$parentid',
                       '','
$allowposting','$cancontainthreads','$daysprune','".addslashes($newpostemail)."','".addslashes($newthreademail)."',
                       '
$moderatenew','$aallowhtmlcode','$aallowbbcode','$aallowimgcode','$aallowsmilies','$aallowicons',
                       '
$styleoverride','$allowratings','$countposts','$moderateattach')"); 
with
PHP Code:
  $DB_site->query("INSERT INTO forum
                      (forumid,styleid,title,description,active,displayorder,parentid,
                       parentlist,allowposting,cancontainthreads,sponsorname,sponsorimg,
                       sponsorurl,daysprune,newpostemail,newthreademail,
                       moderatenew,allowhtml,allowbbcode,allowimages,allowsmilies,allowicons,
                       styleoverride,allowratings,countposts,moderateattach)
                   VALUES
                      (NULL,'
$styleset','".addslashes($title)."','".addslashes($description)."','$isactive','$displayorder','$parentid',
                       '','
$allowposting','$cancontainthreads','".addslashes($sponsorname)."','".addslashes($sponsorimg)."',
                       '"
.addslashes($sponsorurl)."','$daysprune','".addslashes($newpostemail)."','".addslashes($newthreademail)."',
                       '
$moderatenew','$aallowhtmlcode','$aallowbbcode','$aallowimgcode','$aallowsmilies','$aallowicons',
                       '
$styleoverride','$allowratings','$countposts','$moderateattach')"); 
(around lines 136-147)

Still in forum.php, add
PHP Code:
  maketableheader("Sponsors</b> <i>Only supported by categories</i>","",0);

  
makeinputcode("Sponsor name","sponsorname",$forum[sponsorname]);
  
makeinputcode("Sponsor banner file<br>(your default images folder is added, no need in that)","sponsorimg",$forum[sponsorimg]);
  
makeinputcode("Sponsor full URL","sponsorurl",$forum[sponsorurl]); 
right after
PHP Code:
  makeyesnocode("Count posts made in this forum towards user post counts?","countposts",$forum[countposts]); 
(around line 230)

Still in forum.php, replace
PHP Code:
  $DB_site->query("UPDATE forum
                   SET
                     styleid='
$styleset', title='".addslashes($title)."', description='".addslashes($description)."',
                     active='
$isactive', displayorder='$displayorder', parentid='$parentid', parentlist=$parentlist,
                     allowposting='
$allowposting', cancontainthreads='$cancontainthreads', daysprune='$daysprune',
                     newpostemail='"
.addslashes($newpostemail)."', newthreademail='".addslashes($newthreademail)."',
                     moderatenew='
$moderatenew', allowhtml='$aallowhtmlcode', allowbbcode='$aallowbbcode',
                     allowimages='
$aallowimgcode', allowsmilies='$aallowsmilies', allowicons='$aallowicons',
                     styleoverride='
$styleoverride', allowratings='$allowratings', countposts='$countposts',
                     moderateattach='
$moderateattach'
                   WHERE forumid='
$forumid'"); 
with
PHP Code:
  $DB_site->query("UPDATE forum
                   SET
                     styleid='
$styleset', title='".addslashes($title)."', description='".addslashes($description)."',
                     active='
$isactive', displayorder='$displayorder', parentid='$parentid', parentlist=$parentlist,
                     allowposting='
$allowposting', cancontainthreads='$cancontainthreads',
                     sponsorname='"
.addslashes($sponsorname)."',sponsorimg='".addslashes($sponsorimg)."',
                     sponsorurl='"
.addslashes($sponsorurl)."',daysprune='$daysprune',
                     newpostemail='"
.addslashes($newpostemail)."', newthreademail='".addslashes($newthreademail)."',
                     moderatenew='
$moderatenew', allowhtml='$aallowhtmlcode', allowbbcode='$aallowbbcode',
                     allowimages='
$aallowimgcode', allowsmilies='$aallowsmilies', allowicons='$aallowicons',
                     styleoverride='
$styleoverride', allowratings='$allowratings', countposts='$countposts',
                     moderateattach='
$moderateattach'
                   WHERE forumid='
$forumid'"); 
(around lines 261-273)
Save and upload forum.php.

In index.php (the main folder) replace this line
PHP Code:
        eval("\$forumbits .= \"".gettemplate("forumhome_forumbit_level$depth$tempext")."\";"); 
with this code
PHP Code:
        if ($forum['sponsorimg'] && $forum['cancontainthreads']==&& $depth==1) {
          eval(
"\$forumbits .= \"".gettemplate("forumhome_forumbit_level1_nopost_sponsor")."\";");
        } else {
          eval(
"\$forumbits .= \"".gettemplate("forumhome_forumbit_level$depth$tempext")."\";");
        } 
(around line 298)
Save and upload index.php.

That's it.
If you did everything correctly (it wasn't very hard, was it? ) and I didn't do any mistakes (it's tested alright!, but I might have forgot something to post), you can start adding sponsors to your forum!

Show Your Support

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

Comments
  #142  
Old 11-15-2001, 12:59 PM
eg_92901's Avatar
eg_92901 eg_92901 is offline
 
Join Date: Oct 2001
Location: Atlanta, GA
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I use them as my affiliate program. I installed this hack and it works great but CJ say's your not supposed to alter the code they give you.

The way I have it set up now is I just extracted the link and downloaded the image to my server. So I'm actually altering the code?

Is there any way around this. A way to just copy the full code given directly into a field, instead of breaking it up.
Reply With Quote
  #143  
Old 11-16-2001, 02:07 AM
trainer trainer is offline
 
Join Date: Nov 2001
Posts: 160
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

fixed my problem
Reply With Quote
  #144  
Old 11-17-2001, 09:07 PM
jminiman jminiman is offline
 
Join Date: Nov 2001
Posts: 36
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is there any way that we can extend the functionality of this great hack to individual forums? I have support forums for various developers. I'd like to put up a banner or something like that to graphically show who owns the forum.

Does such a hack exist? Recommendations?
Reply With Quote
  #145  
Old 11-18-2001, 12:17 AM
amykhar's Avatar
amykhar amykhar is offline
 
Join Date: Oct 2001
Location: PA
Posts: 4,438
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

jminiman read the thread. The instructions are already here.

Amy
Reply With Quote
  #146  
Old 11-18-2001, 12:37 AM
jminiman jminiman is offline
 
Join Date: Nov 2001
Posts: 36
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Amy,

I'd LOVE to see a live example of your hack. Every URL you have posted is now defunct.
Reply With Quote
  #147  
Old 11-18-2001, 03:33 AM
jminiman jminiman is offline
 
Join Date: Nov 2001
Posts: 36
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Amy,

Please give some details as to how to customize this for each forum. Thanks.
Reply With Quote
  #148  
Old 11-18-2001, 04:14 AM
jminiman jminiman is offline
 
Join Date: Nov 2001
Posts: 36
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi all,

I can't get rid of the padding around the sponsor images at http://discuss.pocketnow.com (I added one for each category). I tried looking everywhere to kill that padding. No matter what I did, it remained!

Where do I find the padding for these cells?
Reply With Quote
  #149  
Old 11-18-2001, 05:13 AM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Try adding cellspacing="0" cellpadding="0" to the td tag that contains the banned, in your forumhome_forumbit_level1_nopost_sponsor template.
Reply With Quote
  #150  
Old 11-18-2001, 02:14 PM
jminiman jminiman is offline
 
Join Date: Nov 2001
Posts: 36
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Already tried that. Here's my code:

<!--

<tr id="cat">
<td bgcolor="{categorybackcolor}" colspan="2"><a href="forumdisplay.php?s=$session[sessionhash]&forumid=$forum[forumid]"><normalfont color="{categoryfontcolor}"><b>$forum[title]</b></normalfont></a>
<br><smallfont color="{categoryfontcolor}">$forum[description]</smallfont></td>
<td bgcolor="{categorybackcolor}" colspan="4"><table width="100%" border="0" cellspacing="0" cellpadding="0" align="center"><a href="$forum[sponsorurl]" target="_blank"><img src="{imagesfolder}/$forum[sponsorimg]" border="0" alt="$forum[sponsorname]" align="right"></a></table></td>
</tr>

-->
Reply With Quote
  #151  
Old 11-18-2001, 02:43 PM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No I mean add that to this:
&lt;td bgcolor="#606096" colspan="4">
Reply With Quote
Reply


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 08:39 PM.


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.06958 seconds
  • Memory Usage 2,373KB
  • 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
  • (2)bbcode_code
  • (10)bbcode_php
  • (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
  • (4)pagenav_pagelink
  • (2)pagenav_pagelinkrel
  • (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