#!/usr/local/bin/perl ############################################################################## # shiromuku(cu3)DIARY version 1.51 # Created 06/10/2003 # Copyright 2003 Shiromuku # Available at http://www.t-okada.com/cgi/ ############################################################################### # COPYRIGHT NOTICE (著作権の告示) # Copyright 2003 Shiromuku All Rights Reserved. # This script can be used and modified free of charge as long as you don't change this header or any of the parts that give me credit for writing this. (このスクリプトは無償で使用または改変できます。ただしこの著作権の告知と上記のコメント、及びCGIにより生成されるHTML表示下部にある著作権表示部は変えないで下さい。) # By using this script you agree to indemnify me from any liability that might arise from its use. In simple English, if this script somehow makes your computer run amuck and kill the pope, it's not my fault.(このスクリプトを使用することにより、使用者はその使用によって起こる可能性のあるいかなる事柄に対する責務についても、私Shiromukuに免責の保証を与えることに同意したものとします。) # Redistributing and selling the code for this program without prior written consent is expressly forbidden.(前もって書面での承諾を得ることなくこのプログラムのコードを再配布したり売ったりすることは 明確に禁じられています。) ####################### require './jcode.pl'; require './scu3_diary_lib.cgi'; ####################### use strict; my $gl = &get_globals("scu3_diary_gl.cgi"); $gl->{version} = "version 1.51"; $gl->{userip} = $ENV{'REMOTE_ADDR'}; my ($form); my $config = &open_config ($gl); if ($ENV{'CONTENT_LENGTH'} || $ENV{'QUERY_STRING'}) {$form = &parse_data($gl,$config);} my %HoD = (); @HoD{"gl", "config", "form"} = ($gl, $config, $form); if (-e "$gl->{basedir}/$gl->{passfile}") { if ($config->{use_view_pass}) { my%boardname = split(/\,/,$HoD{gl}{boardname}); my$cookie = &get_cookie (\%boardname); if ($cookie->{view_password}) { $HoD{form}{view_password} = $cookie->{view_password}; } if ($HoD{form}{view_password}) { &check_view_pass (\%HoD,"view_pass"); } else {&return_login(\%HoD); exit (0) ;} } if ($form->{action} eq "show_icon") {&show_icon(\%HoD);} elsif ($form->{action} eq "admin_enter") {&return_admin_enter(\%HoD);} else {&make_cal(\%HoD);} } else { &head("管理用ページ", \%HoD); print "

IDとパスワードの設定をする

\n"; print "
まず最初にIDとパスワードの設定をして下さい
\n"; print "
{cgi_a}\">\n"; print "\n"; print "
\n"; print "\n"; print "\n"; print "\n"; print "
ユーザID
(半角英数字で8文字以内にして下さい。)
パスワード
(半角英数字で8文字以内にして下さい。)
パスワード
(確認用にもう一度入力して下さい。)
\n"; print "
\n"; print "
\n"; print "\n"; } exit (0) ; ############################ sub parse_data { my ($gl,$config) = @_; my ($buffer, @pairs, $pair, $name, %form, $value); if ($ENV{'REQUEST_METHOD'} eq "POST") { if ($config->{check_referer} == 1) {&check_referer($gl,$config);} read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); } else { $buffer = $ENV{'QUERY_STRING'}; } @pairs = split(/&/, $buffer); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; if ($ENV{'REQUEST_METHOD'} ne "POST") { if ($value =~ /\W/){ &error("エラーです。\n",$config); } } $value =~ s//>/ig; $value =~ s/\|\|\|//g; $value =~ s/\r\n/
/g; $value =~ s/\r/
/g; $value =~ s/\n/
/g; jcode::convert(\$value,$gl->{mycode}); if ($gl->{mycode} eq 'sjis') {jcode::h2z_sjis(\$value); } if ($gl->{mycode} eq 'euc') {jcode::h2z_euc(\$value); } $form{$name} = $value; } return \%form; } ############################ #counter sub counter { my $HoD = shift; my $c_num = &get_number ($HoD->{gl}{c_numfile}, '0', $HoD); if ($ENV{'REQUEST_METHOD'} ne "POST") { $c_num = &increment_num ($HoD->{gl}{c_numfile},$c_num, $HoD); } if (length $c_num < $HoD->{config}{n_figure1}) { $c_num = &make_figure ($c_num,length $c_num,$HoD->{config}{n_figure1}); } return $c_num; } ############################ #桁数調整 sub make_figure { my ($num, $length, $figure) = @_; my $keta = $figure - $length; my $i = 0; while ($i < $keta) { $num = "0$num"; $i++; } return $num; } ############################ #アイコンの表示 sub show_icon { my $HoD = shift; my (@icon_data, $icon_dir_urls, $file); #$HoD->{config} = &open_config ($HoD->{gl}, $HoD->{form}); if ($HoD->{form}{i_type} eq "diary") { $file = &file_open("$HoD->{gl}{basedir}/$HoD->{gl}{iconfile2}"); $icon_dir_urls = $HoD->{gl}{icon_dir_url2}; } if ($HoD->{form}{i_type} eq "reply") { $file = &file_open("$HoD->{gl}{basedir}/$HoD->{gl}{iconfile}"); $icon_dir_urls = $HoD->{gl}{icon_dir_url}; } $HoD->{config}{c1_d_title_color} = "Icon"; print "Content-type: text/html\n\n"; &head_html(\*STDOUT,$HoD); print "

Icon

\n"; print "
\n"; foreach (@{$file}) { @icon_data = split(/\|\|\|/,$_); print "\n"; } print "
$icon_data[2]


\n"; print "
ブラウザを閉じて戻って下さい。
\n"; print "\n"; } ############################ #calendarページを表示 sub make_cal { my $HoD = shift; my($year_last,$year_next,$month_last,$month_next,$today,@afile,@rfile,$c_flag,$day_last,%file,$flag,%last,$p,$ps,$page_maxs,$p_flag,@pp_datax,$filename,@h_files,$s_file,@nfile,@rfile1,%the_data,$the_day,$y,$yearn, $monn, $dayn, $hourn, $minn, $secn, $week, $date, $time, $timex,$today_flag,$flags,@nfilex,%the_data1,@afilex); if ($HoD->{config}{show_today}) { ($yearn, $monn, $dayn, $hourn, $minn, $secn, $week, $date, $time, $timex) = &date_time(); } unless (defined $HoD->{config}{n_page_max1}) {$HoD->{config}{n_page_max1} = 1;} if ($HoD->{form}{action} eq "reply") { unless (($HoD->{form}{year} =~ /^\d{4}$/) && ($HoD->{form}{month} =~ /^\d{1,2}$/) && ($HoD->{form}{day} =~ /^\d{1,2}$/) && ($HoD->{form}{mynum} =~ /^\d+$/)) { &error("エラーです。\n",$HoD->{config}); } } elsif ($HoD->{form}{action} eq "article") { unless (($HoD->{form}{year} =~ /^\d{4}$/) && ($HoD->{form}{month} =~ /^\d{1,2}$/) && ($HoD->{form}{day} =~ /^\d{1,2}$/)) { &error("エラーです。\n",$HoD->{config}); } } elsif ($HoD->{form}{action} eq "show_month") { unless (($HoD->{form}{year} =~ /^\d{4}$/) && ($HoD->{form}{month} =~ /^\d{1,2}$/)) { &error("エラーです。\n",$HoD->{config}); } } else { $HoD->{form}{action} = "showlast"; if (defined $HoD->{form}{year}) { if ($HoD->{form}{year} !~ /^\d{4}$/){&error("年が不正です。\n",$HoD->{config});} } if (defined $HoD->{form}{month}) { if ($HoD->{form}{month} !~ /^\d{1,2}$/){&error("月が不正です。\n",$HoD->{config});} } if (defined $HoD->{form}{day}) { if ($HoD->{form}{day} !~ /^\d{1,2}$/){&error("日が不正です。\n",$HoD->{config});} } if (defined $HoD->{form}{mynum}) { if ($HoD->{form}{mynum} =~ /\D/){&error("番号が不正です。\n",$HoD->{config});} } } if (($HoD->{config}{img_t_mark1} eq "") || ($HoD->{config}{img_t_mark1} eq "http://")) {$HoD->{config}{img_t_mark1} = $HoD->{config}{c1_t_mark1};} else {$HoD->{config}{img_t_mark1} = "{config}{img_t_mark1}\">";} if (($HoD->{config}{img_t_mark2} eq "") || ($HoD->{config}{img_t_mark2} eq "http://")) {$HoD->{config}{img_t_mark2} = $HoD->{config}{c1_t_mark2};} else {$HoD->{config}{img_t_mark2} = "{config}{img_t_mark2}\">";} if (($HoD->{config}{img_c_mark1} eq "") || ($HoD->{config}{img_c_mark1} eq "http://")) {$HoD->{config}{img_c_mark1} = $HoD->{config}{c1_c_mark1};} else {$HoD->{config}{img_c_mark1} = "{config}{img_c_mark1}\" BORDER=0>";} opendir (DIR, "$HoD->{gl}{basedir}"); foreach $filename ( readdir (DIR) ) { if ($filename =~ /^(\d{4})(\d{2})\.txt$/) { if (!$HoD->{config}{show_today} || ($HoD->{config}{show_today} && ((($1 >= $yearn) && ($2 >= $monn)) || ($1 > $yearn)))) { push @h_files,$filename; } $file{$filename}{year} = $1; $file{$filename}{month} = $2; } } closedir (DIR); if ($HoD->{config}{show_today}) {@h_files = sort @h_files;} else {@h_files = reverse sort @h_files;} if ($HoD->{form}{action} eq "showlast") { #$s_file = $h_files[0]; my$n = 0; if ($HoD->{config}{show_today}) { if (-e "$HoD->{gl}{basedir}/$yearn$monn\.txt") { my $file = &file_open("$HoD->{gl}{basedir}/$yearn$monn\.txt"); my $x; foreach $x (@{$file}) { my@data = split(/\|\|\|/,$x); if (($data[0] eq "diary") && ($data[1] eq $dayn)){ $the_day = $data[12]; my$ymd = ($data[4] . $data[5] . $data[1]); $data[0] = $ymd; my$new = join '|||', @data; push @nfile, $new; foreach $y (@{$file}) { my@data1 = split(/\|\|\|/,$y); if (($data1[0] eq "reply") && ($data1[6] eq $the_day)){ push @{$the_data{$data[12]}}, $y; } } $today_flag = 1; } } } } if (($HoD->{config}{show_today} && !$today_flag) || !$HoD->{config}{show_today}){ LOOP: foreach (@h_files) { my $file = &file_open("$HoD->{gl}{basedir}/$_"); my $x; if ($HoD->{config}{show_today}) {@{$file} = sort @{$file};} else {@{$file} = reverse sort @{$file};} foreach $x (@{$file}) { if ($n >= $HoD->{config}{n_page_max1}) {last LOOP;} my@data = split(/\|\|\|/,$x); if ($data[0] eq "diary") { if ($HoD->{config}{show_today}) { if (($data[4] > $yearn) || ($data[5] > $monn) || ($data[1] >= $dayn)) { $flags = 1; } } $the_day = $data[12]; my$ymd = ($data[4] . $data[5] . $data[1]); $data[0] = $ymd; my$new = join '|||', @data; if (($HoD->{config}{show_today} && $flags) || (!$HoD->{config}{show_today})) { push @nfile, $new; ++$n; } foreach $y (@{$file}) { my@data1 = split(/\|\|\|/,$y); if (($data1[0] eq "reply") && ($data1[6] eq $the_day)){ push @{$the_data{$data[12]}}, $y; } } } } } } $flag = 1; } &left_frame_top($HoD); $ENV{'TZ'} = "JST-9"; my($sec,$min,$hour,$mday,$mmonth,$myear,$wday,$yday,$isdst) = localtime(time); $myear=$myear+1900; $mmonth = $mmonth+1; my%days_of_month = ("1" => "31", "2" => "28", "3" => "31", "4" => "30", "5" => "31", "6" => "30", "7" => "31", "8" => "31", "9" => "30", "10" => "31", "11" => "30", "12" => "31"); if ($HoD->{form}{year} eq "") {$HoD->{form}{year} = $myear;} if ($HoD->{form}{month} eq "") {$HoD->{form}{month} = $mmonth;} if ($HoD->{form}{day} eq "") {$HoD->{form}{day} = $mday;} my$monthx = $HoD->{form}{month}; if ($monthx < 10) {$monthx="0$monthx";} my$dayx = $HoD->{form}{day}; if ($dayx < 10) {$dayx="0$dayx";} my($subject1,$s_length, $day_hx, $d_length); if (-e "$HoD->{gl}{basedir}/$HoD->{form}{year}$monthx\.txt") { open(LOG,"<$HoD->{gl}{basedir}/$HoD->{form}{year}$monthx\.txt"); while () { my@data = split(/\|\|\|/,$_); if ($data[0] eq "diary") { push @afile, $_; $HoD->{data_of_day}{$data[1]}++; } else {push @rfile, $_;} } close(LOG); } if ($HoD->{form}{month} == 1) {$year_last = $HoD->{form}{year} - 1;} else {$year_last = $HoD->{form}{year};} if ($HoD->{form}{month} == 12) {$year_next = $HoD->{form}{year} + 1;} else {$year_next = $HoD->{form}{year};} if ($HoD->{form}{month} == 1) {$month_last = 12;} else {$month_last = $HoD->{form}{month} - 1;} if ($HoD->{form}{month} == 12) {$month_next = 1;} else {$month_next = $HoD->{form}{month} + 1;} if (($HoD->{form}{month} == $mmonth) && ($HoD->{form}{year} eq $myear)) { $HoD->{form}{today} = $mday; } if ((!($HoD->{form}{year} % 4) && ($HoD->{form}{year} % 100)) || !($HoD->{form}{year} % 400)) { $days_of_month{"2"} = 29; } my$days_of_month = $days_of_month{$HoD->{form}{month}}; my$day = 1; my$firstday = &getwday($HoD->{form}{year},$HoD->{form}{month},$day); $HoD->{form}{year1} = $HoD->{form}{year}; $HoD->{form}{month1} = $HoD->{form}{month}; $HoD->{form}{day1} = $HoD->{form}{day}; if ($HoD->{config}{intro_color} eq "") { $HoD->{config}{intro_color} = $HoD->{config}{text_color}; } if ($HoD->{config}{intro_color} eq "") { $HoD->{config}{intro_color1} = $HoD->{config}{text_color}; } print "
{config}{align_b}\">{config}{t_width_b}\" BORDER=0 CELLPADDING=0>\n"; print "\n"; print "
\n"; my($c_num); if ($HoD->{config}{show_counter}) {$c_num = &counter ($HoD);} if ($HoD->{config}{show_counter}) { print "{config}{title_color}\" style=\"font-size:9pt;\">$c_num\n"; } print "$HoD->{config}{c2_title}\n"; print "$HoD->{config}{c2_introduction}\n"; print "
{config}{cols}\">\n"; if ($HoD->{config}{n_b_width} eq "") {$HoD->{config}{n_b_width} = 1;} if ($HoD->{config}{intro_color} eq "") {$HoD->{config}{intro_color} = $HoD->{config}{text_color};} if ($HoD->{config}{line_color} eq "") {$HoD->{config}{line_color} = $HoD->{config}{text_color};} if ($HoD->{config}{ca_table_color}) { #if ($HoD->{config}{intro_color}) { print "
{config}{intro_color}; border-style: $HoD->{config}{ca_border_style}; border-width: $HoD->{config}{n_b_width}px; border-collapse: collapse\" CELLPADDING=7 BGCOLOR=\"$HoD->{config}{ca_table_color}\">\n"; #} } else { #if ($HoD->{config}{intro_color}) { print "
{config}{intro_color}; border-style: $HoD->{config}{ca_border_style}; border-width: $HoD->{config}{n_b_width}px; border-collapse: collapse\" CELLPADDING=7 BGCOLOR=\"$HoD->{config}{ca_table_color}\">\n"; #} } print "\n"; print ""; my@day_of_week = split(/\,/,$HoD->{config}{day_of_week}); foreach (@day_of_week) { print ""; } print ""; my$blank = 0; while ($blank < $firstday) { print ""; $blank++; } while ($blank < 7) { if ($blank == 0) {&write_sunday($HoD,$day,\@afile);} elsif ($blank == 6) {&write_saturday($HoD,$day,\@afile);} else {&write_weekday($HoD,$day,\@afile);} $day++; $blank++; } print ""; my$i = 0; while ($day <= $days_of_month) { if ($i == 6) { &write_saturday($HoD,$day,\@afile); print ""; $i = 0; } elsif ($i == 0) { print ""; &write_sunday($HoD,$day,\@afile); $i++; } else { &write_weekday($HoD,$day,\@afile); $i++; } $day++; } if ($i != 0) { while ($i < 7) { print ""; $i++; } print ""; } print "
{config}{intro_color}; border-style: $HoD->{config}{ca_border_style}; border-width: $HoD->{config}{n_b_width}px; border-collapse: collapse\" COLSPAN=7 ALIGN=center>{config}{intro_color1}\">$HoD->{form}{year}年$HoD->{form}{month}月
{config}{intro_color}; border-style: $HoD->{config}{ca_border_style}; border-width: $HoD->{config}{n_b_width}px; border-collapse: collapse\">$_
{config}{intro_color}; border-style: $HoD->{config}{ca_border_style}; border-width: $HoD->{config}{n_b_width}px; border-collapse: collapse\"> 
{config}{intro_color}; border-style: $HoD->{config}{ca_border_style}; border-width: $HoD->{config}{n_b_width}px; border-collapse: collapse\"> 

"; print "
\n"; print "{gl}{cgi}\">\n"; print "\n"; print "\n"; print "\n"; print "{form}{day}\">\n"; print "\n"; print ""; print "{gl}{cgi}\">\n"; print "\n"; print "\n"; print "\n"; print "{form}{day}\">\n"; print "\n"; print "\n"; print "\n"; print "{gl}{cgi}\">\n"; print "\n"; print "{form}{day}\">\n"; print "\n"; print "
年\n"; print "月\n"; print "
"; print "

{config}{n_b_width} COLOR=$HoD->{config}{intro_color} style=\"border-style: $HoD->{config}{hr_border_style1};\">\n"; if ($HoD->{config}{use_download}) { print "
{gl}{cgi}\">\n"; print "\n"; #print "{form}{day}\">\n"; print "
年\n"; print "月の日記を\n"; print "
\n"; } &search_html(\*STDOUT,$HoD); print "
\n"; #if ($HoD->{form}{action} eq "show_month") { #print "
{config}{t_width} CELLPADDING=4>\n"; #if ($HoD->{config}{fa_text_color1}) { #print "
{config}{fa_text_color1}>\n"; #} #else {print "
\n";} #print "{config}{c1_fa_text_color}>$HoD->{config}{img_t_mark2}$HoD->{form}{year}年$HoD->{form}{month}月\n"; #print "
\n"; #if ($HoD->{config}{fa_text_color1}) {print "
\n";} #} #elsif (($HoD->{form}{action} eq "article") || ($HoD->{form}{action} eq "reply")) { #print "
{config}{t_width} CELLPADDING=4>\n"; #if ($HoD->{config}{fa_text_color1}) { #print "
{config}{fa_text_color1}>\n"; #} #else {print "
\n";} #print "{config}{c1_fa_text_color}>$HoD->{config}{img_t_mark2}$HoD->{form}{year}年$HoD->{form}{month}月$HoD->{form}{day}日\n"; #print "
\n"; #if ($HoD->{config}{fa_text_color1}) {print "
\n";} #} my$n; if (@nfile) { $HoD->{config}{n_page_max} = $HoD->{config}{n_page_max2}; $n = @nfile; if ($HoD->{config}{move_article1} != 1) { @nfile = sort @nfile; } } else { if ($HoD->{config}{move_article}) {@afile = reverse sort @afile;} else {@afile = sort @afile;} } if (!$HoD->{form}{next_page}) { $page_maxs = $HoD->{config}{n_page_max}; $p = 0; $HoD->{form}{next_page} = 0; $ps = 0;} else { $page_maxs = $HoD->{form}{next_page} + $HoD->{config}{n_page_max}; $p = 0; $ps = $HoD->{form}{next_page};} if (@afile && !$flag) { foreach (@afile) { chomp; my@pp_data = split(/\|\|\|/,$_); $the_day = $pp_data[12]; if ((($dayx eq $pp_data[1]) && ($HoD->{form}{action} eq "article")) || ($HoD->{form}{action} ne "article")) { if ($p >= $page_maxs) { $p_flag = 1; #last; } #print "$dayx/$pp_data[1]/$p/$page_maxs/$HoD->{form}{next_page}
\n"; if ((($p < $page_maxs) && ($p >= $HoD->{form}{next_page}) && (($HoD->{form}{action} eq "show_month") || ($HoD->{form}{action} eq "showlast") || ($HoD->{form}{action} eq "article"))) || (($HoD->{form}{action} eq "reply") && ($HoD->{form}{mynum} == $pp_data[12]))) { push @afilex, $_; my$y; foreach $y (@rfile) { my@data1 = split(/\|\|\|/,$y); if (($data1[0] eq "reply") && ($data1[6] eq $the_day)){ push @{$the_data{$pp_data[12]}}, $y; } } $ps++; } $p++; } } } if (($flag && @nfile && $HoD->{config}{show_titles}) || (!$flag && @afilex && $HoD->{config}{show_titles1})) { print "
{config}{t_width} CELLPADDING=4 style=\"border-top-width: $HoD->{config}{n_b_width}px; border-top-style: $HoD->{config}{border_style1}; border-top-color: $HoD->{config}{line_color}\">\n"; if (@nfile) {&write_body1($HoD,\@nfile);} else {&write_body1($HoD,\@afilex,"x");} print "

\n"; } my@nfile1; if (@nfile) { foreach (@nfile) { chomp; my@pp_data = split(/\|\|\|/,$_); $pp_data[0] = "diary"; my$new = join '|||', @pp_data; push @nfile1, $new; ++$n; } @nfile = @nfile1; } if ($flag == 1) {@afilex = @nfile;} if(@afilex) { foreach (@afilex) { chomp; my@pp_data = split(/\|\|\|/,$_); if($flag) { if ($p >= $page_maxs) { $p_flag = 1; #last; } } if (($flag && ($p < $page_maxs) && ($p >= $HoD->{form}{next_page})) || !$flag) { print "
\n"; &table_html (\*STDOUT,$HoD); &subj_date_name_hp_htmls(\*STDOUT, $pp_data[0], \@pp_data, $HoD); if ($the_data{$pp_data[12]}[0]) { my$r; foreach $r(sort @{$the_data{$pp_data[12]}}) { my@pp_data1 = split(/\|\|\|/,$r); if (($pp_data1[6] eq $pp_data[12]) && ($pp_data1[0] eq "reply")) { &subj_date_name_hp_htmls(\*STDOUT, $pp_data1[0], \@pp_data1, $HoD); } } } print "

\n"; if ($HoD->{config}{img_line_url}) { print "
\n"; print "
{config}{img_line_url}\">

\n"; } elsif (($HoD->{config}{img_line_url} eq '') && ($HoD->{config}{table_color} eq '') && ($HoD->{config}{border_color} eq "")) { print "
\n"; } if($flag) {$ps++;} } if($flag) {$p++;} } if (($HoD->{form}{action} eq "show_month") || ($HoD->{form}{action} eq "showlast") || ($HoD->{form}{action} eq "article")){ $last{ps} = $ps; $last{p1} = $p; $last{page_maxs} = $page_maxs; $last{p_flag} = $p_flag; $HoD->{last} = {%last}; &last_html ($HoD); } } if ($HoD->{form}{action} eq "reply") { my($cookie); my%boardname = split(/\,/,$HoD->{gl}{boardname}); if ($HoD->{config}{usepasscookie} == 1) {$cookie = &get_cookie (\%boardname);} print "
{config}{t_width}\" BORDER=0 CELLSPACING=0 CELLPADDING=0 BORDERCOLOR=\"$HoD->{config}{text_color}\">
\n"; print "
{gl}{cgi_r}\">\n"; print "\n"; print "{form}{year}\">\n"; print "\n"; print "\n"; print "{form}{mynum}\">\n"; #print "\n"; print "
\n"; &r_add_html(\*STDOUT,$HoD); print "
Pass{pass}>\n"; print "\n"; print "\n"; print "
\n"; print "
\n"; } if (@afilex && ($flag != 1) && (($HoD->{form}{action} eq "article") || ($HoD->{form}{action} eq "reply"))) {&form_html(\*STDOUT,$HoD);} if (!@afilex) { print "
{config}{t_width} CELLPADDING=4>
\n"; print "$HoD->{config}{c2_f_introduction}\n"; print "
\n"; } if ($HoD->{config}{use_add_pass}) {&a_form_html(\*STDOUT,$HoD);} print "\n"; print "\n"; print "
\n"; #print "{gl}{cgi}?\">[TOP]\n"; print "$HoD->{config}{c2_back}\n"; if ($HoD->{form}{action} eq "reply") { print "
{gl}{cgi}?action=article&year=$HoD->{form}{year}&month=$HoD->{form}{month}&day=$HoD->{form}{day}&mynum=$HoD->{form}{mynum}\" style=\"text-decoration:none\">[BACK]\n"; } print "
\n"; print "\n"; print "
\n"; if ($HoD->{form}{day1} < 10) {$HoD->{form}{day1}="0$HoD->{form}{day1}";} if ($HoD->{form}{month1} < 10) {$HoD->{form}{month1}="0$HoD->{form}{month1}";} $HoD->{form}{year} = $HoD->{form}{year1}; $HoD->{form}{month} = $HoD->{form}{month1}; $HoD->{form}{day} = $HoD->{form}{day1}; if (($HoD->{form}{action} eq "article") || ($HoD->{form}{action} eq "reply")) { if (@afilex) {&foot_html1(\*STDOUT,$HoD);} else {&foot_html(\*STDOUT,$HoD);} } else {&foot_html(\*STDOUT,$HoD);} } ############################ #左フレーム中 sub write_body1 { my($HoD,$nfile,$x) = @_; my($subject1,$s_length, $day_hx, $d_length,@pp_data); if ($nfile) { if (@{$nfile}) { foreach (@{$nfile}) { @pp_data = split(/\|\|\|/,$_); #if ($pp_data[0] eq "diary") { $subject1 = $pp_data[8]; if ($HoD->{config}{short_title}) { my$letters = $HoD->{config}{n_letters} * 2; my$letters1 = $letters-1; $s_length = length($subject1); if ($s_length > $letters) { $subject1 = substr $subject1,0,$letters; if ($subject1 =~ /\x8F$/ or $subject1 =~ tr/\x8E\xA1-\xFE// % 2) { $subject1 = substr $pp_data[8],0,$letters1; } $subject1 = "${subject1}.."; } } print "{config}{n_b_width}px; border-bottom-style: $HoD->{config}{border_style1}; border-bottom-color: $HoD->{config}{line_color}\">\n"; #if ($HoD->{config}{use_t_icon}) { #if ($pp_data[7] &&($pp_data[7] ne "no_icon")) { print "$HoD->{config}{img_t_mark1}\n"; #} #} my$the_day = $pp_data[1]; $the_day =~ s/^0//g; my$the_month = $pp_data[5]; $the_month =~ s/^0//g; my$the_year = $pp_data[4]; if ($x) { if ($ENV{'REQUEST_METHOD'} eq "POST") { print "{gl}{cgi}#$pp_data[4]$pp_data[5]$pp_data[1]$pp_data[12]\" style=\"text-decoration:none\">\n"; } else { print "{gl}{cgi}?action=article&year=$the_year&month=$the_month&day=$the_day#$pp_data[4]$pp_data[5]$pp_data[1]$pp_data[12]\" style=\"text-decoration:none\">\n"; } } else { print "{gl}{cgi}?action=article&year=$the_year&month=$the_month&day=$the_day#$pp_data[4]$pp_data[5]$pp_data[1]$pp_data[12]\" style=\"text-decoration:none\">\n"; } if ($HoD->{config}{show_date}) { my@day_of_week = split(/\,/,$HoD->{config}{day_of_week}); my$day_weeks = $day_of_week[$pp_data[11]]; if ($pp_data[11] !~ /\d/) {$day_weeks = $pp_data[11];} my$day_h = $pp_data[1]; $day_h =~ s/^0//g; my$month_h = $pp_data[5]; $month_h =~ s/^0//g; $day_hx = $day_h; $d_length = length($day_hx); if ($d_length == 1) {$day_hx = "  $day_hx";} #if ($pp_data[7] &&($pp_data[7] ne "no_icon")) { #print "{gl}{icon_dir_url2}/$pp_data[7]>\n"; #} print "{config}{c1_f_image1}>$pp_data[4]年$month_h月$day_h日($day_weeks)\n"; } #print "\n"; #if (!$HoD->{config}{show_date}) { #if ($pp_data[7] &&($pp_data[7] ne "no_icon")) { #print "{gl}{icon_dir_url2}/$pp_data[7]>\n"; #} #} #print "{gl}{img_dir_url}/$pp_data[4]$pp_data[5]$pp_data[1]\.html#$pp_data[12]\">$subject1\n"; print "{config}{c1_title_color1}>$subject1\n"; #if ($HoD->{config}{img_line_url1}) {print "{config}{img_line_url1}\">
\n";} #else {print "$HoD->{config}{c1_line}
\n";} print "\n"; #} } } } } ############################ #write_sunday sub write_sunday { my($HoD,$day,$afile) = @_; if ($day == $HoD->{form}{today}) { print "{config}{today_color}\" style=\"border-color: $HoD->{config}{intro_color}; border-style: $HoD->{config}{ca_border_style}; border-width: $HoD->{config}{n_b_width}px; border-collapse: collapse\" WIDTH=\"$HoD->{config}{n_c_width}\" HEIGHT=\"$HoD->{config}{n_c_height}\">"; } else {print "{config}{intro_color}; border-style: $HoD->{config}{ca_border_style}; border-width: $HoD->{config}{n_b_width}px; border-collapse: collapse\" WIDTH=\"$HoD->{config}{n_c_width}\" HEIGHT=\"$HoD->{config}{n_c_height}\">";} print "{config}{sun_color}\" SIZE=2>"; &write_cal_num($HoD,$day,$afile,$HoD->{config}{sun_color}); print ""; print ""; } ############################ #write_saturday sub write_saturday { my($HoD,$day,$afile) = @_; if ($day == $HoD->{form}{today}) { print "{config}{today_color}\" style=\"border-color: $HoD->{config}{intro_color}; border-style: $HoD->{config}{ca_border_style}; border-width: $HoD->{config}{n_b_width}px; border-collapse: collapse\" WIDTH=\"$HoD->{config}{n_c_width}\" HEIGHT=\"$HoD->{config}{n_c_height}\">"; } else {print "{config}{intro_color}; border-style: $HoD->{config}{ca_border_style}; border-width: $HoD->{config}{n_b_width}px; border-collapse: collapse\" WIDTH=\"$HoD->{config}{n_c_width}\" HEIGHT=\"$HoD->{config}{n_c_height}\">";} print "{config}{sat_color}\" SIZE=2>"; &write_cal_num($HoD,$day,$afile,$HoD->{config}{sat_color}); print ""; print ""; } ############################ #write_weekday sub write_weekday { my($HoD,$day,$afile) = @_; if ($day == $HoD->{form}{today}) { print "{config}{today_color}\" style=\"border-color: $HoD->{config}{intro_color}; border-style: $HoD->{config}{ca_border_style}; border-width: $HoD->{config}{n_b_width}px; border-collapse: collapse\" WIDTH=\"$HoD->{config}{n_c_width}\" HEIGHT=\"$HoD->{config}{n_c_height}\">"; } else {print "{config}{intro_color}; border-style: $HoD->{config}{ca_border_style}; border-width: $HoD->{config}{n_b_width}px; border-collapse: collapse\" WIDTH=\"$HoD->{config}{n_c_width}\" HEIGHT=\"$HoD->{config}{n_c_height}\">";} print ""; &write_cal_num($HoD,$day,$afile); print ""; print ""; } ############################ #カレンダーの数字を書く sub write_cal_num { my($HoD,$day,$afile,$color) = @_; my(@cfile,$COLOR); if ($color) {$COLOR = "COLOR=\"$color\"";} else {$COLOR = "";} my$flag = 0; my$dayx; if ($day < 10) {$dayx="0$day";} else {$dayx = $day;} my$monthx = $HoD->{form}{month}; if ($monthx < 10) {$monthx="0$monthx";} if ($HoD->{data_of_day}{$dayx}) { print "{gl}{cgi}?action=article&year=$HoD->{form}{year}&month=$HoD->{form}{month}&day=$day\">"; if ($HoD->{config}{img_c_mark1}) { print "$HoD->{config}{img_c_mark1}
\n"; } print "$day
"; } else { print "{gl}{cgi}?action=admin_enter&year=$HoD->{form}{year}&month=$monthx&day=$dayx\" TARGET=$HoD->{config}{target1} style=\"text-decoration:none\">$day"; } } ############################ #左フレームTOP sub left_frame_top { my $HoD = shift; if ($HoD->{config}{bgcolor} eq '') {$HoD->{config}{bgcolor}="white";} #$HoD->{config}{bgcolor} = $HoD->{config}{f_bgcolor}; #$HoD->{config}{c2_stylesheet} = $HoD->{config}{c2_f_stylesheet}; #$HoD->{config}{c2_introduction} = $HoD->{config}{c2_f_introduction}; #$HoD->{config}{c1_d_title_color} = $HoD->{config}{c1_f_title_color}; #$HoD->{config}{c2_title} = $HoD->{config}{c2_f_title}; #$HoD->{config}{img_bkgd_img} = $HoD->{config}{img_f_bkgd_img}; #$HoD->{config}{text_color} = $HoD->{config}{f_text_color}; #$HoD->{config}{link_color} = $HoD->{config}{f_link_color}; #$HoD->{config}{link_color2} = $HoD->{config}{f_link_color2}; #$HoD->{config}{link_color3} = $HoD->{config}{f_link_color3}; print "Content-type: text/html\n\n"; &head_html(\*STDOUT,$HoD); } ############################ #左フレームBOTTOM sub left_frame_bottom { my $HoD = shift; if ($HoD->{config}{adsbanner_bottom}) { print "
$HoD->{config}{adsbanner_bottom}
"; } print "\n"; } ############################ #ページ移動 sub last_html { my @parms = @_; my $HoD = shift(@parms); my ($page, $i, $k); my $next_pages = $HoD->{last}{ps}; my $prev_page = $HoD->{form}{next_page} - $HoD->{config}{n_page_max}; print "
\n"; if (($prev_page >= 0) && ($HoD->{last}{page_maxs} != $HoD->{config}{n_page_max})) { print "{gl}{cgi}\">\n"; print "{form}{action}\">\n"; print "{form}{year}\">\n"; print "{form}{month}\">\n"; print "{form}{day}\">\n"; print "{form}{searchword}\">\n"; print "{form}{searchword_a}\">\n"; print "{form}{searchword_b}\">\n"; print "{form}{s}\">\n"; print "\n"; print "\n"; } if ($HoD->{last}{p_flag} == 1) { print "{gl}{cgi}\">\n"; print "{form}{action}\">\n"; print "{form}{year}\">\n"; print "{form}{month}\">\n"; print "{form}{day}\">\n"; print "{form}{searchword}\">\n"; print "{form}{searchword_a}\">\n"; print "{form}{searchword_b}\">\n"; print "{form}{s}\">\n"; print "\n"; print "\n"; } if ($HoD->{last}{p1}) { print "
\n"; #if ($HoD->{form}{txtnumber} eq "log") {print "現行ログ/\n";} #else {print "Log$HoD->{form}{txtnumber}/\n";} print "Page/\n"; if ($HoD->{last}{p1}) { $page = int($HoD->{last}{p1}/$HoD->{config}{n_page_max}); if ((($HoD->{last}{p1} % $HoD->{config}{n_page_max}) > 0) || ($HoD->{config}{n_page_max} == 0)) {++$page;} $i = 1; $k = 0; while ($i <= $page) { if ($HoD->{form}{next_page} == $k) { print "[$i]\n"; } else { print "{gl}{cgi}?action=$HoD->{form}{action}&year=$HoD->{form}{year}&month=$HoD->{form}{month}&day=$HoD->{form}{day}&next_page=$k\" style=\"text-decoration:none\">[$i]\n"; } ++$i; $k += $HoD->{config}{n_page_max}; } } print "\n"; } print "
\n"; }