Gossamer Forum
Home : Products : Links 2.0 : Customization :

Webadverts - Detailed instructions for Links

Quote Reply
Webadverts - Detailed instructions for Links
After spending many endless nights trying to understand the webadverts calls in the Links scripts I have come up with the following. I hope that it helps you understand more about it as it does tend to be overwhelming if you don't understand fully.

For CGI generated pages the following has proved to work:

In links_html.pl go to the last entry the Globals section. It may look like this:

#### Start insert of site_html.pl code #####

##########################################################
## Globals ##
##########################################################
# You can put variables here that you would like to use throughout
# the site.

$date = &get_date;
$time = &get_time;

##### More variables are entered here onwards #####

# I'd really appreciate a link back, but you are not obligated to.
$site_footer = qq~
< form action="$build_search_url" method="GET" >
< center >
< hr size=1 width=700 >
< $fon t>
Looking for something in particular?
< p >< input type=text size=15 name="query" > < input type=submit value="Search!" >< br >
< a href="$build_search_url" >More Options< /a >
< /font >
< hr size=1 width=700 >
< /center >
< /form >
< table border=0 width="100%" >
< tr >< td align=left >< a href="http://www.gossamer-threads.com" >< img src="http://www.gossamer-threads.com/images/powered.gif" width=100 height=31 alt="Gossamer Threads Inc." border=0 align=left >< /a >< /td >
< td align=right >< $font >Pages Updated On: $date< /font >< br >
< $font >Links Engine 1.1 By: < a href="http://www.gossamer-threads.com/" >Gossamer Threads Inc.< /a >< /font >< /td >
< /tr >
< /table >

~;

##### My Note (N.B these lines are not normally here,
##### just for example to show you the positioning ) ###
##### you will replace my notes with the advert routine
##### This is the end of Globals #######


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

sub site_html_link {
# --------------------------------------------------------
# This routine is used to display what a link should look
# like. It's a little complex looking just because we have to
# check for blank entries..

#### End insert of site_html.pl code #####


Right, go to where I have typed ##### My Note ##### (the bottom of Globals after the ~; and before ### A Link ### ) and replace the whole line with:

#### Start Advert Routine ####
sub insertadvert { require "/path/to/ads_display.pl";
$adverts_dir = "/path/to/ads/directory";
$display_cgi = "http://www.YOURSITE.com/path/to/display.cgi";
$advertzone = ""; $ADVUseLocking = 1; $ADVLogIP = 0; $DefaultBanner = "";
$ADVNoPrint = 1; &ADVsetup;}
#### End Advert Routine ####

You configure this area just as you would in Webadverts.

Right, now that that is done, go to the pages that are generated on the fly (e.g. search, add, modify, rates, etc) and where you want your ad to be displayed instead of typing < !--#exec cgi="/path/to/ad.cgi"-- > place the following:

~;&insertadvert;print qq~

It might look like below:

< !--"INSERT CGI ADVERTISEMENT START"-- >
< center >
< hr size=1 width=600 >
< center >~;&insertadvert;print qq~< /center >
< !--"INSERT CGI ADVERTISEMENT END"-- >


That covers all CGI generated output of banners. Do not include it in a $call as it will not be excuted and you will get ~;&insertadvert;print qq~ on your page instead of a banner. It must be inserted within each page that you want to display it in such as your search, modify, add, etc.


Now for the interesting part, Targeting the scripts in your categories.

Go to your Categories Pages section in site_html.pl and go to where you want to insert the call and place the following:


< font >
~;
if ($category_name eq "ZoneA") {
$output .= qq~< !--#exec cgi="/cgi-bin/zone_A.cgi"-- >~;
}
elsif ($category_name eq "ZoneB") {
$output .= qq~< !--#exec cgi="/cgi-bin/zone_B.cgi"-- >~;
}
elsif ($category_name eq "ZoneC") {
$output .= qq~< !--#exec cgi="/cgi-bin/zone_C.cgi"-- >~;
}
elsif ($category_name eq "ZoneD") {
$output .= qq~< !--#exec cgi="/cgi-bin/zone_D.cgi"-- >~;
}
else {
$output .= qq~< !--#exec cgi="/cgi-bin/default_banner_script.cgi"-- >~; ### default backup
}
$output .= qq~
< /font >

Here is an example of the placement of the code:

< head >
< title >$site_title: $category_clean< /title >
< /head >

< $site_body >

< center >
< center >

#### Note remove this line...just a marker for the placement starting ####

< font >
~;
if ($category_name eq "advertising") {
$output .= qq~< !--#exec cgi="/cgi-bin/zone_A.cgi"-- >~;
}
elsif ($category_name eq "adult") {
$output .= qq~< !--#exec cgi="/cgi-bin/zone_B.cgi"-- >~;
}
elsif ($category_name eq "business") {
$output .= qq~< !--#exec cgi="/cgi-bin/zone_C.cgi"-- >~;
}
elsif ($category_name eq "computers") {
$output .= qq~< !--#exec cgi="/cgi-bin/zone_D.cgi"-- >~;
}
else {
$output .= qq~< !--#exec cgi="/cgi-bin/default_banner_script.cgi"-- >~; ### default backup
}
$output .= qq~
< /font >

#### Note remove this line...just a marker for the placement ending ####

< /center >
< table border="0" width="700" >
< tr >< td valign="top" >
< P >
< hr size=1 width=700 >
< $font_subtitle >< strong >$site_title: $category_clean< /strong >< /font >< BR >
< $font >< strong >$title_linked< /strong >< /font >< BR >
< hr size=1 width=700 >
< $font_menu >|
< A HREF="$build_root_url">Home< /A > |
< A HREF="http://www.yoursite.com/links/add.cgi?Cat=$category_real" >Add a Resource< /A > |
< A HREF="$build_modify_url" >Modify a Resource< /A > |
< A HREF Bla Bla Bla Bla Bla Bla > ### Page continues

#### Note, all the statements that are in < brackets > have got a space between the < > and the code so that this forum script shows them correctly. Remember to remove the spaces.


With the script you can continue adding Zones or categories after your first elsif call. Just remember that it must look like the above...starting with if and ending with else. You can have as many elsif calls within if and else as you like. Just edit accordingly.

I have tried using this method within a $call but gave up after trying for hours. I'm sure that there is a way but I don't know about it. I would be open to suggestions. I also know that if you have a sub category within lets say "advertising" then the advertising banner of the first will show up on all of sub categories. I haven't gone into depth with this because I personally don't need it. It seems to be categorised enough for my needs but there is an alternative that I read which replaces $category_name with $category_clean but I'm not too sure. Let me know if there is an absolute call to get exact targeting.

To ensure that the SSI calls are parsed on all your category pages make sure that all the .htm and .html statements in nph-build.cgi are all changed to .shtml. You can simply do a search and replace for these. Also check in site_html.pl and links.cfg for the .htm and .html calls.

it's all fairly simple if you follow these steps that i've searched around for on the forum to create this breakdown.

For your normal static pages like home, New, Cool, etc just place <!--#exec cgi="/cgi-bin/banner_script.cgi"--> to have it show up. You can of course replace all the < !--#exec cgi="/path/ad.cgi"-- > with the < img src="bla bla" > call. I hope that this helps lots of other users that use this forum.

If you need any further help, email me and I may be able to help you. This text might help you mark with the FAQ, I dunno, might save you some time.



------------------
Subject Author Views Date
Thread Webadverts - Detailed instructions for Links Mark Gilbert 8445 Nov 9, 1998, 1:43 PM
Post Re: Webadverts - Detailed instructions for Links
cK 8334 Nov 10, 1998, 6:34 AM
Post Re: Webadverts - Detailed instructions for Links
Mark Badolato 8348 Nov 10, 1998, 12:36 PM
Post Re: Webadverts - Detailed instructions for Links
cK 8333 Nov 10, 1998, 9:58 PM
Post Re: Webadverts - Detailed instructions for Links
cK 8340 Nov 11, 1998, 11:40 PM
Post Re: Webadverts - Detailed instructions for Links
Mark Gilbert 8360 Jan 2, 1999, 10:15 AM
Post Re: Webadverts - Detailed instructions for Links
SirDaniel 8346 Jan 9, 1999, 9:24 PM
Post Re: Webadverts - Detailed instructions for Links
Mark Gilbert 8347 Jan 10, 1999, 1:55 AM
Post Re: Webadverts - Detailed instructions for Links
bs 8333 Jan 10, 1999, 9:32 AM
Post Re: Webadverts - Detailed instructions for Links
cK 8332 Jan 10, 1999, 10:40 AM
Post Re: Webadverts - Detailed instructions for Links
Mark Gilbert 8321 Jan 11, 1999, 1:45 AM
Post Re: Webadverts - Detailed instructions for Links
SirDaniel 8342 Jan 11, 1999, 5:25 PM
Post Re: Webadverts - Detailed instructions for Links
Mark Gilbert 8340 Jan 12, 1999, 9:12 AM
Post Re: Webadverts - Detailed instructions for Links
RobC 8349 Apr 27, 1999, 7:47 AM
Post Re: Webadverts - Detailed instructions for Links
RobC 8344 Apr 27, 1999, 8:13 AM
Post Re: Webadverts - Detailed instructions for Links
jozeph 8338 Apr 28, 1999, 2:17 AM
Post Re: Webadverts - Detailed instructions for Links
Ghostmeat 8342 Apr 28, 1999, 4:35 AM
Post Re: Webadverts - Detailed instructions for Links
Mark Gilbert 8339 Apr 29, 1999, 10:06 PM
Post Re: Webadverts - Detailed instructions for Links
Mark Gilbert 8319 Apr 29, 1999, 10:07 PM
Post Re: Webadverts - Detailed instructions for Links
Mark Gilbert 8328 Apr 29, 1999, 10:10 PM
Post Re: Webadverts - Detailed instructions for Links
Martin Pitt 8320 Apr 30, 1999, 3:16 AM
Post Re: Webadverts - Detailed instructions for Links
Jerry 8331 May 2, 1999, 3:02 PM
Post Re: Webadverts - Detailed instructions for Links
cK 8348 May 2, 1999, 10:20 PM
Post Re: Webadverts - Detailed instructions for Links
Mrtvac 8330 May 4, 1999, 5:22 AM
Post Re: Webadverts - Detailed instructions for Links
Jerry 8331 May 4, 1999, 10:22 AM
Post Re: Webadverts - Detailed instructions for Links
Jimz 2969 May 11, 1999, 5:40 AM
Post Re: Webadverts - Detailed instructions for Links
Mark Gilbert 2987 May 31, 1999, 1:28 AM
Post Re: Webadverts - Detailed instructions for Links
bernie 2990 Jun 6, 1999, 3:09 AM
Post Re: Webadverts - Detailed instructions for Links
Bobsie 2982 Jun 6, 1999, 5:36 AM
Post Re: Webadverts - Detailed instructions for Links
JWells 2970 Jun 14, 1999, 3:59 PM
Post Re: Webadverts - Detailed instructions for Links
densu 2962 Jun 15, 1999, 2:34 AM
Post Re: Webadverts - Detailed instructions for Links
ann 2968 Jun 16, 1999, 3:12 AM