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 |
#302
|
||||
|
||||
It would be nice to get this hack for vb3. Do you will rewrite it for this version?
|
#303
|
|||
|
|||
I've requested it in the Vb3 Mod Requests forum. Perhaps anyone else interested can express that there so the coders know there's support.
https://vborg.vbsupport.ru/showthread.php?t=59714 |
#304
|
|||
|
|||
[QUOTE}
and forumdisplay_sponsoredby was included in the list of required templates. Finally, I added $sponsoredby to my forumdisplay template. Sorry for the clumsy explanation. It took a bit of putzing around for me to get this to work, but it does. Amy[/QUOTE] Finally added $sponsoredby to where in the formdisplay template? |
#305
|
|||
|
|||
nevermind.. I got it ..LOL
Quote:
Finally added $sponsoredby to where in the formdisplay template?[/QUOTE] |
#306
|
|||
|
|||
you guys are my heros
|
#307
|
|||
|
|||
ok I will try it out
|
#308
|
||||
|
||||
The 'sponsory categories' hack can be very simply implemented in vb3 if you do not mind not having fancy GUI options to manage your sponsor options. The way I did it is by using the new vb3template conditionals. Note that I am assuming that you already have the old solution installed, ie your 'forum' table has the 3 additional sponsorimg, sponsorurl and sponsorname columns added to it. If that's the case all you need to do is to edit 1 template:
Add following to your forumhome_forumbit_level1_nopost template: Code:
<if condition="!empty($forum[sponsorimg])"> <a style="float:$stylevar[right]; margin-right:10px" href="$forum[sponsorurl]" target="_blank"><img src="$stylevar[imgdir_misc]/$forum[sponsorimg]" border="0" alt="Proudly sponsored by $forum[sponsorname]"></a> </if> |
#309
|
|||
|
|||
I tried this but it did not work. Nothing is shown.
I would love to have something like Sitepoint have on their site. Any help highly appreciated PS I am using VB3.0.3 and only added the template-edit (described in the post above) and the tables to the forum-table. |
#310
|
|||
|
|||
Okay, I seem to have it more or less working. I used this code in the template-edit, maybe somebody can use it:
<!-- Begin Hack Sponsor --> <if condition="!empty($forum[sponsorimg])"> <table cellpadding="0" cellspacing="0" border="0" class="tborder" width="100%" align="center"><tr><td> <table cellpadding="6" cellspacing="1" border="0" width="100%"> <tr><td class="alt2"> <a href="$forum[sponsorurl]"><img src="$stylevar[imgdir_misc]/$forum[sponsorimg]" alt="$forum[sponsorname]" title="Proudly sponsored by $forum[sponsorname]" align="right" /></a> <div style="padding: 6px; text-align: center;">Today's forum discussions are proudly sponsored by <a href="$forum[sponsorurl]">$forum[sponsorname]</a>.</div></td></tr> </table></td></tr></table> </if> <!-- End Hack Sponsor --> |
#311
|
|||
|
|||
Norvo - where did you put this in the template?
and using PhpMyAdmin, how exactly do you put your sponsor info into the three new columns created onto the "forum" table? sorry for the stupid questions but I had the old hack installed on V2 with the nice, easy GUI and this method is a little foreign to me. |
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|