|
Welcome to the South Carolina Farm and Rural Museum's website.

The Museum's mission is to preserve the history of farming and rural life in South Carolina as well as our Agrarian past as a whole. Within this site you will be able to learn what was necessary to feed and sustain ourselves from early times to the present. And what we can do to assure future generations enough food for their tables as well.
The Museum was founded in June of 2003 and is a non profit organization recognized as such by the State of South Carolina.
Support comes from private and public contributions both monetary as well as items donated to the museums inventory for preservation and display.

Karren Long Plowing with a 1957 John Deere 820 Tractor and John Deere #55 Four Bottom Plow
#!/usr/bin/perl
##############################################################################
# Hit Counter Version 1.0.0 #
# Created 10/16/02 Last Modified 10/16/02 #
##############################################################################
# hitcounter.cgi
#
# parameters: returns:
# none none
#
# History:
# Provides a Hit Counter in conjuction with WSCO.
#
# Date: Initials: Defect#: Comments:
# 2002-10-16 SMS N/A creator
# 2002-11-12 GJK Modified to use images from WSC counter
# and to get style from query string.
##############################################################################
#############################################################
### Counter Data File Location:##############################
$imageStyle = "s1";
$serverPath = "http://plugins.websitecomplete.com/wsc_images";
$docroot = $ENV{'DOCUMENT_ROOT'};
if ($docroot eq '') { $docroot = ".." };
$countfile = "$docroot/plugin_data/hitcount.txt";
$digits = 8;
if($ENV{"REQUEST_METHOD"} =~ /^get/i) {
$DATA = $ENV{"QUERY_STRING"};
@Fields = split(/&/, $DATA);
foreach $_ (@Fields) {
($name, $val) = split(/=/, $_);
$val =~ tr/+/ /;
$val =~ s/\%([0-9a-f]{2})/chr(hex($1))/egi;
$Form{$name} = $val;
}
$DATA = $ENV{"HTTP_COOKIE"};
@Fields = split(/; /, $DATA);
foreach $_ (@Fields) {
($name, $val) = split(/=/, $_);
$Cookie{$name} = $val;
}
}
$imageStyle = $Form{"ImageStyle"};
$initial_value = int($Form{"Init"});
$BgColor = "#$Form{'BgColor'}";
if ($Form{'mode'} eq '2') {
&PrintCookie;
}
else {
print "Content-type: text/html\n\n";
if ($Cookie{$Form{'ID'}} ne "true") {
&AddCount;
}
&PrintCount;
}
#while (($k, $_) = each %ENV)
#{
# s/(['\\])/\\$1/g;
# print "\$ENV{'$k'} = '$_'; \n";
#}
sub PrintCookie {
print "Content-type:image/gif\n";
$exprtn = "";
$value = "$Form{'ID'}=true;";
print "Set-Cookie: $value path=/; $exprtn\n\n";
$giffile = "$docroot/images/spacer.gif";
undef $/;
open(F,"< $giffile") or die $!;
print ;
close(F);
}
sub PrintCount {
$ThisPage = $Form{'ID'};
open(FILE, "$countfile");
@Data = ;
close(FILE);
# Print the image to use to generate a cookie
print "";
print " ";
foreach $Match (@Data)
{
chop($Match);
($count, $url) = split(/::/, $Match);
if ($url eq $ThisPage) {
$hits = $count;
last;
}
}
@nums = split(//, $hits);
$cnt = $digits - int(@nums);
$printcount = "";
while ($cnt > 0) {
$printcount="$printcount ";
$cnt--;
}
$end1 = "";
$end2 = "";
if ($imageStyle ne 's1') {
$end1 = " ";
$end2 = " ";
}
foreach $CountNr (@nums) {
$printcount = "$printcount ";
}
print "$end1$printcount$end2";
print " ";
}
sub AddCount {
$ThisPage = $Form{'ID'};
open(COUNTS, "+<$countfile") or open(COUNTS, "+>$countfile") or print("Cannot open counts file: $!");
while () {
chop;
($count, $file, $initialcount) = split(/::/, $_);
$counts{$file} = $count;
$initial{$file} = $initialcount;
}
$counts{$ThisPage}++;
if ($initial{$ThisPage} ne $initial_value) {
$counts{$ThisPage} = $initial_value;
$initial{$ThisPage} = $initial_value;
}
seek(COUNTS, 0, 0);
foreach $file (keys %counts) {
print COUNTS $counts{$file}, "::", $file, "::", $initial{$file}, "\n";
}
close(COUNTS);
}
|