#!/usr/bin/perl
###############################################
# whats_new.cgi
#
# Copyright(C) Center-Field
###############################################
use Jcode;
require './cgi-lib.pl';
$script = 'topics.cgi';
$script_path_from_index = 'topics/topics.cgi';
$base = './data'; #データ格納ディレクトリ
$colfile = "$base/whats_new.txt"; #記事
$opfile = "$base/option.txt";
$cgi_lib'maxdata = 20000000000; #入力最大容量(byte)
$index_html_path = '../index.html';
$index_tpl_path = './tpl/index.tpl';
$contents_tpl_path = './tpl/contents.tpl';
$whats_new_contents_tpl_path = './tpl/whats_new_contents.tpl';
$whats_new_tpl_path = './tpl/whats_new.tpl';
$whats_new_indiv_tpl_path = './tpl/whats_new_indiv.tpl';
$header_tpl_path = './tpl/header.tpl';
$footer_tpl_path = './tpl/footer.tpl';
$anchor_class = "topics";
$pdf_icon = '';
$xlsx_icon = '';
$xls_icon = '';
$doc_icon = '';
$docx_icon = '';
$xdw_icon = '';
$other_icon = '';
$pdf_icon_tp = '';
$xlsx_icon_tp = '';
$xls_icon_tp = '';
$doc_icon_tp = '';
$docx_icon_tp = '';
$xdw_icon_tp = '';
$other_icon_tp = '';
$page_index = 5; #トップページの表示件数
open (IN,"$opfile") || &error("OPEN ERROR_opfile"); $opdata = ; close IN;
if (!$opdata) {
$pass = &crypt('cgi');
chmod(0666,$opfile); open(OUT,">$opfile") || &error("OPEN ERROR_opfile");
print OUT "$pass<>コラム<><><>$base<>$base<><><>#fafaf5,#000000,#c00000,#800000<>20<>160<>160";
close OUT;
chmod(0666,$colfile);
}
### メイン処理 ###
&ReadParse;
$mode = $in{'mode'};
$num = $in{'num' };
open (IN,"$opfile") || &error("OPEN ERROR_opfile");
($pass,$title,$com_adm,$home,$savedir,$loaddir,$bg_img,$home_icon,$colors,$page,$max_w,$max_h) = split(/<>/,);
close IN;
($bg_color,$text_color,$title_color,$sub_color) = split(/,/,$colors);
if ($page == 0) {$page = 20;}
if ($mode eq 'admin') {&admin;}
elsif($mode eq 'dsp' ) {&dsp;}
else {&whtats_new_main;}
#&footer;
exit;
###
sub header {
print "Content-type: text/html\n\n";
print "\n";
print "WEBページ管理画面\n";
$head = 1;
}
sub footer {
print "