#!/usr/bin/perl ## PETIT BOARD 補助プログラム ## 過去ログ表示・検索システム ## petit2.cgi (99/03/07) ## by KENT $|=1; ## 基本設定 $title = 'JAPANESE TRASH1 過去ログ'; $script = './bbs.cgi'; # スクリプト名 $nofile = '../kakopastnum.txt'; # カウントファイル名 $bbsfile = '../bbs.cgi'; # 掲示板への戻り先 # bodyタグ $body = ''; $method = 'POST'; # method形式 (POST or GET) $logfile = '../newbbsdat.txt'; # YY-BOARDログファイル $past_dir = "."; # 過去ログのディレクトリ(フルパスだと / から) $past_url = "."; # 過去ログのURL(フルパスだと http:// から) # アクセスを禁止するUserAgent @denyagent = ('JustView','WebTV'); ## 設定完了 # 過去ログカウントファイルを読み込み open(NUM,"$nofile") || &error("Can't open $nofile"); $count = ; close(NUM); ## -------- メイン処理 --------------------------------- ## &get_form; if (!$buffer) { &frame; } &form_decode; if ($mode) { &ue_html; } #if ($mode eq 'find_html') { &find_html; } #if ($mode eq 'do_find') { &do_find; } exit; ## --------- 処理完了 ---------------------------------- ## ## フレーム部 sub frame { # 過去ログ用カウントファイルをチェック unless (-e $nofile) { &error("Don't exist $nofile"); } print "Content-type: text/html\n\n"; print <<"HTML"; $title $body <h3>フレーム非対応のブラウザの方は利用できません。</h3> <!--VirtualAvenueBanner--> HTML exit; } ## 上フレーム(メニュー部) sub ue_html { &header; print <<"HTML";
$title

[最新] HTML # 過去ログの[リンク]を新規順に表示 for ($i=$count-1; $i>0; $i--) { print "[$i]\n"; } print "[掲示板へもどる]\n"; print "
\n"; print "\n"; exit; } ## フォーム取得 sub get_form { $buffer = $ENV{'QUERY_STRING'}; } ## フォームからのデータ処理 sub form_decode { @pairs = split(/&/,$buffer); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $FORM{$name} = $value; } $mode = $FORM{'mode'}; } ## HTMLヘッダー部 sub header { print "Content-type: text/html\n\n"; print "\n\n"; print "\n"; print "$title\n"; print "$body\n"; } ## エラー処理 sub error { &header; print "

ヽ(´ー`)ノ

\n"; print "

$_[0]\n"; print "


\n"; print "\n"; print "\n"; exit; }