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.
------------------
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.
------------------