#!/usr/local/bin/perl
#==============================================================================
# sha-mail diary Version 0.1
#==============================================================================
#’Æü’ËÜ’¸ì’¥³’¡¼’¥É’ÊÑ’´¹’¥â’¥¸’¥å’¡¼’¥ë
require './jcode.pl';
require './mimew.pl';
$datad = 's-data';
$web = 'http://ftvjapan.ddo.jp/~funa/sha';
$newd = 's-new';
$prfile = 'pr.html';
$catef = 'cate.txt';
$userd = '/home/funa/sha/s-user';
$tbbsd = '/home/funa/public_html/sha/tbbs';
$cntd = '/home/funa/public_html/sha/cntdir';
$cated = '/home/funa/public_html/sha/s-cate';
$mailprog = '/usr/sbin/sendmail'; # mail system
$admin = 'funa@cc.seikei.ac.jp';
$jsky = 'J-PHONE';
$imode = 'DoCoMo';
$ezweb ='UP.Browser';
$wwwc = 'WWWC';
$iria = 'Iria';
$ninja = 'Internet Ninja';
$iria = 'Iria';
$pockey = 'Pockey';
$ie = 'Mozilla';
$mmse = 'MMSE';
$pockey = 'Pockey';
$mmse = 'MMSE';
@scate = ("’̵","’¼Ì","’¥¢","’Ãå","’ÂÔ","’¥¤","’Àë","’¿Í","’À®","’ÊÑ","’ÃË","’½÷","’Ʊ","’¾");
&getcate();
if ($ENV{'REQUEST_METHOD'} eq "POST") {
read(STDIN, $formdata, $ENV{'CONTENT_LENGTH'});
} else { $formdata = $ENV{'QUERY_STRING'}; }
@pairs = split(/&/,$formdata);
foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
# $value =~ s/</g;
# $value =~ s/>/>/g;
$value =~ s/\n//g;
# $value =~ s/^M/
/g;
$value =~ s/\,//g;
&jcode'convert(*value,'sjis');
$FORM{$name} = $value;
}
$ADD = $FORM{'add'};
$CATE = $FORM{'cate'};
$KEYON = $FORM{'KEYON'};
$COMM = $FORM{'comm'};
$ACT = $FORM{'ACT'};
$ST = $FORM{'ST'};
$FILE = $FORM{'file'};
$USER = $FORM{'user'};
$B5 = $FORM{'B5'};
$B2 = $FORM{'B2'};
$B7 = $FORM{'B7'};
$agent = $ENV{'HTTP_USER_AGENT'};
$REA = $ENV{'REMOTE_ADDR'} ;
if(($agent =~ /$wwwc/) || ($agent =~ /$pockey/) || ($agent =~ /$mmse/)
|| ($agent =~ /$iria/) || ($agent =~ /$ninja/ )){
exit;
}
if($REA =~ /210.224.177.59/){
print "(TT)/22PK=>9758PK\n";
exit;
}
&getcolor();
$title ="’¼Ì’¥á’¡¼’¥ëde’¥¦’¥¨’¥Ö";
print "Content-type: text/html\n\n";
print "
\n"; print "
\n"; if(($agent =~ /$wwwc/) || ($agent =~ /$pockey/) || ($agent =~ /$mmse/) || ($agent =~ /$iria/) ){ exit; } #print "’¼Ì’¥á’¡¼’¥ëde’¥¦’¥¨’¥Ö
\n"; if ($ACT eq "DEL") { &delreq();} if ($ACT eq "DELDO") { &deldo();} if ($ACT eq "SHOW") { &show();} if ($ACT eq "NEW") { &new();} if ($ACT eq "RM") { &rm();} if ($ACT eq "RMDO") { &rmdo();} if ($ACT eq "TUHO") { &tuhoreq();} if ($ACT eq "TUHODO") { &tuhodo();} if ($ACT eq "NOAMAIL") { &noamailreq();} if ($ACT eq "NOAMAILDO") { &noamaildo();} if ($ACT eq "MAIL") { &mailreq();} if ($ACT eq "MAILDO") { &maildo();} if ($ACT eq "PAMAIL") { &pamail();} if ($ACT eq "PAMAILDO") { &pamaildo();} if ($ACT eq "CNTSHOW") { &cntshow();} if ($ACT eq "PGSHOW") { &pgshow();} if ($ACT eq "PGSHOW2") { &pgshow2();} if ($ACT eq "CATENEW") { &catenew($CATE);} if ($ACT eq "SHOWCATE") { &showcate();} if ($ACT eq "KEYSHOW") { &keyshow();} if ($ACT eq "KEYNEW") { &keynew($KEYON);} if ($ACT eq "USERS") { &users();} if ($ACT eq "USERLOOK") { &userlook($B2);} exit ; # print "ACT = $ACT\n"; # print "user = $USER\n"; # print "file = $FILE\n"; &error("WAHTS? ACTION $ACT"); # print "’¼Ì’¥á’¡¼’¥ëde’¥¦’¥¨’¥Ö\n"; &getpr(); print "\n"; exit ; ### END PROGRAM #### sub pgshow { # print "’¼Ì’¥á’¡¼’¥ëde’¥¦’¥¨’¥Ö \n"; # print "\n"; &getpr(); print "’¥Ú’¡¼’¥¸’¿ô’½ç’¥é’¥ó’¥’¥ó’¥°50\n"; $FILE = "$datad"; $next = $ST + 1; $total = 0; # $LS = `/bin/ls -1t $FILE | /usr/bin/head -$st | /usr/bin/tail -20 `; $LS = `/bin/ls -1t $FILE| /bin/sort -r `; $WC = `/bin/ls -1t $FILE | /usr/bin/wc -l`; @LIST = split(/\s+/, $LS) ; @aa = (); foreach $LIST (@LIST) { $cnt = `/bin/ls -1t $datad/$LIST/*.html | /usr/bin/wc -l`; $LIST =~ s/$datad//; $LIST =~ s/\///; $total = $total + $cnt; push (@aa , "$cnt $LIST"); #print "push $cnt , $LIST\n"; } @sorted = sort{$b<=>$a}@aa; @top = splice(@sorted ,0,50); foreach $list (@top) { #print "push list , $list\n"; ($cn, $book) = split(" ", $list); print "$book:$cn\n"; } print ""; print "\n"; print "\n"; exit ; } sub cntshow { # print "
\n"; print "total: $total(Pages)\n"; $bbs = "’¥Ú’¡¼’¥¸’¿ô’¥é’¥ó’¥’¥ó’¥°’¤Ë’¤Ä’¤¤’¤Æ"; print "’¥µ’¥Ý’¡¼’¥È’·Ç’¼¨’ÈÄ’¤Ø($bbs)
\n"; print "’»ä’¤â’¼Ì’¥á’¡¼’¥ëde’¥¦’¥¨’¥Ö’¤ä’¤ê’¤¿’¤¤!\n"; print "Powerd by funa\n"; print "
\n"; $cntdir = 'cnt'; &getcnt; print "’¼Ì’¥á’¡¼’¥ëde’¥¦’¥¨’¥Ö \n"; # print "\n"; &getpr(); print "’¥¢’¥¯’¥»’¥¹’½ç’¥é’¥ó’¥’¥ó’¥°50\n"; $FILE = "$cntd/*"; $total = 0; # $LS = `/bin/ls -1t $FILE | /usr/bin/head -$st | /usr/bin/tail -20 `; # $LS = `/bin/ls -1t $FILE`; $LS = `/bin/ls -1t $FILE | /usr/bin/head -200 `; $WC = `/bin/ls -1t $FILE | /usr/bin/wc -l`; @LIST = split(/\s+/, $LS) ; @aa = (); foreach $LIST (@LIST) { #print "push $cnt , $LIST\n"; open (NOTE,"$LIST") || exit; $cnt ="; print "\n"; print "; close(NOTE); $total = $total + $cnt; $LIST =~ s/$cntd//; $LIST =~ s/\///; push (@aa , "$cnt $LIST"); } @sorted = sort{$b<=>$a}@aa; @top = splice(@sorted ,0,50); foreach $list (@top) { #print "push list , $list\n"; ($cn, $book) = split(" ", $list); print "$book:$cn\n"; } print "
\n"; print "TOP200total: $total(PV)\n"; $bbs = "’¥¢’¥¯’¥»’¥¹’¿ô’¥é’¥ó’¥’¥ó’¥°’¤Ë’¤Ä’¤¤’¤Æ"; print "’¥µ’¥Ý’¡¼’¥È’·Ç’¼¨’ÈÄ’¤Ø($bbs)
\n"; print "’»ä’¤â’¼Ì’¥á’¡¼’¥ëde’¥¦’¥¨’¥Ö’¤ä’¤ê’¤¿’¤¤!\n"; print "Powerd by funa\n"; print "
\n"; $cntdir = 'cnt'; &getcnt; print "