Gossamer Forum
Home : Products : Links 2.0 : Discussions :

WebAdvert Users - Templates

Quote Reply
WebAdvert Users - Templates
Well, if you are using image tag for CGI generated pages, you can stop using it. Use banner tag instead. Well, many complaint about it prints before the HTML tag. Well, thanks to Yasser now it doesn't and it prints where you put the tag.

Step 1:

In your site_html_templates.pl:

Quote:
%globals = (
date => &get_date,
time => &get_time,
db_cgi_url => $db_cgi_url,
build_root_url => $build_root_url,
build_detail_url => $build_detail_url,
site_title => $build_site_title,
css => $build_css_url,
banner => \&insertadvert
);

Add that \&insertadvert.

Step 2:

Still in site_html_templates.pl:

Add this somewhere in the file,

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

Step 3:

Put the banner tag <%banner%>, to where you want the banner to show up, in normal html pages as well in CGI generated pages.

Ermm...that's all! Hope this helps.

[This message has been edited by Eddie (edited July 24, 1999).]
Quote Reply
Re: WebAdvert Users - Templates In reply to
Have not been able to get this to work using the Yahoo templates.

I am getting a syntex error at the banner= \&insertadvert line.

Any help?

Jerry
Quote Reply
Re: WebAdvert Users - Templates In reply to
Hmm...weird. This is a standard routine that should work with any templates. Where did you put the sub insertadvert? I should have said that it should be put right after the closing of of the globals.
Quote Reply
Re: WebAdvert Users - Templates In reply to
I tried the exact same thing and got the same error...weird.

------------------
Quote Reply
Re: WebAdvert Users - Templates In reply to
What templates are you using jusu? Yahoo templates like Jerry?
Quote Reply
Re: WebAdvert Users - Templates In reply to
I use Webcrawler templates and i got a message. I edited the code and it started printing the path of ads on the page.

------------------
------------------------------------------
Lavon Russell
LookHard! Search
http://www.lh.yi.org
webmaster@lh.yi.org
Quote Reply
Re: WebAdvert Users - Templates In reply to
Did you put server path to ads.pl or browser URL path? It needs to be full server path to ads.pl . For new readers of this thread, perhaps you would rather read a HTML concerning this. It is available at http://www.codes-central.com/WebAdverts-Links.shtml . I am not sure about the errors you guys getting because this is standard subroutine for all templates. If you are not using templates, use the standard subroutine which is provided within the readme.txt of WebAdverts.
Quote Reply
Re: WebAdvert Users - Templates In reply to
Jerry

If it says syntax error it usually means a typo error in the line. You said:
Quote:
I am getting a syntex error at the banner= \&insertadvert line.

Make sure the > is after = and that these ); are on a new line.

I hope that helps?


------------------
tassie
webmaster@scriptfarm.com
www.scriptfarm.com
Quote Reply
Re: WebAdvert Users - Templates In reply to
I did all that was outlined by Yasser and my banners still don't show up. I get no errors either. It doesn't work for cgi and non cgi pages. The regular SSI calls work fine. However I would like to use the <%banner%> tag. I am using Links2.0 with templates on Unix. Any ideas...