Limited Edition
Lithographs
Most of the lithographs that I am offering are from
the series of so-called "large lithographs" issued by Another
Rainbow. This distinguishes them from the so-called "small lithograph" series, issued by the same company. Each of
them measures at least 20 by 24 inches, is in like-new
condition, and comes with the original certificate of
authenticity. Each of them was personally hand-signed by
Carl
Barks.
When examining the images below, keep in mind that only the
image area is shown. In reality, each lithograph also has
an ample border around the image. The border area beneath
the image carries the title of the print, as well as the edition
number and the signature of Mr. Barks. The "Gold Plate"
edition has a debossed border of actual gold surrounding the
image, as well as a special gold-stamped image in the border. In each case the "Gold Plate" edition was limited to 100
numbered copies. This means that you can be
one of only 100 people in the whole world who has one.
Unless otherwise indicated, each of these lithographs is
unframed. However, when
properly matted and framed in a simple metal frame,
they become very handsome pieces, indeed, as evidenced by this
somewhat poor quality photo of one that is hanging on a wall
within walking distance of my keyboard. In the descriptions
that follow, the term "current estimate of its market value" refers to the market value as estimated
in May 2000 by the Bruce Hamilton Company, the publisher and
leading secondary market dealer in these prints.
Sailing the Spanish Main
This is large lithograph #1 in the series of 24
issued by "Another Rainbow" in 1982. This is number 109 in
the single limited edition of 245 copies. Nearly everyone
who owns one of these "rarest of all" Barks lithographs is
holding onto it. The current estimate of its market value
is $11,000. For
a limited time (until I decide to frame and keep it) this
exceptional lithograph, is being offered postpaid
to anywhere in the United States, for 10% less than that: $9900
[Sorry, already SOLD]
An Embarrassment of Riches
This is large lithograph #2 in the series of 24
issued by "Another Rainbow." This is number 243 in a
limited edition of 395 copies, nicely matted and framed. The current estimate of
its market value is $4300. I
am offering it, postpaid to anywhere in the United States, for
25% less than that: $3225
[Sorry, already
SOLD]
In Uncle Walt's Collectery
This is large lithograph #5 in the series of 24,
issued by "Another Rainbow" in 1984. This is number 301 in
the regular edition of 345 copies. The current estimate of
its market value is $2500. I am
offering it, postpaid
to anywhere in the United States, for 30% less than that: $1750
If you prefer the Gold Plate edition, I am also offering
number 71 in the edition of only 100 copies. This
lithograph is nicely matted and framed, ready to hang on your
wall. There is a very small crease in the white border area
of the upper left-hand corner (not affecting the image) that is
invisible except upon close examination and which could easily be
completely covered by rematting. The current estimate of
its market value is $3750. I am
offering it, postpaid to anywhere in the United States, for 35%
less than that: $2437
Return to Morgan's Island
This is large lithograph #6 in the series of 24
issued by "Another Rainbow." This is number 179 in a
limited edition of 395 copies. The current estimate of
its market value is $1750. I
am offering it, postpaid to anywhere in the United States, for
30% less than that: $1225
First National Bank of
Cibola
This is large lithograph #10 in the
series
of 24 that have been issued by "Another Rainbow." This is
number 96 in the "Gold Plate" limited edition of only 100 copies.
The current estimate of its market value is $1875. I
am offering it, postpaid to
anywhere in the United States, for 35% less than that: $1218
[Sorry, already SOLD]
Trespassers Will Be Ventilated
This is large lithograph #11 in the series of 24 that have been issued by "Another Rainbow." This is number 28 in the "Gold Plate" limited edition of only 100 copies, one of the most popular images from the many adventures of Uncle Scrooge. The current estimate of its market value is $1850. I
am offering it, postpaid to anywhere in the United States, for 30% less than that: $1295
[Sorry, already
SOLD]
Return to Plain Awful
This
is large lithograph #13 in the series of 24 issued
by "Another Rainbow." The image is based on the famous
"Square Eggs" story and is number 96 in the "Gold Plate" limited
edition of only 100 copies. The current estimate of its
market value is $1950. I am
offering it, postpaid to anywhere in the United States, for 25%
less than that:
$1462
[Sorry, already
SOLD]
Holiday in Duckburg
This
is large lithograph #14 in the series of 24 issued
by "Another Rainbow." Great image in which the gang's all
here: Gladstone, Daisy, even Gyro Gearloose! This is number
96 in the "Gold Plate" limited
edition of only 100 copies. The current estimate of its
market value is $2250. I am
offering it, postpaid to anywhere in the United States, for 25%
less than that: $1687
[Sorry, already
SOLD]
An Astronomical Predicament
This is large lithograph #15 in the series of 24 issued by
"Another Rainbow." This is number 96 in the "Gold Plate" limited edition of only 100 copies. The current
estimate of its market value is
$1500. I am offering it, postpaid to anywhere in the United
States, for 15% less than that: $1275
[Sorry, already
SOLD]
The Stone That Turns All Metals
Gold
This is large lithograph #17 in the series of 24 issued by
"Another Rainbow." This is number 96 in the "Gold Plate" limited edition of only 100 copies. The current
estimate of its market value is
$1800. I am offering it, postpaid to anywhere in the United
States, for 35% less than that: $1170
Mardi Gras Before the Thaw
This
is large lithograph #18 in the series of 24 issued
by "Another Rainbow." The original oil painting of this
image sold for half a million dollars, but you can have this one
at a nice price. This is number 96 in the "Gold Plate"
limited
edition of only 100 copies. The current estimate of its
market value is $2250. I am
offering it, postpaid to anywhere in the United States, for 25%
less than that: $1687
[Sorry, already
SOLD]
This Dollar Saved My Life at
Whitehorse
This is large lithograph #21 in the series of 24 issued
by "Another Rainbow." The original oil painting of this
image is considered by many to be the best of all the "money bin"
paintings. This is number 32 in the "Gold Plate" limited
edition of only 100 copies. There were no special or
foreign editions, so only a very few collectors will ever own
this remarkable print. The current estimate of its
market value is $2850. I am
offering it, postpaid to anywhere in the United States, for 5%
less than that: $2700 [Sorry, already
SOLD]
Too Rich For Your Blood?
Perhaps you would be interested in one of the lithographs from
the "smaller" editions. When the prices of the large
lithographs began to command impressive prices on the
secondary market, a series of smaller signed
and numbererd lithographs were produced in an effort to make a
more affordable product available to those of lesser means.
I have the following available for sale.
Gifts For Shacktown
This print was inspired by one of the best remembered holiday
stories, Christmas For Shacktown, that appeared in Donald Duck
Four Color comics #367, the January 1952 issue.
This is number 409/595 from this limited edition lithograph,
signed by the artist, Carl Barks. The image area of the
print measures approximately 8½ by
10 inches. The current estimate of its value, by the
original publisher, is $460. I am offering it, postpaid to
anywhere in the United States, for 20% less than that: $368
Always Another Rainbow
The name of this print was inspired by a well-remembered
quotation of Scrooge McDuck, from which the name of the company
that produced these lithographs was also taken.
This is number 409/595 from this limited edition lithograph,
signed by the artist, Carl Barks. The image area of the
print measures approximately 8½ by
10 inches. The current estimate of its value, by the
original publisher, is $1400. I am offering it, postpaid to
anywhere in the United States, for 20% less than that: $1120 [Sorry, already
SOLD]
For a limited time (until I come to my senses) I'm also
willing to part with my "Gold Plate" copy of this lithograph,
number 99/100. The current estimate of its value is $2100.
I am offering it, postpaid to anywhere in the United States, for 20% less than that: $1680
[Sorry, already SOLD]
A 1934 Belchfire Runabout
This is large lithograph #4 in the series of 24 issued
by "Another Rainbow," in 1984, in recognition of Donald Duck's
50th birthday. I am offering number 100 in the "Gold Plate"
limited edition of only 100 copies, the current market value
estimate of which is $3300.
However, this one is missing the certificate of
authenticity and is otherwise short of investment grade quality.
On the other hand, it would be very handsome, indeed, if
properly matted and framed. If you are interested, at the
giveaway price of only $985,
please inquire for further details.
Limited Edition
Serigraphs
Unlike lithographs, a serigraph (think "silk screen")
has a "texture" due to the very large number of layers of color
that are used to build each print. At least three large
Barks serigraphs were issued by the Carl Barks Studios. These are also found in more than one
edition.
Golden Fleece
The image in this first of the serigraphs is based on the
December 1956 story "The Golden Fleecing," that
appeared in Walt Disney's Uncle Scrooge Comics #12. The original 12" x 24" oil was painted in 1972. The
96-color serigraph was produced in "general," "remarqued," and
"deluxe"
editions, the latter being not on rag paper but, rather, on
maple wood. The deluxe edition sold in the year of its
original issue (1993) for $3000. Only 65 of the deluxe
edition were produced (an edition of 50 plus 15 artists proofs)
and
close to half of them were destroyed in a flood. In
February 1998, the Carl Barks Studio estimated the value of the
remaining copies at $6000. I am offering #16 from the
deluxe edition, a "just-like-new" copy, postpaid to anywhere in
the United States, for: $4935
[Sorry, already SOLD]
Rich Finds At Inventory
Time
Perhaps the best known of the three serigraphs, "Rich Finds..."
is a reproduction of the largest oil painting
Mr. Barks has ever done. The serigraph may or may not
be exactly the same size as the painting, but it is quite large,
measuring 28" by 35". The original issue price of this
serigraph, in 1994, was $3000. I am offering a very low
number (3/100) from the "remarqued" edition, custom double matted
and framed, postpaid to anywhere in the United States, for: $3385
[Sorry, already
SOLD]
Original Oil
Painting
Spoiling the
Concert
This is one of only a very few so-called
"money bin" paintings, carefully rendered, coin by coin, by Mr.
Barks. "Spoiling the Concert" is one of the lesser known of
the money bin
oils. It has not been reproduced as a lithograph and the
image does not appear on a calendar, as a poster, or elsewhere,
as far as I know.
While many Barks paintings are based on a comic
book cover or story, each of the money bin oils is essentially
"new." This one, however, does contain a favorite and
familiar image--that of Scrooge playing the cash register as if
it were a musical instrument. This painting, while
essentially original in concept, was inspired by the cover of
Walt Disney's Uncle
Scrooge Comics #5, the Spring 1954 issue.
This is one of only five
paintings that I have previously showcased on my main Carl
Barks page as a candidate for his "best" oil painting.
In addition to the expected money bin elements, this painting
contains excellent lighting, composition, and balance,
and also tells a little story. Notice that the nephews are
winding up and releasing little mechanical mice which are
destined to disrupt the rapture with which Scrooge "plays" the
ledger-as-sheet-music. Also the larger foreground figures
combine with other elements to produce a nice three dimensional
effect.
This remarkable and highly desirable
oil painting is being offered for sale by Heritage Auction Galleries in its forthcoming auction to be held August 1 - 4, 2007. The catalog mailing and Internet bidding will begin on July 14, 2007. I invite you to see details, place your bids, and follow the results of this auction at the Heritage Auction Galleries web page. This original oil painting measures 16 by 20 inches and is nicely
presented in a modestly handsome frame with a brass plaque
stating the name. It was painted by Mr. Barks in 1973.
To the best of my knowledge this is only the second time a Barks "money bin" painting from the early-70s period has been offered to the public in many years. On June 4, 2007, the auction house of Bonhams and Butterfields sold the 1975 painting "Hands Off My Playthings" for $204,000. Who knows what "Spoiling the Concert" will sell for, but it is a superior image to that of "Playthings" and I would remind you that the highest
previously reported sale of a Carl Barks original oil painting, that of "Mardi Gras Before The Thaw," was realized by Sotheby's auction house in the Spring of 1997, when that painting sold
for a total price to the buyer of $505,000. "Spoiling the Concert" may well sell for less than that. On the other hand, "Mardi Gras ..." is not a "money bin" painting and it is of relatively
recent origin, not rendered during Mr. Barks' prime 1970s period. Whoever ends up with "Spoiling the Concert" will have a unique item and, if the experience of the previous owner who held it for some 30 years is any indication, will take great pleasure with it every day that passes.
Mr. Barks passed away, August 25, 2000, at age 99, so there
will be no further wonderful images from his hand. Who
knows if or when
another money bin painting will be offered to the market? Critics once pronounced that the work
of Norman Rockwell (a mere "illustrator") would never bring such
a price. I invite you to inquire into what his best work is
going for at auction today. This may be a singular chance of a lifetime to own such a wonderful Carl Barks original oil painting.
The Fine Art of Walt
Disney's Donald Duck
In 1981, Russ Cochran and Bruce Hamilton published a book
entitled "The Fine Art of Walt Disney's Donald Duck," a
heavyweight volume that featured color pictures of all 122 Barks
Disney oil paintings produced to that date.
The book was published in a very limited
edition of only 1,875 signed and numbered copies, some of them in
a blue binder and some in maroon. It was produced
using high grade glossy paper stitched in a heavy top-of-the-line
binding and came in a sturdy matching slipcase. The overall
product was so exceptional that it won a prestigious industry
award for its binding. Because of the exceptionally small
print run, not to mention the extraordinary contents, this book
which sold for $150 per copy upon publication is now valued at
something like $2,000 -- if you are lucky enough to find a
willing seller. I am offering a copy of the blue-binding
edition (#1713/1875) in absolutely like-new condition,
postpaid to anywhere in the United States, for significantly less
than that: $1895
[Sorry, already
SOLD]
However, if you like the maroon-binding edition, I am offering a copy
(#294/1875) which is also in like-new condition with the
exception of relatively insignificant small scuff marks on the slipcase (present
since original issue), postpaid to anywhere in the United States,
for only: $1695
[Sorry, already
SOLD]
Terms and
Conditions
- Orders or inquiries by phone are not accepted.
- Orders or inquiries by mail are not encouraged.
- If you are interested in purchasing an item
featured on this page please contact me by e-mail (jimlowe2@aol.com). I will advise
you of its availability, the total price including shipping, and
will reserve it for you pending the arrival of your payment.
I accept payment by cashier's check or money order.
For buyer's within the United States or any of the 37
countries listed at the bottom of this page, I also accept Visa
and Mastercard payments via "Pay Pal" (see below).
I will be out of the country from July 4 to July 18, 2007. If you are interested in purchasing a Barks item from this page, you may contact me after July 18.
If you are not using Pay Pal, perhaps you should consider it. Not only can you make purchases with your credit card, but
it is free to register and to use. New members even get a
$5.00 credit just for signing up! If you'd like to join,
just click the Pay Pal image above.
Return to top of page or use one of the
links below.
VISA, Mastercard, Discover, and American Express payments through the Pay Pal program are available to purchasers in: Anguilla, Argentina, Australia, Austria, Belgium, Brazil, Canada, Chile, China, Costa Rica, Denmark, Dominican Republic, Finland, France, Germany, Greece, Hong Kong, Iceland, India, Ireland, Israel, Italy, Jamaica, Japan, Luxembourg, Mexico, Netherlands, New Zealand, Norway, Portugal, Singapore, South Korea, Spain, Sweden, Switzerland, Taiwan, and the United Kingdom.
This page created and maintained by Jim Lowe (jimlowe2@aol.com)
First appearance: July 1998
Last updated: June 14, 2007
#!/usr/local/bin/perl5
use GD;
alarm(600);
# cgi-bin access counter program
# Version 4.0.7
#
# Copyright (C) 1995 George Burgyan
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# A full copy of the GNU General Public License can be retrieved from
# http://www.webtools.org/counter/copying.html
#
# gburgyan@webtools.org
#
# George Burgyan
# 1380 Dill Road
# South Euclid, OH 44121
#
# For more information look at http://www.webtools.org/counter/
########################################################################
#
# CHANGE THESE TO SUIT YOUR SITE
#
# The default language option (english, french, swedish)
$default_lang = "english";
# The name of the file to use. You should probably give this an absolute path
$FileName = "$ENV{'DOCUMENT_ROOT'}/counter/access_count";
# Replace with a list of regular expression IP addresses that we
# are supposed to ignore. If you don't know what this means, just use
# "\." instead of periods. Comment out entirely to ignore nothing.
#@IgnoreIP = ("199\.18\.203\..*",
# "199\.18\.159\.1",
# );
# Aliases: Set this up so that diffent pages will all yield the same
# count. For instance, if you have a link like "index.html -> home.html"
# set it up like ("/index.html", "/home.html"). Make sure you give a full
# path to it. This will treat "/index.html" as if it were "/home.html".
%Aliases = ("/fakename.html", "/realname.html",
"/index.html", "/home.html",
);
# AUTOMATICALLY SET BY INSTALL!! Modify only if necessary!!!
#
# BaseName: set to whatever you have counter installed as. This is
# used to derive the arguments. No not touch the next comment.
### AUTOMAGIC ###
$BaseName = "counter";
# counter or counterbanner or counterfiglet
#
# Outputs the number of times a specific page has been accessed.
# The output depends on which page 'called' it, and what the program
# is named:
#
# The counter can "take arguments" via its name. That is, if you tack
# -arg to the end of the program name, -arg is taken to be an argument.
# For example, if you call the counter 'counter-ord', '-ord' is considered
# an argument, and an ordinal count (1st, 2nd, 3rd, ...) will be printed
# instead of (1, 2, 3, ...). Note that counterord does the same thing as
# counter-ord for backward compatibility.
#
# Currently recognized arguments:
#
# -f=font sets "font" to be the font for figlet
# -lang=lang sets the language used to ordinalize to "lang"
# -nc no count; don't to write the incremented count back to the file
# -nl no link; don't automatically generate a link
# -nd no display; don't display anything, just count
# -ord make an ordinal count instead of regular
# -doc=document override the DOCUMENT_URI environment variable
#
# Example: counterfiglet-ord-f=bigfont-nc
#
# This will cause the counter to call figlet as the output routine, printing
# in a big font an ordinal count, without updating the access count file.
# Note that the order of arguments is irrelevant so long as you spell the
# file name correctly. It is generally assumed that the ability to take
# different arguments/use different output routines is done with symlinks:
# i.e. ln -s counter counterfiglet-ord-f=bigfont-nc
#
# More complete documentation can be found at
# http://www.webtools.org/counter/
#
########################################################################
#
# Thing that shouldn't really need changing, but are configurable anyway.
#
# Maximum number of times to try to lock the file.
# Each try is .1 second. Try for 1 second.
$MaxTries = 10;
# Set this to point to something, or comment it out, and it
# won't be a link at all.
# $Link = "http://www.webtools.org/counter/";
# Whether or not to use locking. If perl complains that flock is not
# defined, change this to 0. Not *really* necessary because we check
# to make sure it works properly.
$UseLocking = 0;
# What version of the counter file format are we using?
$FileVersion = "02.000";
# Common names of the counter to install...
@CommonExtensions = ("-ord", # Ordinam
"figlet", # Figlet'ed
"figlet-ord",# Ordinal figlet
"banner", # Bannered
"banner-ord",# Ordinal banner
);
#
#########################################################################
#
# Misc documents to refer people to in case of errors.
#
$CreateFile = "[Error Creating Counter File -- Click for more info]";
$AccessRights = "[Error Opening Counter File -- Click for more info]";
$TimeoutLock = "[Timeout locking counter file]";
$BadVersion = "[Version access_count newer than this program. Please upgrade.]";
#########################################################################
#
# The actual program!
### Stage 1
###
### Parse the arguments... (just ignore this part)
# Get arguments from program name. Argh...what a horrible way to do it!
$prog = $0;
$prog =~ s/(\.cgi|\.pl)//; #strip .cgi|.pl name extension
$prog =~ s!^(.*/)!!; # separate program name
$prog =~ s/\\(.)/sprintf("%%%02x", ord($1))/ge; # quote \c to %xx
($printer, @args) = split(/-/, $prog); # args are separated by dashes
$printer =~ s/%(..)/pack("c", hex($1))/ge; # unquote printer function name
$printer =~ s/$BaseName/counter/; # Make it cannonical.
# This gets path info, which is only applicable if you are using our
# ssis script (see above). This makes counter/ord the same as counter-ord
push(@args, split("/", $ENV{"PATH_INFO"})) if $ENV{"PATH_INFO"};
# put them in assoc array %arg
foreach (@args) # means do this for each element in the array
{
s/%(..)/pack("c", hex($1))/ge; # unquote %xx
/^([^=]*)=?(.*)$/; # extract "=" part, if any
$arg{$1} = $2 ? $2 : 1;
}
if ($ARGV[0] eq '-install') {
&CheckPerl;
&SetBaseName;
&MakeCommon(0);
exit(0);
}
if ($ARGV[0] eq '-installforce') {
&CheckPerl;
&SetBaseName;
&MakeCommon(1);
exit(0);
}
if ($ARGV[0] eq '-unlock') {
open(FILE,"$FileName");
&UnlockFile(FILE);
exit(0);
}
undef $Link if $arg{'nl'}; # make link?
### Stage 2
###
### Print out the header
# Print out the header
print "Content-type: text/html\n\n";
#print "Debug 1: $ConfName Debug 2: $FileName";
### Stage 3
###
### Open the access_count file for read-write taking all the precautions
# Make sure the file exists:
if (!(-f $FileName)) {
if (!open (COUNT,">$FileName")) {
# Can't create the file
print $CreateFile;
exit 1;
} else {
# We got the file, print out the version number
print COUNT "$FileVersion\n";
$version = 2;
}
} else {
if (!((-r $FileName) && (-w $FileName))) {
# Make sure that we can in fact read and write to the file in
# question. If not, direct them to the FAQ.
print $AccessRights;
exit 1;
}
if (!open (COUNT,"+<$FileName")) { # Now make sure it *really* opens
print $AccessRights; # ...just in case...
exit 1;
}
# Try to read in a version number
$version = ;
if (!($version =~ /^\d+.\d+$/)) {
# No version number, assume version 1 and reset the file.
$version = 1;
seek(COUNT,0,0);
}
}
# This is for the future: the access_count file will have a version number.
if ($version > 2) {
print $BadVersion;
exit 1;
}
### Stage 4
###
### Attempt to lock the file
$lockerror = &LockFile(COUNT);
# You would figure that $MaxTries would equal 0 if it didn't work. The
# post-decrement takes it to -1 when the loop finally exits.
if ($lockerror) {
print $TimeoutLock;
exit(0);
}
### Stage 5
###
### Check if we need to update the file to a newer version
if ($version < 2) {
&UpdateVersion1;
}
### Stage 6
###
### Convert the information the server gave us into the document
### identifier.
# Make sure perl doesn't spit out warnings...
if (defined $ENV{'DOCUMENT_URI'}) {
$doc_uri = $ENV{'DOCUMENT_URI'};
} else {
$doc_uri = "";
}
# Campatibility: Version 2 files have the server name in front if and
# only if it doesn't have a "~" in it.
$old_uri = $doc_uri;
# Add the server name in front to support multi-homed hosts if and only if
# it doesn't have a "~" in it. (usernames are global in most multi-homed
# settings
if (defined $ENV{'SERVER_NAME'} && !($doc_uri =~ /~/)) {
$doc_uri = $ENV{'SERVER_NAME'} . "/" . $doc_uri;
}
if (defined $arg{'doc'}) {
$doc_uri = $arg{'doc'};
}
$doc_uri = $Aliases{$doc_uri} if defined $Aliases{$doc_uri};
### Stage 7
###
### Find the relevant place in the file
$location = tell COUNT;
while ($line = ) {
# Read the file line-by-line.
if (($uri,$accesses) = ($line =~ /^'(\S*)' (\d\d\d\d\d\d\d\d\d\d)$/)) {
# An old line
if ($uri eq $old_uri) {
&ConvertDocV1($doc_uri,$old_uri,$accesses,$location);
last;
}
} elsif (($uri,$accesses,$flags) = ($line =~ /^'(\S*)' (\d\d\d\d\d\d\d\d\d\d) (\w\w\w\w)$/)) {
# A new line
if ($uri eq $doc_uri) {
$flags = hex($flags);
last;
}
}
last if ($uri eq $doc_uri);
$location = tell COUNT;
#reset the fields
$accesses = 0;
$flags = 0;
}
### Stage 8
###
### Update the access count of the file
$accesses += 1; # *NOT* '++' because we don't want '++'s magic
### Stage 9
###
### Figure out what to print out
# If we have to ordinalize, do it now.
if (defined $arg{'ord'}) {
if (defined $arg{'lang'}) {
$ord = eval("&ordinalize_$arg{lang}($accesses)");
} else {
$ord = &ordinalize($accesses);
}
} else {
$ord = "";
}
$to_print = $accesses . $ord;
# Give it to the printer function to actually produce the output from the
# ascii text that we have (to_print)
($count, $nLink) = eval("&output_$printer('$to_print')");
# If the above line gave us an error, default to just the text.
if ($@) {
($count, $nLink) = &output_counter($to_print);
}
### Stage 10
###
### Now we actually tell the browser what the count is.
if (! $arg{"nd"} ) { # If we print anything
# Print out a link to something informative (if we were requested to)
$script_name = $ENV{'SCRIPT_NAME'};
print "" if $nLink;
if ($script_name =~ /cgi-bin\/count(\w+)/) {
$img_dir = $1;
}
if ($img_dir ne "er") { &give_graphic }
else {
print $count;
print "" if $nLink;
}
}
sub give_graphic {
@img_count = split(//,$count);
foreach (@img_count) {
print " ";
};
}
sub comment1 {
# create a new image
print "Content-type: image/gif\n\n";
$im = new GD::Image(100,100);
# allocate some colors
$white = $im->colorAllocate(255,255,255);
$black = $im->colorAllocate(0,0,0);
$red = $im->colorAllocate(255,0,0);
$blue = $im->colorAllocate(0,0,255);
# make the background transparent and interlaced
$im->transparent($white);
$im->interlaced('true');
# Put a black frame around the picture
$im->rectangle(0,0,99,99,$black);
# Draw a blue oval
$im->arc(50,50,95,75,0,360,$blue);
# And fill it with red
$im->fill(50,50,$red);
# Convert the image to GIF and print it on standard output
print $im->gif;
}
### Stage 11
###
### Check if we are supposed to update the count in the file. (ie. we're
### not ignoring the host that just accessed us)
# Make sure we are not ignoring the host:
$ignore = 0;
$ignore = grep($ENV{"REMOTE_ADDR"} =~ /$_/, @IgnoreIP) if defined ($ENV{"REMOTE_ADDR"});
$ignore = $ignore || $arg{"nc"};
### Stage 12
###
### Actually write the updated information back to the file
if (!$ignore) # If we aren't ignoring this access
{
# Now update the counter file
seek(COUNT, $location, 0);
$longaccesses = sprintf("%010.10d", $accesses);
$hexflags = sprintf("%04.4x", $flags);
print COUNT "'$doc_uri' $longaccesses $hexflags\n";
}
&UnlockFile(COUNT);
close COUNT;
#######################################################################
#
# Support functions
#
# translate_output
#
# Quote any special characters with HTML quoting.
sub translate_output {
local($string) = @_;
$_ = $string;
s/è/è/g;
return $_;
}
sub LockFile {
local(*FILE) = @_;
local($TrysLeft) = $MaxTries;
if ($UseLocking) {
# Try to get a lock on the file
while ($TrysLeft--) {
# Try to use locking, if it doesn't use locking, the eval would
# die. Catch that, and don't use locking.
# Try to grab the lock with a non-blocking (4) exclusive (2) lock.
# (4 | 2 = 6)
$lockresult = eval("flock(COUNT,6)");
if ($@) {
$UseLocking = 0;
last;
}
if (!$lockresult) {
select(undef,undef,undef,0.1); # Wait for 1/10 sec.
} else {
last; # We have gotten the lock.
}
}
}
if ($TrysLeft >= 0) {
# Success!
return 0;
} else {
return -1;
}
}
sub UnlockFile {
local(*FILE) = @_;
if ($UseLocking) {
flock(FILE,8); # Unlock the file.
}
}
####################################################################
#
# Installation helpers
#
# SetBaseName
#
# Change the counter program itself to set the basename
sub SetBaseName {
local($name) = $0;
$name =~ s/^.*\/([^\/]+)$/$1/; # Strip off any of the path
if ($name eq $BaseName) { # The way we're set up now!!!
return; # Don't need to change a thing.
}
if (!open(COUNTERFILE, "+<$0")) {
print "Can't modify program. Set \$BaseName manually.\n";
return;
}
print "Configuring \$BaseName variable...\n";
local($oldsep) = $/;
undef($/);
local($program) = ;
# The next line does all the magic.
$program =~ s/\#\#\# AUTOMAGIC \#\#\#\n\$BaseName = \"[^\"]+\";\n/\#\#\# AUTOMAGIC \#\#\#\n\$BaseName = \"$name\";\n/;
seek(COUNTERFILE,0,0) || return;
truncate(COUNTERFILE,0);
print COUNTERFILE $program;
close COUNTERFILE;
}
# CheckPerl
#
# Make sure that the "#! /[path]/perl" points to something real...
sub CheckPerl {
if (!open(COUNTERFILE, "<$0")) {
print "Can't check to make sure Perl is in the right place.\n";
return;
}
print "Checking to make sure Perl is found properly...\n";
$firstline = ;
($command) = ($firstline =~ /^\#! *([^\s]+) *$/);
close(COUNTERFILE);
if (! -x $command) {
print "The location of Perl is misconfigured. Please edit the\n";
print "first line of this program to point to the locally installed\n";
print "copy of perl.\n\n";
print "Currently, it is configured to be \"$command\", however,\n";
print "that file either does not exist or is not a program.\n\n";
print "Some common locations for Perl are:\n";
print " /usr/bin/perl\n";
print " /usr/local/bin/perl\n";
print " /bin/perl\n";
print " /opt/gnu/bin/perl\n\n";
exit;
}
}
# MakeCommon
#
# Make some common links to the counter
sub MakeCommon {
local($force) = @_;
local($ext);
print "Installing the counter...\n";
print " ...making counter executable\n";
chmod(0755,$0);
local($path, $name, $cgi);
$name = $0;
if ($name =~ /^(.*\/)([^\/]+)$/) {
$path = $1; $name = $2;
}
if ($name =~ /^(.*)(\.cgi)$/) {
$name = $1, $cgi = $2;
}
foreach $ext (@CommonExtensions) {
print " ...making link from $path$name$cgi to $path$name$ext$cgi\n";
if (!&MakeLink("$path$name$cgi","$path$name$ext$cgi",$force)) {
# An error occured while making the link. :-(
print " *** An error occured while making the link.\n";
}
}
if ($symlink_exists == 0 && $link_exists == 0) {
print "* NOTE * Your system does not support symbolic or hard links,\n";
print " copies made instead. If you modify the counter, you must\n";
print " run counter -install again to recopy it to the other files.\n";
}
print "...done!\n";
}
# MakeLink
#
# Actually create the link.
sub MakeLink {
local($oldname,$newname,$force) = @_;
# Check to see if we can make symbolic links instead of hard links
if (!defined $symlink_exists) {
$symlink_exists = (eval 'symlink("","");', $@ eq '');
}
# Check to see if we can make a link if we can't make a symlink
if (!symlink_exists) {
$link_exists = (eval 'link("","");', $2 eq '');
}
if ($force) {
# Check to see if the file exists
if (-e $newname) {
if (!unlink ($newname)) {
return 0;
}
}
}
if ($symlink_exists) {
return symlink($oldname, $newname);
} elsif ($link_exists) {
return link($oldname, $newname);
} else {
# Copy it the old-fashioned way... *sigh*
open(OLDFILE, $oldname) || die "Can't open $oldname for copy";
open(NEWFILE, ">$newname") || die "Can't open $newname for write";
while() {
print NEWFILE $_;
}
close(NEWFILE);
close(OLDFILE);
}
}
####################################################################
#
# Ordinalizing functions
#
# ordinalize
#
# Call the appropriate ordinalize function for the default language
sub ordinalize
{
local($count) = @_;
if (defined $arg{'lang'}) {
return eval("&ordinalize_$arg{lang}($count)");
} else {
return eval("&ordinalize_$default_lang($count)");
}
}
# ordinalize_english
#
# Figure out what suffix (st, nd, rd, th) a number would have in ordinal
# form and return that extension.
sub ordinalize_english {
local($count) = @_;
local($last, $last2);
$last2 = $count % 100;
$last = $count % 10;
if ($last2 < 10 || $last2 > 13) {
return "st" if $last == 1;
return "nd" if $last == 2;
return "rd" if $last == 3;
}
return "th"; # Catch "eleventh, twelveth, thirteenth" etc.
}
# ordinalize_french
#
# Trivial... Return the extension for french. The only exception is 1.
# Thank you Chris Polewczuk
sub ordinalize_french {
local ($count) = @_;
if ($count == 1) {
return "'ière";
} else {
return "ième";
}
}
# ordinalize_swedish
#
# A function to ordinalize in Swedish. Thanks go to Johan Linde
# for the code!
sub ordinalize_swedish {
local($count) = @_;
local($last, $last2);
$last2 = $count % 100;
$last = $count % 10;
if ($last2 < 10 || $last2 > 12) {
return ":a" if ($last == 1 || $last == 2);
}
return ":e";
}
########################################################################
#
# Output functions
#
# The following are the routines that actually convert the number
# of accesses into something that we print out.
#
# The name of each function is "output_" followed by the program's name.
# For instance, is the program is called "counter" then "output_counter"
# will be called; a program called "counterbanner" will call
# "output_counterbanner" to get the output.
#
# If the function is not defined, then "output_counter" will be called.
#
# output_counter
#
# The simplest function: just returns the number of accesses and the link.
sub output_counter {
local($count) = @_;
return &translate_output($count), $Link; # we return the count and the link
}
# output_counterord
#
# Return the number of accesses as an ordinal number. (ie. 1st, 2nd, 3rd, 4th)
sub output_counterord {
local($count) = @_;
return &translate_output($count . &ordinalize($count)), $Link;
}
# output_counterbanner
#
# A somewhat silly one that uses the "banner" command to print out the
# count. :) You might need to change the path to make it work.
sub output_counterbanner {
local($count) = @_;
$banner = `banner $count`;
return "$banner "; # return no link here (it would be annoying)
}
# output_counterfiglet
#
# An even sillier one than counterbanner. :)
sub output_counterfiglet {
local($count) = @_;
$fig = "echo $count | /usr/games/figlet"; # setup command line
$fig .= " -f $arg{'f'}" if $arg{"f"}; # use a different font?
$fig = `$fig`;
$fig =~ s!&!&!g;
$fig =~ s!" . $fig . " "; # note no link here, either
}
#########################################################################
#
# Conversion functions
#
# UpdateVersion
#
# Convert a version 1file into a version 2 file.
sub UpdateVersion1 {
local ($contents,$dummy);
local ($oldsep) = $/;
$/ = "";
seek(COUNT,0,0); # Go to the beginning of the file
$contents = ;
seek(COUNT,0,0);
print COUNT "$FileVersion\n";
print COUNT $contents;
seek(COUNT,0,0);
$/ = $oldsep;
$dummy = ; # Skip the new line
}
# ConvertDocV1
#
# Convert the a version 1 line into a version 2 line
sub ConvertDocV1 {
local ($doc_uri,$old_uri,$accesses,$location) = @_;
local ($contents,$dummy,$oldsep);
$oldsep = $/;
seek (COUNT,$location,0); # Skip the line in question
$dummy = ;
$/ = ""; # Read in the whole file
$contents = ;
seek (COUNT,$location,0);
local ($longaccesses,$hexflags);
$longaccesses = sprintf("%010.10d", $accesses);
$hexflags = sprintf("%04.4x", $flags);
# Print out the new stuff
print COUNT "'$doc_uri' $longaccesses $hexflags\n";
print COUNT $contents;
$/ = $oldsep;
}
canny investors
have visited this page since 10/08/98
|