My Favorite things about Angelfire.
My Favorite Web Sites
Angelfire - Free Home Pages
Free Web Building Help
Angelfire HTML Library
HTML Gear - free polls, guestbooks, and more!
#!/usr/bin/perl
# please inser the correct perl path in the line above
#*******************************************************************************
# WonderCatStudio Bulletin Board System 7.30
# BBS Note 7.x
# 2000/12/07 >> LastModify 2002/05/30
# Created by WonderCatStudio NoraNeko
# English version provided by shounen.org
#***********************************************************************************
######################################################
########## Settings (Changes not required) ##########
######################################################
$BBS_Version = '7.30b7';
#-----------------------------------------------------------------------------
sub AdminPassCheck;
sub AdminPageOpen;
sub BrowsCss;
sub CountFileOpen;
sub DelImageFile();
sub errorexit;
sub escape();
sub unescape();
sub FileAnalyze();
sub FileListCheck();
sub FileLogDel();
sub FileLogList;
sub FileLogWrite();
sub FileLogResWrite();
sub FileSave();
sub FastBoot;
sub FormMultipart;
sub Function;
sub filelock;
sub fileunlock;
sub fl();
sub call();
sub randstr;
sub CatalogOpen;
sub CookieWrite;
sub GetCookie;
sub GetFileCookie;
sub GetBrowse;
sub GetDate();
sub GetForm;
sub GetMsgPassword();
sub HelpOpen;
sub Initialize;
sub ImgContinue;
sub ImgReplace;
sub MsgCov;
sub MsgConvert;
sub MsgConvEsc();
sub MsgWrite;
sub MsgDelete;
sub MsgReflesh;
sub PostCheck;
sub PasswordCheck();
sub PageOpen;
sub PageForm;
sub PaintInt;
sub PaletteOpen();
sub Panic;
sub Restore;
sub SetPCH_Size;
#----------------------------------------------------------
#Do NOT edit the information regarding the version of this code
$paint_cgi= './paint.cgi' if($paint_cgi eq '');
$Version='BBS NOTE '.$BBS_Version.' ';
require './config.cgi';
errorexit ('1','There is a version regarding the config.cgi','「config.cgi」'.$CONFIG_VERSION.' はこの '.$BBS_Version.' Version does not match!
Please recheck your codes and try again.') if($CONFIG_VERSION ne 'Fair Rain');
$cookie_file="$FileSave_DIR/cookie.log";
$lock_sleep=1;
$lock_try = 5;
$lock_sec = 60;
$lockdir = "$FileSave_DIR/lock";
&call('Initialize');
require $skin_cgi;
$maxData=$MaxUpLoadData;
$siiApplet_Use = 1 if(!defined $siiApplet_Use);
my $c='
Client Program Module '.$ModuleVer if($ModuleVer);
$ClientVer.=$d.'www.shounen.org" TARGET="_blank">Shounen.org 'if$siiApplet_Use;
$ClientVer.=$c.'www.gt.sakura.ne.jp/~ocosama/" TARGET="_blank">Shii-chan Oekaki 'if$siiApplet_Use;
$ClientVer.='
Client Program Ono Oekaki'if$PictureBBSApplet_Use;
$ClientVer.=$c.'www.geocities.co.jp/SiliconValley-SanJose/8609/" TARGET="_blank">Nina Oekaki 'if$BBSPainterApplet_Use;
&Function;
#------------------------------------------------------------
sub Function{
&Captor if($fc eq 'captor');
&FormMultipart;
&call('Function');
if($fc eq 'write'){&MsgWrite;&MsgReflesh;&PageOpen}
elsif($fc eq 'page'){&AdminPassCheck if$FORM{'password'};&PageOpen}
elsif($fc eq 'repost'){&RePostOpen}
elsif($fc eq 'post'){&PostOpen}
elsif($fc eq 'delete'){&MsgDelete}
elsif($fc eq 'del'){&AdminPassCheck;&MsgDelete}
elsif($fc eq 'continue'){&ImgContinue}
elsif($fc eq 'pch_size'){&SetPCH_Size}
elsif($fc eq 'help'){&HelpOpen}
elsif($fc eq 'admin'){&AdminPageOpen}
elsif($fc eq 'reflesh'){&AdminPassCheck;&MsgReflesh;&PageOpen}
elsif($fc eq 'restore'){&AdminPassCheck;&Restore}
elsif($fc =~ /paint|open/){&PaintOpen}
&PageOpen;
}
#############################################################
#Page Open
#
sub PageOpen{
&call('PageOpen');
$FORM{'mode'}=$MODE_TOGGLE_TURN[0] if($FORM{'mode'} eq '');
if($fc eq 'write'){&CookieWrite}
elsif($fc eq 'rev'){
&call('Receive');
if(-e $cookie_file){&GetFileCookie}else{&GetCookie}$fc='page';
}
else{
&GetCookie;
if(!"$fc$FORM{mode}$FORM{sort}"){
$FORM{mode} = $COOKIE{mode} if($COOKIE{mode});
$FORM{sort} = $COOKIE{sort} if($COOKIE{sort});
}
if($COOKIE{mode} ne $FORM{mode} || $COOKIE{sort} ne $FORM{sort}){
&GetDate();
&CookieWrite;
}
}
&CatalogOpen if($FORM{'mode'} eq 'catalog' && $fc ne 'rev');
$FORM{'page'}=1 if ($FORM{'page'} eq '');
$page=(($FORM{'page'}-1) * $ViewMessage);
&FileLogList;
if ($LogTotal == 0 && !$adminMode){&FastBoot};
&PageForm;
&GetBrowse;
$LayerForm_Use=($USER_OS=~/Win/ && $AGENT eq 'MSIE')?$LayerForm_Use:0;
print "Content-type: text/html\n$Exp\n";
&HTML_HEAD;print $SKIN_MAIN_FORMAT;
#Administrator Mode View
if($adminMode){
$REFLESH='
'if$index_reflesh_Use;
print <
$ADMIN_FUNCTION
"
}else{
$Image = ""
}
}
if($RES_Enable){
$Image = "".$Image.'';
}else{
$Image = "".$Image.'';
}
}else{
$Image = ' /img);$LineCntCapa*=2;
$LineCntCapa+=($mesg =~ s/\n/
EOF
exit
_SUB_
} #Restore
#############################################################
#
sub HelpOpen{eval << '_SUB_';
print "Content-type: text/html\n$Exp\n";
print <
* Administrator Mode *
$login$REFLESH
「$FileSave_DIR」is analyzing the files in the directory.
Entire log size as well as entire image size has been collected here.
$PAGE_FormTAG
EOF
}
for($n=$page,$cnt=0;($cnt < $ViewMessage && $cnt < $LogTotal);$n++,$cnt++){
&fl($fileNo[$n]);
if(-e "$LogFile") {
open(MSG,$LogFile);@FileData=
$SKIN_MODE_INPUT
DEL
print $DEL_FUNCTION;
##############################################################
}
}
}
&HTML_FOOT;
exit
}
sub CatalogOpen{
$CATALOG_View = $ViewMessage = $CATALOG_W * $CATALOG_H;
$FORM{'page'}=1 if ($FORM{'page'} eq '');
$page = (($FORM{'page'}-1) * $CATALOG_View);
&FileLogList;
&PageForm;
&GetCookie;
if($COOKIE{mode} ne $FORM{mode} || $COOKIE{sort} ne $FORM{sort}){
&GetDate();
&CookieWrite;
}
print "Content-type: text/html\n$Exp\n";
&HTML_HEAD;print $SKIN_MAIN_FORMAT;
$CATALOG_View = $LogTotal if($LogTotal < $CATALOG_View);
print <
HTML
&HTML_FOOT;
exit
}
#---------------
HTML
for($n=$page,$cnt=0,$Tcnt=$CATALOG_W;($cnt < $CATALOG_View && $n < $LogTotal);$n++){
&fl($fileNo[$n]);
if(-e "$LogFile") {
$LogSize=-s $LogFile;
open(MSG,$LogFile);@FileData= ";
$Tcnt=$CATALOG_W;
if($cnt < $CATALOG_View){
print "
Animation Data ( '.$Csize." KB )
$CTitle ($Cname)
No image
'
}
if($Cthumb =~ /(\.pch$|\.jpeg$)/){
$Anim = '*Animation Available';
}
print " ";
$Tcnt--;$cnt++;
if(($cnt) % $CATALOG_W ==0){
$a = $cnt % $CATALOG_W;
print "$Image $CATALOG_FONT DATE : $Cdate
$Anim $CATALOG_FONT_END$admintag\n";
}
}
}
}
for(;($Tcnt > 0)&&($Tcnt != $CATALOG_W);$Tcnt--){
print ' \n";
}
}
print < ';
if($Tcnt-1 == 0){
print "
Please change your content and try again.');
}
}
}
_SUB_
}
####################################################
#Refreshing the info onto index.html
#
sub MsgReflesh{eval << '_SUB_';
if($index_reflesh_Use){
&call('MsgReflesh');
$MsgRefleshFlag=1;
&FileLogList;
filelock;
local(@back)=($fc, $adminMode, $LayerForm_Use, $name, $mail, $url, $flower);
$LayerForm_Use=$adminMode=0;
$name=$mail=$url=$flower=$fc="";
&PageForm;
push @back, $PAGE_FormTAG;
$PAGE_FormTAG =~ s/(name=password value=)\w*>/$1>/sg;
open(INDEXFILE,">$IndexFile");
select INDEXFILE;
&HTML_HEAD;
print $SKIN_MAIN_FORMAT;
for($n=0;($n < $ViewMessage && $n < $LogTotal);$n++){
&fl($fileNo[$n]);
if(-e "$LogFile") {
$LogSize=-s $LogFile;
open(MSG,$LogFile); @FileData=';
}
last
}
}
$Next=0;
$PAGE_FormTAG .= $PageTag.' ';
$PAGE_FORM_FLAG=1;
}
}
####################################################
#Admin Password Insertion Area
#
sub AdminPageOpen{eval << '_SUB_';
&call('AdminPageOpen');
&GetCookie;
if($password eq $passwrd){$FORM{'password'}=$passwrd;$adminMode =1;$login='Automatic Login
';&PageOpen}
$TXT_ADMIN='Please enter your administrator password.
'if(!$TXT_ADMIN);
print "Content-type: text/html\n\n";
print <
$TXT_ADMIN
Please go back and enter in the required elements.')}
if($title eq ""&&$Input_Title){errorexit ('post','You have not entered your title.','You have not enter your title.
Please go back and enter in the required elements.')}
if($mesg eq ""){errorexit ('post','You have not entered your message.','You have not enter your message.
Please go back and enter in the required elements.')};
&MsgConvert;
_SUB_
}
sub MsgConvert{eval << '_SUB_';
&call('MsgConvert');
if(!$mail && $Input_Mail){
if($fc eq 'captor'){print "Content-type: text/plain\n\nerror\n Error! \n Your email address has not been entered. \n Please go back and enter in the required elements.";exit};
errorexit ('post','You have not entered your email address.','You have not enter your email address.
Please go back and enter in the required elements.')
}
if(length $mail > 0 && $mail !~ /(.*)\@(.*)\.(.*)/){errorexit ('post','You have entered an incorrect email address format.','Please only use letters and numbers.')}
if(length $name > $Maxnamelen){$len=length $name;errorexit ('post','Your name contains too many characters.',"Please go back and try again.
You currently have $len<\/FONT> characters. \ This board's character limit is $Maxnamelen characters.<\/FONT>")}
if(length $title > $Maxtitlelen){$len=length $title;errorexit ('post','Your title contains too many characters.',"Please go back and try again.
You currently have $len<\/FONT> characters. \ This board's character limit is $Maxmaillen characters.<\/FONT>")}
if(length $mail > $Maxmaillen){$len=length $mail;errorexit ('post','Your email address contains too many characters.',"Please go back and try again.
You currently have $len<\/FONT> characters. \ This board's character limit is $Maxmaillen characters.<\/FONT>")}
if(length $url > $MaxURLlen){$len=length $url;errorexit ('post','Your URL contains too many characters.',"Please go back and try again.
You currently have $len<\/FONT> characters. \/ character limit. $MaxURLlen characters.<\/FONT>")}
if(length $mesg > $Maxmesg){$len=length $mesg;errorexit ('post','Your message contains too many characters.',"Please go back and try again.
You currently have $len<\/FONT> characters. \ This board's character limit is $Maxmesg characters.<\/FONT>")}
$RankCmt=$RankCmt+$mesglen;
#-------------------------- Tag Usage -------------------------------
if($TAGS_Use){
local($msg,$end,@parts,@NeedCnt,$pre_flag);
$mesg =~ s/\<\;BR>/\n/ig;
$mesg =~ s/\<\;P>/\n\n/ig;
my @parts = split(/(>)/,$mesg);
my $end = pop @parts;
foreach(@parts){
if(index $_,'<' > -1){
local($n,$aliment,$need,$slash,@l);
foreach $need(@l=@OKTags){
($need,@tag_element) = split /:/,$need;
if(s/\<\;(\/)?$need(.*|$)/<$1$need/i){
$slash=$1;
if($need eq 'PRE'){
$pre_flag = $pre_flag != 1?1:0;
}
if($slash eq ''){
$NeedCnt[$n]++;
}else{
$NeedCnt[$n]--;
}
if(!$pre_flag){
$aliment = $2;
$aliment =~ s/\=/\&equ\;/gi;
$aliment =~ s/\&equ\;\"\;([\w-.!~*'();\/?:\@\&\+\$,%\#\x80-\xFF]+)\"\;(\s|$)/\&equ\;\"\;$1\e\"\;$2/g;
$URLAutoLink=0 if($need eq 'A');
if($need eq 'FONT'){
$aliment =~ s/\bSIZE\&equ\;\"\;(\w*)(?:\e)\"\;/size=\"$1\"/i;
$aliment =~ s/\bCOLOR\&equ\;\"\;([\w\#]*)(?:\e)\"\;/color=\"$1\"/i;
$aliment =~ s/\bFACE\&equ\;\"\;(.*)(?:\e)\"\;/face=\"$1\"/i;
}elsif($need eq 'DIV'){
$aliment =~ s/\bALIGN\&equ\;\"\;(CENTER|LEFT|RIGHT)(?:\e)\"\;/align=\"$1\"/i;
}
foreach $e(@tag_element){
$aliment =~ s/(\s*)$e\&equ\;\"\;([^ ]*)(?:\e)\"\;/$1$e\=\"$2\"/si;
}
undef %tag_element;
}elsif($need ne 'PRE'){s/\<\;/}
$aliment =~ s/(?:\e|\"\;|\&equ\;)//g;
$aliment =~ s/(?: *)$//g;
last
}
$n++
}
$_.=$aliment
}
$msg .= $_
}
$n=0;
my($error,$tag,$s);
foreach(@NeedCnt){
if($_>0){
($tag) = split /:/,$OKTags[$n],1;
$s = "$_ places" if $_>1;
$error.= "<$tag>$s ";
}
$n++
}
errorexit ('post','You have not closed one fo your tags.',"$errorIn order for message to send, you MUST make sure all of your tags are closed.")if($error);
$mesg = $msg.$end;
}
#----------------------------------------------------------------------
#Linkage
if($URLAutoLink){$mesg =~ s/https?:\/\/([-_.!~*'()\w;\/?:\@&=+\$,%#]+)/http\:\/\/$1<\/A>/ig};
if($MailAutoLink){$mesg =~ s/mailto\:([\w\.\?\#\_\:\;\/\%\&\$\"\!\'\(\)\=\~\^\-\+\|\@]*)/$1<\/A>/ig};
#Breaks
$mesg=~ s/\x0D\x0A/\n/g;
$mesg=~ s/\x0D/\n/g;
$mesg=~ s/\x0A/\n/g;
if($Msg_Quotation){
for($m=0;$m<2;$m++){$mesg=~ s/(^|\n)(>|>|#)(.+)(\n|$)/$1$Msg_Quot_Font$2$3$Msg_Quot_Font_End$4/g}
}
$LineCntCapa=($mesg =~ s/\n\n/
/img);
if($LineCntCapa > $MaxLine){errorexit ('post','Your message contains too many lines.',"Your message contains too many lines.
You currently have $LineCntCapa lines. \ The board's limit is $MaxLine lines.")};$mesg_log=$mesg;
if(($flower eq "1"||$Panic_Mode == 1)&&$Panic_Mode != 2){&Panic(*mesg,$PanicTable,$PanicDat);}
_SUB_
}
sub MsgConvEsc(){
($_,$c)=@_;
if($c == 1){
$$_ =~ s/http\:\/\///g;
$$_ =~ s/ftp\:\/\///g;
$$_ =~ s/mailto\:\/\///g;
$$_ =~ s/ //g;
}else{
$$_ =~ s/\"/\"\;/g;
$$_ =~ s/\<\;/g;
}
$$_ =~ s/\t//g;
}
#############################################################
#Message Form
#
sub MsgWrite{
# jcodeLE.pl is Copyrighted to Yui Suzuki
Please go back and try again.')};
if($mesg eq ""){errorexit ('post','Your message has not been entered.','Your message has not been entered.
Please go back and try again.')};
&MsgConvEsc(\$name);
&MsgConvEsc(\$mesg);
&MsgConvEsc(\$flower);
&MsgConvEsc(\$mail,1);
&MsgConvEsc(\$url,1);
if($jcode_pl=~/jcode/){
&jcode'convert(*name,"sjis");
&jcode'convert(*mesg,"sjis");
}
&MsgConvert;
}
}#>>Captor
if(($fc ne "write")&&(length $FORM{'ExpHead'} > 0)){
local(@head,$s,$t,$f);
$s = substr $FORM{'ExpHead'},0,1;
if($s eq 'a'){$t='\=';$f='&'}else{$t="\t";$f="\f"}
@head=split(/$f/, $FORM{'ExpHead'});
foreach (@head){
local($_, $val)=split(/$t/);
&unescape(\$val);
&jcode'convert(*val,"sjis") if($jcode_pl=~/jcode/);
$$_=$val
}
&MsgConvEsc(\$name);
&MsgConvEsc(\$app);
&MsgConvEsc(\$mail,1);
&MsgConvEsc(\$url,1);
&MsgConvEsc(\$title);
&MsgConvEsc(\$mesg);
&MsgConvEsc(\$flower); $FORM{'flower'}=$flower;
&MsgConvEsc(\$passwrd); $FORM{'password'}=$passwrd;
&MsgConvEsc(\$newpass);
&MsgConvEsc(\$agent);
&MsgConvEsc(\$anime_speed);
$browse=$agent if(length $agent > 0);
&MsgConvert
}
$paint_time='' if(!$PaintTime_Use);
$app = $App if $app eq "";
if($paint_time){
&MsgConvEsc(\$paint_time);
&MsgConvEsc(\$paint_add);
$paint_time=int($paint_time-$paint_add);
if($paint_time > 0){
local($p_day,$p_hour,$p_min,$p_sec);
$TIME = time + $TIME_DIFF_SEC;
$paint_time = $TIME - $paint_time;
if($paint_time > 86400){
$p_day = int $paint_time / 86400;
$paint_time = $paint_time - ($p_day*86400);
}
if($paint_time > 3600){
$p_hour = int $paint_time / 3600;
$paint_time = $paint_time - ($p_hour*3600);
}
if($paint_time > 60){
$p_min = int $paint_time / 60;
$paint_time = $paint_time - ($p_min*60);
}
$p_sec = $paint_time;
$p_day=$p_day == 0?'':$p_day.'Day';
$p_hour=$p_hour == 0?'':$p_hour.'Hour';
$p_min=$p_min == 0?'':$p_min.'Min';
$p_sec=$p_sec == 0?'':$p_sec.'Sec';
$paint_time = $p_day.$p_hour.$p_min.$p_sec;
}
}else{$paint_time=''}
&CountFileOpen;
$s = length $FORM{'file'};
&FileAnalyze('file',$FileSave_DIR,$FileNameHead);
if($app eq 'pai' && $FORM{'file_length'} > $MaxPaintData){
errorexit ('1','Your image data size is over the maximum limit.',$MaxPaintData.'byte is the maximum data size limit. Your image is currently'.$FORM{'file_length'}.' byte');
}elsif($fc eq 'write' && $FORM{'file_length'} > $MaxUpLoadData){
errorexit ('post','Your upload image data size is over the maximum limit.',$MaxUpLoadData.'byte is the maximum data size limit for uploading. Please go back and make the correct adjustments.');
}
if(length $FORM{'thumbnail'} > $MaxThumbnailData){
errorexit ('post','Your thumbnail data size is too big.',$MaxThumbnailData.'byte is the maximum data size limit for thumbnails. Please go back and make the correct adjustments.');
}
&FileAnalyze('thumbnail',$FileSave_DIR,$ThumbnailNameHead);
&FileAnalyze('animedata',$FileSave_DIR,$ThumbnailNameHead);
&PostCheck;
filelock;
$crypt_pass=$crypt_Use ? crypt($passwrd,'ID'):$passwrd if($passwrd ne "");
if($FORM{'file_length'} > 0 ){
if($maxImageWidth < $FORM{'file_width'}||$maxImageHeight < $FORM{'file_height'}){
fileunlock;
errorexit ('post','Your image width and height is too big.', $maxImageWidth.'x'.$maxImageHeight.'is the maximum image dimensions.
Your current dimensions are '.$FORM{'file_width'}.'x'.$FORM{'file_height'})
}
&call('FileSave');
&ImgReplace;
&FileSave
}else{$FORM{file_name}=$FORM{file_length}=""}
if($FORM{'file_name'} eq ""&&$NotCommentOnlyPost&&$interrupt eq ""&&$add_Thread eq ""){
fileunlock;
errorexit ('post','You cannot olny post messages.', 'Messages must be accompanied by an image.
')
}
if($add_Thread eq ""||$interrupt){
my $log_thumb = $FORM{animedata_name}?$FORM{animedata_name}:$FORM{thumbnail_name};
if($interrupt){
if(!&PasswordCheck($FORM{'interpass'},&GetMsgPassword($interrupt))){errorexit ('1','Incorrect password.','Inncorect password!
Please go back and try again.')};
chomp $line;
($ac_msgcnt,$_,$_,$_,$_,$_,$_,$_,$_,$_,$FORM{'file_name'},$FORM{'file_width'},$FORM{'file_height'},$FORM{'file_length'},$_,$log_thumb,$paint_time,$app,$MSG_ADD_FORMAT)=split(/\t/,$line)
}else{
$ac_Thread++;
&FileLogWrite($FORM{'file_name'},$log_thumb,$ac_Thread);
&fl($ac_Thread)
}
if($fc eq 'captor'){
$c_flag=1 if(!$name || !$mesg);
my $c_pass = $passwrd ? $passwrd:&randstr;
$crypt_pass=$crypt_Use ? crypt($c_pass,'ID'):$c_pass;
open(CREV,">>$cookie_file");
&call('CookieLog');
print CREV time."\t$id\t$ac_Thread\t$c_flag\t$c_pass\t$name\t$mail\t$url\t$passwrd\t$flower\t$FORM{'file_name'}\t$app\n";
close(CREV);
}
open(MSGFILE,">$LogFile");
#LOG WRITE FORMAT
$MsgFormat="$ac_msgcnt\t$name\t$C_date\t$title\t$mail\t$url\t$mesg\t$HOST\t$IP\t$browse\t$FORM{'file_name'}\t$FORM{'file_width'}\t$FORM{'file_height'}\t$FORM{'file_length'}\t$crypt_pass\t$log_thumb\t$paint_time\t$app\t$MSG_ADD_FORMAT";
$MsgFormat=~s/\n//g;$MsgFormat.="\n";
&call('Log_Write');
print MSGFILE $MsgFormat;
local($Logcnt)=1;
if($interrupt){
foreach (@FileData){print MSGFILE}
}
}
else{
#----------------Cache Reposting
#CHECK
&fl($add_Thread);
if($MaxResmesg < -s $LogFile){
fileunlock;
errorexit ('post','You have already posted a comment for this message.', 'You can no longer post another message in this slot.
Please create a new heading.');
}
&call('Log_AddWrite');
open(MSGFILE,"<$LogFile");@FileData=
Please go back and try again.')}
}
&call('MsgDelete');
if($FORM{'No'} =~ /(\d+)\-(\d+)/){
local($ThredID)=$1;local($AesNo)=$2;
filelock;
&fl($ThredID);
open(MSG,">$LogFile");
local($cnt)=0;
foreach (@FileData) {
$cnt++;
@l=split(/\t/,$_,2);
print MSG if($AesNo ne $l[0]);
}
close(MSG);
fileunlock;
&MsgReflesh;
}
elsif($FORM{'No'} =~ /(\d+)/){
&fl($FORM{'No'});
if(-e "$LogFile") {
filelock;
open(MSG,"<$LogFile");@FileData=
Please choose a number between 0-99';
errorexit ('1','エラー',$E) if($W == 0||$H == 0||$W > 999||$H > 999);
&fl($FORM{'No'});
if(-e "$LogFile") {
open(MSG,$LogFile);@FileData=
Please so back and try again.')if($FORM{'password'} ne $password &&!&PasswordCheck($FORM{'password'},$l[14]));
}
$pch="$FileSave_DIR/$l[10]";
if(open(PCH,"<$pch")){
binmode(PCH);
$PCHSIZE = -s $pch;
read(PCH, $PCHHEAD, 10);
read(PCH, $PCHDATA, $PCHSIZE-10);
close PCH;
if($PCHHEAD =~ /(\x1F\x8B\x08\x00)\x00{6}/){
filelock;
$s = pack("v",$FORM{'speed'});
$w = pack("v",$FORM{'width'});
$h = pack("v",$FORM{'height'});
open(PCH,">$pch");binmode(PCH);
print PCH "$1$s$w$h$PCHDATA";
open(MSG,">$LogFile");
$l[11]=$FORM{'width'};
$l[12]=$FORM{'height'};
print MSG join "\t",@l;
print MSG foreach(@FileData);
close (PCH,MSG);
fileunlock;
}else{errorexit ('1','Error!','The data you have submitted cannot be entered.')}
}
&PageOpen
_SUB_
}
sub ImgContinue{eval << '_SUB_';
errorexit ('2','Error!','This program does not that capability!')if(!$Image_Continue_Use);
&GetBrowse;&GetCookie;
if($Input_Mail){
$FORM{mail}=$mail if $mail;
if($FORM{mail} =~ /(.*)\@(.*)\.(.*)/){
&CookieWrite;
} else {
my $t = '*Your email format is incorrect.
Please enter letters and numbers.'if $FORM{mail};
errorexit ('c','Please enter an email address.',"$t
You are required to enter your email address.")if!$mail;
}
}
my $cFlag;
&fl($FORM{No});
if(open(LOG,"<$LogFile")) {
$_=
Please go back and try again.')
unless($FORM{'password'} eq $password ||
&PasswordCheck($FORM{'password'},$l[14]) ||
!$Image_Continue_Pass ||
$Image_Continue_Pass==2 && $FORM{'t'} eq 'new'
);
if($cFlag == 3){
if($l[10] =~/\.jpeg$|\.pch$/){
$Lfile=$l[10];
}elsif($l[15] =~/\.jpeg$|\.pch$/){
$Lfile=$l[15];
}elsif($animesrc=~/\.jpeg$|\.pch$/){
$Lfile=$animesrc;
}else{errorexit ('2','Error!',$err)}
$FORM{'anime'}='true';
}elsif($cFlag == 2 && $l[10] =~/\.jpg$|\.gif$/){
$Lfile=$l[10];
$FORM{'anime'}='false';
}else{errorexit ('2','Error!',$err)}
$pch = "$FileURL_DIR/$Lfile";
$FORM{'width'} = $l[11];
$FORM{'height'} = $l[12];
$l[16]=~ s/(\d+)Day//; $p_day = $1;
$l[16]=~ s/(\d+)Hour//; $p_hour= $1;
$l[16]=~ s/(\d+)Min//; $p_min = $1;
$l[16]=~ s/(\d+)Sec//; $p_sec = $1;
$paint_add_time = ($p_day*24*3600)+($p_hour*3600)+($p_min*60)+$p_sec;
if($sii_archive=~/applet\.cgi/){
if(-e 'pch.cgi'){$pch = "pch.cgi?$Lfile"}
elsif(-e '../pch.cgi'){$pch = '../pch.cgi?'.$Lfile}
else{errorexit ('1','pch.cgi cannot be found.','In order to continue the animationa nd this image, you have have pch.cgi.
Please go to WonderCatStudio to obtain a copy.')}
$pch = "pch.cgi?$Lfile"
}
&escape(\$LOG_app);&escape(\$FORM{'password'});&escape(\$FORM{'newpass'});&escape(\$browse);
$cgi_param.="&mode=$FORM{'t'}&No=$FORM{'No'}&app_add=$l[17]&passwrd=$FORM{'password'}&newpass=$FORM{'newpass'}";
$param = $Lfile=~/\.pch$|\.jpeg$/?'pch_file':'image_canvas';
$PARAM_SII.="";
$SII_ARGUMENT.=$cgi_param;
&PaintOpen;
}
$OKj=$OKj==1 ? '':'';
$OKp=$OKp==1 ? '':'';
if($Image_Continue_Pass){$PINPUT ="Password:"}
else{$PINPUT =""}
print "Content-type: text/html\n$Exp\n";
&HTML_HEAD;
print <
Continue No.$FORM{No}
$OKb$Image
[BACK]
Emails can only contain letters and numbers.'if $FORM{mail};
errorexit ('c','Please enter your email address.',"$t
Your email address must be entered for the action to work.")if!$mail;
}
$SII_ARGUMENT.="&mail=$mail";
}
errorexit ('p','Error','「'.$paint_cgi.'」cannot be found.
This file is important for all WCS boards 7.0 and over.')if(!-e $paint_cgi);
require $paint_cgi;
errorexit ('1','Oekaki update error.','「paint.cgi」'.$PAINT_VERSION.' and '.$BBS_Version.' cannot be used together.
Please make sure the version of the two files match.') if($PAINT_VERSION ne 'Blue Pencil');
if($fc eq 'paint_sii'){&Open_sii}
elsif($fc eq 'paint_pai'){&Open_pai}
elsif($fc eq 'paint_pic'){&Open_pic}
elsif($fc eq 'open_pch'){&Open_pch}
else{&Open_sii}
_SUB_
}
sub Restore{eval << '_SUB_';
$TotalMsgByte=0;
$TotalIMGByte=0;
$ThreadID=0;
$IMG_ID=0;
$MSG_ID=0;
$MSG_CNT=0;
&GetDate();
if(! opendir DIR,$FileSave_DIR){errorexit ('1','Directory cannot be opened.','「'.$FileSave_DIR.'」cannot be opened.
Please go check your config.cgi file.')};
while ($_=readdir DIR){
if($_ =~ /$MessageNameHead.*\.log/){
push @FileList,$_;$MSG_CNT++;
}
}
if($FORM{'filelog'} eq ""&&$FORM{'countlog'} eq ""){$analyze=1};
print "Content-type: text/html\n\n";
$TITLE=$analyze==1?'Analysis':'Restore';
print <Directory $TITLE
Log File(Size)
Message ID
Image
Size
Thumbnail
Size
EOF
#SORT
@FileList=reverse sort @FileList;
if($FORM{'filelog'}){open(FLOG, ">$FORM{'filelog'}")}
foreach (@FileList){
$MSG_SIZE=-s "$FileSave_DIR/$_";
open(MSG,"<$FileSave_DIR/$_");@LOG= \n";
$TotalMsgByte +=$MSG_SIZE;
}
$MSG_ID++;$IMG_ID++;
if($FORM{'countlog'}){open(CLOG, ">$FORM{'countlog'}");
print CLOG "$ThreadID\t$MSG_ID\t$IMG_ID\n";
close(CLOG)}
if($FORM{'filelog'}){close(FLOG)}
print <".$_." \( $MSG_SIZE byte\) ";
$_f_ID=''; $_f_src=''; $_f_sum='';
$_ =~ s/$MessageNameHead(.*)\.log//;
if($ThreadID < $1){$ThreadID=int $1};
$_f_ID=int $1;
($AC_msgcnt,$name,$date,$title,$mail,$url,$mesg,$HOST,$IP,$BROWSER,$FileSRC,$FileW,$FileH,$FileSize,$_,$ThumbnailName,$Paint_Time)=split(/\t/,shift @LOG);
$IMG_SIZE=0;$IMG_F="";$IMG_S="";
if($FileSRC){$IMG_SIZE=-s "$FileSave_DIR/$FileSRC";
$TotalIMGByte+=$IMG_SIZE;
if($IMG_SIZE > 0){
$IMG_F="○ \($IMG_SIZE byte\)";
$_f_src="\t".$FileSRC;
}else{$IMG_F='× Not Found'}
}
if($ThumbnailName){$IMG_SIZE=-s "$FileSave_DIR/$ThumbnailName";
$TotalIMGByte+=$IMG_SIZE;
if($IMG_SIZE > 0){
$IMG_S="○ \($IMG_SIZE byte\)";
$_f_sum="\t".$ThumbnailName;
}else{$IMG_S='× Not Found'}
}
foreach (@LOG){
chomp ;@Re=split(/\t/);
$date=$Re[2];
}
$date =~ /^(\d*)\/(\d\d)\/(\d\d).*(\d\d\:\d\d)$/;
$date="\($1\/$2\/$3\[$4\:00\]\)";
if($FORM{'filelog'}){print FLOG "$_f_ID$date$_f_src$_f_sum\n"}
if($FileSRC =~ /$FileNameHead(.*)\.(png|jpg|gif)/){
if($IMG_ID < $1){$IMG_ID=$1};
}
if($AC_msgcnt =~ /(\d*)/){
if($MSG_ID < $1){$MSG_ID=$1};
}
foreach (@LOG){
@Re=split(/\t/);
if($Re[0] =~ /(\d*)/){
if($MSG_ID < $1){$MSG_ID=$1};
}
}
print "$AC_msgcnt $FileSRC $IMG_F $ThumbnailName $IMG_S
EOF
if(!$analyze){print "FileLog \: $FORM{'filelog'}
Log Number
Slot ID
Image ID
Message ID
Total Message Log Size
Total Image Data Size
$MSG_CNT
$ThreadID
$IMG_ID
$MSG_ID
$TotalMsgByte byte
$TotalIMGByte byte
CountLog \: $FORM{'countlog'}
as been restored."}
print <
EOF
print $TXT_HELP_SII if($siiApplet_Use);
print $TXT_HELP_OHONO if($PictureBBSApplet_Use);
print $TXT_HELP_NINA if($BBSPainterApplet_Use);
print <
$F BBS Configurations
*Canvas's biggest resolution is "at the image's greatest resolution".$F Maximum log entries $F $LogMax entries $F Maximum message size $F $Maxmesg byte $F Maximum response message size $F $MaxResmesg byte $F Maximum paint image size $F $MaxPaintData byte $F Maximum animation data size $F $MaxAnimeData byte $F Maximum thumbnail data size $F $MaxThumbnailData byte $F Maximum upload data size $F $MaxUpLoadData byte $F Maximum received resolution $F $maxImageWidth x $maxImageHeight
EOF
if($TAGS_Use){
print '$F Maximum canvas size $F $viewLimitW x $viewLimitH ';
}
print <'.$F.' Listed below are tags you can use. *Tags must be closed in order for message to send.
';
foreach(@OKTags){print "\<\;$_\>\;\ \;"}
print '$E_TITLE<\/H1>
$E_BODY
$TXT_ERROR/si;
$SKIN_MAIN_FORMAT=$_;
&PostForm;
print $SKIN_MAIN_FORMAT;
&HTML_FOOT;
exit;
}elsif($E_Flag eq "ref"){
$REF = "\n";
}
print "Content-type: text/html\n$Exp\n" if($E_Flag ne 'skin');
eval '&skin("SKIN_ERROR_HTML")';
$_=$SKIN_ERROR_HTML;
if(!$_){
print <
$E_TITLE
$E_BODY
$TXT_ERROR