Gossamer Forum
Home : Products : Links 2.0 : Customization :

WebAdvert & CGI

Quote Reply
WebAdvert & CGI
I've have been through the former threads and read everything about WebAdvert, and I still can't get it to work.

Using the latest Links.

As per earlier instructions it says. On the script "site_html.pl" I follow directions on putting the following lines in.
# I'd really appreciate a link back, but you are not obligated to.
$site_footer = qq~

~;

#### Start Advert Routine ####
sub insertadvert { require "/home/sites/home/ads/ban-gen/ads_display.pl";
$adverts_dir = "/home/sites/home/ads/ban-gen/img";
$display_cgi = "http://www.domain.com/ads/ban-gen/ads_display.pl";
$advertzone = ""; $ADVUseLocking = 1; $ADVLogIP = 1; $DefaultBanner = "";
$ADVNoPrint = 1; &ADVsetup;}
#### End Advert Routine ####

##########################################################
## A Link ##
##########################################################

And, on the template for the search results, I have place either of these:
1) &insertadvert; (as per WebAdvert Doc)
2) ~;&insertadvert;print qq~ (as per a posting here http://www.gossamer-threads.com/scripts/forum/resources/Forum3/HTML/000138.html)
And none have worked.

Can someone please tell me what's wrong with these lines?
Quote Reply
Re: WebAdvert & CGI In reply to
Try changing the third line of you Advert Routine to:

$display_cgi = "http://www.domain.com/ads/ban-gen/ads.pl";

and give it a try


Eduardo
Quote Reply
Re: WebAdvert & CGI In reply to
volpi,

Thanks for your interest. I have changed the line, but still nothing. It only prints the text &insertadvert; or ~;&insertadvert;print qq~ on search results instead of the banner.

Any other advise?

Regards

Quote Reply
Re: WebAdvert & CGI In reply to
That only works on cgi generated pages. Did it work with the cgi files, such as add.cgi modify.cgi, etc.?

If you want to display webadverts banners on your links pages, you will have to insert the image call tags (or SSI exec tags, if you're using SSI).

-Ryan
Quote Reply
Re: WebAdvert & CGI In reply to
Open and check your ads.pl for the line

$display_cgi = "http://www.domain.com/ads/ban-gen/ads.pl";

Is it correct?

I mean it must point to your "ads.pl" instead of ads_display.pl


Eduardo

[This message has been edited by volpi (edited January 25, 1999).]
Quote Reply
Re: WebAdvert & CGI In reply to
volpi & Ryan,

My SSI calls work fine through regular .shtml pages.

This is "ads.pl" lines:

require "/home/sites/home/ads/ban-gen/ads_display.pl";

$adverts_dir = "/home/sites/home/ads/ban-gen/img";
$display_cgi = "http://www.domain.com/ads/ban-gen/ads.pl";

This is the "site_html.pl" lines:

# I'd really appreciate a link back, but you are not obligated to.
$site_footer = qq~

~;

#### Start Advert Routine ####
sub insertadvert { require "/home/sites/home/ads/ban-gen/ads_display.pl";
$adverts_dir = "/home/sites/home/ads/ban-gen/img";
$display_cgi = "http://www.domain.com/ads/ban-gen/ads.pl";
$advertzone = ""; $ADVUseLocking = 1; $ADVLogIP = 1; $DefaultBanner = "";
$ADVNoPrint = 1; &ADVsetup;}
#### End Advert Routine ####

##########################################################
## A Link ##
##########################################################


Now, in my "search_results.shtml" template page, I have placed the following line:

&insertadvert; (or)
~;&insertadvert;print qq~

And neither of these two lines displays a banner. All I get is the above text printed.

I know others have done this same thing, but I can't get it to work.

Thanks
Quote Reply
Re: WebAdvert & CGI In reply to
No, others have not done the same thing. Maybe in DBman, because the pages are .cgi not .html, but Links creates .htm or .html pages. An .html page will not understand the command &insertadvert.

If you want to display WebAdvers banners, you have to use the image call tags on .htm or .html pages, or use the SSI call tags and set-up Links to build pages using the .shtml extentions. (I would recommend the image call tags)

However, for the .cgi pages (such as jump.cgi, add.cgi, modify.cgi, etc.), you may use your &insertadvert code or the image call tags. Do not try to use the SSI call tags. They will not work because the extentions are .cgi, not .shtml

-Ryan
Quote Reply
Re: WebAdvert & CGI In reply to
Setup a special zone for your cgi generated pages like "zone_whatever.pl" for example

Open your new zone_whatever.pl and look for the line

$advertzone = "";

make it

$advertzone = "whatever";

then in your advert routine you will have

#### Start Advert Routine ####
sub insertadvert { require "/home/sites/home/ads/ban-gen/ads_display.pl";
$adverts_dir = "/home/sites/home/ads/ban-gen/img";
$display_cgi = "http://www.domain.com/ads/ban-gen/zone_whatever.pl";
$advertzone = "whatever"; $ADVUseLocking = 1; $ADVLogIP = 1; $DefaultBanner = "";
$ADVNoPrint = 1; &ADVsetup;}
#### End Advert Routine ####

then insert the call

~;&insertadvert;print qq~


Don't forget to specify the zone "whatever" to the banners you want to show up on these cgi generated pages


Try this.


Eduardo



[This message has been edited by volpi (edited January 25, 1999).]