Index
cyrk
Chmielewska Joanna (Nie)boszczyk maz (5)
311 02
253 00 (2)
rozdzial 09 (204)
Polonez Fiat Poradnik Napraw
Przetacznik Gierowska Maria, Włodarski Ziemowit Psychologi (2)
Niezwyciezony
741 08
013 07 (3)
  • zanotowane.pl
  • doc.pisz.pl
  • pdf.pisz.pl
  • urodze-zycie.htw.pl

  • [ Pobierz całość w formacie PDF ]
    .Varying the frequency of each individual banner URL in the config file increases the chances of seeing that particular banner, thus allowing for rate schedules for advertisers wanting more exposure.The beauty of this scheme is that you can mix it with a static banner display scheme.Say, for example, one company wants to pay you a ton of money for placing its banner on your front page all the time.Well, that's fine; just statically code the URL.Done! The randomizer runs only when you tell it to.It doesn't have to be used on each page.This program is written in Perl and must be run on a server with server-side includes enabled (see Chapter 6, "SSI—Server-Side Includes").Also, you need to specify a configuration file, which is a file consisting one or more lines of the following format:"Link-URL","Image-URL","IMAGE_OPTIONS"Briefly, "Link-URL" specifies a fully qualified URL for the destination the user is taken to upon clicking the banner, "Image-URL" is a fully qualified URL for the banner itself, and "IMAGE_OPTIONS" is a tag added to the <IMAGE> tag of the banner graphic.Any string of valid tags and values is acceptable here, the most important, perhaps, being the "BORDER=" tag, which is a Netscape extension to HTML specifying the size and presence of a hyperlink color border around an image.So a sample graphics.conf would look something like this:"http://www.foobar.com","http://www.yoursite.com/banners/foobar.gif","BORDER=0""http://www.anothersite.com","http://www.yoursite.com/banners/anothersite.gif", "BORDER=0""http://www.foobar.com","http://www.yoursite.com/banners/foobar.gif","BORDER=0""http://www.foobar.com","http://www.yoursite.com/banners/foobar.gif","BORDER=0"In this configuration file, there are only two advertisers who have banners.However, foobar.gif will be seen 75 percent of the time (3 out of 4), while anothersite.gif will be seen 25 percent of the time (1 out of 4).This allows for a schedule of rates, as I mentioned.Listing 5.13.The Perl randomizer.#!/usr/local/bin/perl -w## random.cgi - prints a graphic at random from a configuration file## $conf_file: the absolute path to your configuration file (your listing of# URL's to the graphics.## $ad_tag: the string outputted to the web page SSI location## Call this script from a server-parsed html document (.shtml for example) and make# sure that server-side includes are enabled.## Use the following example code:## <!--#exec cmd="/yourpath/random.cgi"-->## Of course, substitute your actual path to the random.cgi for / yourpath.Again,# this won't work unless Server-Side Includes are activated for Apache.use strict; # Declare all our variables before using them$| = 1; # Flush the output buffer#Variablesmy( $conf_file, $URL, $graphic, $ad_tag, $border );my( @Graphics );my( $num_graphics, $rand_graphic );$conf_file = "/path-to-config-file/graphics.conf";srand;open( IN, $conf_file ) || die "Cannot open $conf_file: $!";@Graphics = <IN>;close( IN );$num_graphics = @Graphics; #Get length of @Graphics array$rand_graphic = int( rand( $num_graphics - 1 ) );($URL,$graphic,$border) = split( /,/, $Graphics[$rand_graphic] );$URL =~ s/\"//g;$graphic =~ s/\"//g;$border =~ s/\"//g;$ad_tag = "<A HREF=\"$URL\"><IMG SRC=\"$graphic\" $border></A>";print $ad_tag;exit( 0 );A URL RandomizerYou can very easily adapt the image randomizer to act as a URL randomizer.What good is a URL randomizer? Well, it adds that ever-so-important quality of variety to your site, and it allows you to direct people to random, but related sites of interest.Say you were writing a page about turtles—their habitats, behavior, variations, basically the whole "turtle thing." Being the thorough person you are, you decide to include hyperlinks to those resources in your page.Naturally, there are a lot of resources on turtles on the Internet.Yahoo! lists 31 entries on the query turtle—too many to include on a main page.So you decide to include the hyperlinks on a separate page called "Turtle Links." But this is away from the main page; you need something more eye-catching to draw people to other resources.Aha! Perhaps a "Link of the Day" at the top of your main page would look cool.How could you use the image randomizer to do this? Well, the easiest way to do it is to simply create one image for "Random Turtle Link of the Day" and make it the default clickable image for each hyperlink in the graphics [ Pobierz całość w formacie PDF ]
  • zanotowane.pl
  • doc.pisz.pl
  • pdf.pisz.pl
  • aceton.keep.pl
  • 
    Wszelkie Prawa Zastrzeżone! Kawa była słaba i bez smaku. Nie miała treści, a jedynie formę. Design by SZABLONY.maniak.pl.