#!/usr/bin/perl ################################ # CHECKED GUEST BOOK CGI (4) # # For Mindan # # By Kyosuke Fumino (99/12/12) # ################################ print "Content-type: text/html\n\n"; ####################################### # Define the location of the database # ####################################### require 'prm.pl'; require 'func.pl'; require 'jcode.pl'; ################# # Get the Input # ################# %in = &getCgiInputs(); %get = &getCgiInputs($ENV{QUERY_STRING}); ($CNT, @bbs) = &getEntryData; ################# # Get the Count # ################# $get{'baseCnt'} = 0 if ($get{'baseCnt'} eq ""); # 表示開始カウント $StartCNT = $get{'baseCnt'} + 1; # 現頁の表示開始カウント $EndCNT = $get{'baseCnt'} + $Set_CNT; # 表示終了カウント $NextCNT = $EndCNT + 1; # 次頁の表示開始カウント $NextPV = ($Set_CNT * 2) + $get{'baseCnt'}; # 次ページの表示件数 if ($NextPV > $CNT) { $NextPV = $Set_CNT - ($NextPV - $CNT); } else { $NextPV = $Set_CNT; } ##################################### # Make the Link of Next / Back Page # ##################################### ##### 投稿データが存在している $NextST = $get{'baseCnt'} + $Set_CNT; $BackST = $get{'baseCnt'} - $Set_CNT; if ($CNT > $Set_CNT) { # データ数が頁内表示件数より多い場合 if ($get{'baseCnt'} == 0) { # かつ、表示開始カウントが 0の場合(最初の頁) $prtSubmit = <<_HTML_CNT_;
$CNT件中 $StartCNT件目から $EndCNT件目を\表\示\ ≫ 次の$NextPV件を\表\示\
_HTML_CNT_ } elsif ($NextPV <= 0) { # かつ、次頁の表示件数が 0以下の場合(最後の頁) $prtSubmit = <<_HTML_CNT_;
$CNT件中 $StartCNT件目から $CNT件目を\表\示\ ≫ 前の$Set_CNT件を\表\示\
_HTML_CNT_ } else { # かつ、次頁の表示件数が 1以上の場合(通常の頁) $prtSubmit = <<_HTML_CNT_;
$CNT件中 $StartCNT件目から $EndCNT件目を\表\示\ ≫ 前の$Set_CNT件を\表\示\ 次の$NextPV件を\表\示\
_HTML_CNT_ } } else { # データ数が頁内表示件数より少ない場合 $prtSubmit = <<_HTML_CNT_;
$CNT件中 $StartCNT件目から $CNT件目を\表\示\
_HTML_CNT_ } ###################### # Print the BBS HTML # ###################### ##### Print the Header print <<_HTML01_; 民団新聞会議室
民団新聞 MINDAN
在日本大韓民国民団 民団新聞 会議室
民団新聞 会議室
この会議室はリニューアルに伴い閉鎖しました。
新しい「会議室」及び「自由掲示板」へどうぞ

$prtSubmit
_HTML01_ ##### Print the Contents for($i = $get{'baseCnt'}; $i < $EndCNT; $i++){ chomp($bbs[$i]); @list = (); @list = split(/\t/,$bbs[$i]); if($list[11] == 1 && $list[12] == 1){ print <<_HTML02_; _HTML02_ $list[13] =~ s/http:\/\/(.+?)(\s|
|$)/http:\/\/$1<\/A>$2/g; if($list[9] eq ""){ print <<_HTML03_
記事番号: $list[0]  投稿者: $list[7] - $list[1]年 $list[2]月 $list[3]日 ($list[4]時 $list[5]分 $list[6]秒)
$list[13]

_HTML03_ }else{ print <<_HTML04_
記事番号: $list[0]  投稿者: $list[7] - $list[1]年 $list[2]月 $list[3]日 ($list[4]時 $list[5]分 $list[6]秒)
$list[13]

_HTML04_ } } } print <<_HTML05_; $prtSubmit

最新ニュースインデックスページへ


民団に対するお問い合わせはこちらへ


_HTML05_ exit 0; ######################################### Sub Routines ######################################### ##### Get the Entry Data (Only True) sub getEntryData{ my @line; open(FILE,"$MainFile") || die "Can't open $MainFile.\n" ; while(){ chomp; @line = split(/\t/,$_); push(@file,$_) if($line[11] == 1 && $line[12] == 1); } @file = reverse(@file); $file = @file; return ($file,@file); }