#!/ ####################################################### # Message Board V2.3 # # This program is distributed as freeware. We are not # responsible for any damages that the program causes # to your system. It may be used and modified free of # charge, as long as the copyright notice # in the program that give me credit remain intact. # If you find any bugs in this program. It would be thankful # if you can report it to us at cgifactory@cgi-factory.com. # However, that email address above is only for bugs reporting. # We will not respond to the messages that are sent to that # address. If you have any trouble installing this program. # Please feel free to post a message on our CGI Support Forum. # Selling this script is absolutely forbidden and illegal. ################################################################## # # COPYRIGHT NOTICE: # # Copyright 1999 CGI-Factory.com # # Author: Yutung Liu # Web site: http://www.cgi-factory.com # E-Mail: cgifactory@cgi-factory.com # Released Date: September 04, 1999 # # Message Board V2.3 is protected by the copyright # laws and international copyright treaties, as well as other # intellectual property laws and treaties. ################################################################### require "cfg.pl"; @months = ('January','February','March','April','May','June','July','August','September','October','November','December'); @days = ('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'); print "Content-type: text/html\n\n"; opendir (DIR, "$messages") or &error("Unable to open the dir for reading"); if ($flock==1) { flock DIR, 2; } @reading=readdir(DIR); @reading=grep(/\.dat/, @reading); close (DIR); $total=0; COUNTING:foreach $read(@reading) { $read=~ s/\.dat//; open (content, "<$messages/$read.dat") or next COUNTING; if ($flock eq "y") { flock content, 2; } @content=; close (content); $order[$total]="@content[2]x$read"; $total++; } @order=sort(@order); @order=reverse(@order); $num=0; print "\n"; print ""; print "\n"; print "\n"; print "\n"; print "\n"; if ($total==0) { print ""; print "\n"; print "
Subject Replies Poster Last Post 
No messages were posted.---
\n"; &skip; } Opening:foreach $order (@order) { @xorder=split (/x/, "$order"); open (data, "<$messages/@xorder[1].dat") or next Opening; if ($flock eq "y") { flock data, 2; } @data=; close (data); #time chomp(@data[2]); ($sec,$min,$hour,$mday,$mon,$year,$wday) = (localtime(@data[2]))[0,1,2,3,4,5,6]; $sec = sprintf("%.02d",$sec); $min = sprintf("%.02d",$min); $hour = sprintf("%.02d",$hour); $mday = sprintf("%.02d",$mday); $year += 1900; $date = "$days[$wday], $months[$mon] $mday, $year"; $time = "$hour:$min:$sec"; # $num++; print "@data[0]"; print "@data[1]"; print "@data[3]"; print "On $date at $time\n"; if ($num==$max) { print "\n"; &post_box; exit; } } sub skip { &post_box; exit; } print "\n"; &post_box; exit; #post box sub post_box { print "


\n"; print ""; print "Post a new message:

\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "
Name:
Email:
Subject:
Message:\n"; print "
"; } #####error sub error { print "

An error has occured

The error is $_[0]
\n"; print "Reason: $!\n

"; print "Please contact the webmaster of this web site if you keep getting this message."; exit; }
Make your own free website on Tripod.com