>\n"; $all_thread_html .= "noタイトル作成者作成日レス最終更新\n"; $all_thread_html .= "\n"; } if(!$mo) {$mo=0;} for($i=0;$lines[$mo];$mo++,$i++) { if($i == $this->onep) {break;} $all_thread_html .= $this->onethread($lines[$mo]); } if(!$i) { $all_thread_html .= "\n"; $all_thread_html .= "トピックが1件もありません\n"; $all_thread_html .= "\n"; } $all_thread_html .= "\n"; if($this->onep < $all_row) { $all_thread_html .= $this->move_link($page,$pages,$all_row,$mo,0); } if($i) { $all_thread_html .= "
\n"; $all_thread_html .= "
\n"; $all_thread_html .= "\n"; $all_thread_html .= "
\n"; $all_thread_html .= "\n"; $all_thread_html .= "\n"; $all_thread_html .= "\n"; $all_thread_html .= "\n"; $all_thread_html .= "\n"; $all_thread_html .= "
img_dir"."normal.gif\" width=\"23\" height=\"28\" />通常スレッド  img_dir"."nowrite.gif\" width=\"23\" height=\"28\" />書き込み禁止  img_dir"."noread.gif\" width=\"23\" height=\"28\" />閲覧禁止  img_dir"."max.gif\" width=\"23\" height=\"28\" />レス最大  
\n"; $all_thread_html .= "
\n"; } $all_thread_html .= "

\n"; $all_thread_html .= "\n"; $all_thread_html .= "\n"; $all_thread_html .= "\n"; return $all_thread_html; } # スレッド1件簡易表示 function onethread($line) { list($num,$title,$name,$date,$res,$last_d,$last_n,$key,$ip,$state) = explode("<>",$line); $onethread .= "\n"; $onethread .= "$num
img_dir$state.gif\" width=\"23\" height=\"28\" />script."?s=$num&mode=skw\">$title
$name$date$res$last_d
$last_n\n"; $onethread .= "\n"; return $onethread; } # スレッド詳細表示 function thread_kwsk($s,$all) { $lines = @file("$this->sre_dir$s.cgi"); list($thread_title,$thread_state) = explode("<>",$lines[0]); if($lines[0] == "") { echo $this->error("該当スレッドが見当たらないです"); return; } if($thread_state == "noread") { echo $this->error("現在[$thread_title"."]の閲覧は禁止されています"); return; } $thread_kwsk .= "

\n"; $thread_kwsk .= "

\n"; $thread_kwsk .= "
\n"; $thread_kwsk .= "$thread_title\n"; $thread_kwsk .= ""; $thread_kwsk .= "script\">戻る\n"; $thread_kwsk .= "script?s=$s&mode=skw&all=1\">全部\n"; $thread_kwsk .= "script?s=$s&mode=skw\">最新$this->df_disp\n"; $thread_kwsk .= "\n"; $thread_kwsk .= "
\n"; $thread_kwsk .= "
\n"; list($num,$name,$com,$mail,$date,$key,$ip,$bt) = explode("<>",$lines[1]); $com = ereg_replace("(http://)[^<>[:space:]]+[[:alnum:]/]", "\\0", $com); $com = eregi_replace(">>([0-9]+)", "script."?mode=pi&n=\\1&t=$s\">>>\\1", $com); if($mail != "") {$name = "$name";} $thread_kwsk .= "[$num] $name ( $date )
\n"; $thread_kwsk .= "
$com
\n"; if($all) { $i=2; } else { $all_row = count($lines); $i = $all_row - $this->df_disp; if($i < 1) {$i = 2;} } for( ;$lines[$i];$i++) { list($num,$name,$com,$mail,$date,$key,$ip,$bt) = explode("<>",$lines[$i]); $com = ereg_replace("(http://)[^<>[:space:]]+[[:alnum:]/]", "\\0", $com); $com = eregi_replace(">>([0-9]+)", "script."?mode=pi&n=\\1&t=$s\">>>\\1", $com); if($mail != "") {$name = "$name";} $thread_kwsk .= "[$num] $name ( $date )
\n"; $thread_kwsk .= "
$com
\n"; } $thread_kwsk .= "
\n"; $thread_kwsk .= "
\n"; $thread_kwsk .= "
\n"; if($thread_state == "nowrite") { $thread_kwsk .= "
\n"; $thread_kwsk .= "現在このトピックへの書き込みは行えません\n"; $thread_kwsk .= "
\n"; } elseif($thread_state == "max") { $thread_kwsk .= "
\n"; $thread_kwsk .= "このトピックにはレスが$this->maxres"."件に達したため書き込めないです\n"; $thread_kwsk .= "
\n"; } else { $c = $_COOKIE["cforumc"]; list($cname,$cmail,$ckey) = explode("<>",$c); $thread_kwsk .= "
script?mode=wr\" method=\"post\" style=\"margin:0px\">\n"; $thread_kwsk .= "\n"; $thread_kwsk .= "\n"; $thread_kwsk .= "\n"; $thread_kwsk .= "\n"; $thread_kwsk .= "\n"; $thread_kwsk .= "\n"; $thread_kwsk .= "\n"; $thread_kwsk .= "
名前コメント
メール
編集キー
スレを上げない
"; $thread_kwsk .= "\n"; $thread_kwsk .= "\n"; $thread_kwsk .= "
\n"; $thread_kwsk .= "\n"; $thread_kwsk .= "
\n"; } $thread_kwsk .= "
\n"; $thread_kwsk .= "\n"; $thread_kwsk .= "
\n"; $thread_kwsk .= "
\n"; $thread_kwsk .= "
script?mode=ed\" method=\"post\" style=\"margin:0px\">\n"; $thread_kwsk .= "\n"; $thread_kwsk .= "\n"; $thread_kwsk .= "
\n"; $thread_kwsk .= "NO\n"; $thread_kwsk .= "\n"; $thread_kwsk .= "編集キー\n"; $thread_kwsk .= "\n"; $thread_kwsk .= "\n"; $thread_kwsk .= "\n"; $thread_kwsk .= "
\n"; $thread_kwsk .= "\n"; $thread_kwsk .= "
\n"; $thread_kwsk .= "
\n"; $thread_kwsk .= "\n"; $thread_kwsk .= "
\n"; $thread_kwsk .= "

\n"; return $thread_kwsk; } # 移動用リンク function move_link($page,$pages,$all_row,$mo,$word) { if($word != '') {$plus = "&word=$word&mode=se";} ## 移動用リンク $movelink .= "
"; # 先頭ページ if(($page - $this->back) > 1) { $movelink .= "script."?mo=0$plus\" class=\"disp_link\">|<< "; } # 前ページ表示 if(($mo - $this->onep) > 0) { $xpage = $page; $fp = $xpage - $this->back - 1; for($i=0;$i<$this->back;$fp++) { if($fp > -1) { $nmo = $fp * $this->onep; $dfp = $fp + 1; $movelink .= "script."?mo=$nmo$plus\" class=\"disp_link\">$dfp "; } $i++; } } # 現在のページ表示 $movelink .= "$page "; # 次ページ表示 if($mo < $all_row) { $xpage = $page; $nmo = $mo; for($i=0;$i<$this->next;$i++){ $xpage++; if($pages < $xpage) {break;} $movelink .= "script."?mo=$nmo$plus\" class=\"disp_link\">$xpage "; $nmo = $nmo + $this->onep; } } # 末ページ if(($mo + $this->onep * $this->next) < $all_row) { $nmo = ($pages * $this->onep) - $this->onep; $movelink .= "script."?mo=$nmo$plus\" class=\"disp_link\">>>|"; } $movelink .= "
\n"; return $movelink; } # 書き込み確認 function write_sure() { extract($_POST); $Hname = $name; $name = str_replace("◆","◇",$name); list($xn1,$xn2) = explode("#",$name); if($xn2 != "") { $str = crypt($xn2,"vi"); $tri = substr($str,2,12); $name = $xn1."◆".$tri; } $name = str_replace("<","<",$name); $mail = str_replace("<","<",$mail); $com = str_replace("<","<",$com); $com = str_replace("\r\n","\n",$com); $com = str_replace("\r","\n",$com); $com = str_replace("\n","
",$com); if($this->Jsh and preg_match("/^[a-zA-Z0-9\s<>\/]+$/", $com)) { echo $this->error("不正な書き込みです"); return; } for($i=0;$this->taboo[$i];$i++) { if(strstr($com,$this->taboo[$i])) { echo $this->error("禁止ワードが含まれています"); return; } } $ip = $_SERVER['REMOTE_ADDR']; if($this->wait) { $lines = @file("$this->sre_dir$s.cgi"); for($i=0;$lines[$i];$i++) { list($xnum,$xname,$xcom,$xmail,$xdate,$xkey,$xip,$xbt) = explode("<>",$lines[$i]); if(time() - $this->wait < $xbt) { echo $this->error("もう少し時間を空けて投稿して下さい"); return stop; } } } if($com == "") { echo $this->error("コメントが未入力です"); return stop; } if(strlen($com) > $this->max_com) { echo $this->error("コメントの文字数が多すぎです"); return stop; } if($name == "") {$name = $this->noname;} for($i=0;strlen($key)!=$i;$i++) { $key_disp .= '*'; } $write_sure .= "

\n"; $write_sure .= "

script?mode=pl\" method=\"post\" style=\"margin:0px\">\n"; $write_sure .= "\n"; $write_sure .= "\n"; $write_sure .= "\n"; $write_sure .= "\n"; $write_sure .= "\n"; $write_sure .= "\n"; $write_sure .= "\n"; $write_sure .= "\n"; $write_sure .= "\n"; $write_sure .= "\n"; $write_sure .= "
名前$name
メール$mail
コメント$com
編集キー$key_disp
"; $write_sure .= "
\n"; $write_sure .= "▲以上のように送信します。よろしければ送信ボタンを押してください。\n"; $write_sure .= "\n"; $write_sure .= "\n"; $write_sure .= "\n"; $write_sure .= "\n"; $write_sure .= "\n"; $write_sure .= "\n"; $write_sure .= "\n"; $write_sure .= "\n"; $write_sure .= "\n"; $write_sure .= "\n"; $write_sure .= "
\n"; $write_sure .= "
\n"; $write_sure .= "

\n"; $write_sure .= "
\n"; return $write_sure; } # ログ追加後 function push_log_after($t) { $push_log_after .= "

\n"; $push_log_after .= "

\n"; $push_log_after .= "書き込み完了

\n"; $push_log_after .= "書き込み処理が正常に完了しました。

\n"; $push_log_after .= "script."?s=$t&mode=skw\">戻る

\n"; $push_log_after .= "
\n"; $push_log_after .= "

\n"; $push_log_after .= "\n"; return $push_log_after; } # ログの追加処理 function push_log() { extract($_POST); if($_POST[com] == "") { echo $this->html_head(); echo $this->error("不正なアクセスです"); echo $this->html_foot(); exit; } $ip = $_SERVER['REMOTE_ADDR']; $date = date("y-m-d-H:i"); if($key != "") { $key2 = crypt("$key", "vi"); } # クッキー $timeout = time() + 90 * 86400; if($Hname == $this->noname) {$cname = "";} else {$cname = $Hname;} setcookie("cforumc","$cname<>$mail<>$key<>",$timeout,'/',''); # スレ詳細ファイル $fp = fopen("$this->sre_dir"."$s.cgi","r+"); flock($fp,LOCK_EX); $lines = array(); $gyou = 0; while (!feof($fp)) { $lines[$gyou] .= fgets($fp); $gyou++; } list($thread_title,$thread_state) = explode("<>",$lines[0]); if($thread_state == "nowrite" or $thread_state == "noread" or $thread_state == "max") { fclose($fp); return; } $alls = count($lines) - 1; if($alls >= $this->maxres) { array_shift($lines); array_unshift($lines,"$thread_title<>max<>\n"); $flag = 1; } $Lbt = time(); $lastnum = $alls - 1; list($xnum,$xname,$xcom,$xmail,$xdate,$xkey,$xip,$xbt) = explode("<>",$lines[$lastnum]); if($com == $xcom and $xip == $ip) {return;} ftruncate($fp, 0); rewind($fp); $num = $xnum + 1; for($i=0;$lines[$i];$i++) { fputs($fp,$lines[$i]); } fputs($fp,"$num<>$name<>$com<>$mail<>$date<>$key2<>$ip<>$Lbt<>\n"); flock($fp,LOCK_UN); fclose($fp); # スレ一覧ファイル $fp = fopen($this->sre_all,"r+"); flock($fp,LOCK_EX); $lines = array(); $gyou = 0; while (!feof($fp)) { $lines[$gyou] .= fgets($fp); $gyou++; } for($i=0;$lines[$i];$i++) { list($anum,$atitle,$aname,$adate,$ares,$alast_d,$alast_n,$akey,$aip,$astate) = explode("<>",$lines[$i]); if($s == $anum) {break;} } $ares2 = $ares + 1; ftruncate($fp, 0); rewind($fp); if($flag) {$astate = "max";} if(!$sage) {fputs($fp,"$anum<>$atitle<>$aname<>$adate<>$ares2<>$date<>$name<>$akey<>$aip<>$astate<>\n");} for($i=0;$lines[$i];$i++) { list($anum,$atitle,$aname,$adate,$ares,$alast_d,$alast_n,$akey,$aip,$astate) = explode("<>",$lines[$i]); if($anum != $s) { fputs($fp,$lines[$i]); } elseif($sage) { if($flag) {$astate = "max";} fputs($fp,"$anum<>$atitle<>$aname<>$adate<>$ares2<>$date<>$name<>$akey<>$aip<>$astate<>\n"); } } flock($fp,LOCK_UN); fclose($fp); } # 新規スレッド function new_thread() { $new_thread .= "

\n"; $new_thread .= "

script?mode=nts\" method=\"post\" style=\"margin:0px\">\n"; $new_thread .= "\n"; $new_thread .= "\n"; $new_thread .= "\n"; $new_thread .= "\n"; $new_thread .= "\n"; $new_thread .= "
作成者名
メール
スレッドタイトル
本文([1]の内容)