Gossamer Forum
Home : Products : Links 2.0 : Customization :

Webadverts - Detailed instructions for Links

(Page 1 of 2)
> >
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.



------------------
Quote Reply
Re: Webadverts - Detailed instructions for Links In reply to
I would like to know if it is possible to put an ad on the seach-page, based on the search terms.

Does this work with webadverts ??

I hope so!
Quote Reply
Re: Webadverts - Detailed instructions for Links In reply to
It will work if you set up some sort of if-else-elsif routine to parse the keywords and display the appropriate zones.

Its not great, but it will work.

--mark

------------------
You can reach me by ICQ at UIN #8602162


Quote Reply
Re: Webadverts - Detailed instructions for Links In reply to
Does someone have an basic if else if routine i can use to make my mod?

I hope so...
Quote Reply
Re: Webadverts - Detailed instructions for Links In reply to
I found an answer, see Search results ....

Quote Reply
Re: Webadverts - Detailed instructions for Links In reply to
To get results via a particular search term

<center>
~;
if ($term =~ /Keyword1|Keyword2|Keyword3/i)
{ &insertadvert123; }
elsif ($term =~ /Keyword4|Keyword5|Keyword6/i)
{ &insertadvert456; }
else
{ &insertadvert0; }
print qq~
</center>

The &insertadvertbla; is a required routine for a cgi script. The full routine is available in Webadverts readme or help file. It must go at the top of the page just before ## A Link ##.
Quote Reply
Re: Webadverts - Detailed instructions for Links In reply to
> These routines are for Links 1.1. Hope this helps.

But will they work on 2.0?



------------------
Thanks in Advance

Daniel J.
http://www.blackrose.net
webmaster@blackrose.net
Quote Reply
Re: Webadverts - Detailed instructions for Links In reply to
These routines are for Links 1.1. Hope this helps.

Edited in:
But these routines should work on all the later versions of links. If anyone knows differently then please let me know. Thanks.

[This message has been edited by Mark Gilbert (edited January 10, 1999).]
Quote Reply
Re: Webadverts - Detailed instructions for Links In reply to
Just curious if this info was in regards to Links 2.3 or ver 1.1. Thanks for all the info, will prove to be very useful!



------------------
Brian
wwnurse.com
Quote Reply
Re: Webadverts - Detailed instructions for Links In reply to
>>>>>>>>>> reply
~;
if ($term =~ /Keyword1|Keyword2|Keyword3/i)
{ &insertadvert123; }
elsif ($term =~ /Keyword4|Keyword5|Keyword6/i)
{ &insertadvert456; }
else
{ &insertadvert0; }
print qq~
</center>

What will happen if someone types in: "keyword3 keyword4"?

Quote Reply
Re: Webadverts - Detailed instructions for Links In reply to
Well, I'm not too sure that the script will get your output as you would want it. There is a mod available that logs search terms so you will be able to monitor these then sell the common keywords that come up on a regular basis. Otherwise I'm not sure I can help.
Quote Reply
Re: Webadverts - Detailed instructions for Links In reply to
I followed the instructions to the letter. Some worked fine.

The catagories and the Home page, What New and What Cool are not working..

the
<!--#exec cgi="/inetpub/wwwroot/cac-bbs/bondage/ads/webadverts/ads.pl"-->

Just writes <!--#exec cgi="/inetpub/wwwroot/cac-bbs/bondage/ads/webadverts/ads.pl"--> into the HTML file.

the page is located at
http://www.cac-bbs.com/bondage/links-test


the site_html.pl can be found at
http://www.cac-bbs.com/bondage/links-test/site_html.txt

Any suggestions?

this is a WinNT 4.0 IIS3 spk3 Machine perl 5.02 Link 2.03b



------------------
Thanks in Advance

Daniel J.
http://www.blackrose.net
webmaster@blackrose.net
Quote Reply
Re: Webadverts - Detailed instructions for Links In reply to
SirDaniel,
inorder for an exec cgi to work the script has to be located in the cgi bin. I have tried all sorts of numerous directories in the past and the cgi-bin is the only way I can get them to work...not virtual directories. Give it a try and keep us updated.
Quote Reply
Re: Webadverts - Detailed instructions for Links In reply to
Mark , great instructions on your post.

Im alittle stuck on one thing.

1)Web adverts works
2)zones work
(tested each zone on a test html page)
3)the on the fly pages for web adverts works

however..

the when loading any category pages it reads at the top "cannot process this directive"

this only happens with the code below inserted. Other wise with a normal SSI call it works.

I have removed the spaces between the brackets.
The category names are listed in the proper case (first letter=uppercase)

Any clue?

< 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 >
Quote Reply
Re: Webadverts - Detailed instructions for Links In reply to
-

[This message has been edited by RobC (edited April 27, 1999).]
Quote Reply
Re: Webadverts - Detailed instructions for Links In reply to
If using Templates... this modification work???
Quote Reply
Re: Webadverts - Detailed instructions for Links In reply to
There I was, just about to search through the entire message board for ANY posts about running webadverts in the cgi output, when low and behold, it was the first topic on the list. This is going to be a good day. ^_^

At any rate, I followed the instructions for placing the code in site_html.pl and insterting the line into the html whereI was them to appear. However, when I BUILD the pages, the adverts appear in the Link Manager as well as every image graphic from that point to the bottom of the pages, and does not show up on the pages themselves.

I'm sure this is something I may have done wrong, but it does not stand out to me. Any clues?

Thanks,

Ghostmeat
Quote Reply
Re: Webadverts - Detailed instructions for Links In reply to
Hi RobC,
I only have one question. Are all your built pages shtml pages or supported for SSI calls. If they are then all should work fine. If you are not sure just edit the entries for .html and change them to shtml. If you still have problems let me know.

Regards

Mark Gilbert
Quote Reply
Re: Webadverts - Detailed instructions for Links In reply to
Hi Jozeph,
I'm not too sure about the templates version. With that just enter the ssi call. Otherwise I don't use templates...I find the raw editing rather challenging and exciting.
Quote Reply
Re: Webadverts - Detailed instructions for Links In reply to
Hi Ghostmeat,
I think the problem that you are having there is that you have inserted the "on the fly" call which is all the &insertadvert123; calls. Change those to the ssi calls then all should work fine. Mind you that is only for pages that are being built. For pages "on the fly" you will need the &insertadvert123; call inorder for it to be executed by the cgi's. Hope this helps
Quote Reply
Re: Webadverts - Detailed instructions for Links In reply to
Hi,

Just a quick question?

Has anyone above solved or near to solving the solution to display banners based on keywords?

Martin
Quote Reply
Re: Webadverts - Detailed instructions for Links In reply to
Mark

this is not working for 2.0 when using the Yahoo templates from CEGlobe.

Any ideas how to make work.

Jerry

Quote Reply
Re: Webadverts - Detailed instructions for Links In reply to
No, I dont have a clue, but if you post you're exact problems we could help.

Just It's not working isn't enough!!!
Quote Reply
Re: Webadverts - Detailed instructions for Links In reply to
Did anyone try this MOD with Links 2.0 and Templates and does it work ?

Thank you.

------------------
~~~~~~~~~~~~~~~~~~~~~~~~~~
UnReal 'Net - The Ultimate Portal Site
http://www.unreal-net.com
~~~~~~~~~~~~~~~~~~~~~~~~~~
Quote Reply
Re: Webadverts - Detailed instructions for Links In reply to
It is that simple it does not work.

I get the ~;&insertadvert;print qq~ where my banner should be.

Jerry
> >