The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Details »» | |||||||||||||||||||||||||
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 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> In forum.php (under your admin folder) add PHP Code:
PHP Code:
Still in forum.php, replace PHP Code:
PHP Code:
Still in forum.php, add PHP Code:
PHP Code:
Still in forum.php, replace PHP Code:
PHP Code:
Save and upload forum.php. In index.php (the main folder) replace this line PHP Code:
PHP Code:
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
|
Comments |
#252
|
|||
|
|||
allright! i finally got it...and i was just inserting the code in the wrong places my fault 100% i just missunderstood the directions at first ...but this hack rocks!
DannyITR sorry but i dont have a clue how to help you with the problem you are having or i would help... |
#253
|
|||
|
|||
Mabye I'm confusing.
Here are my two problems: I can't add a new forum since modifying forums.php I can't get the banner in each thread. Would anyone be able to help me? |
#254
|
|||
|
|||
ok firs thing is, did you maka aback up of the forum.php file?
you should go back the the original, and in worse case senario jus get it from your original vb zip or just grab it from the svb site... once you do that...you should go back and start from the first step on the forum.php file... i have to say i could not get it to work at first either, but it was all due to my errors, the hack works very nicely, if you want to see it working go to www.dsswareforums.com. |
#255
|
|||
|
|||
I see you've got the banners in each thread. They really didn't explain it very well in this thread. Are you able to tell me quickly what I need to modify?
Thanks for helping! |
#256
|
|||
|
|||
well honestly i just had to do exactly what the instructions said...
i dont know how else to really help, you just have to follow it step by step. |
#257
|
|||
|
|||
The thing is, they didn't really explain it. On page five the question is asked and then someone answers with just a bunch of code. I don't know where to put or in which file. How did you do it?
|
#258
|
|||
|
|||
ok i took FireFlys instruction and just tried to change a couple of things on the description to try to make a loittle more clear...dot know if this will help, but i'm just trying to help
---------------------------------------------------------------------------------- ////First of all, run the following Mysql query: 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 ////Add a custom template, name it forumhome_forumbit_level1_nopost_sponsor and put the following in it: <tr id="cat"> <td bgcolor="#336D95" background="https://vborg.vbsupport.ru/images/catagory_backing.gif" colspan="2"><a href="forumdisplay.php?s=$session[sessionhash]&forumid=$forum[forumid]"><normalfont color="#000000"><b>$forum[title]</b></normalfont></a> <br><smallfont color="#000000">$forum[description]</smallfont></td> <td bgcolor="#336D95" background="https://vborg.vbsupport.ru/images/catagory_backing.gif" colspan="4"><a href="$forum[sponsorurl]" target="_blank"><img src="https://vborg.vbsupport.ru/images/$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) find: makeyesnocode("Count posts made in this forum towards user post counts?","countposts",1); and right after this code add: 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"); ////Still in forum.php, replace this line: $DB_site->query("INSERT INTO forum (forumid,styleid,title,description,active,displayo rder,parentid, parentlist,allowposting,cancontainthreads,daysprun e,newpostemail,newthreademail, moderatenew,allowhtml,allowbbcode,allowimages,allo wsmilies,allowicons, styleoverride,allowratings,countposts,moderateatta ch) VALUES (NULL,'$styleset','".addslashes($title)."','".adds lashes($description)."','$isactive','$displayorder ','$parentid', '','$allowposting','$cancontainthreads','$daysprun e','".addslashes($newpostemail)."','".addslashes($ newthreademail)."', '$moderatenew','$aallowhtmlcode','$aallowbbcode',' $aallowimgcode','$aallowsmilies','$aallowicons', '$styleoverride','$allowratings','$countposts','$m oderateattach')"); /////with $DB_site->query("INSERT INTO forum (forumid,styleid,title,description,active,displayo rder,parentid, parentlist,allowposting,cancontainthreads,sponsorn ame,sponsorimg, sponsorurl,daysprune,newpostemail,newthreademail, moderatenew,allowhtml,allowbbcode,allowimages,allo wsmilies,allowicons, styleoverride,allowratings,countposts,moderateatta ch) VALUES (NULL,'$styleset','".addslashes($title)."','".adds lashes($description)."','$isactive','$displayorder ','$parentid', '','$allowposting','$cancontainthreads','".addslas hes($sponsorname)."','".addslashes($sponsorimg)."' , '".addslashes($sponsorurl)."','$daysprune','".adds lashes($newpostemail)."','".addslashes($newthreade mail)."', '$moderatenew','$aallowhtmlcode','$aallowbbcode',' $aallowimgcode','$aallowsmilies','$aallowicons', '$styleoverride','$allowratings','$countposts','$m oderateattach')"); ////Still in forum.php, find: makeyesnocode("Count posts made in this forum towards user post counts?","countposts",$forum[countposts]); right after that add: 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]); ////Still in forum.php, find: $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'"); and replace with: $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)."',sponsor img='".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'"); ////Save and upload forum.php. In index.php (the main folder) find this line eval("\$forumbits .= \"".gettemplate("forumhome_forumbit_level$depth$te mpext")."\";"); replace with this code: if ($forum['sponsorimg'] && $forum['cancontainthreads']==0 && $depth==1) { eval("\$forumbits .= \"".gettemplate("forumhome_forumbit_level1_nopost_ sponsor")."\";"); } else { eval("\$forumbits .= \"".gettemplate("forumhome_forumbit_level$depth$te mpext")."\";"); } ////Save and upload index.php. ----------------------------------------------------------------------------------- |
#259
|
|||
|
|||
I installed it and it works great! One thing we use this Hack:
http://www.vbulletin.com/forum/showt...ht=split+forum and when we insert the sponsor ad into the forums for some reason they merge back together thus voiding xiphoid's hack. Any help? Thanks |
#260
|
|||
|
|||
oh i had the same problem...you need to do the same hack to the forumdisplay_sponsoredby and forumhome_forumbit_level1_nopost_sponsor
then you will be all set... |
#261
|
|||
|
|||
did I mess something? I only created one tmeplate:
forumhome_forumbit_level1_nopost_sponsor Do I need to create another one: forumdisplay_sponsoredby Cause the mod worked with out it. Just merged all the forums together. And which Hack this one or the one that spartated out the forums from each other? Thanks |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|