#!c:/sambar51/perl/bin/perl.exe use CGI ':standard'; use CGI::Carp qw(fatalsToBrowser); require 'chat-subs.cgi'; ######################## Program Header ######################################### ## ## Copyright (C) 2004 Poetic Pollution ## Script Name: ChatterBox ## URL: http://poeticpollution.net/scripts/ChatterBox/ ## ## Portions of this code were written by Robert Fogt - http://www.bluesparks.com ## ## 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. ## ## Please read the full GNU GPL: http://www.gnu.org/copyleft/gpl.html ## ################################################################################# $logIn = param('logIn'); if ($logIn) { $chatHandle = param('chatHandle'); if ($chatHandle =~ /"|<|>/) { die "These symbols are not allowed in your Username: \" < >"; } &makeFrames; } $timeNow = time; open(FILE, "+>>chat-who.cgi") || die "Unable to open the Online File for reading and writing.."; flock(FILE, 2); seek(FILE, 0, 0); chomp(@chattersOnline = ); seek(FILE, 0, 0); truncate(FILE, 0); for ($co = 0; $co < @chattersOnline; $co++) { ($name[$co],$mIP[$co],$mTime[$co]) = split(/````/,$chattersOnline[$co]); if ($timeNow < $mTime[$co] + 120) { push(@newOnline, "$name[$co]````$mIP[$co]````$mTime[$co]\n"); } } print FILE @newOnline; close(FILE); $currentlyOnline = @newOnline; &headerFooter; print "Content-type: text/html\n\n"; print @header; print qq|
$chatTitle » Login
JavaScript is required to chat. Please enable it and reload the page.
Username:
Currently Chatting: $currentlyOnline
\n|; print @footer; exit; sub makeFrames { # ------------------------------------------------ $chatText = "[i]entered chat..[/i]"; print "Content-type: text/html\n\n"; print qq|$chatTitle \n|; exit; }