#!/usr/local/bin/perl use Tk; $mw = new MainWindow; $Input = $mw->Entry(); $Conv = $mw->Button(-text=>"conv",-command=>\&conv); $Input->pack; $Conv->pack; MainLoop; sub conv{ local($_) = $Input->get; $Input->delete(0,end); foreach(split(/ +/,$_)){ if(/^0x(.*)/i){ $Input->insert(end,hex($1)." "); }else{ $Input->insert(end,sprintf("0x%x ",$_)); } } } diff -rcN QuickIRC28b/qi-cgi.conf QuickIRC28b_conf/qi-cgi.conf *** QuickIRC28b/qi-cgi.conf Thu Jan 1 09:00:00 1970 --- QuickIRC28b_conf/qi-cgi.conf Tue Jan 29 13:34:57 2002 *************** *** 0 **** --- 1,3 ---- + our $SERVER = 'irc.2ch.net'; + our $PORT = '6667'; + our $CODEBase = 'http://irc.2ch.net/tpchat/test/'; diff -rcN QuickIRC28b/qi-list.cgi QuickIRC28b_conf/qi-list.cgi *** QuickIRC28b/qi-list.cgi Fri Jan 25 19:28:08 2002 --- QuickIRC28b_conf/qi-list.cgi Tue Jan 29 13:23:43 2002 *************** *** 1,10 **** #!/usr/local/bin/perl -w # 接続先 ! my $server = 'irc.2ch.net'; ! my $port = '6667'; ! my $user = "hoge" . $$; # tpchat.cgi のURL my $tpchaturl ='qi-login.cgi'; --- 1,11 ---- #!/usr/local/bin/perl -w + require './qi-cgi.conf'; # 接続先 ! my $server = $SERVER; ! my $port = $PORT; ! my $user = "QIRC" . $$; # tpchat.cgi のURL my $tpchaturl ='qi-login.cgi'; diff -rcN QuickIRC28b/qi-login.cgi QuickIRC28b_conf/qi-login.cgi *** QuickIRC28b/qi-login.cgi Fri Jan 25 20:16:38 2002 --- QuickIRC28b_conf/qi-login.cgi Tue Jan 29 13:34:03 2002 *************** *** 1,4 **** --- 1,5 ---- #!/usr/local/bin/perl -w + require './qi-cgi.conf'; require 'jcode.pl'; use CGI; *************** *** 98,107 ****

! ! ! ! --- 99,108 ----

! ! ! ! diff -rcN QuickIRC28b/qi-login2.cgi QuickIRC28b_conf/qi-login2.cgi *** QuickIRC28b/qi-login2.cgi Sun Jan 27 08:38:00 2002 --- QuickIRC28b_conf/qi-login2.cgi Tue Jan 29 13:27:58 2002 *************** *** 1,4 **** --- 1,5 ---- #!/usr/local/bin/perl -w + require 'qi-cgi.conf'; require 'jcode.pl'; use CGI; *************** *** 93,102 ****
! ! ! ! --- 94,103 ----
! ! ! #!/usr/local/bin/perl ### ### HyperLinkable BBS ver 0.9.1 ### Scripted by White(white@jks.is.tsukuba.ac.jp) ### ### 実行のためには、以下の変数の値を各人の環境に合わせて設定してください。 ### $scriptdir スクリプトを置いてあるディレクトリ名 ### $scriptname このスクリプト自身の名前 ### $digestname 最新版htmlファイル名($scriptdirからの相対指定) ### $logdir 過去ログ保存のためのディレクトリ名 ### $logsize 記事いくつごとに過去ログを分けるかの数値 ### $viewstep 過去ログ閲覧時に、いくつを同時に表示するか ### $WWWdomain サーバーにhttpでアクセスするときのドメイン名 ### $WWWpath $scriptdirにhttpでアクセスするときのディレクトリ名 ### ### また、サブルーチンprinthtmlhead、printhtmlfoot、viewerror、writetoBoard ###  などのhtml部分についても記述を変更してください。 ### ## sample : ## board is "http://www.jks.is.tsukuba.ac.jp/~white/cgi-bin/board.(cgi|html)" ## $scriptdir = "/home/white/public_html/cgi-bin"; $scriptname = "board.cgi"; $digestname = "board.html"; $logdir = "/home/white/public_html/cgi-bin/HL-BBSlog"; $logsize = 100; $viewstep = 10; $WWWdomain = "www.jks.is.tsukuba.ac.jp"; $WWWpath = "/~white/cgi-bin"; ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdist)=localtime(time); require 'jcode.pl'; $cookies = $ENV{'HTTP_COOKIE'}; $message = ""; $warning = ""; $digestfile = "$scriptdir/$digestname"; if($cookies ne ""){ $cookies =~ /userinfo=name:(.*)/;$username = $1; }else{ $username = "名前"; } if($ENV{REQUEST_METHOD} eq "GET"){ $str = $ENV{QUERY_STRING}; $mode = "view"; }else{ if($ENV{'CONTENT_LENGTH'} == 0){ print "Content-type: text/html\n\n"; &showBoard(); exit(0); } read(STDIN,$str,$ENV{'CONTENT_LENGTH'}); $mode = "write"; } @part = split('&',$str); foreach $i (@part) { ($variable,$value) = split('=',$i); $value =~ tr/+/ /; $value =~ s/%([0-9a-fA-F][0-9a-fA-F])/pack("C",hex($1))/eg; &jcode'convert(*value,'sjis'); # $value =~ s//>/g; $value =~ s/\015\012/\012/g; $value =~ s/\015/\012/g; $cgi{$variable} = $value; } if($mode eq "view"){ if($cgi{view} ne ""){&viewarticle();exit(0);} }elsif($cgi{name} eq "名前" || $cgi{name} eq ""){ $warning = "Massage Writing Error ! : Please input your name.
"; $message = $cgi{text}; print "Content-type: text/html\n\n"; &showBoard(); exit(0); }else{ &writetoBoard(); } exit(0); sub lock { while(-e "$logdir/.boardlock"){sleep(1)} open(lockfile.">$logdir".".boardlock"); close(lockfile); } sub unlock { unlink("$logdir/.boardlock"); } sub showBoard{ open(FILE,"$digestfile"); while(){ if(/<\/body>/){ print "$warning"; } if(//){ print <書き込まない

EOWRITETOOL next; } print; } return; } sub viewarticle{ if($cgi{view} =~ /(\-?\d+)-(\-?\d+)/){ $articlebegin = $1; $articlebegin = 1 if($articlebegin < 1); $articleend = $2; $articleend = 10 if($articleend < 1); if($articlebegin > $articleend){ local($temp); $temp = $articlebegin; $articlebegin = $articleend; $articleend = $temp; } $here = "$articlebegin-$articleend"; }else{ $articlebegin = $cgi{view}; $articleend = $articlebegin; $here = "$articlebegin"; } $filename = $articlebegin - ($articlebegin % $logsize) + $logsize; $top = $articlebegin - $viewstep; $last= $articlebegin - 1; if($top < 1){$top = 1;} if($last < 1){ $before = ""; }else{ $before = "$top-$last <-- "; } $top = $articleend+1;$last=$articleend+$viewstep; $next = ""; open(FILE,"$logdir/$filename"); local($error) = 1; while(){ if(//){ $error = 0; &printhtmlhead(); while(){ if(//){ $articleno = $1; if($articleno > $articleend){ $next=" --> $top-$last"; last; } }elsif(//){ $articleno++; close(FILE); $filename += $logsize; open(FILE,"$logdir/$filename"); while(){ if(//){print;last;} } } print; } &printhtmlfoot(); last; } } if($error == 1){&viewerror();} } sub printhtmlhead{ print < Board Test EOHTMLHEAD } sub printhtmlfoot{ print <
[Progressive]

  $before $here $next

最新版


EOHTMLFOOT } sub viewerror{ print < Board Test

指定した番号の記事は見つかりませんでした。

最新版 EOVIEWERROR } sub writetoBoard{ $cgi{text} =~ s/\n/\n
/g; &lock; $time = sprintf("%2d/%2d-%2d:%2d",$mon+1,$mday,$hour,$min); $time =~ s/ /0/g; $newarticle = "$time : $cgi{title} : $cgi{name}
\n$cgi{text}\n"; $temp = ""; open(FILE,"$digestfile"); while(){ $temp = "$temp"."$_"; if(//){ while(){ if(//){ $articleno = $1; $firstarticle = $1; last; } } last; } } while(){ if(//){ $articleno = $1; }elsif(//){ $articleno++; $newarticle = "\n


$articleno:\n$newarticle"; $temp = "$temp"."$newarticle"; }elsif(//){ local($top,$last); $top = $firstarticle-$viewstep;$last=$firstarticle-1; if($top < 1){$top = 1;} if($last < 1){ $_ = "\n"; }else{ $_ = "

 $top-$last <-- 最新版($firstarticle-$articleno)\n"; } } $temp = "$temp"."$_"; } close(FILE); open(FILE,"> $digestfile"); print FILE $temp; close(FILE); &unlock; print "Content-type: text/html\n"; print "Set-Cookie: userinfo=name:$cgi{name}; expires=Sat, 1-Jan-2000 00:00:00 GMT; path=$WWWpath; domain=$WWWdomain; \n\n"; print "\n\nMessage Write Report\n\n"; print "\n


\n$newarticle\n
\n

以上の内容が書き込まれました\n"; print "

掲示板へ戻る\n\n\n"; close(STDOUT); close(STDIN); $logfilename = $articleno - ($articleno % $logsize) + $logsize; open(FILE,">>$logdir/$logfilename"); print FILE $newarticle; if(($articleno % $logsize) == 0){ print FILE ""; } close(FILE); } Board Sample

htmlAHyperLinkable BBS0.9.2pAVt@CTvB t@CRgAfヲXNvgQAB

  • <!-- Article : 0 -->
  • <!-- ArticleEnd -->
  • <!-- PopWriteTool -->
  • <!-- Pointer Line -->



#!/usr/local/bin/perl ### ### HyperLinkable BBS ver 0.9.1 ### Scripted by White(white@d51.net) ### ### 実行のためには、以下の変数の値を各人の環境に合わせて設定してください。 ### $scriptdir スクリプトを置いてあるディレクトリ名 ### $scriptname このスクリプト自身の名前 ### $digestname 最新版htmlファイル名($scriptdirからの相対指定) ### $logdir 過去ログ保存のためのディレクトリ名 ### $logsize 記事いくつごとに過去ログを分けるかの数値 ### $viewstep 過去ログ閲覧時に、いくつを同時に表示するか ### $WWWdomain サーバーにhttpでアクセスするときのドメイン名 ### $WWWpath $scriptdirにhttpでアクセスするときのディレクトリ名 ### ### また、サブルーチンprinthtmlhead、printhtmlfoot、viewerror、writetoBoard ###  などのhtml部分についても記述を変更してください。 ### ## sample : ## board is "http://www.jks.is.tsukuba.ac.jp/~white/cgi-bin/board.(cgi|html)" ## $scriptdir = "/home/white/public_html/cgi-bin"; $scriptname = "board.cgi"; $digestname = "board.html"; $logdir = "/home/white/public_html/cgi-bin/HL-BBSlog"; $logsize = 100; $viewstep = 10; $WWWdomain = "www.jks.is.tsukuba.ac.jp"; $WWWpath = "/~white/cgi-bin"; ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdist)=localtime(time); require 'jcode.pl'; $cookies = $ENV{'HTTP_COOKIE'}; $message = ""; $warning = ""; $digestfile = "$scriptdir/$digestname"; if($cookies ne ""){ $cookies =~ /userinfo=name:(.*)/;$username = $1; }else{ $username = "名前"; } if($ENV{REQUEST_METHOD} eq "GET"){ $str = $ENV{QUERY_STRING}; $mode = "view"; }else{ if($ENV{'CONTENT_LENGTH'} == 0){ print "Content-type: text/html\n\n"; &showBoard(); exit(0); } read(STDIN,$str,$ENV{'CONTENT_LENGTH'}); $mode = "write"; } @part = split('&',$str); foreach $i (@part) { ($variable,$value) = split('=',$i); $value =~ tr/+/ /; $value =~ s/%([0-9a-fA-F][0-9a-fA-F])/pack("C",hex($1))/eg; &jcode'convert(*value,'sjis'); # $value =~ s//>/g; $value =~ s/\015\012/\012/g; $value =~ s/\015/\012/g; $cgi{$variable} = $value; } if($mode eq "view"){ if($cgi{view} ne ""){&viewarticle();exit(0);} }elsif($cgi{name} eq "名前" || $cgi{name} eq ""){ $warning = "Massage Writing Error ! : Please input your name.
"; $message = $cgi{text}; print "Content-type: text/html\n\n"; &showBoard(); exit(0); }else{ &writetoBoard(); } exit(0); sub lock { while(-e "$logdir/.boardlock"){sleep(1)} open(lockfile.">$logdir".".boardlock"); close(lockfile); } sub unlock { unlink("$logdir/.boardlock"); } sub showBoard{ open(FILE,"$digestfile"); while(){ if(/<\/body>/){ print "$warning"; } if(//){ print <書き込まない

EOWRITETOOL next; } print; } return; } sub viewarticle{ if($cgi{view} =~ /(\-?\d+)-(\-?\d+)/){ $articlebegin = $1; $articlebegin = 1 if($articlebegin < 1); $articleend = $2; $articleend = 10 if($articleend < 1); if($articlebegin > $articleend){ local($temp); $temp = $articlebegin; $articlebegin = $articleend; $articleend = $temp; } $here = "$articlebegin-$articleend"; }else{ $articlebegin = $cgi{view}; $articleend = $articlebegin; $here = "$articlebegin"; } $filename = $articlebegin - ($articlebegin % $logsize) + $logsize; $top = $articlebegin - $viewstep; $last= $articlebegin - 1; if($top < 1){$top = 1;} if($last < 1){ $before = ""; }else{ $before = "$top-$last <-- "; } $top = $articleend+1;$last=$articleend+$viewstep; $next = ""; open(FILE,"$logdir/$filename"); local($error) = 1; while(){ if(//){ $error = 0; &printhtmlhead(); while(){ if(//){ $articleno = $1; if($articleno > $articleend){ $next=" --> $top-$last"; last; } }elsif(//){ $articleno++; close(FILE); $filename += $logsize; open(FILE,"$logdir/$filename"); while(){ if(//){print;last;} } } print; } &printhtmlfoot(); last; } } if($error == 1){&viewerror();} } sub printhtmlhead{ print < Board Test EOHTMLHEAD } sub printhtmlfoot{ print <
[Progressive]

  $before $here $next

最新版


EOHTMLFOOT } sub viewerror{ print < Board Test

指定した番号の記事は見つかりませんでした。

最新版 EOVIEWERROR } sub writetoBoard{ $cgi{text} =~ s/\n/\n
/g; &lock; $time = sprintf("%2d/%2d-%2d:%2d",$mon+1,$mday,$hour,$min); $time =~ s/ /0/g; $newarticle = "$time : $cgi{title} : $cgi{name}
\n$cgi{text}\n"; $temp = ""; open(FILE,"$digestfile"); while(){ $temp = "$temp"."$_"; if(//){ while(){ if(//){ $articleno = $1; $firstarticle = $1; last; } } last; } } while(){ if(//){ $articleno = $1; }elsif(//){ $articleno++; $newarticle = "\n


$articleno:\n$newarticle"; $temp = "$temp"."$newarticle"; }elsif(//){ local($top,$last); $top = $firstarticle-$viewstep;$last=$firstarticle-1; if($top < 1){$top = 1;} if($last < 1){ $_ = "\n"; }else{ $_ = "

 $top-$last <-- 最新版($firstarticle-$articleno)\n"; } } $temp = "$temp"."$_"; } close(FILE); open(FILE,"> $digestfile"); print FILE $temp; close(FILE); &unlock; print "Content-type: text/html\n"; print "Set-Cookie: userinfo=name:$cgi{name}; expires=Sat, 1-Jan-2000 00:00:00 GMT; path=$WWWpath; domain=$WWWdomain; \n\n"; print "\n\nMessage Write Report\n\n"; print "\n


\n$newarticle\n
\n

以上の内容が書き込まれました\n"; print "

掲示板へ戻る\n\n\n"; close(STDOUT); close(STDIN); $logfilename = $articleno - ($articleno % $logsize) + $logsize; open(FILE,">>$logdir/$logfilename"); print FILE $newarticle; if(($articleno % $logsize) == 0){ print FILE ""; } close(FILE); }