// PHP掲示板 // Copyright 2000-2002 (c) motion.to Webmaster's // // for motion.to Server // // [Readme.txt] // この掲示板は、motion.to Server内にて使用できるよう、 // ある程度のカスタマイズが入っておりますので、 // 他サイトでのご使用はご遠慮ください。 // // データファイルは勝手に作成されますので、 // 事前の作成は必要ありません。 // // この掲示板は、現在、 // パソコン、NTT DoCoMo(i-mode)、J-PHONE(SkyWeb)、EZweb(au,TU-KA)に // 対応済みです。 // // [履歴] // Ver 1.00 2000/ 7/20 初版 // Ver 1.05 2000/ 8/22 削除機能追加 // Ver 1.06 2000/ 9/17 設定ファイルを別ファイルへ // Ver 1.07 2000/ 9/18 i-mode対応 // Ver 1.08 2000/ 9/19 EZweb対応 // Ver 1.09 2000/ 9/21 管理モード作成 // Ver 1.10 2000/ 9/22 デザイン変更 // Ver 1.11 2000/ 9/30 デザイン変更 & J-PHONE MML3.0対応 // Ver 1.12 2000/10/11 PalmOS対応 // Ver 1.13 2000/10/27 DreamCast表示 & Windows Me表示 // Ver 1.14 2000/11/ 7 J-PHONE全機種対応 // Ver 1.15 2000/11/22 返信機能追加 // Ver 1.16 2000/11/28 入力機能JavaScript対応 // Ver 1.17 2000/11/30 管理者メニューサブウインドウ化 // Ver 1.18 2000/12/ 3 管理者設定メニュー化 // Ver 1.18a 2000/12/ 4 管理者設定メニュー修正 // Ver 1.19 2001/ 3/ 6 新着メッセージ部分の変更 // Ver 1.30 2001/ 3/14 返信機能強化 // Ver 1.30a 2001/ 3/20 返信機能の修正 // Ver 1.31 2001/ 9/ 7 携帯の返信機能追加 // Ver 1.31a 2001/ 9/ 8 携帯の返信機能強化 // Ver 1.31b 2001/ 9/ 9 WindowsCE対応 // Ver 1.32 2001/ 9/18 time関数の繰り上がり対応 // Ver 1.33 2001/ 9/19 改行不具合の修正 // Ver 1.34 2002/ 3/24 WindowsXP対応 // Ver 1.35 2002/ 4/11 レス複数件不具合対応 // Ver 1.35a 2002/ 4/16 レス複数件不具合対応 // Ver 1.35b 2002/ 4/16 kabo's Customize // Ver 1.36 2002/ 5/16 J-PHONE表示修正 // Ver 1.40 2002/ 6/16 表示形式変更(COC利用のため履歴表示可能な形へ) // Ver 1.41 2002/10/15 書き込み通知メール機能追加 // Ver 1.41a 2002/10/17 書き込み通知メール機能res部分機能追加 // Ver 1.42β2002/12/15 書き込み通知メール、機能追加 (COC 2003.1 OFF Custom版) // 必須設定 ------------------------------------------------------------------ // データファイル名 $file = "phpbbs.dat"; // 管理者用パスワードファイル $admin_file = "phpbbs.adm"; // Ver 1.09 Added // 設定ファイル $conf_file = "phpbbs.conf"; // Ver 1.18 Added // include ('phpbbs.conf'); // 設定ファイル読み込み if (file_exists ($conf_file)) { $conf_data = file($conf_file); while ( list( $num, $conf_line ) = each( $conf_data ) ) { $confdata = explode(" | ", $conf_line); $title = $confdata[0]; $disp_max = $confdata[1]; $top_url = $confdata[2]; $bgcolor = $confdata[3]; $subject_color = $confdata[4]; $txtcolor = $confdata[5]; $lnkcolor = $confdata[6]; $mail_address = $confdata[7]; //Ver 1.41 Added $from_address = $confdata[8]; //Ver 1.41 Added } } else { $title = "PHP BBS"; $disp_max = 100; $top_url = "http://www.motion.to/"; $bgcolor = "#FFFFFF"; $subject_color = "#AAAAAA"; $txtcolor = "#000000"; $lnkcolor = "#0000FF"; $mail_address = ""; //Ver 1.41 Added $from_address = ""; //Ver 1.41 Added } // Ver 1.42 Added // 転送メールON/OFF設定 (0:OFF 1:ON) $mail_tenso= 1; // 転送内容 (0:件名 & 投稿者, 1:件名 & 投稿者 & 内容) $mail_body = 1; // 転送フッタ $mail_footer = "このアドレスには返信できません。\n"; $mail_footer = $mail_footer . "下のURLより掲示板の方へ書き込みください\n"; // 管理者パスワード読み込み if (file_exists ($admin_file)) { $admin_data = file($admin_file); while ( list( $num, $admin_line ) = each( $admin_data ) ) { $admdata = explode(" | ", $admin_line); $admin_passwd = $admdata[0]; } } else { $admin_passwd = crypt("","pb"); } // 管理者モードパスワード設定 if ($admin_mode == 3) { if ($admin_passwd <> crypt($olpass,"pb")) { $admin_mode = 2; } else { $admin_mode = 3; if (($n1pass <> "" && $n2pass <> "") && ($n1pass == $n2pass)) { if (file_exists ($admin_file)) { $admin_data = file($admin_file); } $write_adm = crypt($n1pass,"pb") . " | \n"; unset($admin_data[0]); $admin_data[0] = $write_adm; $adm_file_data = join($admin_data,""); $fp = fopen($admin_file ,"w"); fwrite($fp,$adm_file_data); fclose($fp); $admin_mode = 9; } else if ($n1pass <> $n2pass) { $admin_mode = 4; } } } // 書き込み削除部分 if ($pwd <> "") { $crypt_pwd = crypt($pwd,"pb"); if (file_exists ($file)) { $data = file($file); } while ( list( $num, $line ) = each( $data ) ) { $bbsdata = explode(" | ", $line); if (($bbsdata[0] == $target) && (($bbsdata[9] == $crypt_pwd) || ($admin_passwd <> crypt($olpass,"pb")))){ unset($data[$num]); $file_data = join($data,""); $fp = fopen($file ,"w"); fwrite($fp,$file_data); fclose($fp); } } } // レス対応 Added Ver1.30 if ($name <> "" && $subject <> "" && $passwd <> "" && $res <> "") { if (file_exists ($file)) { $data = file($file); } $repl_cnt = 0; $res_search = 0; while ( list( $num, $line ) = each( $data ) ) { $bbsdata = explode(" | ", $line); if ($bbsdata[0] == $res) { $repl = $num; } if ($bbsdata[0] == $res - $res_search) { $res_search = $res_search + 1; $repl_cnt = $repl_cnt + 1; } } $value2 = ereg_replace( "\r|\n", "", nl2br(htmlspecialchars($value))); $write_bbs = $res - $repl_cnt. " | " . $name . " | " . $subject . " | " . $value2 . " | " . $url . " | " . date("Y年n月j日 G時i分") . " | " . $email . " | " . $REMOTE_HOST . " | " . $HTTP_USER_AGENT . " | " . crypt($passwd,"pb") . " | " . time() . " | \n"; $data[] = $write_bbs; $file_data = join($data,""); $fp = fopen($file ,"w"); fwrite($fp,$file_data); fclose($fp); // Ver 1.41 Added // mail送付ルーチン if ($from_address <> "" && $mail_address <> "") { $to = ereg_replace("\n", ",", $mail_address); $mail_subject = $title . "に書き込まれました"; $from = $from_address; $mes = $mes . "$name さんより"; $mes = $mes . "\n"; $mes = $mes . "$subject について、書き込みされました。"; $mes = $mes . "\n"; // Ver 1.42 Added if ($mail_body == 1) { $mes = $mes . "-------------------------------------------------------\n"; $mes = $mes . "$value"; } $mes = $mes . "\n-------------------------------------------------------\n"; $mes = $mes . "\n"; $mes = $mes . "$mail_footer"; $mes = $mes . "$top_url"; mail($to,$mail_subject,ereg_replace("\r", "", $mes),"From: $from\nX-Mailer: PHP/" .phpversion()); } } // 入力書き込み部分 if ($name <> "" && $subject <> "" && $passwd <> "" && $res == "") { if (file_exists ($file)) { $data = file($file); } $value2 = ereg_replace( "\r|\n", "", nl2br(htmlspecialchars($value))); $write_bbs = time() . " | " . $name . " | " . $subject . " | " . $value2 . " | " . $url . " | " . date("Y年n月j日 G時i分") . " | " . $email . " | " . $REMOTE_HOST . " | " . $HTTP_USER_AGENT . " | " . crypt($passwd,"pb") . " | | \n"; $data[] = $write_bbs; $file_data = join($data,""); $fp = fopen($file ,"w"); fwrite($fp,$file_data); fclose($fp); // Ver 1.41 Added // mail送付ルーチン if ($from_address <> "" && $mail_address <> "") { $to = ereg_replace("\n", ",", $mail_address); $mail_subject = $title . "に書き込まれました"; $from = $from_address; $mes = $mes . "$name さんより"; $mes = $mes . "\n"; $mes = $mes . "$subject について、書き込みされました。"; $mes = $mes . "\n"; // Ver 1.42 Added if ($mail_body == 1) { $mes = $mes . "-------------------------------------------------------\n"; $mes = $mes . "$value"; } $mes = $mes . "\n-------------------------------------------------------\n"; $mes = $mes . "\n"; $mes = $mes . "$mail_footer"; $mes = $mes . "$top_url"; mail($to,$mail_subject,ereg_replace("\r", "", $mes),"From: $from\nX-Mailer: PHP/" .phpversion()); } } // 設定内容書き込み部分 if ($conf_title <> "") { if (file_exists ($conf_file)) { $data = file($conf_file); } $rep_mail_address = ereg_replace("\n", "," , $conf_mail_address); $write_conf = $conf_title . " | " . $conf_disp_max . " | " . $conf_top_url . " | " . $conf_bgcolor . " | " . $conf_subject_color . " | " . $conf_txtcolor . " | " . $conf_lnkcolor . " | " . $rep_mail_address . " | " . $conf_from_address . " | \n"; unset($conf_data[0]); $conf_data[0] = $write_conf; $conf_file_data = join($conf_data,""); $fp = fopen($conf_file ,"w"); fwrite($fp,$conf_file_data); fclose($fp); $admin_mode = 9; } // BROWSERの判別 if (ereg("Palmscape",$HTTP_USER_AGENT)) { print ("
\n"); // 書き込み表示部分 if (file_exists ($file)) { $data = file($file); rsort($data); $bbs_cnt = count($data) + 1; while ( list( $num, $line ) = each( $data ) ) { $bbsdata = explode(" | ", $line); $bbs_cnt = $bbs_cnt - 1; //表示部分Main if ($log_cnt < $disp_max) { print ("\n"); //題名 print ("
[$bbs_cnt]$bbsdata[2] |
\n"); //内容 print ("$bbsdata[3]\n"); $log_cnt = $log_cnt + 1; } } } print ("
\n"); print ("
\n");
} else if (ereg("UP\.Browser",$HTTP_USER_AGENT)) {
header ("Content-type: text/x-hdml;charset=Shift_JIS");
print ("
\n");
while ( list( $num, $line ) = each( $data ) ) {
$bbsdata = explode(" | ", $line);
//表示部分Main
if ($bno == "") {
//題名
if ($page == "") $page = 0;
if ($num >= $page && $num <= $page + 7){
print ("
\n");
//内容
print ("$bbsdata[3]
\n");
//投稿日
print ("$bbsdata[5]
\n");
//投稿者
print ("投稿者:\n");
print ("$bbsdata[1]\n");
}
}
print("
\n");
}
while ( list( $num, $line ) = each( $data ) ) {
$bbsdata = explode(" | ", $line);
//表示部分Main
if ($bno == "") {
//題名
if ($page == "") $page = 0;
if ($num >= $page && $num <= $page + 7){
$key = $num - $page + 1;
$chr_key = $num - $page + 63879;
if ($bbsdata[10] == "") {
print ("$chr_key;$bbsdata[2]
\n");
} else {
print (" $chr_key;$bbsdata[2]
\n");
}
}
if ($num == $page + 7) {
$next_page = $page + 8;
print ("憐次のページへ
\n");
}
} else {
if ($bno == $num) {
//題名
print ("
\n"); //内容 print ("$bbsdata[3]
\n"); //投稿日 print ("$bbsdata[5]
\n"); //投稿者 print ("投稿者:\n"); if ($bbsdata[6] <> "" && ereg("@",$bbsdata[6])) { print ("\n"); } print ("$bbsdata[1]\n"); print ("
\n"); } } } if ($bno == "") { print ("戀新規書き込み\n");
}
while ( list( $num, $line ) = each( $data ) ) {
$bbsdata = explode(" | ", $line);
//表示部分Main
if ($bno == "") {
//題名
if ($page == "") $page = 0;
if ($num >= $page && $num <= $page + 7){
$key = $num - $page + 1;
if ($bbsdata[10] == "") {
print ("$bbsdata[2]
\n");
} else {
print (" $bbsdata[2]
\n");
}
}
if ($num == $page + 7) {
$next_page = $page + 8;
print ("次のページへ
\n");
}
} else {
if ($bno == $num) {
//題名
print ("
\n"); //内容 print ("$bbsdata[3]
\n"); //投稿日 print ("$bbsdata[5]
\n"); //投稿者 print ("投稿者:\n"); if ($bbsdata[6] <> "" && ereg("@",$bbsdata[6])) { print ("\n"); } print ("$bbsdata[1]\n"); print ("
\n"); } } } if ($bno == "" && ereg("J-PHONE/3\.0",$HTTP_USER_AGENT)) { print ("新規書き込み■投稿時には、この記事を削除する時に利用する削除キーを設定してください.
");
*/
// 書き込み表示部分
print ("