#! c:/perl/bin/perl # # evcal.cgi # イベントカレンダー # # 1.007 : 9/25/06 : テンポラリファイルが残るバグを修正 # 1.006 : 9/19/05 : 更新リンクを更新者にするオプションを追加 # その際のURLの自動リンク機能を追加 # 1.005 : 8/29/05 : デコードを修正 # 1.004 : 8/25/05 : cryptを修正 # 1.003 : 8/22/05 : 更新者欄の幅を変更できるオプションを追加 # 1.002 : 8/12/05 : データファイルが無い時のエラー処理を追加 # 1.001 : 8/9/05 : SSIモード追加 # 1.0 : 8/8/05 : 一般公開のために大幅改良 # # $Id: evcal.cgi,v 1.30 2005/09/25 02:37:03 Hideki Kanayama Exp $ # use File::Basename; use Time::Local; use strict; use CGI::Carp qw(fatalsToBrowser); use CGI qw(:cgi-lib); my $lastupdatedyear = 2005; my $version = "1.007"; my $script = basename($0); my $setupfile = "evcal_setup.pl"; my $admindat = "adminpwd.dat"; ##################################### # データファイル名 our $datafile = "eventcal.dat"; # lockfile our $lockfile = "lockfile.dat"; # 戻りリンク 1:on 0:off our $backlink_en = 1; our $backlink = "../evcal.html"; our $backlink_name = '【戻る】'; # バックグラウンド our $bgimage_en = 0; our $bgcolor = 'white'; our $bgimage_file = ''; # カレンダーの色 # ヘッダの背景 our $table_head_bgcolor = 'white'; # ヘッダの文字 our $table_head_color = 'black'; # 更新者の色 our $post_name_color = 'black'; # 更新日の色 our $post_update_color = 'black'; # 平日の背景 our $weekday_bgcolor = 'white'; # 土曜日の背景 our $sat_bgcolor = '#ccffff'; # 日曜日の背景 our $sun_bgcolor = '#ffcccc'; # 日付、内容の文字色はスタイルシートのリンク色の設定で行ってください。 # 日付はclass=daylink, コメントはclass=comlinkとなっています。 # 更新リンク 0:内容 1:更新者 our $update_link = 0; # 更新者を内容更新のリンクに設定した場合はスタイルシートで色の設定を # 行ってください。class=namelinkとなっています。 # その場合の内容の色 our $post_com_color = 'black'; # 本文中のリンクを文字列に置き換える 1:on 0:off # この機能をONにするには更新リンクを更新者に設定してください。 our $link_replace_en = 1; our $link_replace = 'リンクはこちら'; our $link_replace_top_en = 0; # 表の幅 our $body_width = 100; # 更新者欄の幅 our $name_width = 10; # 表示する月数 our $disp_length = 12; our $disp_length_other = ''; # タイトル our %title = ( display => { text => 'イベントカレンダー', image => '', color => 'black', size => '+1', face => '', style => '', sel => 0, # 0:デフォルト、1:テキスト、2:ロゴ、3:スタイルシート loc => 1, # 0:左、1:中、2:右 }, register => { text => 'のイベント登録', image => '', color => 'black', size => '+1', face => '', style => '', sel => 0, # 0:デフォルト、1:テキスト、2:ロゴ、3:スタイルシート loc => 1, # 0:左、1:中、2:右 }, modify => { text => 'のイベントの変更', image => '', color => 'black', size => '+1', face => '', style => '', sel => 0, # 0:デフォルト、1:テキスト、2:ロゴ、3:スタイルシート loc => 1, # 0:左、1:中、2:右 }, setadminpwd => { text => '管理人用パスワードを設定してください。', sel => 4, }, setup => { text => '管理人セットアップ', sel => 4, }, ); # ジャンプリンク 1:on 0:off our $jumplink_en = 1; our $jumplink_name = '【「今日」へジャンプ】'; # セットアップリンク 1:on 0:off our $setup_en = 1; our $setup_name = '【管理用】'; #スタイルシート 1:on 0:off our $style_sheet_en = 1; our $style_sheet = ' A:link {text-decoration: none} A:visited {text-decoration: none} A:active {text-decoration: none} '; #〜内に挿入できる構文 1:on, 0:off our $head_insert_en = 0; our $head_insert = ''; #使い方 our $usage_en = 1; our $usage_name = '【使い方】'; our $usage = '

使い方

'; #上部に表示させる文 1:on, 0:off our $body_insert1_en = 1; our $body_insert1 = '
'; our $body_insert2_en = 0; our $body_insert2 = ''; our $body_insert3_en = 0; our $body_insert3 = ''; our $body_insert4_en = 0; our $body_insert4 = ''; our $body_insert5_en = 0; our $body_insert5 = ''; our $body_insert6_en = 1; our $body_insert6 = '
'; # 時間設定 GMTからのオフセット 日本:+9 our $offset = 9; #################################### require "$setupfile" if (-e "$setupfile"); my $q = CGI->new; my $cgierror = $q->cgi_error; &error($cgierror) if ($cgierror); my %in = $q->Vars; &postprocess; if (! -e "$admindat"){ if ($in{mode} eq 'wradminpwd'){ &wradminpwd($in{pwd}); } else { &setadminpwd; } } if ($script eq 'evssi.cgi'){ $script = 'evcal.cgi'; $in{mode} = 'ssi'; } my $host = $ENV{'REMOTE_HOST'}; my $ip = $ENV{'REMOTE_ADDR'}; my @weekday = ('日','月','火','水','木','金','土'); my $day; my $now = time+$offset*3600; my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=gmtime($now); my $next_mon = $disp_length+$mon; my $next_year = $year; if ($next_mon > 11){ $next_year += int($next_mon/12); $next_mon %= 12; } my $start_day = timegm(0,0,0,1,$mon,$year); my $end_day = timegm(0,0,0,1,$next_mon,$next_year) - 1; if ($in{mode} eq 'register') { ®ister; } elsif ($in{mode} eq 'evwrite') { &evwrite; } elsif ($in{mode} eq 'modify') { &modify; } elsif ($in{mode} eq 'evreplace') { &evreplace; } elsif ($in{mode} eq 'setup') { &setup; } elsif ($in{mode} eq 'setupwrite') { &setupwrite; } elsif ($in{mode} eq 'ssi') { &evssi; } else { &display; } sub display { my $subname = 'display'; my $caldata; my $calname; my $caldate; my $calid; my $i; my $pastyear; if ($in{mode} eq 'past'){ $start_day = timegm(0,0,0,1,0,$in{year}); $end_day = timegm(59,59,23,31,11,$in{year}); } ($caldata, $calname, $caldate, $calid, $pastyear) = &getevdata; if ($in{mode} eq 'past'){ $title{$subname}{text} = "$in{year}年"; $title{$subname}{sel} = 1 if ($title{$subname}{sel} == 2); } &htmlhead($title{$subname}{text}); my $titleprint=&titleprint($title{$subname}); print "$body_insert1\n" if ($body_insert1_en == 1); print "$titleprint\n"; print "$body_insert2\n" if ($body_insert2_en == 1); if ($in{mode} eq 'past') { print "【イベントカレンダーへ】
\n"; } else { &inputform($now); print "$body_insert3\n" if ($body_insert3_en == 1); &updateinfo; print "$body_insert4\n" if ($body_insert4_en == 1); &misclink($now); print "$body_insert5\n" if ($body_insert5_en == 1); } my @pastarray; if ($in{mode} ne 'past'){ @pastarray = sort {$a <=> $b} @{$pastyear}; if ($#pastarray != -1){ foreach ($pastarray[0] .. $year+1900){ print "$_年 "; } } } if ($in{mode} eq 'past'){ print "
\n"; foreach (1 .. 12){ print "$_月 \n"; } } print "$body_insert6\n" if ($body_insert6_en == 1 && $in{mode} ne 'past'); print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; my @comment; my @name; my @update; my @id; for ($i=$start_day;$i<=$end_day;$i+=86400) { my $col_bgcolor; my ($sec,$min,$hour,$day,$mon,$year,$wday,$yday,$isdst)=gmtime($i); print "\n"; $mon++; $year += 1900; if ($wday == 0){ $col_bgcolor = "$sun_bgcolor"; } elsif ($wday == 6) { $col_bgcolor = "$sat_bgcolor"; } else { $col_bgcolor = "$weekday_bgcolor"; } @comment = (); @name = (); @update = (); @id = (); if (exists $caldata->{$year}{$mon}{$day}) { @comment = split //, $caldata->{$year}{$mon}{$day}; @name = split //, $calname->{$year}{$mon}{$day}; @update = split //, $caldate->{$year}{$mon}{$day}; @id = split //, $calid->{$year}{$mon}{$day}; } if ($#comment == -1) { $comment[0] = " "; $name[0] = " "; $update[0] = " "; } my $rowspan = $#comment+1; print "\n"; } else { print "$mon月$day日\n"; } print "\n"; my $j; for ($j=0;$j<=$#comment;$j++){ chomp($comment[$j]); next if ($comment[$j] eq ''); print "\n"; print "\n"; my $updatedate; $updatedate = &calupdate($update[$j]); print "\n"; print "\n"; print "\n" if ($j < $#comment); } } print "
日付内容更新者更新日
"; if ($in{mode} eq 'past'){ print "$mon月$day日$weekday[$wday]"; print ""; if ($comment[$j] ne ' ' && $in{mode} ne 'past') { if ($update_link == 0){ print "$comment[$j]"; } else { $comment[$j] = &link_replace($comment[$j]); print "$comment[$j]"; } } else { $comment[$j] = &link_replace($comment[$j]); print "$comment[$j]"; } print ""; if ($update_link == 0){ print "$name[$j]\n"; } else { print "$name[$j]"; } print "$updatedate
\n"; print "【イベントカレンダーへ】
\n" if ($in{mode} eq 'past'); &usage unless ($in{mode} eq 'past'); &htmltail; } sub link_replace { my $elem = shift; my $link_replace_target; if ($link_replace_top_en == 1){ $link_replace_target = 'target="_top"'; } else { $link_replace_target = 'target="_blank"'; } if ($link_replace_en == 1){ $elem =~ s/(https?:\/\/[\w\.\~\-\/\?\&\+\=\:\@\%\;\#\%\$]*)/$link_replace<\/a>/g; } else { $elem =~ s/(https?:\/\/[\w\.\~\-\/\?\&\+\=\:\@\%\;\#\%\$]*)/$1<\/a>/g; } return ($elem); } sub evssi { my ($caldata, $calname, $caldate, $calid, $pastyear); ($caldata, $calname, $caldate, $calid, $pastyear) = &getevdata; print "Content-Type: text/html\n\n"; $year += 1900; $mon++; return 1 unless (exists $caldata->{$year}{$mon}{$mday}); my @comment = split //, $caldata->{$year}{$mon}{$mday}; foreach (@comment){ $_ = &link_replace($_); print "
  • $_
  • \n"; } } sub postprocess { my $key; foreach $key (keys %in){ my $br; $br = "
    "; $in{$key} =~ s//>/g; if ($in{$key} =~ /\r\n/) { $in{$key} =~ s/\r\n/$br/g; } if ($in{$key} =~ /\n/) { $in{$key} =~ s/\n/$br/g; } if ($in{$key} =~ /\r/) { $in{$key} =~ s/\r/$br/g; } if ($in{$key} =~ /,/) { $in{$key} =~ s/,/&\#44;/g; } } } sub htmlhead { my $title = shift; my $bgimage; if ($bgimage_en == 1){ $bgimage = "background=\"$bgimage_file\""; } else { $bgimage = "bgcolor=\"$bgcolor\""; } print "Content-type:text/html\n\n"; print "\n"; print "\n"; print "\n"; print "$title\n"; if ($head_insert_en == 1){ print "$head_insert\n"; } if ($style_sheet_en == 1){ print "\n"; } print "\n"; print "\n"; print "
    \n"; } sub htmltail { print "
    $script Ver. $version
    \n"; print "
    Copyright(C) 1997-$lastupdatedyear, Hideki
    \n"; print "
    \n"; } sub error { my ($msg) = shift; &unlockfile; &htmlhead($msg); print "
    $msg
    \n"; &htmltail; exit; } sub makecrypt { my $plain = shift; my $salt = join "", ('.', '/', 0..9, 'A'..'Z', 'a'..'z')[rand 64, rand 64]; my $result = crypt($plain,$salt) or crypt($plain,'$1$'.$salt.'$'); return $result; } sub setadminpwd { my $subname = 'setadminpwd'; &htmlhead('管理者用パスワードを入力してください'); print &titleprint($title{$subname}); print "
    \n"; if ($in{mode} eq 'setup'){ print "
    管理者用パスワードを入力してください。
    \n"; print "\n"; print "\n"; print "\n"; } else { print "
    管理者用パスワードを設定してください。
    \n"; print "\n"; print "\n"; print "\n"; } &htmltail; exit; } sub wradminpwd { my $plain = shift; my $passwd = &makecrypt($plain); if (open(FILE,"> $admindat")){ print FILE "$passwd"; close(FILE); } else { &error('パスワードファイル作成に失敗しました'); } print "Location: $script\n\n"; } sub checkadmin { my $pwd = shift; if (open(FILE,"< $admindat")){ my $filepwd = ; close(FILE); my $inpwd = crypt($pwd,$filepwd); return ("$inpwd" eq "$filepwd"); } else { &error('パスワードファイルが存在しません'); } } sub titleprint { my $title = shift; my @location = ('left','center','right'); my $titleline; if ($title->{sel} == 0) { $titleline = "
    {loc}]\">

    $title->{text}

    "; } elsif ($title->{sel} == 1){ $titleline = "
    {loc}]\">{size}\" color=\"$title->{color}\" face=\"$title->{face}\">$title->{text}

    "; } elsif ($title->{sel} == 2){ $titleline = "
    {loc}]\">{image}\" alt=\"$title->{text}\">

    "; } elsif ($title->{sel} == 3){ $titleline = "
    {loc}]\" style=\"$title->{style}\">$title->{text}

    "; } elsif ($title->{sel} == 4){ $titleline = ""; } return($titleline); } sub register { my $subname = 'register'; if ($ENV{"REQUEST_METHOD"} eq "POST"){ my ($ssec,$smin,$shour,$sday,$smon,$syear,$swday,$syday,$sisdst)=gmtime($start_day); if ($in{year} eq ''){ if ($smon > $in{month}-1) { $in{year} = $syear + 1901; } else { $in{year} = $syear + 1900; } } &monthdaycheck($in{year},$in{month}-1,$in{day}); my $regtime = timegm(0,0,0,$in{day},$in{month}-1,$in{year}); &error('選択範囲が登録可能範囲(カレンダーの表示範囲)を超えています。') if ($regtime > $end_day || $regtime < $start_day); ($ssec,$smin,$shour,$sday,$smon,$syear,$swday,$syday,$sisdst)=gmtime($regtime); $in{weekday} = $swday; } $title{$subname}{text} = "$in{year}年$in{month}月$in{day}日($weekday[$in{weekday}])$title{$subname}{text}"; &htmlhead($title{$subname}{text}); my $titleprint=&titleprint($title{$subname}); print < お名前


    内容

    パスワード


    HTMLOUT &htmltail; } sub modify { my $subname = 'modify'; $title{$subname}{text} = "$in{year}年$in{month}月$in{day}日($weekday[$in{weekday}])$title{$subname}{text}"; my $caldata; my $calname; my $caldate; my $calid; my $pastyear; ($caldata, $calname, $caldate, $calid, $pastyear) = &getevdata; my @comment = (); my @name = (); my @update = (); my @id = (); if (exists $calname->{$in{year}}{$in{month}}{$in{day}}) { @comment = split //, $caldata->{$in{year}}{$in{month}}{$in{day}}; @name = split //, $calname->{$in{year}}{$in{month}}{$in{day}}; @update = split //, $caldate->{$in{year}}{$in{month}}{$in{day}}; @id = split //, $calid->{$in{year}}{$in{month}}{$in{day}}; } &htmlhead($title{$subname}{text}); my $titleprint=&titleprint($title{$subname}); my $j; my $dataline; my $name; my $id; for ($j=0;$j<=$#comment;$j++){ next unless ($in{id} == $id[$j]); $dataline = $comment[$j]; $dataline =~ s/
    /\n/g; $dataline =~ s/\n*$//; $name = $name[$j]; $id = $id[$j]; last; } print < お名前


    内容

    パスワード


    HTMLOUT &htmltail; } sub evwrite { &error('名前とパスワードは必ず入力してください。') if ($in{name} eq '' || $in{pwd} eq ''); &lockfile; my ($id) = &getevdata(-lastid); $id++; my $pwd = &makecrypt($in{pwd}); my $now = time+$offset*3600; open WR, ">> $datafile" or &error("データファイル$datafileが開けません。"); print WR "$id,$in{year},$in{month},$in{day},$in{name},$now,$pwd,$host,$ip,$in{comment}\n"; close WR; &unlockfile; print "Location: $script#${in{year}}_${in{month}}_$in{day}\n\n"; } sub evreplace { &error('名前とパスワードは必ず入力してください。') if ($in{name} eq '' || $in{pwd} eq ''); &lockfile; my $now = time+$offset*3600; my ($dyear,$dmonth,$dday,$dname,$dnow,$dpwd,$dhost,$dip,$dcomment); my $id; open DATA, "< $datafile" or &error("データファイル$datafileが開けません。"); open WR, "> tmp.$$" or &error("テンポラリファイルが開けません。"); while (){ chomp; ($id,$dyear,$dmonth,$dday,$dname,$dnow,$dpwd,$dhost,$dip,$dcomment) = split /,/; chomp; if ($id == $in{id}){ if (!checkcrypt($in{pwd}, $dpwd)){ close(WR); &error('パスワードが違います。'); } print WR "$in{id},$in{year},$in{month},$in{day},$in{name},$now,$dpwd,$host,$ip,$in{comment}\n"; } else { print WR "$id,$dyear,$dmonth,$dday,$dname,$dnow,$dpwd,$dhost,$dip,$dcomment\n"; } } close WR; close DATA; rename("tmp.$$","$datafile"); &unlockfile; print "Location: $script#${in{year}}_${in{month}}_${in{day}}\n\n"; } sub calupdate { my $now = shift; return $now if ($now eq ' '); my ($sec,$min,$hour,$day,$mon,$year,$wday,$yday,$isdst)=gmtime($now); $mon++; $year += 1900; my $update = "$mon/$day/$year"; return $update; } sub getevdata { # options # -lastid : Return the last id in the data file # -latest : Return the latest update information in the data file # -alldta : Retrun hash reference for all registered contents in the data file # (default) my @options = @_; my %caldata; my %calname; my %caldate; my %calid; my $id; my ($dyear,$dmonth,$dday,$dname,$dnow,$dpwd,$dcomment); my $host; my $ip; my $data_day; my $latest; my ($lid,$lyear,$lmonth,$lday,$lname,$lnow); my @pastyear; if (open DATA, "< $datafile"){ while (){ chomp; ($id,$dyear,$dmonth,$dday,$dname,$dnow,$dpwd,$host,$ip,$dcomment) = split /,/; if (grep /-alldata/, @options or $#options == -1) { $data_day = timegm(0,0,0,$dday,--$dmonth,$dyear); if ($data_day < $start_day || $in{mode} eq 'past') { push @pastyear, $dyear if (! grep /$dyear/, @pastyear); } next if ($data_day < $start_day or $data_day > $end_day); $dmonth++; if (exists $caldata{$dyear}{$dmonth}{$dday}) { next if ($dcomment eq ''); $caldata{$dyear}{$dmonth}{$dday} .= "$dcomment"; $calname{$dyear}{$dmonth}{$dday} .= "$dname"; $caldate{$dyear}{$dmonth}{$dday} .= "$dnow"; $calid{$dyear}{$dmonth}{$dday} .= "$id"; } else { next if ($dcomment eq ''); $caldata{$dyear}{$dmonth}{$dday} = "$dcomment"; $calname{$dyear}{$dmonth}{$dday} = "$dname"; $caldate{$dyear}{$dmonth}{$dday} = "$dnow"; $calid{$dyear}{$dmonth}{$dday} = "$id"; } } elsif (grep /-latest/, @options){ if ($dnow > $latest) { $lnow = $dnow; $lid = $id; $lyear = $dyear; $lmonth = $dmonth; $lday = $dday; $lname = $dname; } } } close DATA; } if (grep /-lastid/, @options) { return ($id); } elsif (grep /-latest/, @options){ return ($lid,$lyear,$lmonth,$lday,$lname,$lnow); } else { return (\%caldata, \%calname, \%caldate, \%calid, \@pastyear); } } sub lockfile { while(-e "$lockfile"){ sleep(1); } open(LOCK,"> $lockfile"); close(LOCK); } sub unlockfile { unlink("tmp.$$") if (-e "tmp.$$"); unlink("$lockfile") if (-e $lockfile); } sub checkcrypt { my ($pwd,$encpwd)=@_; return(crypt($pwd,$encpwd) eq "$encpwd" or &checkadmin($pwd)); } sub updateinfo { my ($id,$dyear,$dmonth,$dday,$dname,$dnow); ($id,$dyear,$dmonth,$dday,$dname,$dnow) = &getevdata(-latest); my ($sec,$min,$hour,$day,$mon,$year,$wday,$yday,$isdst)=gmtime($dnow); my $datetime = sprintf("%d年%d月%d日%d時%d分",$year+1900,++$mon,$day,$hour,$min); my $newest = sprintf("%4d年%d月%d日",$dyear,$dmonth,$dday); print "最終更新者は "; print "$dname、 "; print "最終更新日は "; print "$datetimeです。
    \n"; my ($nsec,$nmin,$nhour,$nday,$nmon,$nyear,$nwday,$nyday,$nisdst)=gmtime($now); my $start_table_date = timegm(0,0,0,1,$nmon,$nyear); my $dmonth_n = $dmonth - 1 if ($dmonth != 0); $dday = 1 if ($dday eq ''); my $last_written_date = timegm(0,0,0,$dday,$dmonth_n,$dyear); if ($last_written_date < $start_table_date){ print "イベントが更新された日は、
    $newestです。

    \n"; } else { print "イベントが更新された日は、$newestです。

    \n"; } } sub inputform { my $now = shift; my $n; my $nn; my ($sec,$min,$hour,$day,$mon,$year,$wday,$yday,$isdst)=gmtime($now); print "

    \n"; if ($disp_length > 12) { print "月\n"; } print "月\n"; print " \n"; print "\n"; print "\n"; print "

    \n"; } sub usage { if ($usage_en == 1){ print < $usage USAGE print "【トップへ】\n"; } } sub misclink { my $now = shift; my ($sec,$min,$hour,$day,$mon,$year,$wday,$yday,$isdst)=gmtime($now); $mon++; $year += 1900; print "$backlink_name\n" if ($backlink_en == 1); print "$jumplink_name\n" if ($jumplink_en == 1); print "$usage_name\n" if ($usage_en == 1); print "$setup_name\n" if ($setup_en == 1); print "

    \n"; } sub monthdaycheck { my ($year,$month,$day) = @_; my @monthdays = (31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31); my $md = $monthdays[$month]; ++$md unless $month != 1 or $year % 4 or !($year % 400); $month++; &error("日付が適切ではありません。$month月$day日") if $day > $md or $day < 1; } sub setup { my $subname = 'setup'; &setadminpwd if ($in{pwd} eq ''); &error('管理用パスワードが違います。') unless &checkadmin($in{pwd}); &htmlhead($title{$subname}{text}); my %check; $check{backlink}[$backlink_en] = "checked"; $check{bgimage}[$bgimage_en] = "checked"; $check{title}{display}{sel}[$title{display}{sel}] = "checked"; $check{title}{display}{loc}[$title{display}{loc}] = "checked"; $check{title}{register}{sel}[$title{register}{sel}] = "checked"; $check{title}{register}{loc}[$title{register}{loc}] = "checked"; $check{title}{modify}{sel}[$title{modify}{sel}] = "checked"; $check{title}{modify}{loc}[$title{modify}{loc}] = "checked"; $check{style_sheet}[$style_sheet_en] = "checked"; $check{head_insert}[$head_insert_en] = "checked"; $check{usage}[$usage_en] = "checked"; $check{jumplink}[$jumplink_en] = "checked"; $check{setup}[$setup_en] = "checked"; $check{disp_length}[$disp_length] = "checked"; $check{disp_length}[13] = "checked" if (!grep /checked/, $check{disp_length}[1,3,6,12]); $check{body_insert1}[$body_insert1_en] = "checked"; $check{body_insert2}[$body_insert2_en] = "checked"; $check{body_insert3}[$body_insert3_en] = "checked"; $check{body_insert4}[$body_insert4_en] = "checked"; $check{body_insert5}[$body_insert5_en] = "checked"; $check{body_insert6}[$body_insert6_en] = "checked"; $check{update_link}[$update_link] = "checked"; $check{link_replace_en}[$link_replace_en] = "checked"; $check{link_replace_top_en}[$link_replace_top_en] = "checked"; print "

    \n"; print "\n"; print "\n"; print <
    • セットアップリンクを非表\示にしている場合は、$script?mode=setupからパスワードを入力してこのページに入ってください。
    • 数字やカラー指定は必ず半角で指定してください。全角やブランクだとCGIが起動しなくなります。万一間違って全角で書いてしまった場合は、$setupfileをエディタで開きその場所を半角に正しく修正してください。それで直ります。
    データファイル ロックファイル バックグランド 画像を使う カラー設定にする
    画像を使う場合の画像ファイル
    カラー設定の場合のカラー番号(白:#ffffff 又は white) カレンダーの色 カラー番号又はカラー名
    ヘッダの背景
    ヘッダの文字
    更新者
    更新日
    平日欄の背景
    土曜日の背景
    日曜日の背景
    日付、内容の文字色はスタイルシートのリンク色の設定で行ってください。
    日付はclass=daylink, コメントはclass=comlinkとなっています。 更新リンク 更新ページへのリンクを「内容」欄にするか「更新者」欄にするか
    内容 更新者
    ここの設定を「更新者」にした場合の更新者の色設定はスタイルシートで行ってください。class=namelinkとなっています。
    その場合の「内容」の色 http://からの自動リンク置き換え 自動リンクは更新ページリンクを「更新者」に設定したときの表\示、過去の表\示ページ、SSIモードでの表\示で有効です。
    置き換え そのまま
    リンク名
    リンククリック時
    同じウィンドウ 別ウィンドウ
    表\の表\示幅 ブラウザ全体の% 更新者欄の幅 テーブル全体の% 表\示する月数 1ヶ月 3ヶ月 6ヶ月 12ヶ月 その他 イベントカレンダータイトル名
    無し
    デフォルト<H2></H2>
    テキスト color= size= face=
    ロゴ画像
    スタイルシート
    位置: 右 登録タイトル名 ○月×日
    無し
    デフォルト<H2></H2>
    テキスト color= size= face=
    スタイルシート
    位置: 右 変更タイトル名 ○月×日
    無し
    デフォルト<H2></H2>
    テキスト color= size= face=
    スタイルシート
    位置: 右 トップへのリンク 表\示 非表\示
    リンク名
    URL
    ジャンプのリンク 表\示 非表\示
    リンク名
    セットアップのリンク 表\示 非表\示
    リンク名
    使い方 表\示 非表\示
    リンク名
    <head>内挿入文 有効 無効
    HTML書式
    ポップアップ広告やJavascript、<META>を挿入したい場合にここに記述する。
    以下の記述が<head>〜</head>内に挿入される。

    スタイルシート 有効 無効

    日付、内容の文字色はスタイルシートで変更できます。
    日付はclass=daylink, コメントはclass=comlinkとなっています。 <body>内挿入文 イベントカレンダー上部に表\\示される文をHTMLで記述。ルールやコメント、広告やアクセスカウンタ、リンクなど記すことができます。
    タイトルの上 有効 無効

    タイトルの下 有効 無効

    「更新情報」の上 有効 無効

    「更新情報」の下 有効 無効

    メニューリンクの下 有効 無効

    表\\の上 有効 無効

    時間設定 GMTより時間(日本:+9時間) END print ""; print ""; &htmltail; } sub setupwrite { $in{title_display_size} =~ s/ /+/; $in{title_register_size} =~ s/ /+/; $in{title_modify_size} =~ s/ /+/; foreach (keys(%in)){ $in{$_} =~ s/
    /\n/g; $in{$_} =~ s/,/,/g; $in{$_} =~ s/<//g; } open(SETUP,"> $setupfile"); $in{disp_length_other} = 12 if ($in{disp_length_other} !~ /\d/); $in{disp_length} = $in{disp_length_other} if ($in{disp_length} == 13); print SETUP <〜内に挿入できる構文 1:on, 0:off \$head_insert_en = $in{head_insert_en}; \$head_insert = '$in{head_insert}'; #使い方 \$usage_en = $in{usage_en}; \$usage_name = '$in{usage_name}'; \$usage = '$in{usage}'; #上部に表\\示させる文 1:on, 0:off \$body_insert1_en = $in{body_insert1_en}; \$body_insert1 = '$in{body_insert1}'; \$body_insert2_en = $in{body_insert2_en}; \$body_insert2 = '$in{body_insert2}'; \$body_insert3_en = $in{body_insert3_en}; \$body_insert3 = '$in{body_insert3}'; \$body_insert4_en = $in{body_insert4_en}; \$body_insert4 = '$in{body_insert4}'; \$body_insert5_en = $in{body_insert5_en}; \$body_insert5 = '$in{body_insert5}'; \$body_insert6_en = $in{body_insert6_en}; \$body_insert6 = '$in{body_insert6}'; # 時間設定 GMTからのオフセット 日本:+9 \$offset = $in{offset}; 1; END close(SETUP); print "Location: $script\n\n"; }