#!/usr/local/bin/perl #┌───────────────────────────────── #│ Web Forum v4.3 #│ Copyright(C) KENT WEB 2003 #│ webmaster@kent-web.com #│ http://www.kent-web.com/ #└───────────────────────────────── #============# # 基本設定 # #============# # 外部ファイル取込み require './jcode.pl'; require './fold.pl'; require './wf_init.cgi'; #============# # 設定完了 # #============# # 基本処理を定義 &decode; &axs_check; if ($mode eq "msgview") { &msgview; } elsif ($mode eq "allread") { &allread; } elsif ($mode eq "newsort") { &newsort; } elsif ($mode eq "usr_del") { &usr_del; } elsif ($mode eq "usr_edt") { &usr_edt; } elsif ($mode eq "find") { &find; } elsif ($mode eq "past") { &past_view; } elsif ($mode eq "check") { ✓ } &list_view; #--------------# # リスト表示 # #--------------# sub list_view { &header; print "
\n"; # タイトル部 if ($t_img) { print "\"$title\"\n"; } else { print "$title\n"; } print "
\n", "[もどる]\n", "[新規投稿]\n"; if ($in{'list'} ne "new") { print "[新規順表\示]\n"; } else { print "[ツリー表\示]\n"; } print "[新着記事]\n", "[留意事項]\n", "[ワード検索]\n"; print "[過去ログ]\n" if ($pastkey); # print "[過去ログ]\n"; print "[管理用]\n", "
\n", "
  • $new_time時間以内の記事は $newmark で表\示されます。

  • \n"; if ($in{'list'} eq "new") { print "
  • 以下は新規投稿順のリスト表\示です。

  • \n"; } else { print "
  • ツリー先頭部の $treehead をクリックすると関連記事を一括表\示します。

  • \n"; } print "
    \n"; # ログを開く if ($in{'list'} eq "new") { &ListNewOpen; } else { &ListTreeOpen; } # ページ移動フォーム &move_list; # メッセージ投稿フォ−ムを表示 &msg_form; # 著作権表示(削除しないで下さい) print "

    \n", "- Web Forum -\n", "
    \n\n"; exit; } #--------------------# # リストツリー表示 # #--------------------# sub ListTreeOpen { local($no,$reno,$lx,$sub,$email,$url,$name,$dat,$msg,$t,$h,$pw,$w,$oya); # 時間取得 $time = time; if ($mode ne "past") { print "
    \n"; } print "\n"; $x--; } while ($x < $lx) { print "\n"; $x--; } } # 所定時間以内の投稿は[NEWマーク]表示 if ($time - $t > $new_time * 3600) { $newsign = ""; } else { $newsign = $newmark; } # 記事タイトル長調整 $sub = &cut_subject($sub); # 過去記事 if ($mode eq "past") { print "
  • $sub - $name $dat No\.$no $newsign\n"; # 削除記事 } elsif ($pw eq 'DEL') { if ($lx == 0) { print "

    $treehead - "; print "$sub - $dat No\.$no\n"; } else { print "
  • $sub - $dat No\.$no\n"; } # レス記事 } elsif ($lx != 0) { print "
  • $sub - $name $dat No\.$no $newsign\n"; # 親記事 } else { print "

    $treehead - "; print "$sub - $name $dat No\.$no $newsign\n"; } } close(IN); while ($x > 0) { print "\n"; $x--; } print "\n"; if ($mode ne "past") { print "
  • \n"; } } #--------------------# # リスト新着順表示 # #--------------------# sub ListNewOpen { local($no,$reno,$xl,$sub,$email,$url,$name,$date,$msg,$tim,$h,$pw,$wrap,$oya); # 時間取得 $time = time; open(IN,"$logfile") || &error("Open Error : $logfile"); $top = ; while () { ($no,$reno,$xl,$sub,$email,$url,$name,$date,$msg,$tim,$h,$pw,$wrap,$oya) = split(/<>/); $cnt{$no} = $tim; $rno{$no} = $reno; $dat{$no} = $date; $nam{$no} = $name; $sub{$no} = $sub; $oya{$no} = $oya; } close(IN); print "
      \n"; # ソート処理 $i=0; $x=0; $p_tree *= 3; foreach (sort { ($cnt{$b} <=> $cnt{$a}) } keys(%cnt)) { $i++; if ($i < $page + 1) { next; } if ($i > $page + $p_tree) { next; } # 所定時間以内の投稿は[NEWマーク]表示 if ($time - $cnt{$_} > $new_time * 3600) { $newsign = ""; } else { $newsign = $newmark; } if ($sub{$_} eq '投稿者削除') { print "
    • $sub{$_} - $dat{$_} No\.$_ $newsign\n"; } else { print "
    • $sub{$_} - $nam{$_} $dat{$_} No\.$_ $newsign\n"; } } print "
    \n"; } #----------------------# # メッセージ内容表示 # #----------------------# sub msgview { local($no,$re,$lx,$sub,$eml,$url,$nam,$dat,$msg,$lt,$ho,$pw,$wrap,$oya,$sml,$v_dat,$v_nam,$v_eml,$v_url,$v_msg,$v_tim,$v_sub,$v_wrp,$v_sml,$date); $flag=0; @new=(); open(IN,"$logfile") || &error("Open Error : $logfile"); $top = ; while () { ($no,$re,$lx,$sub,$eml,$url,$nam,$dat,$msg,$lt,$ho,$pw,$wrap,$oya,$sml) = split(/<>/); if ($in{'oya'} == $oya) { push(@new,$_); } elsif ($flag && $in{'oya'} != $oya) { last; } if ($in{'no'} == $no) { $flag=1; $v_dat = $dat; $v_nam = $nam; $v_eml = $eml; $v_url = $url; $v_msg = $msg; $v_tim = $lt; $v_sub = $sub; $v_wrp = $wrap; $v_sml = $sml; } } close(IN); # レスメッセージ $res_msg = "\n> $v_msg"; $res_msg =~ s/"/"/g; $res_msg =~ s/
    /\r> /g; # レスタイトル $res_sub = $v_sub; if ($res_sub =~ /^Re\^(\d+)\:(.*)/) { $renum = $1 + 1; $res_sub = "Re\^$renum\:$2"; } elsif ($res_sub =~ /^Re\:(.*)/) { $res_sub = "Re\^2:$1"; } else { $res_sub = "Re: $res_sub"; } # HTMLを出力 &header; print "
    \n"; if ($t_img) { print "\"$title\"\n"; } else { print "$title\n"; } print "
    \n", "[記事リスト]\n", "[新着記事]\n", "[ワード検索]\n"; print "[過去ログ]\n" if ($pastkey); # print "[過去ログ]\n"; print "[管理用]
    \n"; # 自動リンク if ($autolink) { &auto_link($v_msg); } $v_msg =~ s/"/"/g; # 引用部色変更 if ($refcol) { $v_msg =~ s/([\>]|^)(>[^<]*)/$1$2<\/font>/g; } # PREタグ if ($v_wrp eq 'pre') { $v_msg =~ s/
    /\n/g; $v_msg = "
    $v_msg
    "; } # 投稿日時 $date = &get_time($v_tim); print "

    \n", "", "\n", "\n", "\n"; if ($v_url) { print "\n" } print "
    タイトル$v_sub
    投稿日: $date
    投稿者$v_nam "; if ($v_eml && $v_sml eq '0') { print "  <$v_eml>"; } print "
    参照先: ", "", "http://$v_url

    $v_msg

    \n"; if (@new > 1) { print "


    - 関連一覧ツリー\n", "($treehead をクリックするとツリー全体を一括表\示します)
    \n"; $x=0; print "
      \n"; foreach (@new) { ($no,$re,$lx,$sub,$eml,$url,$nam,$dat,$msg,$lt,$ho,$pw,$wrap,$oya,$sml) = split(/<>/); while ($x > $lx) { print "
    \n"; $x--; } while ($x < $lx) { print "
      \n"; $x++; } # 記事タイトル長調整 $sub = &cut_subject($sub); if ($lx != 0) { print "
    • $sub - $nam $dat "; } else { print "$treehead - $sub - $nam $dat"; } if ($in{'no'} == $no) { print "No\.$no\n"; } else { print "No\.$no\n"; } } while ($x > 0) { print "
    \n"; $x--; } print "\n"; } # 返信フォーム &msg_form; print "\n\n"; exit; } #----------------# # 一括表示機能 # #----------------# sub allread { local($no,$re,$lx,$sub,$eml,$url,$nam,$dat,$msg,$t,$ho,$pw,$wrap,$oya,$sml,$date); # HTMLを出力 &header; print <<"EOM"; [リストへもどる]
    一括表\示
    EOM # 過去ログの場合 if ($in{'act'} eq "past") { # ログファイルを定義 if ($in{'pastlog'}) { $count = $in{'pastlog'}; } else { open(NO,"$nofile") || &error("Open Error : $nofile"); $count = ; close(NO); } $logfile = sprintf("%s%04d\.cgi", $pastdir,$count); } # 親記事を出力 $x=0; print "
      \n"; open(IN,"$logfile") || &error("Open Error : $logfile"); $top = if ($in{'act'} ne "past"); $flag=0; while () { ($no,$re,$lx,$sub,$eml,$url,$nam,$dat,$msg,$t,$ho,$pw,$wrap,$oya) = split(/<>/); if ($in{'no'} == $oya) { $flag=1; push(@new,$_); while ($x > $lx) { print "
    \n"; $x--; } while ($x < $lx) { print "
      \n"; $x++; } # 記事タイトル長調整 $sub = &cut_subject($sub); if ($pw eq 'DEL') { print "
    • $sub - $dat No\.$no\n"; } else { print "
    • $sub - $nam $dat No\.$no\n"; } } elsif ($flag && $in{'no'} != $oya) { last; } } close(IN); while ($x > 0) { print "
    \n"; $x--; } print "
    \n"; foreach (@new) { ($no,$re,$lx,$sub,$eml,$url,$nam,$dat,$msg,$t,$ho,$pw,$wrap,$oya,$sml) = split(/<>/); if ($pw eq 'DEL') { next; } # 自動リンク if ($autolink) { &auto_link($msg); } $msg =~ s/"/"/g; # 引用部色変更 if ($refcol) { $msg =~ s/([\>]|^)(>[^<]*)/$1$2<\/font>/g; } # 図表モード if ($wrap eq 'pre') { $msg =~ s/
    /\n/g; $msg = "
    $msg
    "; } $date = &get_time($t); print "\n", "\n", "
    ", "\n", "\n", "\n", "\n"; if ($url) { print "\n"; } print "
    タイトル: ", "$sub
    記事No$no
    投稿日: $date
    投稿者$nam "; if ($eml && $sml eq '0') { print "  <$eml>"; } print "
    参照先: ", "", "http://$url
    $msg
    \n"; if ($in{'act'} ne "past") { print "
    \n", "
    \n", "\n", "\n", "\n", "\n", "\n", "
    \n"; } print "

    \n"; } print "
    \n\n\n"; exit; } #--------------------# # 新着順ソート表示 # #--------------------# sub newsort { local($no,$re,$x,$sub,$eml,$url,$nam,$dat,$msg,$tim,$ho,$pw,$wrp,$oya,$sml,$date); &header; print <<"EOM"; [リストへもどる]
    新着記事

    EOM # 記事展開 open(IN,"$logfile") || &error("Open Error : $logfile"); $top = ; while () { ($no,$re,$x,$sub,$eml,$url,$nam,$dat,$msg,$tim,$ho,$pw,$wrp,$oya,$sml) = split(/<>/); if ($pw eq 'DEL') { next; } # 連想配列化 $cnt{$no} = $tim; $nam{$no} = $nam; $eml{$no} = $eml; $url{$no} = $url; $rno{$no} = $re; $sub{$no} = $sub; $oya{$no} = $oya; $msg{$no} = $msg; $wrp{$no} = $wrp; $sml{$no} = $sml; } close(IN); # ソート処理 $i=0; foreach (sort { ($cnt{$b} <=> $cnt{$a}) } keys(%cnt)) { $i++; if ($i > $sortcnt) { last; } # ループを抜ける if ($autolink) { &auto_link($msg{$_}); } $msg{$_} =~ s/"/"/g; if ($refcol) { $msg{$_} =~ s/([\>]|^)(>[^<]*)/$1$2<\/font>/g; } # PRE機能 if ($wrp{$_} eq "pre") { $msg{$_} =~ s/
    /\n/g; $msg{$_} = "
    $msg{$_}
    "; } $date = &get_time($cnt{$_}); print "\n", "
    \n", "", "", "\n", "\n", "\n"; if ($url{$_}) { print "\n"; } print "
    タイトル: ", "$sub{$_}
    記事No$_   ", "[関連記事]
    投稿日: $date
    投稿者$nam{$_} "; if ($eml{$_} && $sml{$_} eq '0') { print "  <", "$eml{$_}>"; } print "
    参照先: ", "", "http://$url{$_}
    $msg{$_}
    \n", "
    \n", "
    \n", "\n", "\n", "\n", "\n", "\n", "
    \n", "

    \n"; } print "
    \n\n\n"; exit; } #------------------# # 投稿フォーム部 # #------------------# sub msg_form { # クッキーを取得 local($cname, $cmail, $curl, $cpwd, $cpv, $csmail) = &get_cookie; # 修正時 if ($_[0] eq "edt") { ($type,$cname,$cmail,$curl,$csmail,$res_sub,$res_msg,$wrap) = @_; $res_msg =~ s/"/"/g; if (!$wrap) { $wrap='soft'; } print "[戻る]\n", "

    修正フォーム

    \n", "
    \n", "\n", "\n", "\n", "\n"; # 返信時 } elsif ($mode eq 'msgview') { $wrap='soft'; print "
    \n", "- 返信フォーム\n", "(この記事に返信する場合は下記フォームから投稿して下さい)
    \n", "\n", "\n", "\n", "\n", "\n", "\n"; # 新規時 } else { $wrap='soft'; print "

    \n", "書籍のご感想、市民活動やインターネットに関するご意見など、お気軽にご投稿ください。
    \n", "

    \n", "\n", "\n", "\n"; } print "

    \n", "", "\n", "", "\n", "", "\n", "", "\n"; if ($_[0] eq "edt") { print "\n", "
    おなまえ
    Eメール ", "
    タイトル
    メッセージ   "; @w1 = ('手動改行', '強制改行', '図表モード'); @w2 = ('soft', 'hard', 'pre'); foreach (0 .. 2) { if ($wrap eq $w2[$_]) { print "$w1[$_]\n"; } else { print "$w1[$_]\n"; } } # プレビューのチェック if ($cpv eq "on") { $checked = "checked"; } print "
    ", "
    URL
    \n"; } else { print <<"EOM"; パスワード (英数字で8文字以内)   プレビュー
    - 以下のフォームから自分の投稿記事を修正・削除することができます -
    処理 記事No パスワード

    EOM } } #----------------# # 記事修正処理 # #----------------# sub usr_edt { local($no,$re,$lx,$sub,$eml,$url,$nam,$dat,$msg,$lt,$ho,$pw,$wrp,$oya,$sml,$res); # フォーム内容のチェック $in{'no'} =~ s/\D//g; if ($in{'no'} eq '' || $in{'pwd'} eq '') { &error("記事NOまたはパスワードの記入モレがあります"); } if ($in{'action'} eq "edit") { # 入力チェック &chk_form; # ロック処理 &lock if ($lockkey); } $flag=0; open(IN,"$logfile") || &error("Open Error : $logfile"); $top = ; while () { chop; ($no,$re,$lx,$sub,$eml,$url,$nam,$dat,$msg,$lt,$ho,$pw,$wrp,$oya,$sml,$res) = split(/<>/); if ($in{'no'} == $no) { $pw2 = $pw; $flag=1; if ($in{'action'} ne "edit") { last; } else { $_ = "$no<>$re<>$lx<>$in{'sub'}<>$in{'email'}<>$in{'url'}<>$in{'name'}<>$dat<>$in{'message'}<>$lt<>$ho<>$pw<>$in{'wrap'}<>$oya<>$in{'smail'}<>$res<>"; } } if ($in{'action'} eq "edit") { push(@new,"$_\n"); } } close(IN); if (!$flag) { &error("該当の記事が見当たりません"); } if ($pw2 eq "") { &error("パスワードが設定されていません"); } $check = &decrypt($in{'pwd'}, $pw2); if ($check ne "yes") { &error("パスワードが違います"); } @wrap1 = ('手動改行', '強制改行', '図表モード'); @wrap2 = ('soft', 'hard', 'pre'); if ($in{'action'} eq "edit") { unshift(@new,$top); open(OUT,">$logfile") || &error("Write Error : $logfile"); print OUT @new; close(OUT); &unlock if ($lockkey); if ($in{'url'}) { $in{'url'} = "http://$in{'url'}"; } if ($in{'wrap'} eq "pre") { $in{'message'} = "
    $in{'message'}
    "; } $in{'message'} =~ s/"/"/g; if ($refcol) { $in{'message'} =~ s/([\>]|^)(>[^<]*)/$1$2<\/font>/g; } foreach (0 .. 2) { if ($wrap2[$_] eq $in{'wrap'}) { $wp=$_; last; } } if ($in{'smail'} == 1) { $in{'email'} = '非表示'; } &header; print "

    - 以下のとおり修正が完了しました -

    \n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "
    名前: $in{'name'}
    e-mail: $in{'email'}
    タイトル: $in{'sub'}
    URL: $in{'url'}
    記事

    $in{'message'}

    \n"; print "
    \n"; print "\n\n"; exit; } $msg =~ s/
    /\r/g; &header; &msg_form("edt",$nam,$eml,$url,$sml,$sub,$msg,$wrp); print "\n"; exit; } #----------------# # 記事削除処理 # #----------------# sub usr_del { local($no,$re,$lx,$sub,$eml,$url,$nam,$dat,$msg,$tim,$ho,$pw,$wr,$oya,$sml,$res,$date); # POST限定 if ($postonly && !$post_flag) { &error("不正なアクセスです"); } # フォーム内容のチェック $in{'no'} =~ s/\D//g; if ($in{'no'} eq '' || $in{'pwd'} eq '') { &error("記事NOまたはパスワードの記入モレがあります"); } # 確認画面 if ($in{'keyno'} eq "") { $flag=0; open(IN,"$logfile") || &error("Open Error : $logfile"); $top = ; while () { ($no,$re,$lx,$sub,$eml,$url,$nam,$dat,$msg,$t,$ho,$pw,$wr,$oya,$sml,$res) = split(/<>/); if ($in{'no'} == $no) { $flag=1; last; } } close(IN); if (!$flag) { &error("該当の記事は見当たりません"); } if ($pw eq "") { &error("この記事(No $in{'no'})は削除キーが設定されていません"); } # 照合 $match = &decrypt($in{'pwd'}, $pw); if ($match ne "yes") { &error("削除キーが違います"); } &header; print "

    以下の記事を本当に削除しますか?

    \n", "", "
    \n", "\n", "\n"; print "\n"; print "\n" if ($url); print "", "
    記事No$no
    投稿日: $dat
    投稿者$nam "; if ($eml && $sml eq '0') { print "<$eml>"; } print "
    参照先: http://$url
    タイトル$sub
    \n", "

    \n", "
    \n", "
    \n", "\n", "\n", "\n", "\n", "
    ", "", "

    \n", "\n\n"; exit; } # ロック開始 &lock if ($lockkey); # ログを読み込む $new=(); $flag=0; open(IN,"$logfile") || &error("Open Error : $logfile"); $top = ; while () { chop; ($no,$re,$lx,$sub,$eml,$url,$nam,$dat,$msg,$tim,$ho,$pw,$wr,$oya,$sml,$res) = split(/<>/); if ($in{'no'} == $no) { if ($pw eq "") { $flag=2; last; } $match = &decrypt($in{'pwd'}, $pw); if ($match ne "yes") { $flag=3; last; } else { $flag=1; } if ($res == 0) { next; } $_ = "$no<>$re<>$lx<>投稿者削除<><><>(削除)<>$dat<>(投稿者により削除されました)<>$tim<>$ho<>DEL<>$wr<>$oya<>$sml<>$res<>"; } elsif ($no == $in{'keyno'}) { if ($res > 0) { $res--; } $_ = "$no<>$re<>$lx<>$sub<>$eml<>$url<>$nam<>$dat<>$msg<>$tim<>$ho<>$pw<>$wr<>$oya<>$sml<>$res<>"; } push(@new,"$_\n"); } close(IN); if ($flag == 0) { &error("該当記事は見つかりません"); } elsif ($flag == 2) { &error("パスワードが設定されていません"); } elsif ($flag == 3) { &error("パスワードが違います"); } # ログを更新 unshift(@new,$top); open(OUT,">$logfile") || &error("Write Error : $logfile"); print OUT @new; close(OUT); # ロック解除 &unlock if ($lockkey); # リスト表示部にもどる &list_view; } #------------------# # クッキーを取得 # #------------------# sub get_cookie { local($key, $val, *cook); $cook = $ENV{'HTTP_COOKIE'}; foreach (split(/;/, $cook)) { ($key, $val) = split(/=/); $key =~ s/\s//g; $cook{$key} = $val; } @cook = split(/<>/, $cook{'WEBFORUM'}); return @cook; } #----------------------# # パスワード照合処理 # #----------------------# sub decrypt { local($inpw, $logpw) = @_; local($salt, $key, $check); $salt = $logpw =~ /^\$1\$(.*)\$/ && $1 || substr($logpw, 0, 2); $check = "no"; if (crypt($inpw, $salt) eq $logpw || crypt($inpw, '$1$' . $salt) eq $logpw) { $check = "yes"; } return $check; } #----------------# # 検索フォーム # #----------------# sub find { &header; print <<"EOM"; [リストに戻る]

    • 検索したいキーワードを入力し、検索条件を選択して「検索」を押してください。
    • 複数のキーワードを入力するときは、半角スペースで区切って下さい。
      キーワード: 条件: 表\示:
    \n"; # ワード検索の実行と結果表示 if ($in{'word'} ne "") { &search; } print "\n\n"; exit; } #----------------# # 検索処理実行 # #----------------# sub search { local($no,$re,$lx,$sub,$eml,$url,$nam,$dat,$msg,$t,$ho,$pw,$wr,$oya,$sml,$back,$next); # 入力内容を整理 $in{'word'} =~ s/\x81\x40/ /g; @wd = split(/\s+/, $in{'word'}); # ロック処理:サーバ負荷を考慮し多重起動回避のため &lock if ($lockkey); # ファイルを読み込み $i=0; @new=(); open(IN,"$logfile") || &error("Open Error : $logfile"); $top = if ($mode ne "past"); while () { $flag=0; foreach $wd (@wd) { if (index($_,$wd) >= 0) { $flag=1; if ($in{'cond'} eq 'OR') { last; } } else { if ($in{'cond'} eq 'AND') { $flag=0; last; } } } if ($flag) { $i++; next if ($i < $page + 1); next if ($i > $page + $in{'view'}); ($no,$re,$lx,$sub,$eml,$url,$nam,$dat,$msg,$t,$ho,$pw,$wr,$oya,$sml) = split(/<>/); if ($w eq "pre") { $msg =~ s/
    /\r/g; $msg = "
    $msg
    "; } if ($autolink) { &auto_link($msg); } $msg =~ s/"/"/g; if ($refcol) { $msg =~ s/([\>]|^)(>[^<]*)/$1$2<\/font>/g; } $date = &get_time($t); print "
    \n", "\n", "\n"; } else { print "[関連記事]\n"; } print "\n", "\n"; if ($url) { print "\n"; } print "
    タイトル: ", "$sub
    記事No$no   "; if ($in{'pastlog'}) { print "[関連記事]
    投稿日: $date
    投稿者$nam "; if ($eml && $sml eq '0') { print "  <$eml>"; } print "
    参照先: ", "", "http://$url
    $msg
    \n"; } } close(IN); # 検索終了 print "
    検索結果:$i件\n"; $next = $page + $in{'view'}; $back = $page - $in{'view'}; $enwd = &url_enc($in{'word'}); if ($back >= 0) { print "[前の$in{'view'}件]\n"; } if ($next < $i) { print "[次の$in{'view'}件]\n"; } if ($i) { print "

    ▲TOP\n"; } # ファイルロック解除 &unlock if ($lockkey); } #--------------# # 自動リンク # #--------------# sub auto_link { $_[0] =~ s/([^=^\"]|^)(https?\:\/\/[\w\.\~\-\/\?\&\=\;\#\:\%\+\@]+)/$1$2<\/a>/g; } #----------------# # 過去ログ表示 # #----------------# sub past_view { open(IN,"$nofile") || &error("Open Error : $nofile"); $pastno = ; close(IN); $pastno = sprintf("%04d", $pastno); if (!$in{'pastlog'}) { $in{'pastlog'} = $pastno; } &header; print <<"EOM"; [掲示板に戻る]
    過去ログ [ $in{'pastlog'} ]

    \n"; print "
    過去ログ:\n\n"; print "
    \n"; print "\n"; print "\n"; print "ワード検索:\n"; print "条件: 表\示: ", "
    \n"; # ファイルを定義 $logfile = "$pastdir$in{'pastlog'}\.cgi"; # ワード検索処理 if ($in{'word'} ne "") { &search; print "\n\n"; exit; } &ListTreeOpen('past'); &move_list; print "\n\n"; exit; } #----------------------# # 記事タイトル長調整 # #----------------------# sub cut_subject { # 制限長に満たないものは戻す if (length($_[0]) <= $sub_length) { return $_[0]; } # カット処理 ($_[0], $folded) = &fold($_[0], $sub_length); $_[0] .= '..'; return $_[0]; } #----------------------# # ページ移動フォーム # #----------------------# sub move_list { local($next, $back); $next = $page + $p_tree; $back = $page - $p_tree; print "

    \n"; if ($back >= 0) { print "\n"; } if ($next < $i) { print "\n"; } print "
    \n"; print "\n" if ($in{'pastlog'} ne ""); print "\n"; print "\n" if ($mode eq 'past'); print "\n"; print "
    \n"; print "\n" if ($in{'pastlog'} ne ""); print "\n"; print "\n" if ($mode eq 'past'); print "\n"; print "
    "; # ページ移動ボタン表示 $x=1; $y=0; while ($i > 0) { if ($page eq $y) { print "[$x]\n"; } elsif ($in{'pastlog'} ne "") { print "[$x]\n"; } else { print "[$x]\n"; } $x++; $y = $y + $p_tree; $i = $i - $p_tree; } print "

    \n"; } #-----------------# # URLエンコード # #-----------------# sub url_enc { local($_) = @_; s/(\W)/'%' . unpack('H2', $1)/eg; s/\s/+/g; $_; } #------------------# # チェックモード # #------------------# sub check { &header; print "

    Check Mode

    \n
      \n"; # ログ print "
    • ログパス:"; if (-e $logfile) { print "OK\n"; # パーミッション print "
    • ログパーミッション:"; if (-r $logfile && -w $logfile) { print "OK\n"; } else { print "NG → $logfile\n"; } } else { print "NG → $logfile\n"; } # ロックディレクトリ print "
    • ロック形式:"; if ($lockkey == 0) { print "設定なし\n"; } else { if ($lockkey == 1) { print "symlink\n"; } else { print "mkdir\n"; } ($lockdir) = $lockfile =~ /(.*)[\\\/].*$/; print "
    • ロックディレクトリ:$lockdir\n"; if (-d $lockdir) { print "
    • ロックディレクトリのパス:OK\n"; } else { print "
    • ロックディレクトリのパス:NG → $lockdir\n"; } if (-r $lockdir && -w $lockdir && -x $lockdir) { print "
    • ロックディレクトリのパーミッション:OK\n"; } else { print "
    • ロックディレクトリのパーミッション:NG → $lockdir\n"; } } # 過去ログ print "
    • 過去ログ:"; if ($pastkey == 0) { print "設定なし\n"; } else { print "設定あり\n"; # NOファイル if (-e $nofile) { print "
    • NOファイルパス:OK\n"; if (-r $nofile && -w $nofile) { print "
    • NOファイルパーミッション:OK\n"; } else { print "
    • NOファイルパーミッション:NG → $nofile\n"; } } else { print "
    • NOファイルのパス:NG → $nofile\n"; } # ディレクトリ if (-d $pastdir) { print "
    • 過去ログディレクトリパス:OK\n"; if (-r $pastdir && -w $pastdir && -x $pastdir) { print "
    • 過去ログディレクトリパーミッション:OK\n"; } else { print "
    • 過去ログディレクトリパーミッション:NG → $pastdir\n"; } } else { print "
    • 過去ログディレクトリのパス:NG → $pastdir\n"; } } print "\n"; exit; } __END__