Todos os direitos autorais
são reservados aos autores
das obras expostas.
A Sala das Najas é uma galeria de arte virtual, voltada à divulgação dos trabalhos de nossos habitantes e de artistas em geral. Pintores, escultores, desenhistas, fotógrafos, gravuristas, ilustradores. Estamos fechados por tempo indeterminado.
#!/usr/bin/perl
##############################################################################
# Visitor Counter Version 2.51 #
# Copyright 1998-99, UtilMind Solutions info@utilmind.com #
# http://www.utilmind.com #
# Created: Nov 3, 1998-99 Last Modified: May 03, 2000 #
##############################################################################
# COPYRIGHT NOTICE #
# Copyright 1998-99, UtilMind Solutions All Rights Reserved. #
# #
# VisCounter may be used and modified free of charge by anyone so long as #
# this copyright notice and the comments above remain intact. By using this #
# code you agree to indemnify UtilMind Solutions from any liability that #
# might arise from it's use. #
# #
# Selling the code for this program without prior written consent is #
# expressly forbidden. In other words, please ask first before you try and #
# make money off of our programs. #
# #
# Obtain permission before redistributing this software over the Internet or #
# in any other medium. In all cases copyright and header must remain intact.#
##############################################################################
# Set Variables
$counterfile = 'contadornaja.txt';
# Get the input
$link = $ENV{'DOCUMENT_NAME'};
# Begin Code
open(FILE, $counterfile) || die Can't locate counter file $!;
@DATA = ;
close(FILE);
$SIZE = @DATA;
if ($SIZE eq 0) { exit; }
for ($i=0;$i<$SIZE;$i++) {
($counter, $baselink) = split(/'/, $DATA[$i]);
chop($baselink);
if ($baselink eq $link) {
&UpdateStats;
}
}
# Add new link to database file
open(FILE, ">>$counterfile") || die Can't locate database file $!;
flock(FILE, 2); # blocking write lock
print FILE "1'$link\n"; # First time
flock(FILE, 8);
close(FILE);
$counter = '1';
&LocateLink;
# Increase through-link counter
sub UpdateStats {
@DATA = sort {($b =~ /(\d+)/)[0] <=> ($a =~ /(\d+)/)[0]} @DATA;
$counter++;
open(FILE, ">$counterfile") || die Can't locate database file $!;
flock(FILE, 2); # blocking write lock
for ($j=0;$j<$SIZE;$j++) {
if ($j eq $i) {
print FILE "$counter'$link\n";
}
else {
print FILE "$DATA[$j]";
}
}
flock(FILE, 8);
close(FILE);
&LocateLink;
}
sub LocateLink {
print "Content-Type: text/html\n\n";
print $counter;
exit;
}