i bath00m my the infrothy face washh连成一句话

#!/usr/local/bin/perl
#┌─────────────────────────────────
JOYFUL NOTE v1.6 ()
Copyright(C) Kent Web 2003
webmaster@
http://www./
#└─────────────────────────────────
$ver = 'Joyful Note v1.6';
#┌─────────────────────────────────
#│ [注意事項]
#│ 1. このスクリプトはフリーソフトです。このスクリプトを使用した
いかなる損害に対して作者は一切の責任を負いません。
#│ 2. 設置に関する質問はサポート掲示板にお願いいたします。
直接メールによる質問は一切お受けいたしておりません。
#│ 3. このスクリプトは、method=POST 専用です。
#│ 4. 同梱のアイコンで、以下のファイルの著作権者は以下のとおりです。
home.gif : mayuRinさん
clip.gif : 牛飼いとアイコンの部屋さん
#└─────────────────────────────────
# 【ファイル構成例】
public_html (ホームディレクトリ)
+-- news / news.cgi [755]
news.log [666]
cgi-lib.pl [644]
pastno.dat [666]
+-- img [777] / home.gif, bear.gif, ...
+-- lock [777] /
+-- past [777] / 1.dat [666] ...
#============#
#============#
# ライブラリ取込
require './jcode.pl';
require './cgi-lib.pl';
# タイトル名を指定
$title = "HIFANA News";
# タイトルの色
$t_color = "#804040";
# タイトルの大きさ(ポイント数:スタイルシートで有効)
$t_size = '22pt';
# タイトル/本文の文字フォント
$face = "MS Pゴシック";
# 本文の文字大きさ(ポイント数:スタイルシートで有効)
$b_size = '10pt';
# 壁紙を指定する場合(http://から指定)
# 背景色を指定
$bc = "#000000";
# 文字色を指定
$tx = "#666666";
# リンク色を指定
$lk = "#006699"; # 未訪問
$vl = "#808080"; # 訪問済
$al = "#FF6600"; # 訪問中
# 戻り先のURL (index.htmlなど)
$homepage = "/index.html";
# 最大記事数 (親記事もレス記事も含めた数)
$max = 100;
# 管理者用マスタパスワード (英数字で8文字以内)
$pass = 'fresh!!';
# 返信がつくと親記事をトップへ移動 (0=no 1=yes)
$topsort = 0;
# 返信にも添付機能を許可する (0=no 1=yes)
$res_clip = 1;
# 画像と記事の位置
1 : 画像が左。記事は右から回り込む
2 : 画像が下。記事は画像の上に表示。
$imgpoint = 1;
# タイトルにGIF画像を使用する時 (http://から記述)
$t_img = "/h/cgi/hNewsImg/news_title.gif";
$t_w = 650; # GIF画像の幅 (ピクセル)
$t_h = 76; #
高さ (ピクセル)
# ファイルロック形式
# → 0=no 1=symlink関数 2=mkdir関数
$lockkey = 0;
# ロックファイル名
$lockfile = './lock/joyful.lock';
# ミニカウンタの設置
# → 0=no 1=テキスト 2=GIF画像
$counter = 0;
# ミニカウンタの桁数
$mini_fig = 6;
# テキストのとき:ミニカウンタの色
$cnt_color = "#BB0000";
# GIFカウンタのとき:画像までのディレクトリ
# → 最後は必ず / で閉じる
$gif_path = "./img/";
$mini_w = 8;
# 画像の横サイズ
$mini_h = 12;
# 画像の縦サイズ
# カウンタファイル
$cntfile = './count.dat';
# スクリプトのファイル名
# → フルパスで指定する場合は http:// から記述
= '/h/cgi/news/news.cgi';
# ログファイルを指定
# → フルパスで指定する場合は / から記述
$logfile = 'news.log';
# アップロードディレクトリ
# → パスの最後は / で終わること
# → フルパスだと / から記述する
$ImgDir = '../hNewsImg/';
# アップロードディレクトリのURLパス
# → パスの最後は / で終わること
$ImgUrl = "/h/cgi/hNewsImg/";
# 添付ファイルのアップロードに失敗したとき
0 : 添付ファイルは無視し、記事は受理する
1 : エラー表示して処理を中断する
$clip_error = 1;
# 記事 [タイトル] 部の長さ (全角文字換算)
$sub_len = 15;
# メールアドレスの入力必須 (0=no 1=yes)
$in_email = 0;
# 記事の [タイトル] 部の色
$sub_color = "#666666";
# 記事表示部の下地の色
$tbl_color = "#FFFFFF";
# 同一IPアドレスからの連続投稿時間(秒数)
# → 連続投稿などの荒らし対策
# → 値を 0 にするとこの機能は無効になります
$wait = 0;
# 1ページ当たりの記事表示数 (親記事)
$p_log = 20;
# 投稿があるとメール通知する (sendmail必須)
0 : 通知しない
1 : 通知するが、自分の投稿記事はメールしない。
2 : 通知する。自分の投稿記事も通知する。
$mailing = 0;
# メールアドレス(メール通知する時)
$mailto = 'xxx@xxx.xxx';
# sendmailパス(メール通知する時)
$sendmail = '/usr/lib/sendmail';
# 他サイトから投稿排除時に指定 (http://から書く)
$base_url = "";
# 文字色の設定(半角スペースで区切る)
$colors = '#0000 #DF #0000FF #C100C1 #FF80C0 #FF';
# URLの自動リンク (0=no 1=yes)
$autolink = 1;
# タグ広告挿入オプション (FreeWebなど)
の代わりに「広告タグ」を挿入する。
→ 広告タグ以外に、MIDIタグ や LimeCounter等のタグにも使用可能です。
$banner1 = ''; # 掲示板上部に挿入
$banner2 = ''; # 掲示板下部に挿入
# アクセス制限(半角スペースで区切る)
→ 拒否するホスト名又はIPアドレスを記述(アスタリスク可)
→ 記述例 $deny = '*. *.denyhost.xx.jp 211.154.120.*';
$deny = '';
# アップロードを許可するファイル形式
= 1; # GIFファイル
= 1; # JPEGファイル
= 1; # PNGファイル
= 1; # TEXTファイル
= 1; # LHAファイル
= 1; # ZIPファイル
= 1; # PDFファイル
= 1; # MIDIファイル
= 1; # WORDファイル
$excel = 1; # EXCELファイル
= 1; # POWERPOINTファイル
= 1; # RAMファイル
= 1; # RMファイル
= 1; # MPEGファイル
= 1; # MP3ファイル
# 投稿受理最大サイズ (bytes)
# → 例 : 102400 = 100KB
$cgi_lib'maxdata = 2048000;
# 画像ファイルの最大表示の大きさ(単位:ピクセル)
# → これを超える画像は縮小表示します
$MaxW = 500; # 横幅
$MaxH = 250; # 縦幅
# 家アイコンの使用 (0=no 1=yes)
$home_icon = 1;
# アイコン画像ファイル名 (ファイル名のみ)
$IconHome = "home.gif";
$IconClip = "clip.gif";
# クリップ
$IconSoon = "soon.gif";
# COMINIG SOON
# 画像管理者チェック機能 (0=no 1=yes)
# → アップロード「画像」は管理者がチェックしないと表示されない機能です
# → チェックされるまで「画像」は「COMMING SOON」のアイコンが表示されます
$ImageCheck = 0;
# 投稿後の処理
→ 掲示板自身のURLを記述しておくと、投稿後リロードします
→ ブラウザを再読み込みしても二重投稿されない措置。
→ Locationヘッダの使用可能なサーバのみ
$location = '';
#---(以下は「過去ログ」機能を使用する場合の設定です)---#
# 過去ログ生成 (0=no 1=yes)
$pastkey = 0;
# 過去ログ用NOファイル
= './pastno.dat';
# 過去ログのディレクトリ
# → フルパスなら / から記述(http://からではない)
# → 最後は必ず / で閉じる
$pastdir = './past/';
# 過去ログ1ファイルの行数
# → この行数を超えると次ページを自動生成します
$log_line = 600;
#============#
#============#
# メイン処理
if ($mode eq "howto") { & }
elsif ($mode eq "find") { & }
elsif ($mode eq "usr_del") { &usr_ }
elsif ($mode eq "usr_edt") { &usr_ }
elsif ($mode eq "regist") { & }
elsif ($mode eq "res") { &res_ }
elsif ($mode eq "res_broad") { &res_form_ }
elsif ($mode eq "broad") { & }
elsif ($mode eq "admin") { & }
elsif ($mode eq "past") { & }
elsif ($mode eq "check") { & }
#----------------#
アクセス制限
#----------------#
sub axs_check {
# ホスト名を取得
local($flag)=0;
foreach (split(/?s+/, $deny)) {
s/?*/?.?*/g;
if ($host =? /$_/i) { $flag=1; }
if ($flag) { &error("アクセスを許可されていません"); }
#--------------#
記事表示部
#--------------#
sub html_log {
local($ipt,$wh,$i,$flag);
# ヘッダを出力
# カウンタ処理
# if ($counter) { & }
# タイトル部
# print "?n";
# if ($banner1 ne "") { print "$banner1?n"; }
if ($t_img eq '') {
print "$title?n";
print "?n";
# メニュー部
# print "?n";
# print "[]?n";
# print "[]?n";
# print "[]?n";
# print "[]?n" if ($pastkey);
# print "[]?n";
# print "?n";
# 投稿フォーム
# &form();
print "?n";
# 記事を展開
open(IN,"$logfile") || &error("Open Error : $logfile");
while () {
($no,$reno,$date,$name,$mail,$sub,$comment,$url,$host,$pw,$color,$tail,$w,$h,$chk) = split(//);
if ($reno eq "") { $i++; }
$page + $p_log) { }
# 題名の長さ
if (length($sub) > $sub_len*2) {
$sub = substr($sub,0,$sub_len*2);
$sub .= "...";
if ($mail) { $name = ""; }
if ($home_icon && $url) { $url = ""; }
elsif (!$home_icon && $url) { $url = "&&"; }
if (!$reno && $flag) {
print "?n";
if (!$reno) {
print "?n";
if ($reno) { print "?n"; }
print "?n";
if ($reno) { print ""; }
print "$sub ";
if (!$reno) {
print "$name&<>";
print "&<>";
print "$name - $date ";
print " - $date ";
#記事No.を削除
print "No?.$no";
print " & $url ?n";
if (!$reno) {
print "?n";
print "?n";
print "?n";
print "?n";
print "?n";
#ここから記事開始
if ($w && $h) {
$wh1="width=$w";
#画像ファイルが無い場合に以前の$wが使われてしまうので、対応
print "?n";
if (!$reno) { print "?n"; }
# 自動リンク
if ($autolink) { &auto_link($comment); }
if ($imgpoint == 1) { $ipt="align=left hspace=18"; }
# 添付ファイルが存在する場合
if (-e "$ImgDir$no$tail") {
if ($tail eq ".gif" || $tail eq ".jpg" || $tail eq ".png") {
if ($ImageCheck && $chk != 1) {
print "?n";
if ($w && $h) { $wh="width=$w height=$h"; }
else { $wh=""; }
print "?n?n";
print " $no$tail?n?n";
print "$comment" if ($imgpoint == 1);
print "$comment" if ($imgpoint == 1);
if (!$reno) { print "?n"; }
print "?n";
close(IN);
print "?n";
$next = $page + $p_
$back = $page - $p_
$p_flag=0;
print "?n";
if ($back >= 0) {
$p_flag=1;
print "?n";
print "?n";
print "?n";
if ($next < $i) {
$p_flag=1;
print "?n";
print "?n";
print "?n";
# ページ移動ボタン表示
if ($p_flag) {
print "[直接移動]?n";
while ($i > 0) {
if ($page == $y) { print "[$x]?n"; }
else { print "[]?n"; }
$y = $y + $p_
$i = $i - $p_
print "?n";
print "?n";
# print "?n";
# print "?n";
# print "- 以下のフォームから自分の投稿記事を修正?削除することができます -?n";
# print "処理 ?n";
# print "修正?n";
# print "削除?n";
# print "記事No ?n";
# print "パスワード ?n";
# print "?n";
# 著作権表示部(削除改変不可)
# print "$banner2?n";
# print "-
# print "?n?n?n";
# print "?n?n?n";
print "?n?n";
#----------------#
ログ書込処理
#----------------#
sub regist {
# フォーム入力チェック
# 時間を取得
# クッキーを発行
# ファイルロック
if ($lockkey) { & }
# ログを開く
open(IN,"$logfile") || &error("Open Error : $logfile");
@lines = ;
close(IN);
# 記事NO処理
$top = shift(@lines);
($no,$ip,$time2) = split(//, $top);
# 連続投稿チェック
if ($addr eq $ip && $wait > $times - $time2)
{ &error("連続投稿はもうしばらく時間をおいて下さい"); }
# 削除キーを暗号化
if ($in{'pwd'} ne "") { $ango = &encrypt($in{'pwd'}); }
# ファイル添付処理
if ($in{'upfile'}) { &UpF }
# 親記事の場合
if ($in{'reno'} eq "") {
foreach (@lines) {
($no2,$reno2,$d,$n,$m,$s,$com,$u,$ho,$p,$c,$tail2,$w,$h,$chk) = split(//);
if ($i > $max-1 && $reno2 eq "") { $stop=1; }
if (!$stop) { push(@new,$_); }
if ($pastkey) { push(@data,$_); }
if (-e "$ImgDir$no2$tail2") { unlink("$ImgDir$no2$tail2"); }
unshift(@new,"$no$date$in{'name'}$in{'email'}$in{'sub'}$in{'comment'}$in{'url'}$host$ango$in{'color'}$tail$W$H0?n");
unshift(@new,"$no$addr$times?n");
# 過去ログ更新
if ($data[0]) { & }
open(OUT,">$logfile") || &error("Write Error : $logfile");
print OUT @
close(OUT);
# レス記事の場合:トップソートあり
} elsif ($in{'reno'} && $topsort) {
foreach (@lines) {
($no2,$reno2) = split(//);
if ($in{'reno'} eq $no2) {
if ($reno2) { $f++; }
push(@new,$_);
} elsif ($in{'reno'} eq $reno2) {
push(@new,$_);
} elsif ($match == 1 && $in{'reno'} ne $reno2) {
push(@new,"$no$in{'reno'}$date$in{'name'}$in{'email'}$in{'sub'}$in{'comment'}$in{'url'}$host$ango$in{'color'}$tail$W$H0?n");
push(@tmp,$_);
} else { push(@tmp,$_); }
if ($f) { &error("不正な返信要求です"); }
if ($match == 1) {
push(@new,"$no$in{'reno'}$date$in{'name'}$in{'email'}$in{'sub'}$in{'comment'}$in{'url'}$host$ango$in{'color'}$tail$W$H0?n");
push(@new,@tmp);
unshift(@new,"$no$addr$times?n");
open(OUT,">$logfile") || &error("Write Error : $logfile");
print OUT @
close(OUT);
# レス記事の場合:トップソートなし
foreach (@lines) {
($no2,$reno2) = split(//);
if ($match == 0 && $in{'reno'} eq $no2) {
if ($reno2) { $f++; }
} elsif ($match == 1 && $in{'reno'} ne $reno2) {
push(@new,"$no$in{'reno'}$date$in{'name'}$in{'email'}$in{'sub'}$in{'comment'}$in{'url'}$host$ango$in{'color'}$tail$W$H0?n");
push(@new,$_);
if ($f) { &error("不正な返信要求です"); }
if ($match == 1) {
push(@new,"$no$in{'reno'}$date$in{'name'}$in{'email'}$in{'sub'}$in{'comment'}$in{'url'}$host$ango$in{'color'}$tail$W$H0?n");
unshift(@new,"$no$addr$times?n");
open(OUT,">$logfile") || &error("Write Error : $logfile");
print OUT @
close(OUT);
# ロック解除
if ($lockkey) { & }
# メール処理
if ($mailing == 1 && $in{'email'} ne "$mailto") { &mail_ }
elsif ($mailing == 2) { &mail_ }
# リロード
if ($location) {
if ($ENV{'PERLXS'} eq "PerlIS") {
print "HTTP/1.0 302 Temporary Redirection?r?n";
print "Content-type: text/html?n";
print "Location: $location??n?n";
print "?n";
print "正常に処理されました?n";
print "?n";
print "?n";
print "?n";
print "?n?n";
#--------------------#
画像アップロード
#--------------------#
sub UpFile {
local($macbin,$fname,$flag,$upfile);
# 画像処理
$macbin=0;
foreach (@in) {
if (/(.*)Content-type:(.*)/i) { $tail=$2; }
if (/(.*)filename=(.*)/i) { $fname=$2; }
if (/application?/x-macbinary/i) { $macbin=1; }
$tail =? s/?r//g;
$tail =? s/?n//g;
$fname =? tr/?"?x0D?x0A//d;
# ファイル形式を認識
if ($tail =? /image?/gif/i && $gif) { $tail=".gif"; $flag=1; }
if ($tail =? /image?/jpeg/i && $jpeg) { $tail=".jpg"; $flag=1; }
if ($tail =? /image?/x-png/i && $png) { $tail=".png"; $flag=1; }
if ($tail =? /text?/plain/i && $text) { $tail=".txt"; $flag=1; }
if ($tail =? /lha/i && $lha) { $tail=".lzh"; $flag=1; }
if ($tail =? /zip/i && $zip) { $tail=".zip"; $flag=1; }
if ($tail =? /pdf/i && $pdf) { $tail=".pdf"; $flag=1; }
if ($tail =? /audio?/.*mid/i && $midi) { $tail=".mid"; $flag=1; }
if ($tail =? /msword/i && $word) { $tail=".doc"; $flag=1; }
if ($tail =? /ms-excel/i && $excel) { $tail=".xls"; $flag=1; }
if ($tail =? /ms-powerpoint/i && $ppt) { $tail=".ppt"; $flag=1; }
if ($tail =? /audio?/.*realaudio/i && $ram) { $tail=".ram"; $flag=1; }
if ($tail =? /application?/.*realmedia/i && $rm) { $tail=".rm"; $flag=1; }
if ($tail =? /video?/.*mpeg/i && $mpeg) { $tail=".mpg"; $flag=1; }
if ($tail =? /audio?/.*mpeg/i && $mp3) { $tail=".mp3"; $flag=1; }
if (!$flag) {
if ($fname =? /?.gif$/i && $gif) { $tail=".gif"; $flag=1; }
if ($fname =? /?.jpe?g$/i && $jpeg) { $tail=".jpg"; $flag=1; }
if ($fname =? /?.png$/i && $png) { $tail=".png"; $flag=1; }
if ($fname =? /?.lzh$/i && $lha) { $tail=".lzh"; $flag=1; }
if ($fname =? /?.txt$/i && $text) { $tail=".txt"; $flag=1; }
if ($fname =? /?.zip$/i && $zip) { $tail=".zip"; $flag=1; }
if ($fname =? /?.pdf$/i && $pdf) { $tail=".pdf"; $flag=1; }
if ($fname =? /?.mid$/i && $midi) { $tail=".mid"; $flag=1; }
if ($fname =? /?.doc$/i && $word) { $tail=".doc"; $flag=1; }
if ($fname =? /?.xls$/i && $excel) { $tail=".xls"; $flag=1; }
if ($fname =? /?.ppt$/i && $ppt) { $tail=".ppt"; $flag=1; }
if ($fname =? /?.ram$/i && $ram) { $tail=".ram"; $flag=1; }
if ($fname =? /?.rm$/i && $rm) { $tail=".rm"; $flag=1; }
if ($fname =? /?.mpe?g$/i && $mpeg) { $tail=".mpg"; $flag=1; }
if ($fname =? /?.mp3$/i && $mp3) { $tail=".mp3"; $flag=1; }
# アップロード失敗処理
if (!$flag && !$clip_error) { }
elsif (!$flag && $clip_error) {
&error("アップロードできないファイル形式です");
$upfile = $in{'upfile'};
# マックバイナリ対策
if ($macbin) {
$length = substr($upfile,83,4);
$length = unpack("%N",$length);
$upfile = substr($upfile,128,$length);
# 添付データを書き込み
$ImgFile = "$ImgDir$no$tail";
open(OUT,"> $ImgFile") || &error("アップロード失敗");
binmode(OUT);
binmode(STDOUT);
print OUT $
close(OUT);
chmod (0666,$ImgFile);
# 画像サイズ取得
if ($tail eq ".jpg") { ($W, $H) = &JpegSize($ImgFile); }
elsif ($tail eq ".gif") { ($W, $H) = &GifSize($ImgFile); }
elsif ($tail eq ".png") { ($W, $H) = &PngSize($ImgFile); }
# 画像表示縮小
if ($W > $MaxW || $H > $MaxH) {
$W2 = $MaxW / $W;
$H2 = $MaxH / $H;
if ($W2 < $H2) { $key = $W2; }
else { $key = $H2; }
$W = int ($W * $key) || 1;
$H = int ($H * $key) || 1;
#----------------#
海外向け書き込み返信フォーム
#----------------#
sub res_form_broad {
local($f,$no,$reno,$date,$name,$mail,$sub,$com,$url);
# ヘッダを出力
# ログを読み込み
open(IN,"$logfile") || &error("Open Error : $logfile");
# 関連記事出力
print "[]?n";
# print "- 以下は、記事NO. $in{'no'} に関する
です -?n";
print "- to Reply↓article NO. $in{'no'}
while () {
($no,$reno,$date,$name,$mail,$sub,$com,$url) = split(//);
if (!$reno) { $com = "$com"; }
if ($in{'no'} == $no && $reno) { $f++; }
if ($in{'no'} == $no || $in{'no'} == $reno) {
if ($in{'no'} == $no) { $resub = $ }
if ($url) { $url = "&&"; }
if ($reno && !$flag) { print "?n"; $flag=1; }
print "$sub 投稿者:$name 投稿日:$date $url No?.$no$com?n";
print "$sub wrote date:$date $url No?.$no$com?n";
close(IN);
if ($f) { &error("不正な返信要求です"); }
if ($flag) { print "?n"; }
print "?n";
# タイトル名
if ($resub !? /^Re?:/) { $resub = "Re?: $resub"; }
print "?n";
&form("res_broad","","","","","",$resub,"","","","","");
print "?n?n";
#----------------#
返信フォーム
#----------------#
sub res_form {
local($f,$no,$reno,$date,$name,$mail,$sub,$com,$url);
# ヘッダを出力
# ログを読み込み
open(IN,"$logfile") || &error("Open Error : $logfile");
# 関連記事出力
print "[]?n";
print "- 以下は、記事NO. $in{'no'} に関する
です -?n";
while () {
($no,$reno,$date,$name,$mail,$sub,$com,$url) = split(//);
if (!$reno) { $com = "$com"; }
if ($in{'no'} == $no && $reno) { $f++; }
if ($in{'no'} == $no || $in{'no'} == $reno) {
if ($in{'no'} == $no) { $resub = $ }
if ($url) { $url = "&&"; }
if ($reno && !$flag) { print "?n"; $flag=1; }
print "$sub 投稿者:$name 投稿日:$date $url No?.$no$com?n";
close(IN);
if ($f) { &error("不正な返信要求です"); }
if ($flag) { print "?n"; }
print "?n";
# タイトル名
if ($resub !? /^Re?:/) { $resub = "Re?: $resub"; }
print "?n";
&form("res","","","","","",$resub,"","","","","");
print "?n?n";
#----------------#
デコード処理
#----------------#
sub decode {
while (($key,$val) = each %in) {
if ($key ne "upfile") {
# シフトJISコードに変換
&jcode'convert(*val, "sjis", "", "z");
# タグ処理
$val =? s/&/&/g;
$val =? s/"/&/g;
$val =? s//&/g;
# 改行処理
if ($key eq "comment") {
$val =? s/?r?n//g;
$val =? s/?r//g;
$val =? s/?n//g;
$val =? s/?r//g;
$val =? s/?n//g;
$in{$key} = $
$mode = $in{'mode'};
$page = $in{'page'};
$in{'url'} =? s/^http?:?/?///;
if ($in{'sub'} eq "") { $in{'sub'} = "無題"; }
#------------#
#------------#
sub howto {
if ($in_email) {
$eml_msg = "記事を投稿する上での必須入力項目は「おなまえ」「Eメール」「メッセージ」です。URL、題名、削除キーは任意です。";
$eml_msg = "記事を投稿する上での必須入力項目は「おなまえ」と「メッセージ」です。Eメール、URL、題名、削除キーは任意です。";
$maxkb = int ($cgi_lib'maxdata / 1024);
if ($gif) { $FILE .= "GIF, "; }
if ($jpeg) { $FILE .= "JPEG, "; }
if ($png) { $FILE .= "PNG, "; }
if ($text) { $FILE .= "TEXT, "; }
if ($lha) { $FILE .= "LHA, "; }
if ($zip) { $FILE .= "ZIP, "; }
if ($pdf) { $FILE .= "PDF, "; }
if ($midi) { $FILE .= "MIDI, "; }
if ($word) { $FILE .= "WORD, "; }
if ($excel) { $FILE .= "EXCEL, "; }
if ($ppt) { $FILE .= "POWERPOINT, "; }
if ($rm) { $FILE .= "RM, "; }
if ($ram) { $FILE .= "RAM, "; }
if ($mpeg) { $FILE .= "MPEG, "; }
if ($mp3) { $FILE .= "MP3, "; }
$FILE =? s/?, $//;
print <<"HTML";
掲示板の利用上の注意
この掲示板はクッキー対応です。1度記事を投稿いただくと、おなまえ、Eメール、URL、削除キーの情報は2回目以降は自動入力されます。(ただし利用者のブラウザがクッキー対応の場合)
画像などのバイナリーファイルをアップロードすることが可能?です。
添付可能?ファイル : $FILE
最大投稿データ量 : $maxkb KB
画像は横$MaxWピクセル、縦$MaxHピクセルを超えると縮小表?示されます。
投稿内容には、タグは一切使用できません。
記事には、半角カナは一切使用しないで下さい。文字化けの原因となります。
記事の投稿時に「削除キー」にパスワード(英数字で8文字以内)を入れておくと、その記事は次回削除キーによって削除することができます。
記事の保持件数は最大 $max件です。それを超えると古い順に自動削除されます。
既存の記事に「返信」をすることができます。各記事の上部にある「返信」ボタンを押すと返信用フォームが現れます。
過去の投稿記事から「キーワード」によって簡易検索ができます。トップメニューののリンクをクリックすると検索モードとなります。
管理者が著しく不利益と判断する記事や他人を誹謗中傷する記事は予?告なく削除することがあります。
#------------------#
ワード検索処理
#------------------#
sub find {
print <<"EOM";
ワード検索
検索したいキーワードを入力し、「条件」「表?示」を選択して「検索」ボタンを押して下さい。
キーワードは「半角スペース」で区切って複数指定することができます。
キーワード:
if (!$in{'cond'}) { $in{'cond'} = "AND"; }
foreach ("AND", "OR") {
if ($in{'cond'} eq "$_") {
print "$_?n";
print "$_?n";
print "?n";
print "表?示:?n";
if ($in{'view'} eq "") { $in{'view'} = $p_ }
foreach (5,10,15,20) {
if ($in{'view'} == $_) {
print "$_件?n";
print "$_件?n";
print "?n";
print "?n?n";
# ワード検索の実行と結果表示
if ($in{'word'} ne "") {
# 入力内容を整理
$in{'word'} =? s/ / /g;
@pairs = split(/?s+/, $in{'word'});
# ファイルを読み込み
open(IN,"$logfile") || &error("Open Error : $logfile");
while () {
foreach $pair (@pairs) {
if (index($_,$pair) >= 0) {
if ($in{'cond'} eq 'OR') { }
if ($in{'cond'} eq 'AND') { $flag=0; }
if ($flag) { push(@new,$_); }
close(IN);
# 検索終了
$count = @
print "検索結果:$count件?n";
if ($page eq '') { $page = 0; }
$end_data = @new - 1;
$page_end = $page + $in{'view'} - 1;
if ($page_end >= $end_data) { $page_end = $end_ }
$next_line = $page_end + 1;
$back_line = $page - $in{'view'};
$enwd = &url_enc($in{'word'});
if ($back_line >= 0) {
print "[]?n";
if ($page_end ne "$end_data") {
print "[]?n";
print "[]?n";
foreach ($page .. $page_end) {
($no,$reno,$date,$name,$email,$sub,$com,$url)
= split(//, $new[$_]);
if ($email) { $name = ""; }
if ($url) { $url = "&&"; }
if ($reno) { $no = "$renoへのレス"; }
# 結果を表示
print "[$no] $sub";
print " 投稿者:$name 投稿日:$date $url?n";
print "$com?n";
print "?n";
print "?n";
#------------------#
クッキーの発行
#------------------#
sub set_cookie {
local($gmt, $cook, @t, @m, @w);
@t = gmtime(time + 60*24*60*60);
@m = ('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');
@w = ('Sun','Mon','Tue','Wed','Thu','Fri','Sat');
$gmt = sprintf("%s, %02d-%s-%04d %02d:%02d:%02d GMT",
$w[$t[6]], $t[3], $m[$t[4]], $t[5]+1900, $t[2], $t[1], $t[0]);
$cook="$in{'name'}$in{'email'}$in{'url'}$in{'pwd'}$in{'icon'}$in{'color'}";
print "Set-Cookie: Joyful_Note=$ expires=$gmt?n";
#------------------#
クッキーを取得
#------------------#
sub get_cookie {
local($key, $val, *ck);
$ck = $ENV{'HTTP_COOKIE'};
foreach (split(/;/, $ck)) {
($key, $val) = split(/=/);
$key =? s/?s//g;
$ck{$key} = $
@ck = split(//, $ck{'Joyful_Note'});
return (@ck);
#--------------#
エラー処理
#--------------#
sub error {
&unlock if ($lockflag);
&header if (!$head_flag);
print "ERROR !?n";
print "$_[0]?n";
print "?n";
print "?n";
#--------------#
海外向け英訳news書き込みモード
#--------------#
sub broad {
# if ($in{'pass'} eq "") {
print "パスワードを入力して下さい?n";
print "?n";
print "?n";
print "?n";
print "?n";
print "?n";
print "?n?n";
# if ($in{'pass'} ne $pass) { &error("パスワードが違います"); }
print "[]?n";
print "?n";
# print "管理モード?n";
print "?n";
# 画像許可
if ($in{'chk'}) {
@CHK = split(/?0/, $in{'chk'});
# ロック処理
if ($lockkey) { & }
# 許可情報をマッチングし更新
open(IN,"$logfile") || &error("Open Error : $logfile");
while () {
($no,$reno,$d,$n,$m,$s,$com,$u,$ho,$p,$c,$t,$w,$h,$chk)
= split(//);
foreach $xx (@CHK) {
if ($no eq $xx) {
$_ = "$no$reno$d$n$m$s$com$u$ho$p$c$t$w$h1?n";
push(@new,$_);
close(IN);
unshift(@new,$top);
open(OUT,">$logfile") || &error("Write Error : $logfile");
print OUT @
close(OUT);
# ロック解除
if ($lockkey) { & }
# 削除処理
if ($in{'del'}) {
@DEL = split(/?0/, $in{'del'});
# ロック処理
if ($lockkey) { & }
# 削除情報をマッチングし更新
open(IN,"$logfile") || &error("Open Error : $logfile");
while () {
($no,$reno,$d,$n,$m,$s,$com,$u,$ho,$p,$c,$tail,$w,$h,$chk)
= split(//);
foreach $del (@DEL) {
if ($no eq $del || $reno eq $del) {
if (-e "$ImgDir$no$tail") {
unlink("$ImgDir$no$tail");
if ($flag == 0) { push(@new,$_); }
close(IN);
unshift(@new,$top);
open(OUT,">$logfile") || &error("Write Error : $logfile");
print OUT @
close(OUT);
# ロック解除
if ($lockkey) { & }
# 管理を表示
# if ($page eq "") { $page = 0; }
# print "?n?n";
# print "記事を削除する場合は「削除」のチェックボックスにチェックを入れ「送信する」を押して下さい。?n";
# print "画像許可を行なう場合は「画像許可」のチェックボックスにチェックを入れ「送信する」を押して下さい。?n";
# print "?n?n";
# print "?n";
# print "?n";
# print "?n";
# print "?n";
# print "?n";
# print "";
# print "?n";
# print "?n";
# print "削除子記事記事NO投稿日";
# print "タイトル投稿者URLコメント";
# print "ホスト名画像(bytes)?n";
if ($ImageCheck) { print "画像許可"; $line=10; }
print "?n";
open(IN,"$logfile") || &error("Open Error : $logfile");
while () {
$img_flag=0;
($no,$reno,$date,$name,$mail,$sub,$com,$url,$host,$pw,$color,$tail,$w,$h,$chk) = split(//);
if ($mail) { $name=""; }
($date) = split(/?(/, $date);
if ($url) { $url = "&&"; }
else { $url = '-'; }
$com =? s///
$com =? s//&/g;
if (length($com) > 40) {
$com = substr($com,0,38);
$com .= "...";
if (-e "$ImgDir$no$tail") {
if ($tail eq ".gif" || $tail eq ".jpg" || $tail eq ".png") {
$img_flag = 1;
$File = "画像";
} else { $File = "File"; }
$clip = "";
$size = -s "$ImgDir$no$tail";
$clip = "";
$size = 0;
if ($reno eq "") { print "?n"; }
# チェックボックス
#削除用のチェックボックスは非表示
print "$no";
print "$date$sub$name";
print "$url$com";
#ホスト名?画像は非表示
print "$host$clip($size)?n";
# 画像許可
if ($ImageCheck) {
if ($img_flag == 1 && $chk == 1) {
print "OK";
} elsif ($img_flag == 1 && $chk != 1) {
print "?n";
close(IN);
print "?n";
print "?n";
$all = int ($all / 1024);
# print "【添付データ総数 : $all KB】?n";
# print "?n";
# print "?n";
#--------------#
管理モード
#--------------#
sub admin {
if ($in{'pass'} eq "") {
print "パスワードを入力して下さい?n";
print "?n";
print "?n";
print "?n";
print "?n";
print "?n";
print "?n?n";
if ($in{'pass'} ne $pass) { &error("パスワードが違います"); }
print "[]?n";
print "?n";
print "管理モード?n";
print "?n";
# 画像許可
if ($in{'chk'}) {
@CHK = split(/?0/, $in{'chk'});
# ロック処理
if ($lockkey) { & }
# 許可情報をマッチングし更新
open(IN,"$logfile") || &error("Open Error : $logfile");
while () {
($no,$reno,$d,$n,$m,$s,$com,$u,$ho,$p,$c,$t,$w,$h,$chk)
= split(//);
foreach $xx (@CHK) {
if ($no eq $xx) {
$_ = "$no$reno$d$n$m$s$com$u$ho$p$c$t$w$h1?n";
push(@new,$_);
close(IN);
unshift(@new,$top);
open(OUT,">$logfile") || &error("Write Error : $logfile");
print OUT @
close(OUT);
# ロック解除
if ($lockkey) { & }
# 削除処理
if ($in{'del'}) {
@DEL = split(/?0/, $in{'del'});
# ロック処理
if ($lockkey) { & }
# 削除情報をマッチングし更新
open(IN,"$logfile") || &error("Open Error : $logfile");
while () {
($no,$reno,$d,$n,$m,$s,$com,$u,$ho,$p,$c,$tail,$w,$h,$chk)
= split(//);
foreach $del (@DEL) {
if ($no eq $del || $reno eq $del) {
if (-e "$ImgDir$no$tail") {
unlink("$ImgDir$no$tail");
if ($flag == 0) { push(@new,$_); }
close(IN);
unshift(@new,$top);
open(OUT,">$logfile") || &error("Write Error : $logfile");
print OUT @
close(OUT);
# ロック解除
if ($lockkey) { & }
# 管理を表示
if ($page eq "") { $page = 0; }
print "?n?n";
print "記事を削除する場合は「削除」のチェックボックスにチェックを入れ「送信する」を押して下さい。?n";
print "画像許可を行なう場合は「画像許可」のチェックボックスにチェックを入れ「送信する」を押して下さい。?n";
print "?n?n";
print "?n";
print "?n";
print "?n";
print "?n";
print "?n";
print "?n";
print "?n";
print "削除子記事記事NO投稿日";
print "タイトル投稿者URLコメント";
print "ホスト名画像(bytes)?n";
if ($ImageCheck) { print "画像許可"; $line=10; }
print "?n";
open(IN,"$logfile") || &error("Open Error : $logfile");
while () {
$img_flag=0;
($no,$reno,$date,$name,$mail,$sub,$com,$url,$host,$pw,$color,$tail,$w,$h,$chk) = split(//);
if ($mail) { $name=""; }
($date) = split(/?(/, $date);
if ($url) { $url = "&&"; }
else { $url = '-'; }
$com =? s///
$com =? s//&/g;
if (length($com) > 40) {
$com = substr($com,0,38);
$com .= "...";
if (-e "$ImgDir$no$tail") {
if ($tail eq ".gif" || $tail eq ".jpg" || $tail eq ".png") {
$img_flag = 1;
$File = "画像";
} else { $File = "File"; }
$clip = "";
$size = -s "$ImgDir$no$tail";
$clip = "";
$size = 0;
if ($reno eq "") { print "?n"; }
# チェックボックス
print "$no";
print "$date$sub$name";
print "$url$com";
print "$host$clip($size)?n";
# 画像許可
if ($ImageCheck) {
if ($img_flag == 1 && $chk == 1) {
print "OK";
} elsif ($img_flag == 1 && $chk != 1) {
print "?n";
close(IN);
print "?n";
print "?n";
$all = int ($all / 1024);
print "【添付データ総数 : $all KB】?n";
print "?n";
print "?n";
#------------------#
ユーザ記事削除
#------------------#
sub usr_del {
if ($in{'no'} eq '' || $in{'pwd'} eq '')
{ &error("記事Noまたは削除キーが入力モレです"); }
# ロック処理
if ($lockkey) { & }
open(IN,"$logfile") || &error("Open Error : $logfile");
@lines = ;
close(IN);
$top = shift(@lines);
foreach (@lines) {
($no,$reno,$date,$name,$mail,$sub,$com,
$url,$host,$pw,$color,$tail,$w,$h,$chk) = split(//);
if ($flag == 0 && $in{'no'} eq "$no") {
if ($pw eq '') {
&error("該当記事には削除キーが設定されていません");
# 削除キーを照合
$match = &decrypt("$in{'pwd'}","$pw");
if ($match ne 'yes') { &error("削除キーが違います"); }
# 添付ファイル削除
if (-e "$ImgDir$no$tail") { unlink("$ImgDir$no$tail"); }
if ($reno eq "") { $flag=2; }
else { $flag=1; }
elsif ($flag == 2 && $in{'no'} eq $reno) {
if (-e "$ImgDir$no$tail") { unlink("$ImgDir$no$tail"); }
else { push(@new,$_); }
if ($flag == 0) { &error("該当記事が見当たりません"); }
unshift(@new,$top);
open(OUT,">$logfile") || &error("Write Error : $logfile");
print OUT @
close(OUT);
# ロック解除
if ($lockkey) { & }
#----------------#
記事修正処理
#----------------#
sub usr_edt {
if ($in{'no'} eq '' || $in{'pwd'} eq '') {
&error("記事Noまたはパスワードが入力モレです");
if ($in{'action'} eq "edit") {
# フォーム入力チェック
# ロック処理
&lock if ($lockkey);
open(IN,"$logfile") || &error("Open Error : $logfile");
while () {
($no,$reno,$date,$name,$mail,$sub,$com,$url,$host,$pw,$color,$tail,$w,$h,$chk) = split(//);
if ($in{'no'} == $no) {
if ($in{'action'} ne "edit") { }
$_ = "$no$reno$date$in{'name'}$in{'email'}$in{'sub'}$in{'comment'}$in{'url'}$host$pw$in{'color'}$tail$w$h$chk?n";
if ($in{'action'} eq "edit") { push(@new,$_); }
close(IN);
if (!$flag) { &error("該当の記事が見当たりません"); }
if ($pw2 eq "") { &error("パスワードが設定されていません"); }
$check = &decrypt($in{'pwd'}, $pw2);
if ($check ne "yes") { &error("パスワードが違います"); }
if ($in{'action'} eq "edit") {
unshift(@new,$top);
open(OUT,">$logfile") || &error("Write Error : $logfile");
print OUT @
close(OUT);
&unlock if ($lockkey);
if ($in{'url'}) { $in{'url'} = ""; }
if ($in{'email'}) { $in{'email'} = ""; }
print "- 以下のとおり修正が完了しました -?n";
print "?n";
print "名前: $in{'name'}?n";
print "e-mail: $in{'email'}?n";
print "題名: $in{'sub'}?n";
print "URL: $in{'url'}?n";
print "$in{'comment'}?n";
print "?n";
print "?n";
print "?n";
print "?n?n";
$com =? s//?r/g;
print "[]?n";
print "- 変更する部分のみ修正して送信ボタンを押して下さい -?n";
&form("edit",$no,$reno,$date,$name,$mail,$sub,$com,$url,$host,$pw,$color);
print "?n?n";
#------------------------#
フォーム入力チェック
#------------------------#
sub form_check {
# 他サイトからのアクセスを排除
if ($base_url) {
$ref = $ENV{'HTTP_REFERER'};
$ref =? s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/
if ($ref !? /$base_url/i) { &error("不正なアクセスです"); }
# 入力項目のチェック
if ($in{'name'} eq "") { &error("名前が入力されていません"); }
if ($in{'comment'} eq "") { &error("コメントが入力されていません"); }
if ($in_email) {
if ($in{'email'} eq "") { &error("Eメールが入力されていません"); }
elsif ($in{'email'} !? /[?w?.?-]+?@[?w?.?-]+?.[a-zA-Z]{2,5}$/) {
&error("Eメールの入力内容が不正です");
#--------------#
時間を取得
#--------------#
sub get_time {
$ENV{'TZ'} = "JST-9";
($min,$hour,$mday,$mon,$year,$wday) = (localtime($times))[1..6];
@week = ('Sun','Mon','Tue','Wed','Thu','Fri','Sat');
# 日時のフォーマット
# $date = sprintf("%04d/%02d/%02d(%s) %00d:%00d",
$year+1900,$mon+1,$mday,$week[$wday],$hour,$min);
#yyyy/mm/dd/[day] mm:ss→yyyy/mm/dd/[day]へ変更(そこさんリクエスト)
$date = sprintf("%04d/%02d/%02d ",
$year+1900,$mon+1,$mday);
#----------------#
カウンタ処理
#----------------#
sub counter {
# 閲覧時のみカウントアップ
if ($mode eq '') { $cntup=1; } else { $cntup=0; }
# カウントファイルを読みこみ
open(IN,"$cntfile") || &error("Open Error : $cntfile");
eval "flock(IN, 1);";
close(IN);
# IPチェックとログ破損チェック
($cnt, $ip) = split(/:/, $data);
if ($addr eq "$ip" || $cnt eq "") { $cntup=0; }
# カウントアップ
if ($cntup) {
open(OUT,"+< $cntfile") || &error("Write Error : $cntfile");
eval "flock(OUT, 2);";
truncate(OUT, 0);
seek(OUT, 0, 0);
print OUT "$cnt?:$addr";
close(OUT);
# 桁数調整
while(length($cnt) < $mini_fig) { $cnt = '0' . $ }
@cnts = split(//, $cnt);
# GIFカウンタ表示
if ($counter == 2) {
foreach (0 .. $#cnts) {
# テキストカウンタ表示
print "$cnt?n";
#--------------#
ロック処理
#--------------#
sub lock {
# 1分以上古いロックは削除する
if (-e $lockfile) {
local($mtime) = (stat($lockfile))[9];
if ($mtime < time - 60) { & }
local($retry) = 5;
# symlink関数式ロック
if ($lockkey == 1) {
while (!symlink(".", $lockfile)) {
if (--$retry <= 0) { &error('LOCK is BUSY'); }
# mkdir関数式ロック
} elsif ($lockkey == 2) {
while (!mkdir($lockfile, 0755)) {
if (--$retry <= 0) { &error('LOCK is BUSY'); }
$lockflag=1;
#--------------#
ロック解除
#--------------#
sub unlock {
if ($lockkey == 1) { unlink($lockfile); }
elsif ($lockkey == 2) { rmdir($lockfile); }
$lockflag=0;
#--------------#
メール送信
#--------------#
sub mail_to {
local($com, $hp, $mail_sub, $mail_body);
# メールタイトルを定義
$mail_sub = "[$title : $no] $in{'sub'}";
# 記事の改行を復元
= $in{'comment'};
$com =? s//?n/g;
if ($in{'url'}) { $hp = "http://$in{'url'}"; }
else { $hp = ""; }
# メール本文を定義
$mail_body = <<"EOM";
投稿日時:$date
ホスト名:$host
ブラウザ:$ENV{'HTTP_USER_AGENT'}
投稿者名:$in{'name'}
Eメール:$in{'email'}
タイトル:$in{'sub'}
投稿記事:
# JISコード変換
&jcode'convert(*mail_sub,'jis');
&jcode'convert(*mail_body,'jis');
# メールアドレスがない場合は管理者メールに置き換え
if ($in{'email'} eq "") { $email = $ }
else { $email = $in{'email'}; }
open(MAIL,"| $sendmail -t");
print MAIL "To: $mailto?n";
print MAIL "From: $email?n";
print MAIL "Subject: $mail_sub?n";
print MAIL "MIME-Version: 1.0?n";
print MAIL "Content-type: text/ charset=ISO-2022-JP?n";
print MAIL "Content-Transfer-Encoding: 7bit?n";
print MAIL "X-Mailer: $ver?n?n";
print MAIL "--------------------------------------------------------?n";
print MAIL "$mail_body?n";
print MAIL "--------------------------------------------------------?n";
close(MAIL);
#----------------------#
パスワード暗号処理
#----------------------#
sub encrypt {
local($inpw) = $_[0];
local(@SALT, $salt, $encrypt);
@SALT = ('a'..'z', 'A'..'Z', '0'..'9', '.', '/');
$salt = $SALT[int(rand(@SALT))] . $SALT[int(rand(@SALT))];
$encrypt = crypt($inpw, $salt) || crypt ($inpw, '$1$' . $salt);
#----------------------#
パスワード照合処理
#----------------------#
sub decrypt {
local($inpw, $logpw) = @_;
local($salt, $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"; }
#------------------#
HTMLのヘッダー
#------------------#
sub header {
$head_flag=1;
print "Content-type: text/html?n?n";
print <<"EOM";
#-----------------#
自動URLリンク
#-----------------#
sub auto_link {
$_[0] =? s/([^=^?"]|^)(http?:[?w?.???-?/???&?+?=?:?@?%?;?#?%]+)/$1"; }
if ($purl) { $purl = "&&"; }
if ($preno) { $pno = "Res: $preno"; }
# 保存記事をフォーマット
push(@temp,"[$pno] $psub 投稿者:$pname 投稿日:$pdate $purl$pcom?n");
# 過去ログを更新
unshift(@past,@temp);
open(OUT,">$pastfile") || &error("Write Error : $pastfile");
print OUT @
close(OUT);
if ($past_flag) { chmod(0666,$pastfile); }
#------------#
#------------#
sub past {
open(IN,"$nofile") || &error("Open Error : $nofile");
$pastno = ;
close(IN);
if (!$in{'pastlog'}) { $in{'pastlog'} = $ }
print <<"EOM";
過去ログ[$in{'pastlog'}]
過去ログ:
$pastkey = $
while ($pastkey > 0) {
if ($in{'pastlog'} == $pastkey) {
print "$pastkey Page?n";
print "$pastkey Page?n";
$pastkey--;
print "?n?n";
print "?n";
print "?n";
print "?n";
print "?n";
print "ワード検索:?n";
print "条件:?n";
foreach ('AND', 'OR') {
if ($in{'cond'} eq "$_") {
print "$_?n";
print "$_?n";
print "?n";
print "表?示:?n";
if ($in{'view'} eq "") { $in{'view'} = $p_ }
foreach (5,10,15,20,25,30) {
if ($in{'view'} eq "$_") {
print "$_件?n";
print "$_件?n";
print "?n?n";
print "?n";
# 表示ログを定義
$in{'pastlog'} =? s/?D//g;
$file = "$pastdir$in{'pastlog'}?.dat";
# ワード検索処理
if ($in{'word'} ne "") {
$in{'word'} =? s/ / /g;
@pairs = split(/?s+/, $in{'word'});
open(IN,"$file") || &error("Open Error : $file");
while () {
foreach $pair (@pairs) {
if (index($_,$pair) >= 0) {
if ($in{'cond'} eq 'OR') { }
if ($in{'cond'} eq 'AND') { $flag=0; }
if ($flag) { push(@new,$_); }
close(IN);
$count = @
print "検索結果:$count件?n";
if ($page eq '') { $page = 0; }
$end_data = @new - 1;
$page_end = $page + $in{'view'} - 1;
if ($page_end >= $end_data) { $page_end = $end_ }
$next_line = $page_end + 1;
$back_line = $page - $in{'view'};
$enwd = &url_enc($in{'word'});
if ($back_line >= 0) {
print "[]?n";
if ($page_end ne "$end_data") {
print "[]?n";
# 表示開始
foreach ($page .. $page_end) { print $new[$_]; }
print "?n?n";
# ページ区切り処理
$start = $page + 1;
= $page + $p_
open(IN,"$file") || &error("Open Error : $file");
while () {
if ($_ =? /^??[??d+??]/) { $flag=1; $i++; }
if ($flag) { print $_; }
$_ =? s///
print "$_?n";
close(IN);
print "?n";
$next = $page + $p_
$back = $page - $p_
print "?n";
if ($back >= 0) {
print "?n";
print "?n";
print "?n";
print "?n";
print "?n";
if ($next < $i) {
print "?n";
print "?n";
print "?n";
print "?n";
print "?n";
print "?n?n?n";
#------------------#
チェックモード
#------------------#
sub check {
print "Check Mode?n";
print "?n";
# ログパス
if (-e $logfile) {
print "ログファイルのパス:OK?n";
# パーミッション
if (-r $logfile && -w $logfile) {
print "ログファイルのパーミッション:OK?n";
} else { print "ログファイルのパーミッション:NG?n"; }
} else { print "ログファイルのパス:NG → $logfile?n"; }
# カウンタログ
print "カウンタ:";
if ($counter) {
print "設定あり?n";
if (-e $cntfile) { print "カウンタログファイルのパス:OK?n"; }
else { print "カウンタログファイルのパス:NG → $cntfile?n"; }
} else { print "設定なし?n"; }
# ロックディレクトリ
print "ロック形式:";
if ($lockkey == 0) { print "ロック設定なし?n"; }
if ($lockkey == 1) { print "symlink?n"; }
else { print "mkdir?n"; }
($lockdir) = $lockfile =? /(.*)[???/].*$/;
print "ロックディレクトリ:$lockdir?n";
if (-d $lockdir) {
print "ロックディレクトリのパス:OK?n";
if (-r $lockdir && -w $lockdir && -x $lockdir) {
print "ロックディレクトリのパーミッション:OK?n";
print "ロックディレクトリのパーミッション:NG → $lockdir?n";
} else { print "ロックディレクトリのパス:NG → $lockdir?n"; }
# 画像ディレクトリ
print "画像ディレクトリ:$ImgDir?n";
if (-d $ImgDir) {
print "画像ディレクトリのパス:OK?n";
if (-r $ImgDir && -w $ImgDir && -x $ImgDir) {
print "画像ディレクトリのパーミッション:OK?n";
print "画像ディレクトリのパーミッション:NG → $ImgDir?n";
} else { print "画像ディレクトリ:NG → $ImgDir?n"; }
# 過去ログ
print "過去ログ:";
if ($pastkey == 0) { print "設定なし?n"; }
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";
print "過去ログディレクトリパーミッション:NG → $pastdir?n";
} else { print "過去ログディレクトリパーミッション:NG → $pastdir?n"; }
print "?n?n";
#------------------#
JPEGサイズ認識
#------------------#
sub JpegSize {
local($jpeg) = @_;
local($t, $m, $c, $l, $W, $H);
open(JPEG,"$jpeg") || return (0,0);
binmode JPEG;
read(JPEG, $t, 2);
while (1) {
read(JPEG, $t, 4);
($m, $c, $l) = unpack("a a n", $t);
if ($m ne "?xFF") { $W = $H = 0; }
elsif ((ord($c) >= 0xC0) && (ord($c) <= 0xC3)) {
read(JPEG, $t, 5);
($H, $W) = unpack("xnn", $t);
read(JPEG, $t, ($l - 2));
close(JPEG);
return ($W, $H);
#-----------------#
GIFサイズ認識
#-----------------#
sub GifSize {
local($gif) = @_;
local($data);
open(GIF,"$gif") || return (0,0);
binmode(GIF);
sysread(GIF,$data,10);
close(GIF);
if ($data =? /^GIF/) { $data = substr($data,-4); }
$W = unpack("v",substr($data,0,2));
$H = unpack("v",substr($data,2,2));
return ($W, $H);
#-----------------#
PNGサイズ認識
#-----------------#
sub PngSize {
local($png) = @_;
local($data);
open(PNG, "$png") || return (0,0);
binmode(PNG);
read(PNG, $data, 24);
close(PNG);
$W = unpack("N", substr($data, 16, 20));
$H = unpack("N", substr($data, 20, 24));
return ($W, $H);
#-----------------#
URLエンコード
#-----------------#
sub url_enc {
local($_) = @_;
s/(?W)/'%' . unpack('H2', $1)/
#----------------#
投稿フォーム
#----------------#
sub form {
local($type,$no,$reno,$date,$name,$mail,$sub,$com,$url,$host,$pw,$color) = @_;
local($cnam,$ceml,$curl,$cpwd,$cico,$ccol);
print "?n";
## フォーム種別を判別
if ($type eq "edit") {
print "?n";
print "?n";
print "?n";
print "?n";
print "?n";
} elsif ($type eq "res") {
if ($res_clip) {
print "?n";
print "?n";
print "?n";
print "?n";
($cnam,$ceml,$curl,$cpwd,$cico,$ccol) = &get_
# 海外向け返信
} elsif ($type eq "res_broad") {
if ($res_clip) {
print "?n";
print "?n";
print "?n";
print "?n";
($cnam,$ceml,$curl,$cpwd,$cico,$ccol) = &get_
print "?n";
print "?n";
($cnam,$ceml,$curl,$cpwd,$cico,$ccol) = &get_
#海外向けであれば
if ($type eq "res_broad") {
print <<"EOM";
#海外向け返信フォームでも画像を許可
if ($type eq "" || ($type eq "res_broad" && $res_clip)) {
print "Add File?n";
print "?n";
print "TEXT COLOR?n";
@col = split(/?s+/, $colors);
if ($ccol eq "") { $ccol = $col[0]; }
foreach (@col) {
if ($ccol eq $_) {
print "■?n";
print "■?n";
print "?n";
print "?n";
#海外向けでなく、通常の場合
print <<"EOM";
# 添付フォーム
if ($type eq "" || ($type eq "res" && $res_clip)) {
print "添付File?n";
print "?n";
# パスワード欄
if ($type ne "edit") {
print "パスワード",
"(英数字で8文字以内)?n";
print "文字色?n";
@col = split(/?s+/, $colors);
if ($ccol eq "") { $ccol = $col[0]; }
foreach (@col) {
if ($ccol eq $_) {
print "■?n";
print "■?n";
print "?n";
if ($ImageCheck) {
print "?画像は管理者が許可するまで「COMING SOON」のアイコンが表?示されます。?n";
print "?n";
が許可するまで「COMING SOON」のアイコンが表?示されます。?n";
print "?n";

我要回帖

更多关于 face wash 的文章

 

随机推荐