#!/usr/local/bin/perl #↑1行目にサーバへ設置されているPerlのパスを設定してください。 #不明な場合にはサーバ管理者へ問い合わせてください。 #(このスクリプトはPerl5で書かれています。) ## ## このファイルについて ## 「管理ページ実行ファイル」 ## #---------------------------------------------------------------------------# #初期設定ファイルini.cgiを要求 require( "./ini.cgi" ); my %in = (); &parse_params( \%in ); #処理開始 &start(); ## 処理開始 ## @return void sub start { if( exists( $in{'mode'} ) && ($in{'mode'} eq 'info') ) { require( $LIB_DIR."appinfo.pl" ); &appinfo::display(); } #ロック &lock(); #記事ファイルを開く if( !open( RECS, "<".$DATA_DIR."recs.cgi" ) ) { &error( '記事ファイルアクセスエラー。' ); } #全行を読む my @rows = ; #ファイルを閉じる close( RECS ); #逆順 if( $REVERSE_ORDER ) { @rows = reverse @rows; } #ロック解除 &unlock(); #HTTPレスポンスヘッダとHTMLヘッダ &print_http_header(); &print_header(); #レコードを書き出す my $tg_win = ""; if( $AUTO_LINK_TG ne "" ) { $tg_win = " target=\"$AUTO_LINK_TG\""; } for( my $i = 0; $i < @rows; $i++ ) { &parse_rec( $rows[$i] ); #改行 if( $rec{'auto_ret'} ) { $rec{'content'} =~ s/\t/
/g; } #HTMLタグ if( $rec{'tag'} ) { $rec{'content'} =~ s/>/>/g; $rec{'content'} =~ s/</$2$3<\/a>/g; } #表示レイアウト if( $LAYOUT == 0 ) { print << "END_OF_DOC"; $rec{'date'} $rec{'headline'}

$rec{'content'} $REC_BOUNDARY END_OF_DOC } else { print << "END_OF_DOC"; $rec{'headline'}

$rec{'content'}

$rec{'date'}
$REC_BOUNDARY END_OF_DOC } } #HTMLフッタ &print_footer(); exit(0); } #---------------------------------------------------------------------------# ## この実行ファイルのHTTPレスポンスヘッダを出力 ## @return void sub print_http_header { #キャッシュ制御 print "Pragma: no-cache\n"; print "Cache-Control: no-cache\n"; print "Expires: -1\n"; #ロボット用 print "Robots: index,follow\n"; #コンテンツ形 print "Content-Type: text/html;charset=Shift_JIS\n"; #コネクション print "Proxy-Connection: close\n"; print "Connection: close\n\n"; return; } ## HTMLヘッダを出力 ## @return void sub print_header { my $style = $LIB_DOCS_ADDR.'style_index.css'; print << "END_OF_DOC"; $TITLE END_OF_DOC return; } ## HTMLフッタを出力 ## @return void sub print_footer { print "

\n"; if( $ADMIN_LINK ) { print "
"; print ""; print "管理用"; print "
\n"; } if( $LISENCE ne 'REGISTERED' ) { print "
"; print ""; print "$THIS_NAME $VERSION"; print "
\n"; } print "\n"; print "\n"; return; } 0;