Gossamer Forum
Home : Products : Links 2.0 : Customization :

The Elusive Webadverts Mod!

Quote Reply
The Elusive Webadverts Mod!
Hi All... I have been trying for one whole month to find the WebAdverts Mod for templates users in the forum - And I think I will have more luck finding Lord Lucan at this rate! :) I have searched using keywords recommended by several users - but seem to find earlier posts from users asking the same question - with posts from others telling the poster to search this forum - which is becoming a little frustrating.

This is obviously a popular mod, and if anyone can point me to it, I would be very, very grateful indeed :)

Kind Regards,

Paul.

Quote Reply
Re: The Elusive Webadverts Mod! In reply to
Here are some hints on narrowing your search results or at least finding relevant threads:

1) Choose Links 2.0 Customization Forum.
2) Type in WebAdverts in the keyword field.
3) Choose all posts for the date range field.
4) Type in 250 in the Hits field.

Regards,

Eliot Lee
Quote Reply
Re: The Elusive Webadverts Mod! In reply to
Here is what I use to display WebAdverts banners. It works on my template and cgi pages.

1) Add this subroutine to site_html_templates.pl

sub advert {
my $ad = `/path/to/ads.cgi`;
$ad =~ s,Content-type:\stext/html,,;
return $ad;
}

2) Put this in your globals in site_html_templates.pl

advert => &advert,

3) Add the following to your templates where you want the ad to show up.

<%advert%>

Hope this helps!

Quote Reply
Re: The Elusive Webadverts Mod! In reply to
Ok,

This is so simple, yet there are so many posts from people trying to different things that it gets confusing! So I posted the codes on my site:
http://links.innovationstudios.com/Detailed/200.html so when somebody just wants to use WebAdverts with Links 2.0 they can refer to that!



Until next time...

Ryan

http://links.innovationstudios.com/
Quote Reply
Re: The Elusive Webadverts Mod! In reply to
Hi. First off - Thanks KLK for posting that - I have a question to that, but first off I would also like to thank, Eliot for the search advice - I was searching the way you suggested but only 100 posts at a time - the extra 150 turned up some other interesting posts which I will no doubt find useful - Cheers! and thanks to Ryan for posting his page.

I have WebAdverts running ok on the static pages, so I will use this mod for the cgi pages only - actually, just the search results page - but I may use it for the add and modify pages too. I have zones set up with webadverts - so I may set up three more for the pages I specified above - using 3 diferent files e.g search.pl addurl.pl and modify.pl - now my question is - how would I implement them into the folowing code:

sub advert {
my $ad = `/path/to/ads.cgi`;
$ad =~ s,Content-type:\stext/html,,;
return $ad;

Would I have to duplicate:

my $ad = `/path/to/ads.cgi`; 3 times and replace my file names with ads.pl

Hope this makes sense guys!

Best Regards,

paul.



Quote Reply
Re: The Elusive Webadverts Mod! In reply to
You would do:

sub advert1 {
my $ad = `/path/to/ads1.cgi`;
$ad =~ s,Content-type:\stext/html,,;
return $ad;

sub advert2 {
my $ad = `/path/to/ads2.cgi`;
$ad =~ s,Content-type:\stext/html,,;
return $ad;

sub advert3 {
my $ad = `/path/to/ads3.cgi`;
$ad =~ s,Content-type:\stext/html,,;
return $ad;

Then make 3 new tags:

advert1 => &advert1,
advert2 => &advert2,
advert3 => &advert3,

Then put <%advert1%> <%advert2%> and <%advert3%> in your templates.


Paul
Installations:http://wiredon.net/gt/
Support: http://wiredon.net/forum/

Quote Reply
Re: The Elusive Webadverts Mod! In reply to
Many thanks Paul, I'll give that a try tomorrow and let you know how I get on - nice one.

Regards,

Paul.

Quote Reply
Re: The Elusive Webadverts Mod! In reply to
Hi All.
I tried the code below but for some reason the banner is not showing - Here is what and how I modified site_html_templates.pl

I added these new subs:(at the end of the script just after the html_rate_faliure sub)

sub advert1 {
my $ad = `/export/home/http.users/www.mysite.net/cgi-bin/advts/search.pl`;
$ad =~ s,Content-type:\stext/html,,;
return $ad;
}

sub advert2 {
my $ad = `/export/home/http.users/www.mysite.net/cgi-bin/advts/searchrgt.pl`;
$ad =~ s,Content-type:\stext/html,,;
return $ad;
}

sub advert3 {
my $ad = `/export/home/http.users/www.mysite.net/cgi-bin/advts/searchtxt.pl`;
$ad =~ s,Content-type:\stext/html,,;
return $ad;
}


Then in Globals I added the folowing:
advert1 => &advert1,
advert2 => &advert2,
advert3 => &advert3,


Then I added < %advert1% > (no spaces) to my search results template.

Im not getting any 500 errors just no banner - but I did notice while viewing the source code for the search results page afterwards that the tag to call the ads is gone.

Any pointers on this would be very helpful indeed

Many thanks - Paul.

Quote Reply
Re: The Elusive Webadverts Mod! In reply to
If you run the .pl scripts, say search.pl, from your browser, what does it do? 500 IS Error? Show the banner?

Andy

webmaster@ace-installer.com
http://www.ace-installer.com
Quote Reply
Re: The Elusive Webadverts Mod! In reply to
Hi.. It says - Execution of (advts/search.pl) is not permitted for the following reason:
Script is not executable. Issue 'chmod 755 filename'

But the script is in fact 755! in respect of a banner - when I tried the mod, I didn't set up an ad account speacially for the search results page - I just instructed an active account to display a banner in the search results zone that I have set up.
Thanks


Quote Reply
Re: The Elusive Webadverts Mod! In reply to
This is totally of the subject...I was browseing and got curious..its just why have you changed your search, modify and add from .cgi to .pl...if ya running on a unix machine its not required is it?. thought that was only required on some NT hosts??

Admittedlamb.

Quote Reply
Re: The Elusive Webadverts Mod! In reply to
Hi - I didn't - These are webadvert scripts I have set up for zones - The three .pl files mentioned are for the search results page - search.pl will control the banner at the top of the page, searchrgt.pl will control a mini banner on the rright side of the search results page and searchtxt.pl will be used to insert a text ad somewhere on the page.

Thanks..

Quote Reply
Re: The Elusive Webadverts Mod! In reply to
You may wanna make sure all of the folders below the webadverts one (at least the ones you can access) are CHMODed to 777. This has been a problem before when installing Links 2 on some servers.

Also, are you sure you can use .pl extensions on your host?

make a script called test.pl with the following code below, upload it to your server and CHMOD to 755. Then try to run it.

#!/usr/bin/perl
# You may have to change this on your server, but i don't
# know where perl is on your server :)

print "Content-type: text/html \n\n";

print "Test \n";



If that script works, then you can run .pl scripts, but if not, then you may have to use .cgi extensions.
Never know, it could be the answer to your problem Wink

Andy

webmaster@ace-installer.com
http://www.ace-installer.com
Quote Reply
Re: The Elusive Webadverts Mod! In reply to
Hi - - .pl extensions are ok - I am running them on the server now, so I don't think that is the issue. I will check the permissions - but I am sure they are OK - WebAdverts is running fine on all of the static pages. I am just wondering if the issue could be related to the three zones on the search results Page - and if the subs I created to display ads (shown in my earlier post) are as they should be.

Thanks

Quote Reply
Re: The Elusive Webadverts Mod! In reply to
Hi All - Still bashing away at this one - with a smidgeon of success!
I now know that my .pl script is working ok I had the settings path in webAdverts pointing to the wrong file- I called it up with the browser and the banner shows ok now calling the scrip directly. But the search results page now shows the word advert1 where the banner should be - still better than nothing at all eh :) - Anyway still tinkering away but if anyone knows why advert1 is there rather than the banner - I would love to know.

All the best - Paul

Quote Reply
Re: The Elusive Webadverts Mod! In reply to
Hi,
Is there any possible way to target banners by keywords. Also I will try to come up with something soon to target banners by category.
Thank You,
Paul

Hot Web Hosting
Low cost web hosting:
http://www.thehotweb.net/webhosting
Quote Reply
Re: The Elusive Webadverts Mod! In reply to
There is a MOD in the Resources section written by glennu.

Regards,

Eliot Lee