Version: , by Admin (Coder)
Developer Last Online: Nov 2024
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:
(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'");
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.
I've added the code at the top of the forumhome_forumbit_level1_nopost template. And I've insert the info into the three new columns using PhpMyAdmin by editing the database-records. If anyone where to write a good-looking hack for this so the GUI is nice and embedded into the administration, I would like to hear about that
I've added the code at the top of the forumhome_forumbit_level1_nopost template. And I've insert the info into the three new columns using PhpMyAdmin by editing the database-records. If anyone where to write a good-looking hack for this so the GUI is nice and embedded into the administration, I would like to hear about that
Hope this helps.
got the template part down... guess I'm doing something wrong in phpmyadmin. I've changed the information in the tables in the sponsorimg, sponsorname and sponsorurl fields but it isn't updating on the site. Its still showing what was inthe fields originally. I feel like maybe I'm changing the wrong information or doing the process incorrectly. Anyone mind just walking me through exactly what to do in phpmyadmin to popular my sponsor fields correctly?
i'm stumped on this --- I've made the template changes and then updated the database records but the information being displayed is still from the last time I ran this script on VB2.3.0
I've changed the sponsorurl, sponsorimg and sponsorname columns in the forum table but the information being displayed does not match this information.
not sure if anyone is even checking this thread, but here's one curious thing that could be leading to my problem.
In the datastore table and the forumcache column, the information seems to be outdated. It contains the exact "old" sponsorurl, sponsorname and sponsorimg references that are showing up on my board despite the changes I made to the forum table.
Should the forumcache be updating automatically and is this the source of my display problems?