Gossamer Forum
Home : Products : Links 2.0 : Customization :

Webadverts -> Will this info help your guys work it out.

Quote Reply
Webadverts -> Will this info help your guys work it out.
OK, I have been looking at WEBCAL, one of Darryl Burgdoff's other scripts, and he calls the script on a cgi generated page using the following code.

____________________

sub Header {
($title) = @_;
print "<HTML><HEAD><TITLE>$title</TITLE></HEAD>\n";
print "<BODY $bodyspec>\n";
if ($header_file) {
open (HEADER,"$header_file");
@header = <HEADER>;
close (HEADER);
foreach $line (@header) {
if ($line =~ /<!--InsertAdvert\s*(.*)-->/i) {
&insertadvert($1);
}
else {
print "$line";
}
}
}
}
________________________-

Hoping that would help you guys figure out how to stop the banner getting placed right up the top of the page.

He also uses the standard

__________________________

sub insertadvert {
require "/u2/www/users/dburgdor/scripts/ads/ads_display.pl";
$adverts_dir = "/u2/www/users/dburgdor/scripts/ads/ads";
$display_cgi = "http://awsd.com/scripts/ads/ads.pl";
$advertzone = $_[0];
$ADVUseBackup = 1;
$ADVUseLocking = 1;
$NonSSI = 0;
$ADVNoPrint = 1;
&ADVsetup;
}

__________________________

Hope you can work it out from that info Bobsie, cause it just gives me a headache :-)
Quote Reply
Re: Webadverts -> Will this info help your guys work it out. In reply to
John, could you be very specific where you put

Quote:
# print a random number between 1 and 10000.
$ran = int(rand(9999))+1;

I'm not a perl person and don't want to screw up Links. It's running too good. But this sounds like a good idea.

Will



------------------
Will
Webmaster
FishHoo! Search index for Fishermen
http://www.fishhoo.com
Quote Reply
Re: Webadverts -> Will this info help your guys work it out. In reply to
Hello,

I don't see why people have so many problem using webadverts with links.
95% of the pages are static html and use the SSI call with no problem.
For the cgi pages all you need to do is use the <img> tag version.
If you want to make sure that a different banner is displayed with
each cgi page just add the following to link.cfg.

# print a random number between 1 and 10000.
$ran = int(rand(9999))+1;

I put in just under the paths statements

if you use templates open site_html-templates.pl and in the globals you will find

banner => ''

Just change it to

banner => $ran

Now just put the tag <%banner%> in the IMG call

<A HREF="http://yoursite.com/cgi-bin/ad.pl?id=<%banner%>">
<IMG SRC="http://yoursite.com/cgi-bin/ad.pl?id=<%banner%>"WIDTH=468 HEIGHT=60"></A>

If you don't use templates I think you can just use $ran instead.

HTH!

------------------
JRM Studios www.jrmstudios.com
The Hotrodding Network www.hotrodding.net
Web discuss Free speech newsgroups - www.webdiscuss.com



Quote Reply
Re: Webadverts -> Will this info help your guys work it out. In reply to
Could you also say which pages I have to use NONSSI calls on, its the add a page on, what else? Thanks alot
Quote Reply
Re: Webadverts -> Will this info help your guys work it out. In reply to
Add, Modify, Rate, Review, anypage that is accessed with a .cgi extension.
Quote Reply
Re: Webadverts -> Will this info help your guys work it out. In reply to
willdeb - I put it just above:

# Database Options
# --------------------------------------------------------

------------------
JRM Studios www.jrmstudios.com
The Hotrodding Network www.hotrodding.net
Web discuss Free speech newsgroups - www.webdiscuss.com



Quote Reply
Re: Webadverts -> Will this info help your guys work it out. In reply to
I tried something similar, but every category page would recieve that same random number, effectivly ruining the effect. Smile

I got it to work by putting <%category_name%> INSTEAD of the random number. Remember, you DO NOT HAVE TO USE A NUMBER, but can use a WORD or PHRASE. Then add custom HTML for the few remaining static pages. This works like a charm.

Owen
Quote Reply
Re: Webadverts -> Will this info help your guys work it out. In reply to
Well that cuts it. I don't have a banner => '' in site_html_templates.pl. Using Yahoo templates.

Is this the section that should go in?
Code:
# --------------------------------------------------------
# This rountine will build a page based for the current category.

return &load_template ( 'category.html', {
date => $date,
time => $time,
category => $category,
links => $links,
title_linked => $title_linked,
title => $title,
total => $total,
grand_total => $grand_total,
category_name => $category_name,
category_name_escaped => $category_name_escaped,
category_clean => $category_clean,
description => $description,
meta_name => $meta_name,
meta_keywords => $meta_keywords,
header => $header,
footer => $footer,
prev => $prev,
next => $next,
related => $related,
build_links_per_page => $build_links_per_page,
%globals
} );

Any thoughts?

------------------
Will
Webmaster
FishHoo! Search index for Fishermen
www.fishhoo.com

[This message has been edited by willdeb (edited July 14, 1999).]
Quote Reply
Re: Webadverts -> Will this info help your guys work it out. In reply to
Owen - The category pages should have the SSI call, No random # needed. Wink

Willdeb - Nope wrong spot it should go here.

Code:
# You can put variables here that you would like to use in any
# of your templates.

%globals = (
date => &get_date,
time => &get_time,
db_cgi_url => $db_cgi_url,
build_root_url => $build_root_url,
site_title => $build_site_title,
css => $build_css_url,
banner => $ran
);


------------------
JRM Studios www.jrmstudios.com
The Hotrodding Network www.hotrodding.net
Web discuss Free speech newsgroups - www.webdiscuss.com







[This message has been edited by John R Marshall (edited July 15, 1999).]
Quote Reply
Re: Webadverts -> Will this info help your guys work it out. In reply to
Will someone please look at the code on this page and tell me what I've screwed up. Think I've been looking at it too long.
http://www.fishhoo.com/...bin/links/search.cgi

------------------
Will
Webmaster
FishHoo! Search index for Fishermen
www.fishhoo.com
Quote Reply
Re: Webadverts -> Will this info help your guys work it out. In reply to
What is wrong? No Ad?
ON the search page you need to use:
Code:
<A HREF="http://yoursite.com/cgi-bin/ad.pl?id=<%banner%>">
<IMG SRC="http://yoursite.com/cgi-bin/ad.pl?id=<%banner%>"WIDTH=468 HEIGHT=60"></A>

Not the SSI call

------------------
JRM Studios www.jrmstudios.com
The Hotrodding Network www.hotrodding.net
Web discuss Free speech newsgroups - www.webdiscuss.com



Quote Reply
Re: Webadverts -> Will this info help your guys work it out. In reply to
Thanks John, I gave up. Couldn't make the damn thing work. Tried several variations of your instructions.

------------------
Will
Webmaster
FishHoo! Search index for Fishermen
www.fishhoo.com
Quote Reply
Re: Webadverts -> Will this info help your guys work it out. In reply to
Hey Everyone,

What I did some time ago was just use <%time%> as the id in the image tag call to Webadverts. No need to do the random thing, although it works just as well.

Joe

[This message has been edited by joecarey (edited July 15, 1999).]
Quote Reply
Re: Webadverts -> Will this info help your guys work it out. In reply to
Of course you COULD use SSI, but where is the fun in it? (and if you don't have it, it is a tad dificult to do. (: ) Anyway, just putting it out for everyone.

Also, I want to point out that SSI is a potential security flaw. It would be eas to put code in that would print a file on the server that might contain passwords. Be sure to use caution when using SSI.