PDA

View Full Version : Add "Sponsored by" banners to your forum categories


Pages : [1] 2

Chen
29 Aug 2001, 16:04
Works with vBulletin v2.2.0!

This hack will allow you to add banners to your categories row (like done on SitePointForum.com (http://www.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! :D

First of all, run the following 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
For more info about running queries take a look here (http://www.vbulletin.com/forum/showthread.php?s=&threadid=26272) or here (http://www.vbulletin.com/forum/showthread.php?threadid=18558).

Add a custom template, name it forumhome_forumbit_level1_nopost_sponsor and put the following in it:
<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
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
makeyesnocode("Count posts made in this forum towards user post counts?","countposts",1);
(around line 121)

Still in forum.php, replace
$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','$aallowsmilie s','$aallowicons',
'$styleoverride','$allowratings','$countposts','$moderateattach')");
with
$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','$aallowsmilie s','$aallowicons',
'$styleoverride','$allowratings','$countposts','$moderateattach')");
(around lines 136-147)

Still in forum.php, 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]);
right after
makeyesnocode("Count posts made in this forum towards user post counts?","countposts",$forum[countposts]);
(around line 230)

Still in forum.php, replace
$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
$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
eval("\$forumbits .= \"".gettemplate("forumhome_forumbit_level$depth$tempext")."\";");
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$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!

TWTCommish
29 Aug 2001, 16:14
Looks interesting. Perhaps I'll give it a try. :)

eva2000
29 Aug 2001, 16:20
wow looks nice might try it on my private testing copy :)

then again with 2.0.4 soon might not :D

Chen
29 Aug 2001, 16:49
Thanks. :)

What do you mean "with 2.0.4 soon might not"?
This feature is gonna be on 2.0.4?
Awesome! :D

eva2000
29 Aug 2001, 16:51
Originally posted by FireFly
Thanks. :)

What do you mean "with 2.0.4 soon might not"?
This feature is gonna be on 2.0.4?
Awesome! :D no what i mean is i might not install this hack until after 2.0.4 is released save me the trouble of rehacking this in :)

Chen
29 Aug 2001, 16:53
Oh ok, gotcha. :)

Kier
30 Aug 2001, 09:42
2.0.4 should be released shortly after John and James return from their expedition

Chen
30 Aug 2001, 09:47
Expedition?
Are they gonna be on National Geographic, like all those people who're going to Alaska and places like that?

eva2000
30 Aug 2001, 09:52
Originally posted by FireFly
Expedition?
Are they gonna be on National Geographic, like all those people who're going to Alaska and places like that? LOL

Lordmusic
30 Aug 2001, 10:59
Don't dis Alaska. I LIVE IN ALASKA. Me = Alaskan Pimp.

Anyways Alaska is cool, and for your info, we don't live in friggin igloos.

Chen
30 Aug 2001, 11:52
Ok...

TWTCommish
30 Aug 2001, 16:36
Sure ya do. I saw it on TV! All people in Alaska wear big brown fluffy coats, live in igloos, have dark tan skin, and eat Eskimo Pie. :D TV told me so...

Where did James/John go?

mjames
30 Aug 2001, 16:42
Originally posted by TWTCommish
Sure ya do. I saw it on TV! All people in Alaska wear big brown fluffy coats, live in igloos, have dark tan skin, and eat Eskimo Pie. :D TV told me so...

Where did James/John go?
My guess? Somewhere out in the Bahamas burning their millions of dollars from vBulletin. :)

BradC
30 Aug 2001, 16:49
Originally posted by mjames

My guess? Somewhere out in the Bahamas burning their millions of dollars from vBulletin. :)

yah with all that money.... I don't think they will be coming back soon... what was that island tubedogg wanted... maybe they purchased it, and are there.. :)

BradC
30 Aug 2001, 16:51
Originally posted by Lordmusic
Don't dis Alaska. I LIVE IN ALASKA. Me = Alaskan Pimp.

Anyways Alaska is cool, and for your info, we don't live in friggin igloos.

Wasn't there a tv show on called something like "Northern Exposure" that was about living and.. umm I working in Alaska.. or was that for somewhere else :)

Ohh... I guess we get the image.. of people living in igloo's... surfing the web and buying stuff off of yahoo.. :)

FreshFroot
30 Aug 2001, 17:58
Great hack...muchas gracias!

Chen
30 Aug 2001, 18:22
Originally posted by FreshFroot
Great hack...muchas gracias!
Thanks god someone cares about the hack! :D
Glad you like it. :)

amykhar
30 Aug 2001, 18:43
I extended this hack a bit to put a sponsor ad in a particular forum.

To do this, I added a new template called forumdisplay_sponsoredby and put this in it:


<br><br><a href="$foruminfo[sponsorurl]" target="_blank"><img src="{imagesfolder}/$foruminfo[sponsorimg]" border="0" alt="Proudly sponsored by $foruminfo[sponsorname]"></a>
<br>



I then edited forumdisplay.php so that


if ($foruminfo['sponsorimg']) {
eval("\$sponsoredby = \"".gettemplate('forumdisplay_sponsoredby')."\";");
}
else {
$sponsoredby = '';
}


was immediately AFTER


if ($foruminfo['allowposting']==1) {
eval("\$newthreadlink = \"".gettemplate('forumdisplay_newthreadlink')."\";");
}


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. :)

demo:
http://www.eaforums.com/forumdisplay.php?s=&forumid=27


Amy

Chen
30 Aug 2001, 18:51
Good job! :)

eva2000
30 Aug 2001, 21:39
nice extension.. waits for 2.0.4 first :D

FreshFroot
31 Aug 2001, 15:21
Ok...so I've got the hack installed, now how do I add the sponsors?

Chen
31 Aug 2001, 15:26
If you want to add sponsors for existing forums, just edit that forum. (Admin CP => Forums and Moderators => Modify => Edit) :)

FreshFroot
31 Aug 2001, 15:30
Damn your quick! I like your style...thanks :)

FreshFroot
31 Aug 2001, 15:32
I went into the CP and in to Modify Forums and didn't see anything about sponsors. Did I miss a step somewhere?

Chen
31 Aug 2001, 15:36
This is where you should look.

If it doesn't show up there, make sure you edited forum.php correctly and uploaded it. :)

FreshFroot
31 Aug 2001, 15:48
Thanks...I got it corrected, but now my server is acting up!!!

Again...another great hack from FireFly :)

Thomas P
31 Aug 2001, 16:10
Hi FireFly,
awesome, will use it as soon as I found some sponsors
or found a way to use it an other way,
thx and keep up your good work,
-Tom

FreshFroot
31 Aug 2001, 16:19
Check out Comission Junction, you can use affiliate programs for your sponsors. Maybe make some $$$.

Thomas P
31 Aug 2001, 16:34
Thanks for the hint,
am on my way :D
-Tom

Chen
31 Aug 2001, 17:17
Thanks guys! :D

Shoonra
03 Sep 2001, 21:39
That's something I've been looking for! I am PHP-phobic though - never installed a hack in my life (I shiver at the thought of upgrading my forums... I always think I'll end up crashing them!).

Firefly, do you provide support by phone for people in your locality :D I might just need that....

Pie'oh'pah
04 Sep 2001, 02:07
Originally posted by Lordmusic
Don't dis Alaska. I LIVE IN ALASKA. Me = Alaskan Pimp.

Anyways Alaska is cool, and for your info, we don't live in friggin igloos.

MUAHAHA Still laughing man!! :D:D

LuBi
04 Sep 2001, 05:01
Everyone who posted in here, the only forum I saw this script on was sitepoint.com did anyone actually install this hack and leave it in?

amykhar
04 Sep 2001, 12:17
I have it running, but I don't show the banners on my main page, just within specific forums. It is still working great though.

I even managed to use this hack to get a sponsor for one of my forums already. It's going to mean extra cash which we can really use right now. :D


Amy

Mark Hewitt
04 Sep 2001, 13:48
This hack would be cool if it gets sponsors for you too! ;)

Chen
04 Sep 2001, 13:56
Hehe. :p

LuBi
04 Sep 2001, 14:00
Well I would install it but I don;t want ot have to uninstall it if I don;t like it. How are th sponsor thingys made? Are they pictures because I read over the read me and it didn't say aything about pictures need to be uploaded.

Mark Hewitt
04 Sep 2001, 14:02
You will need to upload pictures yes.

Chen
04 Sep 2001, 14:05
You can add sponsors selectively for each category.
If there is no sponsor, nothing different will be shown.

LuBi
04 Sep 2001, 14:16
Then I'll be installing this hack, thanks guys.

LuBi
04 Sep 2001, 14:47
What technique did they use on Sitepoint.com? I noticed they have some text, and an image over it. How can I achieve this setup?

Chen
04 Sep 2001, 14:49
The text is just part of the image there.

But anyway, you can change the sponsor template, and add anything you want there.

LuBi
04 Sep 2001, 15:00
I'm having trouble. http://forums.suprascene.com

I'd like to right align everything.

Chen
04 Sep 2001, 16:40
Use this as your template:
<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" align="right"><a href="$forum[sponsorurl]" target="_blank"><img src="{imagesfolder}/$forum[sponsorimg]" border="0" alt="Proudly sponsored by $forum[sponsorname]"></a></td>
</tr>

LuBi
04 Sep 2001, 16:45
Thanks again!:D

amykhar
04 Sep 2001, 18:21
I also added a text field to the database that allows me to put a description or lead-in text next to the forum sponsor image.

I am still playing with the aesthetics, but you can see what I am doing here:

http://www.eaforums.com/forumdisplay.php?s=&forumid=38

Amy

DYer
05 Sep 2001, 02:12
I have test it . It looks like wounderful.

Just make it strong more ...

danielillo
05 Sep 2001, 05:36
I've been lookig for a hack like this since I saw SPF.
Thanks FireFly.

I just add some templates for it to show also the number of post in each category (needed if you want to set to 1 the depth of your forums and justify the prize you want they to pay to be anounced there).

I just test it on my test forum: http://www.dondepuedo.com/prueba/

As soon as I finish my exams I will put it on the main forums (www.dondepuedo.com/foro)


Thanks again.


PS: Please, excuse my English (I'm from Spain)

Chen
05 Sep 2001, 11:57
Thanks a lot for the kind words Danielillo. :)

Originally posted by DYer
I have test it . It looks like wounderful.

Just make it strong more ...
Thanks, but how do you want it stronger?

BluSmurf
08 Sep 2001, 20:06
ahhhhhhhhh this is what I've been looking for :)
will let you know how it goes once I've installed it later

Goldfinger
17 Sep 2001, 03:50
Nice hack .. but i think ill wait for 2.0.4 too :D

shadowbreed
17 Sep 2001, 17:07
Great Hack working perfectly and easy to install on 2.0.3

h4p3
18 Sep 2001, 20:05
Hi,

first of all i want to say that this hack is absolutely great! FireFly nice work! :)

One request:
The ability to add Banners for a certain Forum. Supported by Pics on the Forum Home Page at Categories _and_ the option to add Banners (468x60 or else) in each forum.

Regards,

shadowbreed
18 Sep 2001, 22:36
There is an extension for this hack on page two of this thread that allows you to add banners to your forums

h4p3
19 Sep 2001, 15:54
Originally posted by shadowbreed
There is an extension for this hack on page two of this thread that allows you to add banners to your forums

Yep, i know this. But is it possible to use this modification _and_ the mod by FireFly at the same time?

amykhar
19 Sep 2001, 16:21
Originally posted by h4p3


Yep, i know this. But is it possible to use this modification _and_ the mod by FireFly at the same time?

Yes. It simply adds on to Firefly's. it doesn't replace it.

Amy

Goldfinger
20 Sep 2001, 11:40
works wonderfully. and another great hack by firefly :).

mbombd
20 Sep 2001, 13:05
good **** firefly, good ****....

ForzaGrifo
27 Sep 2001, 07:08
When I go to cpanel and tried to modify the forum, I get this parse error on this line in forum.php:

doformfooter("Save Forum");

What's the problem??

SystemLogic
27 Sep 2001, 07:59
Works excellent.....live example at http://www.systemlogic.net/boards

Chen
27 Sep 2001, 08:41
SystemLogic:
That really looks good. Thanks. :)

ForzaGrifo:
Can you please paste the complete error message here?
This function is used on almost all files, you really shouldn't have a problem with it.
Is this the only place you get this error?

Alien
27 Sep 2001, 13:02
Thanks alot for this, I've been using it for a little while without a glitch! :D

YourHostSucks
27 Sep 2001, 21:02
Works Great!

Thanks! ;)

MarkB
27 Sep 2001, 23:31
I've just started using this hack on my forum (finally!), and it was easy as I could have hoped to get it working :)

I was wondering if it would be possible to, perhaps in a future version, have a counter that would count click-thrus...?

Thanks for another great piece of code!! :D

YourHostSucks
27 Sep 2001, 23:46
Yep, I was thinking the same thing..
I am going to set mine up to keep a record of hits for each sponsor.... easy enough to do.. :)

MarkB
27 Sep 2001, 23:55
Originally posted by YourHostSucks
Yep, I was thinking the same thing..
I am going to set mine up to keep a record of hits for each sponsor.... easy enough to do.. :)

Care to share how to do it? :D

YourHostSucks
28 Sep 2001, 00:30
Sure man.. Just upload a script to count clicks to a url...

I have attached a basic one, that should work just fine for you... ;)

Read the read me file and you will be all set....

You will just be linking to:
http://yourdomain.com/cgi-bin/blah blah/clickcount.cgi?action=jump&URL=http://yoursponsor.com

Really easy and fast to setup...

----------------------------------------------------------------------------

I would like to see this added to the Hack itself...

Like next to the picture (image) for the sponsor | a cell on top "Hits" and then under that the count on bottom?
(as a option that can be turned on or off)
Ofcourse you could just remove the code (hehe)

I will be trying to set mine up in this way later...


<edit> well maybe this information is not needed to be public.. *thinks*

MarkB
28 Sep 2001, 00:38
You kick much bottom. Thanks!

YourHostSucks
28 Sep 2001, 00:53
Blah, I do not think I am going to add the count view to public,
But others may like this feature? Maybe it could be added to this hack... :)

I just added the click count to the admin CP, thats good enuff for me!

MarkB
28 Sep 2001, 01:43
I've added the banner to my forumdisplay using the code on page 2 - how would I go about adding this to my threads as well? I tried using similar code, but I don't know if showthread.php parses $foruminfo properly(??).

Any idea?:confused:

Ta:)
Mark

TheComputerGuy
28 Sep 2001, 02:38
Nice Hack FireFly works great

YourHostSucks
28 Sep 2001, 03:24
Well I tried to add this to PHP include, then use it on the forums

$sp1 = include("http://blahblah.com/cgi-bin/blah/clickcount.cgi?URL=http://blahblah.com");

then place $sp1 where I wanted their number of click to show up..
Well this only placed the number of clicks above the logo , and return the number "1" were the correct number was sup.. to be..

I just* got vBulletin and have not had time to read all the information on it, nor do I understand how it works at all (heh)

But I woud have figure you add that to phpinclude and then use it..


anyone have any ideas? :)

ForzaGrifo
28 Sep 2001, 03:56
Originally posted by FireFly
ForzaGrifo:
Can you please paste the complete error message here?
This function is used on almost all files, you really shouldn't have a problem with it.
Is this the only place you get this error?


Everyone seems to have no problem but I'm having tons of problem!

Here's the error message when I tried to add a forum in vb's cpanel:

Fatal error: Call to undefined function: makeinputcode() in /home/everyone/public_html/forum/admin/forum.php on line 123

Line 123 is this line:

makeinputcode("Sponsor name","sponsorname");

In the cpanel I would see the add forum screen but after the "Sponsor(only supported by categories)" header, it gets cut off and the rest of the input fields are not shown.

And I'm getting this error when I try to show my forums:

Parse error: parse error in /home/everyone/public_html/forum/index.php on line 365


Line 365 in my index.php is this:

if ($forum['sponsorimg'] && $forum['cancontainthreads']==0 && $depth==1) {


Which doesn't make any sense. It seems it's not regconizing the fact that I have added the new fields in the forum tables, and I'm sure that I have added them to the table.
Please help!!!:(

Chen
28 Sep 2001, 14:44
MarkB:

if ($forum['sponsorimg']) {
eval("\$sponsoredby = \"".gettemplate('forumdisplay_sponsoredby')."\";");
} else {
$sponsoredby = '';
}

ForzaGrifo:
Well, the first error I have NO idea what is all about.
That function is used on ALL admin pages, can't understand what it's producing an error here.

About the second error:
Can you paste a line or two BEFORE line 365?
Maybe you deleted a ; or }, I dunno. :confused:

SirSteve
28 Sep 2001, 15:52
makeinputcode("Sponsor banner file<br>(your default images folder is added, no need in that)","sponsorimg");

Shouldn't that be "sponsoring" ?

Also, I would like all my sponsor images in a subfolder under images. Can you help me with this?

YourHostSucks
28 Sep 2001, 15:57
Also, I would like all my sponsor images in a subfolder under images. Can you help me with this?


when you enter the path to the image just enter:

/images/sponsors/blahblah.gif

or what folder you create and sponsors image name...

Chen
28 Sep 2001, 15:58
Originally posted by SirSteve
makeinputcode("Sponsor banner file<br>(your default images folder is added, no need in that)","sponsorimg");

Shouldn't that be "sponsoring" ?

Also, I would like all my sponsor images in a subfolder under images. Can you help me with this?
No, sponsorimg = sponsor image. :)

Chen
28 Sep 2001, 16:00
Originally posted by YourHostSucks
when you enter the path to the image just enter:

/images/sponsors/blahblah.gif

or what folder you create and sponsors image name...
makeinputcode("Sponsor banner file<br>(your default images folder is added, no need in that)","sponsorimg");
Just "sponsors/blahblah.gif".

YourHostSucks
28 Sep 2001, 16:08
doh, yea i have mine setup in the /sponsor folder..

and /sponsors/blah.jpg

just a brain fart -=/

SirSteve
28 Sep 2001, 16:18
Originally posted by FireFly

No, sponsorimg = sponsor image. :)

I seen that afterwards. :)

Thanks.

SirSteve
28 Sep 2001, 16:21
[QUOTE]Originally posted by FireFly
[B]MarkB:

if ($forum['sponsorimg']) {
eval("\$sponsoredby = \"".gettemplate('forumdisplay_sponsoredby')."\";");
} else {
$sponsoredby = '';
}

Does this add the sponsor to threads? If so, can you tell me exactly where this goes?

Chen
28 Sep 2001, 17:36
SirSteve, yes, but you might want to change forumdisplay_sponsoredby to another template.
Add that code (with the new template) in showthread.php right after this:
getforumrules($forum,$getperms);
(almost end of file)
Should work. :)

SirSteve
28 Sep 2001, 18:41
Originally posted by amykhar

and forumdisplay_sponsoredby was included in the list of required templates.

Finally, I added $sponsoredby to my forumdisplay template.


Everything is clean except the above. I have added the forumsdisplay_sponsoredby template and added $sponsoredby in the forumsdisplay template but nothing is showing up.

ForzaGrifo
28 Sep 2001, 18:55
Originally posted by FireFly


ForzaGrifo:
Well, the first error I have NO idea what is all about.
That function is used on ALL admin pages, can't understand what it's producing an error here.



That's what I was saying. The previous calls to makeinputcode() have no problem. When it gets to the makeinputcode() that takes the sponsorname as parameter, error ocurrs. I think it might have got something to do with the fields in the forum table. I've added them in MyPhpAdmin and I'm pretty sure the fields are where they're suppose to be (i.e. after 'cancontainthreads'). It just makes no sense to me why the call to makeinputcode would fail.

Do you know what might have caused makeinputcode() to fail?



About the second error:
Can you paste a line or two BEFORE line 365?
Maybe you deleted a ; or }, I dunno. :confused:


No I'm pretty sure I didn't make any syntax error in the code.

/me Just about to throw his hands up and surrender....



:mad:

hondastyle
28 Sep 2001, 21:34
FireFly, you rock... this hack is sweeet !
The install was rather painless and it's extremely easy to use.

Screenshot attached for those wondering what it looks like..


Great job!

Fred
29 Sep 2001, 08:29
Ok - I set it up and works perfect. Thanks man.

TheComputerGuy
29 Sep 2001, 13:43
If you have the MSN hack, and the world time hack it will mess them up...on the index.php

So I thought I would tell ya, and make sure that you are using a backup copy

Chen
29 Sep 2001, 14:08
How will it mess them up, TheComputerGuy?
I don't use those hacks (URLs please? :)), but maybe I can fix it.

shadowbreed
29 Sep 2001, 15:52
I'm using the world time hack and have this one installed without any problems

TheComputerGuy
29 Sep 2001, 23:30
it wiped them out..as in they are no longer present ...I changed it back last night...I will be glad to show u the files...

DCTR
30 Sep 2001, 01:49
thankx m8

ForzaGrifo
30 Sep 2001, 03:30
Strange!!! I finally got it to work, but that's after I figured out that the culprit is in the copy and paste!!!!

When I copy and paste the code, it gives error when the script is run. But when I manually type the code in, no errors!!!

Does anyone know why it won't work when I copy the code from this thread and paste it into my text editor??

btw, Thx Firefly for helping!

SirSteve
30 Sep 2001, 04:00
Originally posted by ForzaGrifo
Strange!!! I finally got it to work, but that's after I figured out that the culprit is in the copy and paste!!!!

When I copy and paste the code, it gives error when the script is run. But when I manually type the code in, no errors!!!

Does anyone know why it won't work when I copy the code from this thread and paste it into my text editor??

btw, Thx Firefly for helping!

You are probably capturing a space where one shouldn't belong...

hacker
30 Sep 2001, 09:41
Thanks Firefly for this wonderful hack. ;)

MarkB
01 Oct 2001, 01:12
Thanks for that extra snippet of code for showthread.php, Firefly :) As the kids like to say, you rock!:D

FreestylerNZ
02 Oct 2001, 09:28
Heya, I just registered so I can post a question.

How exactly do you have different sponsor ads for each Forum?

I did everything that amykhar listed, including adding $sponsoredby to my forumdisplay template.

Nothing shows up at all in the Forum that I added the banner to through the Admin system!

It would be really great if someone could write more detailed instructions on having unique banners in each forum.

Stephan Whelan
03 Oct 2001, 09:10
Firefly,

I saw this hack a while ago and wanted to install it - however i've only just got round to doing it - and I just wanted to say THANKS! for a great hack...

Rcooper
06 Oct 2001, 05:00
Great hack! One Question. . .

i want to link to pictures on another server. I figure i would have to edit this part of the template

<img src="{imagesfolder}/$forum[sponsorimg]" border="0" alt="Proudly sponsored by $forum[sponsorname]">


but i am not sure exactl what to do. I understant that I will have to type the full URL to evey sponsor i add. that is ok with me!

Thank for any help and thanks for a GREAT hack!

Ryan C.

YourHostSucks
06 Oct 2001, 05:06
I would just replace ( src="images/$forum[sponsorimg]" )

With (src="http://www.blahblah.com/blah/images/$forum[sponsorimg]" )
then you store the images in that folder on that site.. and
when you ad the sponsor just write the picture name..

Seems like the best way to me..

Rcooper
06 Oct 2001, 05:11
YourHostSucks,
only problem is i want to use comission junction to sponsor the forums. This is the code they give you. . .

<a href="http://www.qksrv.net/click-904372-1614906" target="_top" >
<img src="http://www.qksrv.net/image-904372-1614906" width="120" height="60" alt="" border="0"></a>


Any ideas?

BTY Damn your quick! :)

YourHostSucks
06 Oct 2001, 05:17
So they are going to be your only sponsor?



<img src="http://www.qksrv.net/$forum[sponsorimg]" border="0" alt="Proudly sponsored by $forum[sponsorname]">


Then in your admin control panel add them and use image-904372-1614906 as the image..
and
http://www.qksrv.net/click-904372-1614906 as the sponsor url.... and Their name..

Rcooper
06 Oct 2001, 05:22
No not my only one just one to fill in till i get some others. ..

YourHostSucks
06 Oct 2001, 05:27
I edit my other post.. but 120x60 is pretty large to have..
maybe you should use a different image..

Keep the default code for the hack and make your own image.. just link to what they tell you..

EX: Do not change any code.. Just make a new image and upload it to the correct folder..

then link to http://www.qksrv.net/click-904372-1614906

snyx
06 Oct 2001, 06:40
great hack man, I wanted to know this from the get go
only issue the images were left align, no biggie, ez fix.

Rcooper
06 Oct 2001, 15:12
Originally posted by snyx
great hack man, I wanted to know this from the get go
only issue the images were left align, no biggie, ez fix.

Snyx Use this as your template:
[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" align="right"><a href="$forum[sponsorurl]" target="_blank"><img src="{imagesfolder}/$forum[sponsorimg]" border="0" alt="Proudly sponsored by $forum[sponsorname]"></a></td>
</tr>[code]
found in a past post!

YourHostSucks, Thanks I will try that! they say you must use their image code to get credit But i am going to give it a shot anyway! ::D

Thank You.
Rcooper

Chen
06 Oct 2001, 15:14
rcooper, use this as your template:
<img src="$forum[sponsorimg]" border="0" alt="Proudly sponsored by $forum[sponsorname]">
And now just enter the full url to the image, e.g "http://www.qksrv.net/image-904372-1614906".

YourHostSucks
06 Oct 2001, 16:50
Doh! Man I was so sleepy (went to bed after was done with this thread)

I was not thinking clear.. :)

But FireFly is wise and has told you the smart thing to do.

Althou I would still suggest you make your own image
and do not change the code... :)
You will see what I mean if you put that 120x60 image
in the sponsor by section.. (hehe)

Rcooper
06 Oct 2001, 22:17
FireFly yo Rock! Thanks for the great hack and help!

rcooper

YourHostSucks
11 Oct 2001, 03:27
Just wan't to make sure you know how much I love this feature! :)

THANK YOU! :D

It is working very well!

Hooper
18 Oct 2001, 22:26
The hack is wonderful. Just what I wanted. But soon after I installed this my search quit working. I'm not sure if it is the hack or not. Most likely not. However, what could cause my search to stop functioning? When you try a search it comes back to no matches found. If you type less than the required letters for search it does the same thing. It will not redirect or anything. Just no matches found.

Any suggestions?

amykhar
18 Oct 2001, 23:18
When I put something in phpinclude, my buddy list quit working. Have you put anything in there?

(grasping at straws)

Amy

Hooper
19 Oct 2001, 00:04
Oh god... I've PhP included my ass off! .............................:mad:

This shouldn't keep anything from working. I hope a developer responds to this... HELP.................................

Freddie Bingham
19 Oct 2001, 00:11
If you over write a vB variable with something in phpinclude than you can cause all sorts of problems.

My advice? Clean out phpinclude and see if your search works.

Hooper
19 Oct 2001, 00:24
ok. I'll work on it. Thanks.

Freddie Bingham
19 Oct 2001, 00:28
Look in the search templates for variables (start with $) and see if you have any matching variables in your phpinclude template, i.e. like $query

Hooper
19 Oct 2001, 00:39
I had to remove the includes. It works now. But this really stinks. My files that I have included were important to my site.

Are there any work arounds?

Shoot freddie. There are quite a few queries in my php includes.

Freddie Bingham
19 Oct 2001, 00:44
The work arounds are not to use variables of the same name that vB uses.

You can have all the queries you want, just don't name them '$query' - that one would kill the search.

Hooper
19 Oct 2001, 00:52
Thanks Freddie.

amykhar
23 Oct 2001, 12:53
I found a new use for this hack :D

I added one extra field to the database, and now have forum-specific web rings at the bottom of my topical conversation forums. This hack is highly adaptive :)

Example: Scroll down and look right above the footer.

http://www.eaforums.com/forumdisplay.php?s=&forumid=27

Amy

Hooper
24 Oct 2001, 03:09
Amy your a genious. Very nice. Doesn't shock me in the least that you could figure this out.


Very Nice.

Chen
24 Oct 2001, 12:17
Great work Amy! :)

etones
02 Nov 2001, 07:58
Hey, this is a really great hack and I want it, however will it work non 2.2.0??

Please reply, cheers all!

Chen
02 Nov 2001, 13:21
Most chances are that it does, although I haven't had the time to test it yet.

eva2000
02 Nov 2001, 13:26
Originally posted by FireFly
Most chances are that it does, although I haven't had the time to test it yet. well i'm waiting ;) :D

etones
02 Nov 2001, 19:04
Im waiting toooo! :)

etones
02 Nov 2001, 22:02
Tested on 2.2.0 and it works, great one m8!!

Cheers

eva2000
02 Nov 2001, 22:37
Originally posted by etones
Tested on 2.2.0 and it works, great one m8!!

Cheers hey taz where did ya forum go ? 404 error http://www.e-tones.co.uk/forums/index.php ??

Chen
03 Nov 2001, 09:15
Originally posted by etones
Tested on 2.2.0 and it works, great one m8!!

Cheers
Thanks for letting us know. :)

etones
03 Nov 2001, 10:37
Eva, i took it down while testing, its at a secret location :)

message me on ICQ and i'll show you :)

etones
03 Nov 2001, 11:07
I simply cannot get the below to work with version 2.2.0, can anyone help?

Originally posted by amykhar
I extended this hack a bit to put a sponsor ad in a particular forum.

To do this, I added a new template called forumdisplay_sponsoredby and put this in it:


<br><br><a href="$foruminfo[sponsorurl]" target="_blank"><img src="images/$foruminfo[sponsorimg]" border="0" alt="Proudly sponsored by $foruminfo[sponsorname]"></a>
<br>



I then edited forumdisplay.php so that


if ($foruminfo['sponsorimg']) {
eval("\$sponsoredby = \"".gettemplate('forumdisplay_sponsoredby')."\";");
}
else {
$sponsoredby = '';
}


was immediately AFTER


if ($foruminfo['allowposting']==1) {
eval("\$newthreadlink = \"".gettemplate('forumdisplay_newthreadlink')."\";");
}


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. :)

demo:
http://www.eaforums.com/forumdisplay.php?s=&forumid=27


Amy

amykhar
05 Nov 2001, 03:40
The problem seems to be in displaying the template. I will play with it a bit when I get a chance.

Amy

amykhar
05 Nov 2001, 03:51
I don't know why this worked, but it did. I simply copied the eval template line

eval("\$newthreadlink = \"".gettemplate('forumdisplay_newthreadlink')."\";");


from above, pasted it into the if statement, and changed the variables. It works fine now. I am using it for the web rings at the bottom of my forums.

http://www.eaforums.com/forumdisplay.php?s=&forumid=49

Amy

Mr. Slugworth
06 Nov 2001, 20:43
OK, after installing it by hand typing (copy and past didn't work), everything works great, except that on the forums that I have sponsored, only the images shows up, and not the Proudly sponsored by $$$$$. Any ideas of what could be wrong or were to look. I have gone over everything with a fine tooth comb, and can't seem to find anything that looks out of the ordinary.

Thanks!

amykhar
07 Nov 2001, 10:58
I couldn't find a forum that you have sponsored. It also seems that you require registration to view posts, and that might be why I am not seeing the sponsor images. Do you have a test account so I can peek at your html source?

Amy

Mr. Slugworth
07 Nov 2001, 15:33
Amy, thanks for the effort. I changed the code in the template from an alt= text referrence to just text, and it showed up great. For some reason, the image was appearing, but the alt text was missing. Thanks again.

Mr K
08 Nov 2001, 03:59
Okay...

call me nutty ... but where do I upload sponosor details like image and such like??

I've got the hack installed....thanks for this ....

Mr K
08 Nov 2001, 04:24
don't worry ... I found it on page 2 .. didn't realise this was A HUGE thread...

thanks guys ... really like this

Mr K
09 Nov 2001, 12:45
check out http://www.studiowhiz.com/_boards we have this running both on the forum front and in the thread display sections...

now what I'm looking at extending is having the ability to put a FLASH file or GIF/JPG in the FORUM display area ... so sponsors get some space ... not too much (Sitepoint have a bit much) ...

any ideas??

DroppedAtBirth
09 Nov 2001, 17:54
Great hack works great on 2.2.0:)

xug
12 Nov 2001, 04:40
Hi Firefly

The demo looks great so your hack must be great too :)
I haven't installed this (yet) because i'm more looking into something that can rotate banners of original banner size 468x60 pixels so with every view another banner will get in place.

I have something within vbportal on my main page and would like to see this on my forum, is this possible ?

eg_92901
15 Nov 2001, 14:59
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.

trainer
16 Nov 2001, 04:07
fixed my problem :D

jminiman
17 Nov 2001, 23:07
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?

amykhar
18 Nov 2001, 02:17
jminiman read the thread. The instructions are already here.

Amy

jminiman
18 Nov 2001, 02:37
Amy,

I'd LOVE to see a live example of your hack. Every URL you have posted is now defunct.

jminiman
18 Nov 2001, 05:33
Amy,

Please give some details as to how to customize this for each forum. Thanks.

jminiman
18 Nov 2001, 06:14
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?

Chen
18 Nov 2001, 07:13
Try adding cellspacing="0" cellpadding="0" to the td tag that contains the banned, in your forumhome_forumbit_level1_nopost_sponsor template.

jminiman
18 Nov 2001, 16:14
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>

-->

Chen
18 Nov 2001, 16:43
No I mean add that to this:
&lt;td bgcolor="#606096" colspan="4">

jminiman
18 Nov 2001, 17:04
I just figured out what the problem is. Table padding is fine. Problem is that for some reason a space exists right beneath ever Category Name, so as you can see in the screen shot, I can enter a line of text beneath "Unit Specific." If I kill that line in FrontPage, the silly "padding" goes away. Where can I kill that line return?

The attached screen shot shows what I'm talking about.

Littlebit
21 Nov 2001, 15:39
Could someone help me fix this...I'm getting a parse error on this line in index.php:

if ($forum['sponsorimg'] && $forum['cancontainthreads']==0 && $depth==1) {

Littlebit
22 Nov 2001, 15:14
I'm going to retry the index.php changes, but before I do, could me added code with incorrect spacing be the cause of getting a parse error? I copied and pasted from your thread and included the skips in lines...would that be my mistake?

Hooper
25 Nov 2001, 18:13
I too have a parsing problem and just emailed Chen about it.

Parse error: parse error in community/index.php on line 310

I've installed this in 3 or 4 versions up to 2.2.1 without a hitch.

Let's hope Chen see's the problem. I love this hack.

Crinos
25 Nov 2001, 20:33
Well, one of the most common mistakes when posting code in these forums is how the code changes ...

the most common thing I saw was { appearing instead of { when it's in a code quote .... check those and that might solve the problem...

Littlebit
26 Nov 2001, 01:31
Ohhh..I bet you are right. I thought it might be the spaces in between the lines of the code posted on this thread. It's one of those things... if you don't know how to write the stuff, you certainly would not know if 123 was intentional or not. Thanks. I'll go back and look at it again and give it another whirl.

LuBi
05 Dec 2001, 19:40
At what point did this thread go from fireflys hack to amys? Did firefly make a banner hack and then amy made the proudly supported by "sitepoint" hack. I once saw that hack but can't seem to find it anymore, I'm looking for the hack that adds a sponsors on the index not banners but proudly supported by. Any ides where i can find that in here or anywhere on vbhacks?

Thanks!

amykhar
05 Dec 2001, 20:16
It's not my hack :D

I merely added a bit that allows you to have a different banner in a given forum. Firefly wrote the main part, and the part that puts the banner on the forumhome page.

Amy

LuBi
05 Dec 2001, 22:19
I'm still not clear where to find the hack to install the small adds on the index..?

amykhar
06 Dec 2001, 00:43
Firefly's first post.

Amy

LuBi
06 Dec 2001, 02:28
Originally posted by amykhar
Firefly's first post.

Amy

I did that, and nothing happened. No errors but nothing showed up..

http://www.suprascene.com/supraforums

Lionel
18 Dec 2001, 15:51
Originally posted by amykhar
I extended this hack a bit to put a sponsor ad in a particular forum.

and forumdisplay_sponsoredby was included in the list of required templates.
Amy

I tried that, it does not show... Please where do you include the required templates? I placed them twice in forumdisplay.php with all others.

I got it to work on the main page. It is the forumdisplay that does not show. I am using 2.21

Lionel
20 Dec 2001, 18:07
I tried to extend the hack so image shows in forumdisplay but it does not work. The only thing that I am not sure is where to include the template in what list?

amykhar
20 Dec 2001, 19:03
I put mine in the forum display template, right above the $forumslist variable.

Amy

Lionel
20 Dec 2001, 19:17
I meant
forumdisplay_sponsoredby
you said that you placed it in the list of required templates.

Where is that list?

amykhar
20 Dec 2001, 19:25
Ah gotcha!

There is a link to add new templates. Click the link, pick the template set that you want to use it in, and then paste in the code that I supplied.

Amy

Lionel
20 Dec 2001, 19:30
I did all that before. I thought you meant to place it in forumdisplay.php templatesused=

Any way I can't get it to work on forum display. On main page it is fine...

Lionel
20 Dec 2001, 19:47
I got it to work but it is not what I was hoping. Maybe you can help?

Look here (http://www.haitiwebs.com/haitianforums/) and you will see image. Click on main category. This is where I wanted to show it also. Yours shows in Forum 1 which is even great.

amykhar
20 Dec 2001, 20:15
I fixed that on mine as well.

Right now, you placed the code somewhere beneath this


if ($foruminfo['allowposting']==1)


Cut out the code that you added, and paste it right below this instead.


unset($imodcache);


Right now, the code is placed only in forums that allow posting. Moving it up a bit gets it on the category pages as well. I don't have the exact code for you because I am no longer running this exact hack.

Amy

hypedave
25 Dec 2001, 19:58
can someone edit my forum.php file. I have tryed and still can get it to work, thanks

bira
26 Dec 2001, 13:19
hypedave,

Please note that posting entire vBulletin scripts is not allowed.

Thanks,

Bira

hypedave
26 Dec 2001, 13:30
yeah I forgot about that, oops sorry, well can someone still help me out, oh yeah, I hate it when people call me hyperdave

if I wanted an r in hype I would add one, thanks :)

Okiewan
11 Jan 2002, 00:21
First of all... great hack firefly... nice mods too amykhar!

Got it working great on forum home and forum display... now trying to get it to show-up on threads, ie; if a forum is sponsored, the threads within that forum inherit the sponsor and display it on each thread.

tried building duplicate template called sponsoredby_thread, with the following:

<a href="$foruminfo[sponsorurl]" target="_blank"><img src="{imagesfolder}/$foruminfo[sponsorimg]" border="1" alt="This Forum Made Possible by $foruminfo[sponsorname]"></a>

Modified showthread per iinstructions found here, calling that new template.

Added "$sponsoredby" in the template showthread...

Seems to be some kind of path issue? Picks up a holdedr for the image (including alt text), but no sponsor image and no link.

Any ideas? Am I doing this all wrong?

Thanks in advance for any assistance and thanks again for the hack. VERY useful.

rawnet
11 Jan 2002, 22:00
Hello,

I have followed the steps and added some sponsors in my admin system.

Unfortunately, they are not showing up on my Forums homepage where they should be. When I go to edit the admin, it does not pre-fill in the form fields for sponsor information.

Can anybody shed any light on this?

All the best,

Kind Regards,

Ross Williams

rawnet
12 Jan 2002, 14:05
PLEASE - can anybody help? I know this hack has been around for a while, and I've been looking forward to installing it, but for some reason no sponsors are appearing on my forums homepage (http://www.servicepals.com/forums). I'm running vBulletin 2.2.1 and vbPortal.

I can add visitors in the backend, but when I go to edit that forum again, the input fields are not pre-filled with the info I just entered. Is this normal?

The forums are not showing up on my front end, but I would like to clarify the backend first to diagnose what the problem is...sniff sniff... :(

Cheers for now,

Ross

Chen
12 Jan 2002, 14:19
Start with the original forum.php file, and re-install the hack on it.

rawnet
12 Jan 2002, 14:32
Hi Firefly,

Will do - how likely is this to solve the problem? Has my phenomena been seen before?

Ross

rawnet
12 Jan 2002, 14:50
SUCCESS.

I suspect that I'd missed one of the queries out on the forum.php part of the hack.

All working now.

Anybody know how I can incorporate a Commission Junction Smartzone into this code? Reason being that I'd like to rotate the sponsors of each forums without input on my part (I is a lazy bugger).

Cheers for now,

Ross

rawnet
12 Jan 2002, 15:45
Hello,

I've been trying to incorporate Amy's addition, allowing us to display the sponsor at the top of the forum. Have modified forumdisplay.php, created the new template, but am having problems with this bit :


and forumdisplay_sponsoredby was included in the list of required templates.


Where do I define this?

Hugely impressed with this hack guys,

Cheers,

Ross

Okiewan
12 Jan 2002, 21:54
add it to the section "$templatesused="

Now if I could get some help with my problem above I would be most thankful! Gotta have it! :)

DiSS Troya
12 Jan 2002, 23:23
appreciate the hack!

Okiewan
14 Jan 2002, 19:11
Anyone ? Purdy Please?



First of all... great hack firefly... nice mods too amykhar!

Got it working great on forum home and forum display... now trying to get it to show-up on threads, ie; if a forum is sponsored, the threads within that forum inherit the sponsor and display it on each thread.

tried building duplicate template called sponsoredby_thread, with the following:

<a href="$foruminfo[sponsorurl]" target="_blank"><img src="{imagesfolder}/$foruminfo[sponsorimg]" border="1" alt="This Forum Made Possible by $foruminfo[sponsorname]"></a>


Modified showthread per iinstructions found here, calling that new template.

Added "$sponsoredby" in the template showthread...

Seems to be some kind of path issue? Picks up a holdedr for the image (including alt text), but no sponsor image and no link.

Any ideas? Am I doing this all wrong?

Thanks in advance for any assistance and thanks again for the hack. VERY useful.

Okiewan
16 Jan 2002, 15:36
Okay, I'm guessing one of the following:

1) No one cares
2) No one has time
3) It can't be done
4) I'm invisable

It would be cool to at least find out why the "sponsor in threads" question isn't being answered... I'd know rather to give-up on it or not.

?

Chen
16 Jan 2002, 15:39
Try using the $forum array instead of $foruminfo in your sponsoredby_thread template. :)

Okiewan
16 Jan 2002, 15:56
AH HA!
Thanks a lot FireFly... that worked.

Chen
16 Jan 2002, 16:12
Originally posted by Okiewan
AH HA!
Thanks a lot FireFly... that worked.
Of course it did. :)

Ninth Dimension
24 Jan 2002, 11:34
Cool hack, worked fantasticly first time, thank you.

X-Fan
28 Jan 2002, 13:35
Originally posted by FireFly
[b][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.

Great hack, firefly, especially for my forum which, when it goes live, will be sponsored by an online store.

It would be fantastic if you could make it so that sponsored by graphics can show up on forums as well - perhaps by inheriting the sponsor info from the parent category?

I have no idea how to do that, though, so could you possibly create a new step-by-step hack to do that?

Airwaves
04 Feb 2002, 11:26
working with vb2.2.2 ?

http://www.mobile-forum.com - just upgraded to 2.2.2

I have the bg image from the sitepoint forums sponsor cells and it should go lovely with my colour scheme, how do i have it as the bg image in the sponser cells on my site??

also, how do I get the image to be to the RIGHT instead of the left?

importmix
04 Feb 2002, 16:30
great hack fly!

i also added amy's hack, but it didn't seem to work. i want the same ad from fly's hack to show on the corresponding threads, sub-forums....so on.

Airwaves
05 Feb 2002, 19:32
finally, i get the button the right, and the image in the background, but the bg image 'tiles' and i do not want it to, you can see the banner on the forums at http://www.airwavescomms.co.uk/forums

here is the code I am using, can someone please modify it to not get the image to tile, I think CSS is my answer, but, i am defo no good at that.. so i beg you please help me!


<tr id="cat">
<td bgcolor="#336D95" background="http://www.vbulletin.org/forum/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 colspan="4" background="http://www.airwavescomms.co.uk/forum/images/spsback.gif"><a href="$forum[sponsorurl]" target="_blank"><img src="http://www.airwavescomms.co.uk/forum/images/$forum[sponsorimg]" border="0" align="right" width="88" height="31" alt="Proudly sponsored by $forum[sponsorname]"></a></td>
</tr>


i use {imagesfolder } instead of the full URL however, but vb.org decided to parse that and put its own link there.... :confused:

extreme_old
06 Feb 2002, 15:58
Great hack!!

I have installed the hack now, but how do I then decided what banner to show in each catagories? What's the size of the banners?

Ninth Dimension
06 Feb 2002, 17:08
All customisation and design of the banners is up to you, you set them up as you see fit, however I personally have gone for 210x37 images

extreme_old
06 Feb 2002, 21:26
ok, but where do I set which banner for with catagory. I mean I what .php site or template and how? I want to use a difference banner for all catagories and how to I set the url too?? Please help, or paste some code that shows me what to do?

Thanks

Airwaves
06 Feb 2002, 21:34
the banners can be set up in the forum category properties in admin cp.

each category can have a differnet banner this way

extreme_old
07 Feb 2002, 16:08
What's wrong here:

Database error in vBulletin Control Panel 2.2.1:

Invalid SQL: UPDATE forum
SET
styleid='1', title='General', description='',
active='1', displayorder='1', parentid='-1', parentlist='10,-1',
allowposting='1', cancontainthreads='0',
sponsorname='2pass',sponsorimg='2pass.gif',
sponsorurl='http://www.mysponsor.com/cgi-bin/tts-in.cgi?1020207-0',daysprune='30',
newpostemail='', newthreademail='',
moderatenew='0', allowhtml='0', allowbbcode='1',
allowimages='0', allowsmilies='1', allowicons='1',
styleoverride='0', allowratings='1', countposts='1',
moderateattach='0'
WHERE forumid='10'
mysql error: Unknown column 'sponsorname' in 'field list'

mysql error number: 1054

I have made all the changes that Firefly describes and. I'am running version 2.2.1

freehtml
10 Mar 2002, 15:48
will this work on version 2.2.3 also?

Chen
10 Mar 2002, 18:37
Yup it should.

Floris
14 Mar 2002, 22:35
and 2.2.4 ?

trainer
15 Mar 2002, 06:08
could one of the pros help explain how to add-on the specific sponsor for each forum so it carries over to the threads in that forum.

theironmic
15 Mar 2002, 06:11
where de u put the image link at

Floris
15 Mar 2002, 13:51
I just applied the hack and everything went fine.
I guess this works on vBulletin 2.2.4

The only thing I have at the moment is the following:
I have applied my own 'Category background image' template hack, and it looks like the categorie is now a default colour instead of a given background.

I fixed this by adding:
background="{imagesfolder}/catbgtitle.gif"
to the newly added forumhome_forumbit_level1_nopost_sponsor template (in the <td> tags)

I also noticed that the categories that had the banner set to them, no longer were devided from the other categories (I have applied my 'Split categories from eachother' template hack.)

So I re-applied that hack, just only to the new template, take a look at my site if you wonder what i mean, this is how my template looks now:

</table>
</td></tr></table><br>
<table cellpadding="{tableouterborderwidth}" cellspacing="0" border="0" bgcolor="{tablebordercolor}" {tableouterextra} width="{contenttablewidth}" align="center"><tr><td>
<table cellpadding="4" cellspacing="{tableinnerborderwidth}" border="0" {tableinnerextra} width="100%">
<tr id="cat">
<td background="{imagesfolder}/catbgtitle.gif" 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 background="{imagesfolder}/catbgtitle.gif" bgcolor="{categorybackcolor}" colspan="4"><a href="$forum[sponsorurl]" target="_blank"><img src="{imagesfolder}/banners/$forum[sponsorimg]" border="0" alt="Proudly sponsored by $forum[sponsorname]"></a></td>
</tr>
<tr align="center" >
<td background="{imagesfolder}/catbgindex.jpg" bgcolor="{tableheadbgcolor}"><smallfont>&nbsp;</smallfont></td>
<td background="{imagesfolder}/catbgindex.jpg" bgcolor="{tableheadbgcolor}" width="80%" align="left"><smallfont color="{tableheadtextcolor}"><b>Forum</b></smallfont></td>
<td background="{imagesfolder}/catbgindex.jpg" bgcolor="{tableheadbgcolor}"><smallfont color="{tableheadtextcolor}"><b>Posts</b></smallfont></td>
<td background="{imagesfolder}/catbgindex.jpg" bgcolor="{tableheadbgcolor}"><smallfont color="{tableheadtextcolor}"><b>Threads</b></smallfont></td>
<td background="{imagesfolder}/catbgindex.jpg" bgcolor="{tableheadbgcolor}" nowrap><smallfont color="{tableheadtextcolor}"><b>Last Post</b></smallfont></td>
<td background="{imagesfolder}/catbgindex.jpg" bgcolor="{tableheadbgcolor}" width="20%"><smallfont color="{tableheadtextcolor}"><b>Moderator</b></smallfont></td>
</tr>
Please notice that I have my banners in imagedir/banners/ directory! And that I use category & indexing background images!So do not forget to edit that to your liking



Now,
Isn't there any way of removing that line in the middle ?


Additional question:
Is there any way of making this only show up for unregistered members?
Guests > get the banners in category
Registered members > dont. they get normal view

forumuser
15 Mar 2002, 22:30
Once you have installed this hack, which I have done, where do you add the sponsors? I cannot seem to find that, thanks a lot, this hack is awesome by the way

Ninth Dimension
16 Mar 2002, 00:36
you add the sponser information in the admin panel, just choose to modify the categories, and it should ask you for some information regarding that particular cat.

Good Luck.

B16MCC
19 Mar 2002, 00:16
ok I applied the hack and I have the new fields in my CP.

When I click save I get an error detailed below..

There seems to have been a slight problem with the PS2 HOUSE database.
Please try again by pressing the refresh button in your browser.

An E-Mail has been dispatched to our Technical Staff, who you can also contact if the problem persists.

We apologise for any inconvenience.

OK Standard Stuff..

Here's my detail..

Database error in vBulletin Control Panel 2.2.4:

Invalid SQL: UPDATE forum
SET
styleid='1', title='General', description='General Discussion',
active='1', displayorder='1', parentid='-1', parentlist='1,-1',
allowposting='0', cancontainthreads='0',
sponsorname='Morning Norman',sponsorimg='www.morningnorman.com/photos/Stella.jpg',
sponsorurl='http://www.morningnorman.com/ubb',daysprune='0',
newpostemail='', newthreademail='',
moderatenew='0', allowhtml='1', allowbbcode='1',
allowimages='1', allowsmilies='1', allowicons='1',
styleoverride='0', allowratings='1', countposts='1',
moderateattach='0'
WHERE forumid='1'
mysql error: Unknown column 'sponsorname' in 'field list'

mysql error number: 1054

Date: Tuesday 19th of March 2002 12:03:42 AM
Script: http://www.morningnorman.com/vbb/vbb/admin/forum.php3
Referer: http://www.morningnorman.com/vbb/admin/forum.php3?action=edit&forumid=1


Can someone help me with this please.. I am somewhat of a dummy when it comes to scripting..

Chen
19 Mar 2002, 07:12
Run the three queries I tell you to run in my first post, they'll add the required fields to your table. :)

tanman
19 Mar 2002, 16:02
This sponsored by hack is cool.

You said you wanted to know if we wanted more :)

Our site is ad supported. I need to make sure the page top banners are not ignored.... Need to run the banners past some eyeballs, inside the forum threads.

How about a hack that adds a "sponsored by" banner or message with graphic INSIDE a forum thread, automatically, every X posts or so (where x could be set by admin to 10 or 12 or ???)?

One of our competitors has this on a phBB or some such...

Would that be hard?

nafae
28 Mar 2002, 05:49
Hmm Ok I installed this (Exactly) and made sure by going back and checking all the modified files, however whenever I add a sponsor to a forum, the category just dissapears! Then when I remove the sponsorship fields, the categories reeapear again!

I am unsure of what this is, firefly or anyone else any sort of help you could offer would be appreciated :o

mewgood
28 Mar 2002, 06:18
Will this owkr for 2.2.4?

Chen
28 Mar 2002, 10:33
Yes mewgood, and nafae did you add the template I told you to add? And made sure you added it to all template sets?

LouChipher
28 Mar 2002, 12:02
After 15 pages...
FireFly, your hack is only for categories and not specially for forums, correctly?

Chen
28 Mar 2002, 16:25
Yes.

nafae
28 Mar 2002, 18:46
I added the template in the instructions, but not any others, are there other templates I need to add?

Ninth Dimension
02 Apr 2002, 17:15
Hi everyone, does this hack have the ability to display the sponsors banners on pages other than the forumhome yet?

Chen
03 Apr 2002, 07:17
Yeah I think someone posted how to make it show up showthread.php. Browser the thread. :)

Ninth Dimension
03 Apr 2002, 10:30
Ah cool (maybe I should spend some more time reading these messages, but 15 pages is a bit much, and I was so busy yesterday)

dgessler
12 Apr 2002, 04:28
I have a question if someone can be nice enough and show me some light. Would it be possible to run this with something like phpAds, or any similar ad-tracking software? Just so that it can keep track of impressions, etc. Possible?

Thanks a lot,
Dan

hypedave
12 Apr 2002, 04:48
I had this previously installed on my vb 2.2.1 board when vb 2.2.5 came out, I built a whole new board, I cant get this to install on vb 2.2.5 for anything in the world has anybody tryed ?

Wayne2k1.com
12 Apr 2002, 09:31
Yup.

Works with 2.2.5 as well :)

hypedave
12 Apr 2002, 15:55
Originally posted by Wayne2k1.com
Yup.

Works with 2.2.5 as well :)

how did you get it to work, since I know its works now, I will try again, and i have a problem again I will let you know

JackG
14 Apr 2002, 20:48
Hi, when I run this in phpMyAdmin:

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


I get this message;

Your SQL-query has been executed successfully


No tables found in database.

And it dosent create the tables.
I am doing it in the correct place and
their is a forum table thier. My vB version
is 2.2.5.

Does anyone know why this is not working?

Thanks in advance.

UPDATE:

I Have Since Manually Added These Tables.

Airwaves
19 Apr 2002, 23:09
http://www.sitepointforum.com/

has a nice 'proudly sponsored by' graphic which isnt tiled, when I put this image into my forum, it tiles.

I know you can fix this with CSS, but I cant remeber the code, can anyone help please.

BTW, nice hack, have it on my forum :D

kbusque
08 May 2002, 19:57
I installed the hack, and I think it is working (didn't break anything), where do i go to add sponsors? Sponsor img's etc? Directly in the mysql db?

RDX1
28 May 2002, 05:10
i dont have time to read the whole thread, does this work for 2.2.5 and 2.2.6 final

Wayne2k1.com
28 May 2002, 07:58
lol :p

I don't have time to install this hack...will you install it for me? :tired:

Chen
28 May 2002, 08:59
Originally posted by NerdNations
i dont have time to read the whole thread, does this work for 2.2.5 and 2.2.6 final
And you really expect an answer?

Palyntir
29 May 2002, 20:54
has anyone been able to make this work with flash banners?

Demetris
31 May 2002, 19:57
Fantastic

Just installed this hack and already have my first paying sponsor.
The only problem i have is that whichever forum headin i add a sponsor to i then loose the link for that forum.

Did i do something wrong

bpuetz
21 Jun 2002, 01:15
I just love this hack! My site (still in development) will be ad free simply because I hate banners. But this hack gives me a way to generate a few dollars for bandwidth while still being very tasteful and subdued. Thanks so much, FireFly! If you ever make it down San Antonio way, I owe you a margarita! :)

A question. I would like to get rid of the line between the category name cell and the sponsor cell. Anyone know a way to do this without losing the rest of the lines? What I would really like to do is colspan the entire row and left justify the category name and right justify the sponsor ad in the resulting cell. I don't suppose anyone knows any tricks to do this?

Thanks!

Bill

almightyone
27 Jun 2002, 23:15
Originally posted by NerdNations
i dont have time to read the whole thread, does this work for 2.2.5 and 2.2.6 final
if you dont got time to read a few pages wher will you find the time to install this hack? :ermm: :tired:

robdj
02 Jul 2002, 14:47
OK, I had a similar problem to nafae -
"whenever I add a sponsor to a forum, the category just dissapears! Then when I remove the sponsorship fields, the categories reeapear again!"
The problem was that I had the template name incorrect. Make sure it is "forumhome_forumbit_level1_nopost_sponsor" exactly (Version 2.2.6)
Great hack - five stars!

Duke Of Lion
11 Jul 2002, 16:48
Originally posted by FireFly
[b]Works with vBulletin v2.2.0!

For more info about running queries take a look here (http://www.vbulletin.com/forum/showthread.php?s=&threadid=26272) or here (http://www.vbulletin.com/forum/showthread.php?threadid=18558).

I want to look there but it doesn't work! says to enter my username and then my registration number, yeah well my usernames on .org and .com are not the same..... I WANT THEM TO BE, I asked for it when i didn't registred right.....
.org = duke of lion
.com = duke of lions

Please help me out! I am a paying customer and I would appreciate your help!

Chen
12 Jul 2002, 07:50
Try http://www.vbulletin.org/forum/showthread.php?s=&threadid=26272 ...

Duke Of Lion
16 Jul 2002, 20:49
Works fine on 2.2.6, but....

On my techie style it the forum (Category) dissapears? what do I do wrong? Also where do I add "Proudly sponsored by..." in the category?

FireFly, THANK You, hope you don't want a piece of the money, it'll bring ;)

Chen
16 Jul 2002, 20:55
You need to add the new template to all of your template sets.

Duke Of Lion
16 Jul 2002, 21:35
What about if i have 2 styles and my default image folder for the 2nd style is not /image? what do I fill in when I add the sponsor?
Actually I want to fill in the full path so I don't have the problem? what do I do?

FireFly, THANK You, hope you don't want a piece of the money, it'll bring


FireFly r u too rich already? ;)

Sorry, that I am just a poor student...

dieKetzer
17 Jul 2002, 11:56
Use this for your template:
<tr id="cat">
<td bgcolor="#005628" colspan="6" cellspacing="0" cellpadding="0">
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD width="50%" valign="middle"><A href="forumdisplay.php?s=$session[sessionhash]&forumid=$forum[forumid]"><NORMALFONT color="#FFCC00"><B>$forum[title]</B></NORMALFONT></A><br><smallfont color="{categoryfontcolor}">$forum[description]</smallfont></TD>
<TD width="50%" valign="top" align="right"><A href="$forum[sponsorurl]" target="_blank"><IMG src="http://www.vbulletin.org/forum/greentek/$forum[sponsorimg]" border="0" alt="Proudly sponsored by $forum[sponsorname]"></A></TD>
</TR>
</TABLE>
</td>
</tr>

Originally posted by bpuetz
A question. I would like to get rid of the line between the category name cell and the sponsor cell. Anyone know a way to do this without losing the rest of the lines? What I would really like to do is colspan the entire row and left justify the category name and right justify the sponsor ad in the resulting cell. I don't suppose anyone knows any tricks to do this?

Thanks!

Bill

bpuetz
22 Jul 2002, 00:42
The problem (a good problem!) I'm running into with this is that I only have four categories, and one in particular is the one that the sponsors want to be on.

What would it take to allow me to have a pool of sponsors and rotate them randomly? I would like to be able to have individual sponsor pools by category although one pool for all categories would be acceptable. I would like to have equal exposure for all sponsors in the same pool.

Firefly, I would certainly step up with some cash if you could make this happen -- and I bet a number of other folks would also.

Chen
22 Jul 2002, 08:03
Have you tried these hacks?
http://www.vbulletin.org/forum/showthread.php?s=&threadid=41154&highlight=ads
http://www.vbulletin.org/forum/showthread.php?s=&threadid=39074&highlight=ads

carpman
26 Jul 2002, 18:16
Hello, will this hack work ok with this hack?
http://www.vbulletin.org/forum/showthread.php?s=&threadid=33961

cheers

Warlord
29 Jul 2002, 02:17
Originally posted by almightyone

if you dont got time to read a few pages wher will you find the time to install this hack? :ermm: :tired:

Methinks it'd take alot longer to read 16 pages then it would to install this hack. :p

Warlord
31 Jul 2002, 02:50
Nice hack Firefly! :)

Note to anyone who doesn't know... this hack DOES work on 2.2.6 :)

mikeschultz
05 Aug 2002, 17:42
is there any way i can add sponsors to the forums, not just the categories?

Destee
06 Aug 2002, 03:43
FireFly ... Thank You Again !

Wonderful Hack ... (clicking on installed now).

:)

Destee

DannyITR
21 Aug 2002, 06:08
Here is my error

Parse error: parse error, unexpected ':' in /home/dannyitr/public_html/forums/admin/forum.php on line 156




adn this is the line they are talking about:

VALUES
(NULL,'$styleset','".addslashes <http://www.php.net/addslashes>($title)."','".addslashes <http://www.php.net/addslashes>($description)."','$isactive','$displayorder','$parentid',

DannyITR
21 Aug 2002, 06:33
Fixed it. for some reason, when I copied and pasted the code it added a website after each "addslashes". I took out all the websites since they are not in the code provided on the first page and it worked!

DannyITR
21 Aug 2002, 07:37
I can't get the banner in the thread like it says on page 5. Can someone help me?

"and forumdisplay_sponsoredby was included in the list of required templates.

I don't know how to do this so I left it out. Can someone help me?




"SirSteve, yes, but you might want to change forumdisplay_sponsoredby to another template.
Add that code (with the new template) in showthread.php right after this:"


Why would I modify the new template I just created? I tried re-naming it but all my banners disapeared. I still can't get the banners in the threads.

Help.

Audionuts
23 Aug 2002, 02:07
man this is exatcly what i have been looking for, but i cant get this to work :( after i edit the forum.php and upload, i go to the modify forums in the cp i see the the sponsor stuff on top of everything?? looks real funky and i saw a gif posted here that shows the feature in the options of each forum, and thats not what i get at all...what could i be doing wrong? am i adding the code to the wrong place? i'm a little lost with the instalation instructions...sorry to bug but if anyone has time to help i would really apreciate...

DannyITR
27 Aug 2002, 06:25
When I wan to add a new forum, I get this problem:




Database error in vBulletin Control Panel 2.2.6:

Invalid SQL: 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,'1','Vole / Stolen','Post items that have been stolen so people can keep an eye out. ','1','3','13',
'','1','1','','',
'','30','','',
'0','0','1','1','1','1',
'0','1','1','0')
mysql error: Column count doesn't match value count at row 1

mysql error number: 1136

Date: Tuesday 27th of August 2002 01:20:26 AM
Script: http://www.montrealracing.com/forums/forums/admin/forum.php
Referer: http://www.montrealracing.com/forums/admin/forum.php?s=&action=add&parentid=13

DannyITR
27 Aug 2002, 16:30
They refuse to help me on vb.com so can anyone here please respond?