##################################################### ### PopCorn ### $GVERSION ="2006.0421"; ### ### Multimedia Mapping支援ツール/生涯学習支援ツール ### Copyright (C) 1997-2005, Michihiro Maekawa. All Rights Reserved. ### PopCornをご利用なさる方へ ###  ### ▼利用方法など ###  popcorn.plは、Webページ自動生成を行うためのperlスクリプト・サブルーチン集です。 ###  PopCorn最新版、使用方法などの情報は、以下のWebサイトで提供しています。 ###  http://www.mmdb.net/popcorn/ ###  popcorn.plをPerlのlibに入れてお使い下さい。Perl5に対応しています。 ### ▼利用・再配布の条件 ###  商用目的で著作者の許諾なしにご利用になることはお断りします。 ###  PopCornの転載はご自由に行って下さって構いません。 ###  このツールの著作権は、前川道博@PopCornワーキンググループが有します。 ###  このツールをご利用になって発生したいかなる問題にも責任は負いません。 ### ▼バグレポートなど ###  何かお気づきになった点、改善要望などがありましたら、お知らせいただけると幸いです。 ###  宛先:E-mail: maekawa@mmdb.net (前川道博@PopCornワーキンググループ) ###  ### ▼修正履歴 ### popcorn_history.txt をご覧ください。 # 拡張版のスイッチ (戻す場合は環境変数を設定しない) #$GENHANCED = "on"; #================================================================== #** Part 1:自動生成メイン処理系 #================================================================== $GTAB_CODE = " \;\;\;\; "; #リストデータ中ではタブコードをこの値に置換する $GRET_CODE = "\'\'\'\'"; #リストデータ中では改行コードをこの値に置換する $GSPR_CODE = "\=\=\=\="; #クリップリストデータ中では区切り文字をこの値にする ################################################# sub main #** メイン ################################################# { my ($path, $dir_m, $dir_u, $dir_tmp); $GPS_START_TIME = &gettime; # (PopCorn バージョンと開始時刻表示) 2002/05/06 NANDRA output_msg("POP-A001", $GVERSION, $GSITE, &getdate2("/"), &gettime); &machine; $GCLIP_COUNTER = 0; $GSUM_COUNTER = 0; if ($GPATH_LOCAL eq "" && $GPATH_SERVER eq "") { &output_msg("POP-E006"); } # $GPATH_LOCAL && $GPATH_SERVER未設定 2002/05/06 NANDRA if ($GMASTER eq "") { $GMASTER = "master"; } if ($GMACHINE eq "mac" || $GMACHINE eq "win") { $path = $GPATH_LOCAL; } if ($GMACHINE eq "unix") { $path = $GPATH_SERVER; } $G_URL = $GURL; #add(by mogamigawa.F) $G_URL_PUB = $GURL_PUB; #add(by mogamigawa.F) $G_PUB_FLG = $GPUB_FLG; #add(by mogamigawa.F) &set_default ($path); &set_replace_str ($path); # 2002/03/23 NANDRA # トップページ拡張機能がONのときは無条件でトップページを新規作成する if ($GUSE_TOPCONF eq "on") { if ($GHOMEDIR eq "") { &create_toppage_expand ("$path$GHOME"); } else { &create_toppage_expand ("$path$GHOMEDIR$GDELIMITER$GHOME"); } } &exec_all ($path, $GDB_FILE, $GLIST_FILE); &output_msg("POP-A003", $GCLIP_COUNTER); # Number of clips 2002/05/06 NANDRA &update_toppage_clips ($path, $GCLIP_COUNTER); if ($GUSE_TOPCONF eq "on") { &update_toppage_other ($path); } #トップページ機能拡張呼び出し(2002.0207) if ($GHOME_MENU ne "") { #02/12/29トップメニューHTMLファイルの更新 &update_toppage_clips ($path, $GCLIP_COUNTER, $GHOME_MENU); if ($GUSE_TOPCONF eq "on") { &update_toppage_other ($path, $GHOME_MENU); } } output_msg("POP-A004", $GSITE, &getdate2("/"), &gettime, &p_time ($GPS_START_TIME, &gettime) ); # /Finished/ 2002/05/06 NANDRA #sleep(2); } ################################################# sub check_dir #** ディレクトリ存在チェック 98/01/17追加, 99/10/11, 02/01/04 ################################################# { #指定ディレクトリがなければ、ディレクトリを作成する。 my ($dir) = @_; my ($retcode, $drive, $char, $len, $dir2, @this_dirs, $this_dir, $this_path, $i); $dir =~ s/\\\\/\\/g; $dir =~ s/\/\//\//g; &machine; #2001/09/24 if (-d $dir) { $retcode = 2; return; } $drive = substr ($dir, 0,2); $char = substr ($dir,1,1); if ($GMACHINE eq "win" && $char eq ":") { $len = length ($dir); $dir2 = substr ($dir, 2, $len); chdir $drive; # 2002/05/06 NANDRA $dir2 =~ s/\:/\//g; $dir2 =~ s/\\/\//g; #02/01/04 Maekawa @this_dirs = split(/\//, $dir2); #02/01/04 Maekawa $this_path = "$drive"; #02/01/04 Maekawa } else { $dir2 = $dir; $dir2 =~ s/\:/\//g; $dir2 =~ s/\\/\//g; #02/01/04 Maekawa @this_dirs = split(/\//, $dir2); #02/01/04 Maekawa if ($GMACHINE eq "unix") { $this_path = "/"; } #02/01/04 Maekawa } $i = 1; foreach $this_dir (@this_dirs) { #02/01/04 Maekawa next if ($this_dir eq ""); if ($GMACHINE eq "mac" && $i == 1) { $this_path = $this_dir; } else { $this_path .= "$GDELIMITER$this_dir"; } if ( not -d "$this_path") { $retcode = mkdir ($this_path, 0755); if ($retcode == 0) { output_msg("POP-E001", $this_path); # 2002/05/06 NANDRA } if ($retcode == 1) { output_msg("POP-A010", $this_path); # 2002/05/06 NANDRA } } $i++; } } ################################################# sub set_default #** 初期値設定 98/01/09追加 ################################################# { my ($path) = @_; my ($cat_dir, $bg_mime, $rtn); #02/04/10 Maekawa #必須項目チェック if ($GSITE eq "" && $GFILENAME ne "") { $GSITE = $GFILENAME; } if ($GSITE eq "") { &output_msg("POP-E002"); } # /サイト名を$GSITEに設定して下さい/ 2002/05/06 NANDRA if ($GTITLE eq "") { &output_msg("POP-E003"); } # /タイトルを$GTITLEに設定して下さい/ 2002/05/06 NANDRA if ($GINDEX_KEY[0] eq "") { &output_msg("POP-E004"); } # /インデクスのキーを@GINDEX_KEYに設定して下さい/ 2002/05/06 NANDRA if ($GPATH_LOCAL eq "") { &output_msg("POP-E005"); } # /当フォルダのパスを$GPATH_LOCALに設定して下さい/ 2002/05/06 NANDRA #必須項目チェック、未設定時の初期値設定 if ($GDB_FILE eq "") { $GDB_FILE = "$GSITE.db"; } if ($GLIST_FILE eq "") { $GLIST_FILE = "$GSITE.list"; } if ($GURL_DISP eq "") { $GURL_DISP = "url_non"; } if ($G_DD_ON eq "") { $G_DD_ON = "no"; } if ($GADDRESS eq "") { $GADDRESS = ""; } if ($GTAG_NEW eq "") { $GTAG_NEW = " [New\!]"; } if ($GSORT eq "") { $GSORT = ""; } if ($GSORT_NAVI eq "") { $GSORT_NAVI = ""; } #インデクス基本項目埋め合わせ #04/01/27 Maekawa #&fill_in_key(); #BODYタグ属性設定 #02/05/16 Maekawa if ($GBODY eq "") { $GBODY = ""; if ($GBODY_BACKGROUND ne "") { $bg_mime = &get_mime($GBODY_BACKGROUND); $GBODY .= " background=\"../$bg_mime/$GBODY_BACKGROUND\""; } if ($GBODY_BGCOLOR ne "") { $GBODY .= " bgcolor=\"$GBODY_BGCOLOR\""; } if ($GBODY_TEXT ne "") { $GBODY .= " text=\"$GBODY_TEXT\""; } if ($GBODY_LINK ne "") { $GBODY .= " link=\"$GBODY_LINK\""; } if ($GBODY_VLINK ne "") { $GBODY .= " vlink=\"$GBODY_VLINK\""; } if ($GBODY_ALINK ne "") { $GBODY .= " alink=\"$GBODY_ALINK\""; } } #その他項目チェック if ($GHOME eq "") { $GHOME = "index.html"; } if ($GPAGE1 eq "") { $GPAGE1 = "page"; } if ($GPAGE2 eq "") { $GPAGE2 = "page2"; } #言語設定ファイルの有無確認 #2001/11 NANDRA #($GLANGUAGEで指定された言語設定ファイルが無い場合は警告を出し、 # デフォルト言語に切り替わる) if (!(-e $path . $GMASTER . $GDELIMITER . $GLANGUAGE . ".dat") && ($GLANGUAGE ne "")) { $GLANGUAGE = ""; } #表記文字列類 2001/11 NANDRA #(言語設定が無い場合は日本語、ある場合は識別子を埋め込み、後で置換処理) if ($GLANGUAGE eq "") { $GTXT0 = "ホーム"; $GTXT1P = ""; $GTXT1S = "件"; if ($GUPDATE_LABEL eq "") { $GTXT2 = "更新日"; } else { $GTXT2 = $GUPDATE_LABEL; } $GTXT3 = "行"; $GTXT4 = "戻る"; $GTXT4BP = ""; $GTXT4BS = "へ戻る"; $GTXT5 = "←←"; $GTXT6 = "→→"; if ($GDATE_LABEL eq "") { #$GTXT7 = "撮影日"; # 03/03/06 PopCorn WG $GTXT7 = "記録日"; } else { $GTXT7 = $GDATE_LABEL; } #99/08/25追加 if ($GIDX_LABEL eq "") { $GTXT8 = "目次"; } else { $GTXT8 = $GIDX_LABEL; } #99/08/28追加 $GTXT9 = "地域マップ"; $GTXTA = "合計"; $GTXTB = "クリップ"; $GTXTC = "タイトル"; if ($GALT_LABEL eq "") { $GTXTD = "Lサイズ版"; } else { $GTXTD = $GALT_LABEL; } if ($GSTD_LABEL eq "") { $GTXTE = "Mサイズ版"; } else { $GTXTE = $GSTD_LABEL; } if ($GSOURCE_START eq "") { $GSOURCE_START = "##Source Code##"; } #02/01/23 #02/01/27 Maekawa if ($GSOURCE_END eq "") { $GSOURCE_END = "##End##"; } #02/01/23 #02/01/27 Maekawa if ($GSOURCE_COLOR eq "") { $GSOURCE_COLOR = "beige"; } #02/01/23 Maekawa if ($GLABEL_AUTHOR eq "") { $GLABEL_AUTHOR = "著者・編者"; } #02/04/10 Maekawa if ($GLABEL_COPYRIGHT eq "") { $GLABEL_COPYRIGHT = "Copyright (C)"; } #02/04/10 Maekawa if ($GLABEL_COPYRIGHT2 eq "") { $GLABEL_COPYRIGHT2 = "All Rights Reserved."; } #02/04/10 Maekawa if ($GLABEL_CONTACT eq "") { $GLABEL_CONTACT = "連絡先"; } #02/04/10 Maekawa if ($GNEWINFO eq "") { $GNEWINFO = "新着情報"; } #02/04/21 Maekawa $GMONTHNAME[0] = ""; #ダミー $GMONTHNAME[1] = "1"; $GMONTHNAME[2] = "2"; $GMONTHNAME[3] = "3"; $GMONTHNAME[4] = "4"; $GMONTHNAME[5] = "5"; $GMONTHNAME[6] = "6"; $GMONTHNAME[7] = "7"; $GMONTHNAME[8] = "8"; $GMONTHNAME[9] = "9"; $GMONTHNAME[10] = "10"; $GMONTHNAME[11] = "11"; $GMONTHNAME[12] = "12"; if ($GPAGE_MARK eq "") { $GPAGE_MARK = ""; } #99/10/30追加 # 2001/11 NANDRA if ($GCLIP_MARK eq "") { #02/04/24 Maekawa $GCLIP_MARK = ""; } } else { $GTXT0 = ":-Home-:"; $GTXT1P = ":-Pages-P-:"; $GTXT1S = ":-Pages-S-:"; if ($GUPDATE_LABEL eq "") { $GTXT2 = ":-Update-:"; } else { $GTXT2 = $GUPDATE_LABEL; } $GTXT3 = ":-lines-:"; $GTXT4 = ":-Return-:"; $GTXT4BP = ":-ReturnToP-:"; $GTXT4BS = ":-ReturnToS-:"; $GTXT5 = ":-Prev-:"; $GTXT6 = ":-Next-:"; if ($GDATE_LABEL eq "") { $GTXT7 = ":-PhotoDate-:"; } else { $GTXT7 = $GDATE_LABEL; } #99/08/25追加 if ($GIDX_LABEL eq "") { $GTXT8 = ":-TOC-:"; } else { $GTXT8 = $GIDX_LABEL; } #99/08/28追加 $GTXT9 = ":-Map-:"; $GTXTA = ":-Sum-:"; $GTXTB = ":-Clip-:"; $GTXTC = ":-Title-:"; if ($GALT_LABEL eq "") { $GTXTD = ":-Size-L-:"; } else { $GTXTD = $GALT_LABEL; } if ($GSTD_LABEL eq "") { $GTXTE = ":-Size-M-:"; } else { $GTXTE = $GSTD_LABEL; } if ($GSOURCE_START eq "") { $GSOURCE_START = ":-Source-Start-:"; } #02/01/23 Maekawa if ($GSOURCE_END eq "") { $GSOURCE_END = ":-Source-End-:"; } #02/01/23 Maekawa if ($GSOURCE_COLOR eq "") { $GSOURCE_COLOR = ":-Source-Color-:"; } #02/01/23 Maekawa if ($GLABEL_AUTHOR eq "") { $GLABEL_AUTHOR = ":-Author-:"; } #02/04/10 Maekawa if ($GLABEL_COPYRIGHT eq "") { $GLABEL_COPYRIGHT = ":-Copyright-:"; } #02/04/10 Maekawa if ($GLABEL_COPYRIGHT2 eq "") { $GLABEL_COPYRIGHT2 = ":-Copyright-End-:"; } #02/04/10 Maekawa if ($GLABEL_CONTACT eq "") { $GLABEL_CONTACT = ":-Contact-:"; } #02/04/10 Maekawa if ($GNEWINFO eq "") { $GNEWINFO = ":-New-Info-:"; } #02/04/21 Maekawa $GMONTHNAME[0] = ""; #ダミー $GMONTHNAME[1] = ":-Monthname-1-:"; $GMONTHNAME[2] = ":-Monthname-2-:"; $GMONTHNAME[3] = ":-Monthname-3-:"; $GMONTHNAME[4] = ":-Monthname-4-:"; $GMONTHNAME[5] = ":-Monthname-5-:"; $GMONTHNAME[6] = ":-Monthname-6-:"; $GMONTHNAME[7] = ":-Monthname-7-:"; $GMONTHNAME[8] = ":-Monthname-8-:"; $GMONTHNAME[9] = ":-Monthname-9-:"; $GMONTHNAME[10] = ":-Monthname-10-:"; $GMONTHNAME[11] = ":-Monthname-11-:"; $GMONTHNAME[12] = ":-Monthname-12-:"; if ($GPAGE_MARK eq "") { $GPAGE_MARK = "=>"; } #99/10/30追加 # 2001/11 NANDRA if ($GCLIP_MARK eq "") { #02/04/24 Maekawa $GCLIP_MARK = ""; } } #00/01/20修正 if ($GOPTION_DIR ne "") { $GDIR_LSIZE = $GOPTION_DIR; } if ($GSMALL_DIR ne "") { $GDIR_SSIZE = $GSMALL_DIR; } if ($GALT_DIR ne "") { $GDIR_LSIZE_ALT = $GALT_DIR; } #00/01/20追加 if ($GDIR_OSIZE eq "") #2004/02/07 Maekawa { $GDIR_OSIZE = "o"; } if ($GDIR_LSIZE eq "") { $GDIR_LSIZE = "l"; } #旧初期値は"ext" if ($GDIR_LSIZE_ALT eq "") { $GDIR_LSIZE_ALT = "l-alt"; } #旧初期値は"alt" if ($MSIZE_DIR eq "") { $MSIZE_DIR = "m"; } if ($GDIR_SSIZE eq "") { $GDIR_SSIZE = "s"; } #旧初期値は"small" if ($ISIZE_DIR eq "") { $ISIZE_DIR = "i"; } if ($GNEW_DAYS eq "") { $GNEW_DAYS = 14; } #00/04/24 if ($GIMAGECLIP_NUM eq "") { $GIMAGECLIP_NUM = 4; } if ($GLINE eq "on" && $GLINE_COLOR_HEAD eq "" && $GLINE_COLOR eq "") { $GLINE_COLOR = "beige"; $GLINE_COLOR_HEAD = "orange"; } if ($GLINE eq "on" && $GLINE_COLOR_HEAD ne "" && $GLINE_COLOR eq "") { $GLINE_COLOR = $GLINE_COLOR_HEAD; } if ($GLINE eq "on" && $GLINE_COLOR_HEAD eq "" && $GLINE_COLOR ne "") { $GLINE_COLOR_HEAD = $GLINE_COLOR; } &set_clip_option; #クリップオプションリスト読み込み 99/11/01追加 $GBODY_TOP = "\\n"; #99/12/04追加 if ($GWIDTH ne "") { $GPAGE_TOP = "\\n\\n"; } else { $GPAGE_TOP = "\\n\\n"; } #99/12/12追加 if ($GWIDTH ne "") { $GPAGE_TOP .= "\\\n\n
\n"; } else { $GPAGE_TOP .= "\\\n"; } #99/12/12追加 $GPAGE_BOTTOM = "\<\/td>\<\/tr\>\<\/table\>\n\<\/center\>\n"; #99/12/12追加 $GBODY_BOTTOM = "\<\/body\>\n"; #99/12/04追加 #テーブル初期値設定 &default_table; #99/12/06追加 $GTHIS_POPCORN = "\n"; #99/12/10追加 $GDOCTYPE = "\n"; #2002/02/24追加(NANDRA) #ロボット制限オプション #00/04/30 if ($GROBOT_EXCLUSION_LEVEL eq "") { $GROBOT_EXCLUSION_LEVEL = 1; } if ($GROBOT_TAG eq "") { $GROBOT_TAG = "\n"; } #インデクス目次カラム幅指定 #00/05/03 if ($GINDEX_WIDTH_NO eq "") { $GINDEX_WIDTH_NO = 42; } if ($GINDEX_WIDTH_TITLE eq "") { $GINDEX_WIDTH_TITLE = 320; } if ($GINDEX_WIDTH_NUM eq "") { $GINDEX_WIDTH_NUM = 100; } if ($GINDEX_WIDTH_COMMENT eq "") { $GINDEX_WIDTH_COMMENT = 280; } if ($GINDEX_WIDTH_DATE eq "") { $GINDEX_WIDTH_DATE = 100; } $GLINK_WIDTH = $GINDEX_WIDTH_DATE + $GINDEX_WIDTH_TITLE + 2; #スタイル記述 #00/09/15 if ($GTITLE_COLOR eq "") { $GTITLE_COLOR = "royalblue"; } if ($GTITLE_TEXT eq "") { $GTITLE_TEXT = "white"; } if ($GSUBTITLE_COLOR eq "") { $GSUBTITLE_COLOR = "black"; } if ($GSUBTITLE_TEXT eq "") { $GSUBTITLE_TEXT = "white"; } if ($GSTYLE eq "") { #スタイルシートが未適用ならば $GSTYLE = "\n"; } else { #スタイルシートが適用済ならばG変数で設定された値で個々の値を置換 #02/05/16 Maekawa $GSTYLE = &replace_stylesheet ($GSTYLE, "h1", "background-color", $GTITLE_COLOR); $GSTYLE = &replace_stylesheet ($GSTYLE, "h1", "color", $GTITLE_TEXT); $GSTYLE = &replace_stylesheet ($GSTYLE, "h2", "background-color", $GSUBTITLE_COLOR); $GSTYLE = &replace_stylesheet ($GSTYLE, "h2", "color", $GSUBTITLE_TEXT); } #ナビゲーションバー定義 #00/09/15 if ($GNAVI_LINE eq "") { $GNAVI_LINE = "#346767"; } if ($GNAVI_COLOR eq "") { $GNAVI_COLOR = "#e4e7dd"; } #その他 #00/11/20 if ($GTQ_COLOR eq "") { $GTQ_COLOR = "#e4e7dd"; #2004/01/24 #2004/02/07初期値変更#e4e7ed } if ($GLINE eq "") { $GLINE = "on"; } if ($GLINE_COLOR_HEAD eq "") { $GLINE_COLOR_HEAD = "orange"; } if ($GLINE_COLOR eq "") { $GLINE_COLOR = "#e4e7dd"; } #フィルターファイルの$G変数化 2001/05/12 NANDRA if ($GFILTER eq "") { $GFILTER = "filter.dat"; } #フィルターをトップページに使うかどうかのフラグ 2001/05/12 NANDRA # 0:使わない 1:PopCornが更新処理する部分のみ使う 2:全面的に使う if ($GFILTER_TO_TOP eq "") { $GFILTER_TO_TOP = "1"; } #トップページ設定ファイル(初期値はtopconf.dat) 2001/02/11 NANDRA if ($GTOPCONF eq "") { $GTOPCONF = "topconf.dat"; } #メインインデクスキー設定 通常は"cat"、"cat"がなければ@GINDEX_KEYの第1キー #02/04/10 Maekawa $GINDEX_MAIN = &get_atom ($GINDEX_KEY[0],"DIR"); #02/03/27 Maekawa foreach $GINDEX_MAIN (@GINDEX_KEY) { if ($GINDEX_MAIN eq "cat") { $cat_dir = &get_atom ($GINDEX_MAIN,"DIR"); } } #02/03/27 Maekawa if ($cat_dir ne "") { $GINDEX_MAIN = $cat_dir; } #02/03/27 Maekawa #「統一HTML」従来はインデクス種別ごとに分かれていた自動生成HTMLファイル #を、ひとつにまとめる 2002/09/21 NANDRA # 1: $GUNITED_HTMLに"on"をセット # 2: $GINDEX_DATAの第4・第5パラメータを$GINDEX_DATA{"cat"}にだけ設定 # して他は未定義にする # 3: $GPOPUP_CLIPに"on"を設定して、クリップページの別窓化を有効にする # (ことが望ましい) if ($GUNITED_HTML ne "on") { $GUNITED_HTML = ""; } #クリップページの別ウィンドウ化(デフォルトは無効。"on"をセットすると #有効になる) if ($GPOPUP_CLIP eq "on") { $GPOPUP_CLIP = " target=\"PUC\""; } else { $GPOPUP_CLIP = ""; } } ################################################# sub fill_in_key #** インデクス基本項目埋め合わせ #04/01/27 Maekawa ################################################# { my ($key, $data, $dir, $idx, $short, $dir2, $dir3); foreach $key (@GINDEX_KEY) { $data = $GINDEX_DATA {$key}; ($dir, $idx, $short, $dir2, $dir3) = split (/\t/, $data); if ($dir eq "") { if ($key eq "cat") { $dir = "cat"; } if ($key eq "region") { $dir = "rgn"; } if ($key eq "date") { $dir = "date"; } if ($key eq "update") { $dir = "update"; } if ($key eq "idx_opt1") { $dir = "idx_opt1"; } $rtn = &output_msg ("POP-M008", $key); } if ($idx eq "") { if ($key eq "cat") { $idx = "カテゴリフォルダ"; } if ($key eq "region") { $idx = "地域フォルダ"; } if ($key eq "date") { $idx = "記録日フォルダ"; } if ($key eq "update") { $idx = "登録日フォルダ"; } if ($key eq "idx_opt1") { $idx = "オプションフォルダ";} $rtn = &output_msg ("POP-M009", $key); } if ($short eq "") { if ($key eq "cat") { $short = "カテゴリ"; } if ($key eq "region") { $short = "地域"; } if ($key eq "date") { $short = "記録日"; } if ($key eq "update") { $short = "登録日"; } if ($key eq "idx_opt1") { $short = "オプション"; } $rtn = &output_msg ("POP-M010", $key); } $data = "$dir\t$idx\t$short\tdir2\tdir3"; $GINDEX_DATA {$key} = $data; } } ################################################# sub exec_all #** 全ページ一括生成 ################################################# { my ($path, $file_db, $file_list) = @_; my ($sub, $file_listx, $i, $dir, $topfile ); #### LISTファイル生成 #### &list_generate ($path, $file_db, $file_list); ####KEYリスト設定 #### &set_all_keys ($path, $file_list); ####HTMLファイル一括生成 #### for ($i = 0; $GINDEX_KEY[$i] ne ""; $i++) { $dir = &get_atom ($GINDEX_KEY[$i], "DIR"); if ($GINDEX_KEY[$i] eq "region" || $GINDEX_KEY[$i] eq "cat") { &generate_from_list ($path, $file_list, $dir, $GINDEX_KEY[$i], $GURL_DISP); } if ($GINDEX_KEY[$i] eq "date") { $file_listx = $file_list . "2"; &generate_from_list ($path, $file_listx, $dir, $GINDEX_KEY[$i], $GURL_DISP); } if ($GINDEX_KEY[$i] eq "update") { $file_listx = $file_list . "3"; &generate_from_list ($path, $file_listx, $dir, $GINDEX_KEY[$i], $GURL_DISP); } # if ($GINDEX_KEY[$i] eq "idx_opt1" || $GINDEX_KEY[$i] eq "idx_opt2" || $GINDEX_KEY[$i] eq "idx_opt3") # 05.03.21 PopCorn WG if ($GINDEX_KEY[$i] =~ m/idx_opt/) { &generate_from_list ($path, $file_list, $dir, $GINDEX_KEY[$i], $GURL_DISP); } } #add(by mogamigawa RSS) for ($i = 0; $GINDEX_KEY[$i] ne ""; $i++) { $GL_IDX = 0; $dir = &get_atom ($GINDEX_KEY[$i], "DIR"); $file_listx = $file_list . ".rss"; if ($GINDEX_KEY[$i] eq "region" || $GINDEX_KEY[$i] eq "cat") { &rss_generate($path, $file_listx, $dir, $GINDEX_KEY[$i],$GURL_DISP); &rss_write($path , $GINDEX_KEY[$i]); } if ($GINDEX_KEY[$i] eq "date") { &rss_generate($path, $file_listx, $dir, $GINDEX_KEY[$i],$GURL_DISP); &rss_write($path , $GINDEX_KEY[$i]); } if ($GINDEX_KEY[$i] eq "update") { &rss_generate($path, $file_listx, $dir, $GINDEX_KEY[$i],$GURL_DISP); &rss_write($path , $GINDEX_KEY[$i]); } if ($GINDEX_KEY[$i] =~ m/idx_opt/) { &rss_generate($path, $file_listx, $dir, $GINDEX_KEY[$i],$GURL_DISP); &rss_write($path , $GINDEX_KEY[$i]); } } #add(by mogamigawa RSS) if ($GMACHINE eq "unix" && $GLANG_CODE eq "sj") { system "sjtoeuc $GLIST_FROM > $GLIST_EUC"; } if ($GMACHINE eq "unix" && $GLANG_CODE eq "jis") { system "jistoeuc $GLIST_FROM > $GLIST_EUC"; } } ################################################# sub getMediaAbsPath #メディアディレクトリパス取得 # 絶対パス指定 # 引数1:$path(環境ごとのユーザーディレクトリパス) # 引数2:パスを除いた拡張子名を渡す(.は含まない) ################################################# { my ($path, $mime_name) = @_; my ($site, $mime_path ); # サイト名 $site = $GSITE; # 拡張版1 files以下(PushCorn) $mime_path = "$path". "files/$mime_name"; $mime_path = &conv_path($mime_path); if (-d $mime_path) { return $mime_path}; # 互換 $mime_path = "$path" . "$mime_name"; $mime_path = &conv_path($mime_path); if (-d $mime_path) { return $mime_path}; return ""; } ################################################# sub getClipAbsPath #クリップファイル格納パス取得 # 絶対パス指定 # 引数1:$path(環境ごとのユーザーディレクトリパス) # 引数2:$site(サイトディレクトリ名)#03/07/13追加変更 Maekawa # 引数3:パスを除いたクリップファイル名 #を渡す(〜.clip) ################################################# { my ($path, $site, $file_name) = @_; my ($delimiter, $clip_path, $clip_dir); # サイト名 if ($site eq "") { $site = $GSITE; } #03/07/13 Maekawa # 拡張版1 サイト名以下(PushCorn) $clip_path = "$path". "files/clip/$site/$file_name"; $clip_path = &conv_path($clip_path); if (-e $clip_path) { return $clip_path}; # 拡張版2 サイト名なし(手動) $clip_path = "$path" . "files/clip/$file_name"; $clip_path = &conv_path($clip_path); if (-e $clip_path) { return $clip_path}; # 互換 #03/07/13 Maekawa $clip_dir = "$path" . "files/clip"; $clip_dir = &conv_path($clip_dir); if (-d $clip_dir) #ディレクトリfilesがあれば { $clip_path = "$path" . "files/clip/$file_name"; } else { $clip_path = "$path" . "clip/$file_name"; } $clip_path = &conv_path($clip_path); #if (-e $clip_path) { return $clip_path}; return "$clip_path"; } ################################################# sub getClipRelPath #クリップファイル格納パス取得 # 相対パス指定 # 引数1:$path(環境ごとのユーザーディレクトリパス) # 引数2:パスを除いたクリップファイル名 #を渡す(〜.clip) ################################################# { my ($path, $file_name) = @_; my ($site, $delimiter, $clip_path ); # サイト名 $site = $GSITE; # 拡張版1 サイト名以下(PushCorn) $clip_path = "$path/files/clip/$site/$file_name"; $clip_path = &conv_path($clip_path); if (-e $clip_path) { return "../files/clip/$site/$file_name"; } # 拡張版2 サイト名なし(手動) $clip_path = "$path/files/clip/$file_name"; $clip_path = &conv_path($clip_path); if (-e $clip_path) { return "../files/clip/$file_name"; } # 互換 $clip_path = "$path/clip/$file_name"; $clip_path = &conv_path($clip_path); if (-e $clip_path) { return "../clip/$file_name"; } return ""; } ################################################# sub list_generate #** DB→LIST生成 ################################################# { my ($path, $file_db, $file_list) = @_; my ($no,$page, $catg, $region, $xy, $title, $yomi, $url, $date, $email, $comment, @records, @records2, @records3, $delimiter, @pathname, $file_in, $file_out, $file_out2, $file_out3, $file_def, $catg_atom, $dummy, $date2, $date_list, @date2s,$date2_atom, $date2_old, $item, $status, $cond, $tag_chk, $file_mime, $mime, $file_top, %assoc_file, $dir, $catg1, $catg2, $catg_atom_s, $title_s, $url_s, $comment_s,$file_clip_s, $file_alt, $a0, $a1, $a2, $a3, $a4, $a5, $a6, @option_clip_files, $prev_clip, $clip, $file_clip_in, $file_clip, $option_catg, $cross_link, $file_mime2, $mime2, $machine, $char, $check_path, $cnt_catg, $serial, $protocol, $fpath, $site, $option_path, $tmp_path); $machine = $GMACHINE; $delimiter = $GDELIMITER; # オプションパス(クリップファイル等をサイト毎に分ける) # 拡張オプション$GENHANCEDが設定された場合のみ対応する。 # (2003/02/20) # ディレクトリチェック追加 (03/03/12) $site = $GSITE; $tmp_path = "$path$delimiter" . "files$delimiter" . "clip"; if($GENHANCED ne "" || -e $tmp_path ) { $option_path = $delimiter . $site; } else { $option_path = ""; } # パスの最後にデリミタを追加 $char = chop ($path); if ($char ne $GDELIMITER) { $path = $path . $char . $GDELIMITER; } else { $path = $path . $char; } #99/11/07修正 $dir = $path . $GMASTER; # ファイル格納パスの設定 # ファイル格納ディレクトリの階層化により、ファイル格納場所の # パスを新たに設定する。(files ディレクトリ追加) # 拡張オプション$GENHANCEDが設定された場合のみ対応する。 # (2003/02/20) # ディレクトリチェック追加 (03/03/12) $tmp_path = "$path" . "files"; #2003/03/15 Maekawa if($GENHANCED ne "" || -e $tmp_path ) { $fpath = $path . "files$delimiter"; } else { $fpath = $path; } # DBファイル $file_in = $dir . $delimiter . $file_db; # リストファイル $file_out = $dir . $delimiter . $file_list; $file_out2 = $dir . $delimiter . $file_list . "2"; $file_out3 = $dir . $delimiter . $file_list . "3"; #2006/04/19 add $file_rss = $dir . $delimiter . $file_list . ".rss"; #add(by mogamigawa RSS) ### $file_rss3 = $dir . $delimiter . $file_list . ".rss3"; #add(by mogamigawa RSS) #2006/04/19 add %assoc_file = (); # マスターディレクトリチェック &check_dir($dir); # 各ファイルオープン open (FIN, $file_in) || output_msg("POP-E007", "sub: list_generate \$file_db: $file_db $file_in"); #2003/04/17 Maekawa open (FOUT, ">$file_out") || output_msg("POP-E008", $file_out); open (FOUT2, ">$file_out2") || output_msg("POP-E008", $file_out2); open (FOUT3, ">$file_out3") || output_msg("POP-E008", $file_out3); #2006/04/19 add open (FRSS, ">$file_rss") || output_msg("POP-E008", $file_rss); #add(by mogamigawa RSS) ### open (FRSS3, ">$file_rss3") || output_msg("POP-E008", $file_rss3); #add(by mogamigawa RSS) #2006/04/19 add %GLIST_PAGE = (); #全ページリストの連想配列 00/06/19 $no = 0; $olddate = &getolddate; #新着扱いの最古の日付 # DBファイル読み込み while () { last if (/^END/); chop; next if /^#/; # サイトタイトル if (/^■/ || /^\*\*/) { #カラム1:ページ名 $no = 1; s/^■//; s/^\*\*//; $page = $_; $comment = ""; $comment_s = ""; next; } $no = $no + 1; # 分類キー取得 if ($no == 2) { $catg = $_; #カラム2:分類 if (/\=/) { $option_catg = "on"; } else { $option_catg = "off"; } } # 地域キー取得 if ($no == 3) { #カラム3:場所 if (/non/) { #99/02/11追加 s/non /non/g; if ($_ eq "non") { $_ = "non\t"; } } ($region, $xy) = split (/\t/,$_); } # ページファイル名取得 if ($no == 4) { #カラム4:ファイル名… $url = $_; if ($GLIST_PAGE{$url} eq "") { #ページIDの重複チェック #00/06/19 $serial++; $GLIST_PAGE{$url} = $serial; } else { $protocol = &check_protocol ($url); #00/07/11 if ($protocol ne "yes" && $catg ne "エイリアス") { #2002/05/06 NANDRA &output_msg ("POP-M002", $url, $GLIST_PAGE{$url}); } } } # ページのタイトル if ($no == 5) { $title = $_; } #カラム5:タイトル # 未使用(non) if ($no == 6) { $yomi = $_; # $yomi = "その他"; # @yomi = split("\t", $_); $yomi = (split("\t", $_))[0]; } #カラム6:オプションフォルダ(1〜タブ区切り) if ($no == 7) { $date = $_; $date = &conv_date ($date); } #カラム7:登録年月日 next if $no < 8; if ($_ eq "") { #空白行がデータ1件の区切り # 先頭の@recordsはデータ登録順(重複なし)、 #@records2は撮影日順(重複あり)、@records3は登録日順(重複なし) $comment =~ s/\t/$GTAB_CODE/g; #コメントのタブを変換 $comment_s =~ s/\t/$GTAB_CODE/g; #コメントのタブを変換 # カテゴリに関する処理 @catgs = split(/,/, $catg); $num_catgs = @catgs; #00/04/29 $cnt_catg = 0; #00/06/18 foreach $catg_atom (@catgs) { ($catg1, $catg2) = split (/\=/, $catg_atom); if ($title eq "") { &output_msg ("POP-M003", $url, $GLIST_PAGE{$url}); next; } #02/04/15タイトルなしはアラート表示、処理しない if ($url eq "") { &output_msg ("POP-M004", $GLIST_PAGE{$url}); next; } #02/04/15トピックIDなしはアラート表示、処理しない if ($catg2 ne "") { #Lサイズ版データ追加 $cnt_catg++; #00/06/18 $catg_atom_s = "$catg1$catg2"; $url_s = "$GDIR_LSIZE" . "-" . $url; $title_s = "$catg1$title"; $cross_link = "link$GTAB_CODE" . "$url.html$GTAB_CODE$GTAB_CODE" . "$GTAB_CODE" . "このページの$GTXTE$GRET_CODE"; push (@records, "$date\t$page\t$catg_atom_s\t$region\t$xy\t" . "$url_s\t$title_s\t$yomi\t$cross_link$comment_s\t" . "$date2_atom"); #99/03/16変更 push (@records3, "$date $url_s####$date\t$page\t$catg_atom_s\t" . "$region\t$xy\t$url_s\t$title_s\t$yomi\t" . "$cross_link$comment_s\t$date2_atom"); $cross_link = "link$GTAB_CODE" . "$url_s.html$GTAB_CODE$GTAB_CODE" . "$GTAB_CODE" . "このページの$GTXTD$GRET_CODE"; $catg_atom = $catg2; push (@records, "$date\t$page\t$catg_atom\t$region\t$xy\t$url\t" . "$title\t$yomi\t$cross_link$comment\t$date2_atom"); push (@records3, "$date $url####$date\t$page\t$catg_atom\t$region\t" . "$xy\t$url\t$title\t$yomi\t$cross_link$comment\t" . "$date2_atom"); if ($GSET_NEW eq "on" && $catg_atom ne "皆さんの書き込みがあるページ" && $date ge $olddate) { #新着期間内なら新着情報として追加 push (@records, "$date\t$page\t$GNEWINFO\t$region\t$xy\t" . "$url\t$title\t$yomi\t$comment\t$date2_atom"); push (@records3, "$date $url####$date\t$page\t$GNEWINFO\t" . "$region\t$xy\t$url\t$title\t$yomi\t$comment" . "\t$date2_atom"); } } elsif ($catg_atom ne "" ) { #Lサイズ指定なしキー or 新着情報 or #皆さんの書き込みがあるページ if ($catg_atom eq "$GNEWINFO") { if ($GSET_NEW ne "on") { #DBソースで新着情報指定のものは処理する push (@records, "$date\t$page\t$catg_atom\t" . "$region\t$xy\t$url\t$title\t$yomi\t" . "$comment\t$date2_atom"); push (@records3, "$date $url####$date\t$page\t" . "$catg_atom\t$region\t$xy\t" . "$url\t$title\t$yomi\t$comment\t$date2_atom"); } } else { if ($GSET_NEW eq "on" && $catg_atom ne "皆さんの書き込みがあるページ" && $date ge $olddate) { #新着期間内なら新着情報として追加 push (@records, "$date\t$page\t$GNEWINFO\t" . "$region\t$xy\t$url\t$title\t$yomi\t" . "$comment\t$date2_atom"); push (@records3, "$date $url####$date\t" . "$page\t$GNEWINFO\t$region\t$xy\t$url\t" . "$title\t$yomi\t$comment\t$date2_atom"); } push (@records, "$date\t$page\t$catg_atom\t" . "$region\t$xy\t$url\t$title\t$yomi\t$comment\t" . "$date2_atom"); push (@records3, "$date $url####$date\t$page\t" . "$catg_atom\t$region\t$xy\t$url\t$title\t" . "$yomi\t$comment\t$date2_atom"); } } } # 日付に関する処理 @date2s = split (/,/, $date_list); $date2_old = ""; foreach $date2_atom (@date2s) { $date2_atom = &conv_date ($date2_atom); if ($date2_atom ne $date2_old) { @catgs = split(/,/, $catg); foreach $catg_atom (@catgs) { if ($catg_atom eq "$GNEWINFO" || $catg_atom eq "皆さんの書き込みがあるページ" ) { next; } ($catg1, $catg2) = split (/\=/, $catg_atom); if ($catg2 ne "") { $catg_atom_s = "$catg1$catg2"; $url_s = "$GDIR_LSIZE" . "-" . $url; $title_s = "$catg1$title"; push (@records2, "$date2_atom $url_s####$date\t" . "$page\t$catg_atom_s\t$region\t$xy\t" . "$url_s\t$title_s\t$yomi\t$comment_s\t" . "$date2_atom"); } $catg_atom = $catg2; push (@records2, "$date2_atom $url####$date\t" . "$page\t$catg_atom\t$region\t$xy\t$url\t" . "$title\t$yomi\t$comment\t$date2_atom"); } } $date2_old = $date2_atom; } $date_list = ""; @date2s=(); } else { #マクロタグ+MIMEタイプに対応したDBソースの各データ8行目以降の扱い # ※以下の処理でイメージクリップ等の格納パスには$option_pathを # 追加して、サイト毎の格納を実現している。 # $option_path には最初に区切り文字が格納されている。 #コメントの改行は$GRET_CODEに変換 $comment = $comment . $GRET_CODE . $_; # データ行を分割(ファイルパスと日付) ($item, $date2) = split (/\t/, $_); # データ行を分割(その他) ($a1, $a2, $a3, $a4, $a5, $a6) = split (/\t/, $_); # アイテムがタグ名か、ファイルパスかのチェック $tag_chk = &tag_chk ($item); if ($tag_chk eq "no") { # ファイルパスだった場合 $file_mime = $a1; $file_top = $a2; # ファイルの拡張子を取得 $mime = &get_mime($file_mime); if ($mime eq "ml" ) { # ファイルが〜.mlファイルの場合 $file_clip_s = $file_mime; $file_clip_s =~ s/$GDIR_LSIZE\-//; #$file_mime_s = $fpath . $mime . $option_path . # $delimiter . "$GDIR_LSIZE" . $delimiter . $file_clip_s; $file_mime_s = &getClipAbsPath($path, $site, "$GDIR_LSIZE" . $delimiter . $file_clip_s); #03/07/13 Maekawa $file_mime = &getClipAbsPath($path, $site, $file_mime); #03/07/13 Maekawa #$file_mime = $fpath . $mime . $option_path . $delimiter . # $file_mime; $date2 = &get_clip_date ($file_mime, $file_top); } elsif ($mime eq "clip") { # クリップファイルの場合 $file_clip_s = $file_mime; $file_clip_s =~ s/$GDIR_LSIZE\-//; #$file_mime_s = $fpath . $mime . $option_path . $delimiter . # "$GDIR_LSIZE" . $delimiter . $file_clip_s; $file_mime_s = &getClipAbsPath($path, $site, "$GDIR_LSIZE" . $delimiter . $file_clip_s); #03/07/13 Maekawa $file_mime = &getClipAbsPath($path, $site, $file_mime); #03/07/13 Maekawa #$file_mime = $fpath . $mime . $option_path . $delimiter . # $file_mime; $date2 = &get_clip_date ($file_mime, $file_top); } ($date2) = split (/ /, $date2); $date2 = &conv_date ($date2); if ($date2 eq "00/00/00" || $date2 eq "0000/00/00") { $date2 = ""; } if ($date2 ne "" && $date_list ne "") { $date_list = $date_list . ",$date2"; } if ($date2 ne "" && $date_list eq "") { $date_list = "$date2"; } } elsif ($item eq "imageclip") { # タグがイメージクリップタグだった場合 $file_clip_s = $a2; $file_clip_s =~ s/$GDIR_LSIZE\-//; #$file_mime_s = $fpath . $mime . $option_path . $delimiter . # "$GDIR_LSIZE" . $delimiter . $file_clip_s; $file_mime_s = &getClipAbsPath($path, $site, "$GDIR_LSIZE" . $gdelimiter . $file_clip_s); #03/07/13 Maekawa $file_mime = &getClipAbsPath($path, $site, $file_mime); #03/07/13 Maekawa #$file_mime = $fpath . $mime . $option_path . $delimiter . $a2; } if ($option_catg eq "on") { #Lサイズ版処理 98/11/07 # カテゴリにオプション(=〜)がついている場合 if ($tag_chk eq "no") { if ($mime eq "ml" || $mime eq "clip") { push (@option_clip_files, $file_clip_s); $file_clip_s = "$GDIR_LSIZE" . "-" . $file_clip_s; if ($a2 ne "") { $a2 = "$GDIR_LSIZE/" . $a2; } if ($a3 ne "") { $a3 = "$GDIR_LSIZE/" . $a3; } $_ = "$file_clip_s\t$a2\t$a3"; #Lサイズ版ページにインライン画像を表示する場合の #代替画像の付け替え # PNG対応 2001/06/06 NANDRA # マルチメディア対応 2003/02/20 PopCorn WG # $GENHANCED が設定されている場合は全て通す } #elsif ($mime eq "jpg" || $mime eq "JPG" || $mime eq "jpeg" || $mime eq "JPEG" || $mime eq "gif" || $mime eq "GIF" || $mime eq "png" || $mime eq "PNG" || $GENHANCED ne "" ) # 03/03/13 PopCorn WG elsif ($mime ne "clip" && $mime ne "table" && $mime ne "txt" && $mime ne "html" && $mime ne "pl") { # URLかどうかをプロトコルチェックで判断 $protocol = &check_protocol ($a1); #01/03/28 if ($protocol eq "") { #01/03/28 # ローカルファイルであった場合 #$file_mime = $fpath . $mime . $delimiter . # "$GDIR_LSIZE" . $delimiter . $a1; #$file_mime =~ s/\//$delimiter/g; $file_mime = &getClipAbsPath($path, $site, $a1); #03/07/13 Maekawa $file_alt = $fpath . $mime . $delimiter . "$GDIR_LSIZE_ALT" . $delimiter . $a1; #98/11/11 $file_alt =~ s/\//$delimiter/g; #2003/03/15$file_altの処理復活 #$file_alt = &getClipAbsPath($path, $site, $a1); #2003/03/15コメントアウト, #03/07/13復活 if (-e $file_alt) { $a1 = "$GDIR_LSIZE_ALT/" . $a1; } else { if (-e $file_mime) { $a1 = "$GDIR_LSIZE/" . $a1; } } } $_ = "$a1\t$a2\t$a3\t$a4\t$a5\t$a6"; } } elsif ($item eq "imageclip") { # タグがimageclipであった場合 push (@option_clip_files, $file_clip_s); # URLであるかどうかをプロトコルチェックで判断 $protocol = &check_protocol ($a1); #01/03/28 if ($protocol eq "") { #01/03/28 # ローカルファイルであった場合 $file_clip_s = "$GDIR_LSIZE" . "-" . $file_clip_s; if ($a3 ne "") { $a3 = "$GDIR_LSIZE/" . $a3; } if ($a4 ne "") { $a4 = "$GDIR_LSIZE/" . $a4; } } $_ = "$item\t$file_clip_s\t$a3\t$a4"; } #コメントの改行は$GRET_CODEに変換 $comment_s = $comment_s . $GRET_CODE . $_; } } } close (FIN); # DBファイル読み込み終了 #Lサイズ版処理 98/11/07 $prev_clip = ""; sort @option_clip_files; # オプションクリップファイルリストでループ処理 foreach $clip (@option_clip_files) { if ($prev_clip ne $clip && $prev_clip ne "") { # 同じクリップファイルでない場合 # ローカルパスに変換 $prev_clip = &conv_path ($prev_clip); #00/03/16修正 # クリップのパス作成 # サイト別格納($option_path)の対応 2003/02/20 #$file_clip_in = $fpath . "clip" . $option_path . $delimiter # . $prev_clip; $file_clip_in = &getClipAbsPath($path, $site, $prev_clip); #03/07/13 Maekawa #$file_clip = $fpath . "clip" . $option_path . $delimiter # . "$GDIR_LSIZE" . "-" . $prev_clip; $file_clip = &getClipAbsPath($path, $site, "$GDIR_LSIZE" . "-" . $prev_clip); #03/07/13 Maekawa # パスの最上位ディレクトリを取得 #00/03/16追加, 01/04/23修正 $check_path = &path_file ($file_clip, 2); ($check_path) = split (/\t/, $check_path); #00/03/16追加 # $file_clip が存在しない場合はディレクトリを作成 if (not -e $file_clip) { &check_dir ($check_path); } #00/03/16追加 # L版クリップファイルを作成(コピー) open (FCLIPIN, "$file_clip_in") || output_msg("POP-E009", $file_clip_in); #2002/05/06 NANDRA open (FCLIPOUT, ">$file_clip") || output_msg("POP-E010", $file_clip); #2002/05/06 NANDRA while () { if (/^#/ || /^\n/) { print FCLIPOUT "$_"; } else { print FCLIPOUT "$GDIR_LSIZE/$_"; } #Lサイズ版にクリップするデータがテキスト(txt, table) #の場合、ファイルをコピー #99/04/11追加 ($file_mime2) = split (/\t/, $_); ($dummy, $mime2) = split (/\./, $file_mime2); next if ($mime2 ne "txt" && $mime2 ne "table"); #コピー先ディレクトリがない場合、ディレクトリを作成 ©_textclipfile ($file_mime2, $mime2, $fpath); } close (FCLIPIN); close (FCLIPOUT); } $prev_clip = $clip; } if ($prev_clip ne "") { $prev_clip = &conv_path ($prev_clip); #00/03/16修正 #$file_clip_in = $fpath . "clip" . $option_path . $delimiter . $prev_clip; $file_clip_in = &getClipAbsPath($path, $site, $prev_clip); #03/07/13 Maekawa #$file_clip = $fpath . "clip" . $option_path . $delimiter . # "$GDIR_LSIZE" . "-" . $prev_clip; $file_clip = &getClipAbsPath($path, $site, "$GDIR_LSIZE" . "-" .$prev_clip); #03/07/13 Maekawa $check_path = &path_file ($file_clip, 2); #02/03/24 Maekawa ($check_path) = split (/\t/, $check_path); #02/03/24 Maekawa &check_dir ($check_path); #02/03/24 Maekawa open (FCLIPIN, "$file_clip_in") || output_msg("POP-E009", $file_clip_in); #2002/05/06 NANDRA open (FCLIPOUT, ">$file_clip") || output_msg("POP-E010", $file_clip); #2002/05/06 NANDRA while () { if (/^#/ || /^\n/) { print FCLIPOUT "$_"; } else { print FCLIPOUT "$GDIR_LSIZE/$_"; } #Lサイズ版にクリップするデータがテキスト(txt, table) #の場合、ファイルをコピー #99/04/11追加 ($file_mime2) = split (/\t/, $_); ($dummy, $mime2) = split (/\./, $file_mime2); next if ($mime2 ne "txt" && $mime2 ne "table"); #コピー先ディレクトリがない場合、ディレクトリを作成 ©_textclipfile ($file_mime2, $mime2, $fpath); } close (FCLIPIN); close (FCLIPOUT); } # リストファイルに書き出す foreach $record (@records) { print FOUT "$record\r\n"; print FRSS "$record\r\n"; #add(by mogamigawa RSS) } close (FOUT); close (FRSS); #add(by mogamigawa RSS) # 並び替え if ($GSORT eq "reverse") { @records2 = reverse sort @records2; } else { @records2 = sort @records2; } # リストファイルに書き出す foreach $record (@records2) { ($dummy, $record ) = split ( /####/ , $record); print FOUT2 "$record\n"; ### print FRSS2 "$record\n"; #add(by mogamigawa RSS) } close (FOUT2); ### close (FRSS2); #add(by mogamigawa RSS) # 並び替え if ($GSORT eq "reverse") { @records3 = reverse sort @records3; } else { @records3 = sort @records3; } # リストファイルに書き出す foreach $record (@records3) { #99/03/16変更 ($dummy, $record) = split (/####/, $record); print FOUT3 "$record\n"; print FRSS3 "$record\n"; #add(by mogamigawa RSS) } close (FOUT3); ### close (FRSS3); #add(by mogamigawa RSS) } ################################################# sub generate_from_list #** LIST→HTML生成 ################################################# { my ($path, $file_list, $sub, $keyitem, $url_disp) = @_; my ($machine, $delimiter); $sub = $sub . $GDELIMITER; $path = &conv_path ($path); $sub = &conv_path ($sub); &html_generate ($path, $file_list, $sub, $machine, $keyitem, $url_disp); } ################################################# sub html_generate #** HTML生成 ################################################# { my ($path, $file_in, $sub, $machine, $keyitem, $url_disp, $layer_no) = @_; my ($file_def, $file_out, $file_key, $file_sub, $text, $cmap, @this_keys, @cats, $catg, @fkeys, $fkey, $fdata, $fdata2, $key_fkey, $no, $title, $region, $url, $date, $email, $comment, $date2, @records, $page, $xy, $yomi, $i, $layer, $tag_dot, $tag_new, $headline, $str, $dummy, $status, $map_gif, $olddate, $num, $key, $key2, $num2, $num2_new, $num3, $sum, $sum_new, $this_key, $top, $navi, $navi2, $sub2, $protocol, $wpage_on, $sub_navi, $numsub, $numsub_new, $prev, $prev_prev, $prev_prev_prev, $this_navi, $char, $char1, $char2, $num_clip, $sum_clip, $dir, $url_1, $url_2, $url_3, $this_page_dir, $this_clip_dir, $cat_page_dir, $idx_title, $txt_fout, $txt_fsub, $txt_sum, $ucatg, $ucatg_title, $sta_item, $sta_numclip, $sta_headline, $txt_suspend, $catg_no, $catg_noc, $numd, $numc, $fdata2_on, $delimiter, $idx_opt1, $idx_opt2, $idx_opt3, @idx_opt); my ($star2) = "★"; %GLIST_PAGE = ();#02/04/22追加 %GLIST_CLIP = (); #02/04/22追加 if ($layer_no eq "") {$layer_no = 2; } if ($url_disp eq "") {$url_disp = "url_yes"; } for ($i = 1; $i <= $layer_no; $i++) {$layer = $layer . "..\/"; } $tag_dot = "
  • "; if ($GTAG_NEW eq "") { $GTAG_NEW = $tag_new = " [New\!]"; } else {$tag_new = $GTAG_NEW; } #---------------------------------------------------- #入出力ファイル設定 #---------------------------------------------------- $delimiter = $GDELIMITER; if ($file_in eq "") { output_msg("POP-E011"); } #2002/05/06 NANDRA ($file_def) = split (/\./, $file_in); $file_in = $path . $GMASTER . $delimiter . $file_in; $dir = $path . $sub; &check_dir ($dir); $file_out = $path . $sub . "index.html"; $sub2 = $sub; $char = chop ($sub2); if ($char eq "\:" || $char eq "\/" || $char eq "\\") {} else { $sub2 .= $char; } $sub2 = &conv_path ($sub2); $file_key = $path . $GMASTER . $delimiter . $sub2 . ".key"; #00/09/17 $navi = "\n\n\n\n
    \n"; $navi .= "\n\n\n\n
    \n\n"; $sub_navi = "
    \n" . $navi; if ($GPULLDOWN ne "on") { $navi .= "[ $GTXT4\"; } else { $idx_title =&get_atom ($keyitem, "NAME"); $navi .= "[ $GTXT4\ | "; $navi .= "\n\n"; if ($GLANGUAGE eq "") #2001/11 NANDRA { $txt_suspend = ""; $txt_suspend .= ""; #00/04/11修正 memo 05.03.31 ユーザ/サイト/フォルダ種別/index.htmlの項目 } else { $txt_suspend = ""; $txt_suspend .= ""; } if ($fdata2_on eq "on") #99/08/28追加 { if ($GLANGUAGE eq "") #2001/11 NANDRA { $txt_suspend .= ""; #00/04/11修正 } else { $txt_suspend .= ""; #00/04/11修正 } } $txt_suspend .= "\n"; if ($GTEXT_COLOR_HEAD eq "") { $txt_suspend =~ s/\@1\@//g; $txt_suspend =~ s/\@2\@//g; } else { $txt_suspend =~ s/\@1\@/\/g; $txt_suspend =~ s/\@2\@/\<\/font\>/g; } $txt_fout .= $txt_suspend; } %GPREV_NEXT = (); $this_page_dir = &get_atom($keyitem, "PAGE_DIR"); if ($this_page_dir eq "") { $this_page_dir = $GPAGE1; } $this_clip_dir = &get_atom($keyitem, "CLIP_DIR"); if ($this_clip_dir eq "") { $this_clip_dir = $GPAGE2; } $catg_no = 0; #---------------------------------------------------- #総合インデクス編集 #---------------------------------------------------- $num = 0; #03/04/29 Maekawa foreach $key_fkey (@this_keys) #ループ1:各キー(cat,…)のインデクス("津軽半島一周",…)ごとの処理 { ($key, $key2, $fkey, $fdata, $fdata2) = split (/\t/, $key_fkey); if ($num >= 2) #02/04/29 Maekawa { if ($num3 >= 2) { if ($GPREV_NEXT{$prev_prev} eq "") { $GPREV_NEXT{$prev_prev} = "$prev_prev_prev\t$prev"; } if ($GPREV_NEXT{$prev} eq "") { $GPREV_NEXT{$prev} = "$prev_prev\t"; } } } $num = $num + 1; $num2 = $num2_new = $num3 = 0; $prev = $prev_prev = $prev_prev_prev = ""; ($ucatg, $ucatg_title) = split (/\:/, $key); if ($ucatg ne "" && $ucatg_title ne "") #大分類が指定されている場合":"区切り { } else { foreach $record (@records) #ループ2:全レコードを読んで、該当インデクスのみ連続処理 { ($date, $page, $catg, $region, $xy, $url, $title, $yomi, $comment, $date2) = split (/\t/, $record); # ($idx_opt1, $idx_opt2, $idx_opt3) = split (/\t/,$yomi); # ($idx_opt1, $idx_opt2, $idx_opt3) = split (/,/,$yomi); # 05.03.21 PopCorn WG @idx_opt = split (/,/,$yomi); $this_key = $catg; if ($keyitem eq "region") {$this_key = $region; } if ($keyitem eq "date") { if ($GDATE_OPTION eq "by-date") {$this_key = &year_month ($date2, "by-date"); } else {$this_key = &year_month ($date2); } } if ($keyitem eq "update") { if ($GUPDATE_OPTION eq "by-date") {$this_key = &year_month ($date, "by-date"); } else {$this_key = &year_month ($date); } } # if ($keyitem eq "idx_opt1") {$this_key = $idx_opt1; } # if ($keyitem eq "idx_opt2") {$this_key = $idx_opt2; } # if ($keyitem eq "idx_opt3") {$this_key = $idx_opt3; } # 05.03.21 PopCorn WG if ($keyitem =~ m/idx_opt/) { $tmp_key_num = $keyitem; $tmp_key_num =~ s/idx_opt//; $this_key = $idx_opt[$tmp_key_num-1]; } if ($keyitem eq "abc") {$this_key = $yomi . "$GTXT3"; } if ($catg eq "$GNEWINFO") {$this_key = $catg; } if ($catg eq "皆さんの書き込みがあるページ") {$this_key = $catg; } if ($this_key eq $key) #リスト出力 { $num2 = $num2 +1; if ($date ge $olddate) {$num2_new = $num2_new + 1; } $char1 = substr ($url,0,1); $char2 = split (/:/, $url); if ($char1 ne "\/" && $char2 ne "http") { $num3 = $num3 +1; if ($num3 == 1 && $this_key ne "$GNEWINFO" && $this_key ne "皆さんの書き込みがあるページ") { $url_1 = $url; } #02/04/29 Maekawa if ($num3 == 2 && $this_key ne "$GNEWINFO" && $this_key ne "皆さんの書き込みがあるページ") { $url_2 = $url; } #02/04/29 Maekawa if ($num3 >= 3 && $this_key ne "$GNEWINFO" && $this_key ne "皆さんの書き込みがあるページ") #02/04/29 Maekawa { if ($num3 == 3) { $url_3 = $url; } #02/04/29 Maekawa $GPREV_NEXT{$prev_prev} = "$prev_prev_prev\t$prev"; } if ($this_key ne "$GNEWINFO" && $this_key ne "皆さんの書き込みがあるページ") { $prev_prev_prev = $prev_prev; $prev_prev = $prev; $prev = $url; } } } } } if ($ucatg ne "" && $ucatg_title ne "") #大分類が指定されている場合":"区切り { if ($GLINE eq "on") { $txt_fout .= ""; } else { $txt_fout .= "$tag_dot\$ucatg_title\ ("; } if ($GLINE eq "on") { if ($fdata2_on eq "on") { $txt_fout .= ""; } $txt_fout .= "\n"; } else { $txt_fout .= "
    \n"; } } else#インデクスが指定されている場合 { if ($fkey ne "" && $fkey ne "*") { if ($num2 > 0) { $catg_no++; if ($this_key ne "$GNEWINFO" && $this_key ne "皆さんの書き込みがあるページ") { if ($num3 >= 2) { $GPREV_NEXT{$url_1} = "\t$url_2"; #02/04/29 Maekawa $GPREV_NEXT{$url_2} = "$url_1\t$url_3"; #02/04/29 Maekawa $GPREV_NEXT{$prev_prev} = "$prev_prev_prev\t$prev"; #02/04/29 Maekawa $GPREV_NEXT{$prev} = "$prev_prev\t"; #02/04/29 Maekawa } if ($num3 == 1) { $GPREV_NEXT{$prev} = "\t"; } #02/04/29 Maekawa } if ($GLINE ne "on") { $txt_fout .= "$tag_dot\$key\ ("; } else { $catg_noc = &conv_num ($catg_no,2); $txt_fout .= "
    "; } if ($GLINE eq "on") #99/08/28追加 { if ($fdata2_on eq "on") { $txt_fout .= ""; } $txt_fout .= "\n"; } else { if ($fdata2_on eq "on") { $txt_fout .= " ($fdata2)"; } $txt_fout .= "
    \n"; } } if ($key ne "$GNEWINFO" && $key ne "皆さんの書き込みがあるページ") { $sum = $sum + $num2; $sum_new = $sum_new + $num2_new; } } } if ($GLINE eq "on") { $txt_fout .= "
    \@1\@No.\@2\@\@1\@項 目\@2\@\@1\@件数\@2\@
    \@1\@:-No.-:\@2\@\@1\@:-Title-:\@2\@\@1\@:-Include-:\@2\@\@1\@説 明\@2\@\@1\@:-Explanation-:\@2\@
    $ucatg_title\
    $GPAGE_MARK$catg_noc $key\ "; } if ($GPULLDOWN ne "on") { $navi = $navi . " | $key2\"; } else { $navi = $navi . "
    $GPAGE_MARK$catg_noc $key\"; } } } } if ($num2 > 0) { $txt_fout .= "$GTXT1P$num2$GTXT1S"; }# 2001/11 NANDRA if ($num2_new > 0) { $txt_fout .= " / $tag_new $GTXT1P$num2_new$GTXT1S"; } # 2001/11 NANDRA if ($num2 > 0) { if ($GLINE ne "on") { $txt_fout .= ")"; } else { $txt_fout .= "$fdata2
    \n"; } if ($sum_new > 0) {$txt_sum = "
    ($GTXTA $GTXT1P$sum$GTXT1S $tag_new $GTXT1P$sum_new$GTXT1S)

    \n"; } # 2001/11 NANDRA else {$txt_sum = "
    ($GTXTA $GTXT1P$sum$GTXT1S)

    \n"; } $txt_fout .= "\n\n"; $txt_fout =~ s/\!\!TXT_SUM\!\!/$txt_sum/; if ($GPULLDOWN eq "on") { $navi .= "\n"; } $navi2 = $navi . " ]\n"; $navi2 .= "\n

    \n
    \n"; #00/09/17 $navi .= " ]\n"; $navi .= "\n
  • \n\n\n\n"; #00/09/17 $navi .= "$GLINE2_PAGE\n" . &g_navi . "\n"; $sub_navi .= " ]"; $sub_navi .= "\n\n\n\n\n\n\n"; #00/09/17 if ($keyitem eq "cat") { &update_toppage_num ($path, $sum, $sum_new, $tag_new); if ($GHOME_MENU ne "") { &update_toppage_num ($path, $sum, $sum_new, $tag_new, $GHOME_MENU); } #03/01/20 Maekawa } &update_toppage_navi ($keyitem, $path, $sub, $sub_navi); if ($GHOME_MENU ne "") { &update_toppage_navi ($keyitem, $path, $sub, $sub_navi, $GHOME_MENU); } #02/12/29 Maekawa #print "popcorn.pl => $file_out \t $sum...done\n"; output_msg("POP-A002", $file_out, $sum); #---------------------------------------------------- #個別インデクス編集 #---------------------------------------------------- $num = 1; foreach $key_fkey (@this_keys) { ($key, $key2, $fkey, $fdata) = split (/\t/, $key_fkey); ($ucatg, $ucatg_title) = split (/\:/, $key); if ($ucatg ne "" && $ucatg_title ne "") #大分類が指定されている場合":"区切り { next; } if ($fkey ne "" && $key ne "*") { $file_sub = $path . $sub . $fkey . ".html"; $txt_fsub = ""; $txt_fsub .= &create_sub_head ($top, $key, $fkey, "$navi2", $sub2, $path, $keyitem); $sum_clip = 0; #98/02/07追加 } else #インデクスキーに対応した処理 { #小見出し編集 if ($num != 1) { if ($GLINE eq "on") { $txt_fout .= "\n"; } $txt_fout .= "\n"; } $txt_fout .= "\n$GLINE2_PAGE\n\n

    $key\

    \n
    \n\n"; if ($GLINE eq "on") { $txt_fout .= "\n"; $txt_suspend = ""; $txt_suspend .= ""; $txt_suspend .= "\n"; if ($GTEXT_COLOR_HEAD eq "") { $txt_suspend =~ s/\@1\@//g; $txt_suspend =~ s/\@2\@//g; } else { $txt_suspend =~ s/\@1\@/\/g; $txt_suspend =~ s/\@2\@/\<\/font\>/g; } $txt_fout .= $txt_suspend; } } $num = $num + 1; $text = ""; $numsub = $numsub_new = 0; $sta_item=$sta_numclip=$sta_headline=""; $cat_page_dir = &get_atom("cat", "PAGE_DIR"); if ($cat_page_dir eq "") { $cat_page_dir = $GPAGE1; } foreach $record (@records) { $_ = $record; $txt_suspend = ""; if ($GSTAR ne "") { s/$star2/$GSTAR/g; } ($date, $page, $catg, $region, $xy, $url, $title, $yomi, $comment, $date2) = split (/\t/, $_); # ($idx_opt1, $idx_opt2, $idx_opt3) = split (/\t/,$yomi); ($idx_opt1, $idx_opt2, $idx_opt3) = split (/,/,$yomi); #0 5.03.21 PopCorn WG @idx_opt = split (/,/,$yomi); $this_key = $catg; if ($keyitem eq "region") {$this_key = $region; } # if ($keyitem eq "idx_opt1") {$this_key = $idx_opt1; } # if ($keyitem eq "idx_opt2") {$this_key = $idx_opt2; } # if ($keyitem eq "idx_opt3") {$this_key = $idx_opt3; } # 05.03.21 PopCorn WG if ($keyitem =~ m/idx_opt/) { $tmp_key_num = $keyitem; $tmp_key_num =~ s/idx_opt//; $this_key = $idx_opt[$tmp_key_num-1]; } if ($keyitem eq "date") { if ($GDATE_OPITON eq "by-date") {$this_key = &year_month ($date2, "by-date"); } else {$this_key = &year_month ($date2); } } if ($keyitem eq "update") { if ($GUPDATE_OPTION eq "by-date") {$this_key = &year_month ($date, "by-date"); } else {$this_key = &year_month ($date); } } if ($keyitem eq "abc") {$this_key = $yomi . "$GTXT3"; } if ($catg eq "$GNEWINFO") {$this_key = $catg; } if ($catg eq "皆さんの書き込みがあるページ") {$this_key = $catg; } $wpage_on = "yes"; $protocol = &check_protocol ($url); #98/03/18修正 if ($url eq "") { $wpage_on = "no"; } if ($url eq "non") { $wpage_on = "no"; } if ($protocol eq "yes") { $wpage_on = "no"; } if ($this_key eq $key) #リスト出力 { if ($keyitem eq "cat") { if ($wpage_on eq "yes" && $catg ne "$GNEWINFO" && $catg ne "皆さんの書き込みがあるページ") #98/02/01,07修正 { ####### 個別ページ生成 ######### $num_clip = &write_page($path, $keyitem, $this_page_dir, $this_clip_dir, $date, $page, $catg, $region, $xy, $url, $title, $yomi, $comment, $date2); $sum_clip = $sum_clip + $num_clip; #98/02/07追加 if ($num_clip >= 1) { $sta_numclip = "done"; } #99/03/26追加 #2001/08/19バグ修正ByNANDRA } } else { #if ($cat_page_dir ne $this_page_dir && $cat_page_dir ne "" && $wpage_on eq "yes" # && $catg ne "$GNEWINFO" && $catg ne "皆さんの書き込みがあるページ") #98/02/01,07修正 if ($this_page_dir ne "" && $wpage_on eq "yes" && $catg ne "$GNEWINFO" && $catg ne "皆さんの書き込みがあるページ") #2002/09/01 NANDRA(トピック上書き処理に対応) { $num_clip = &write_page ($path, $keyitem, $this_page_dir, $this_clip_dir, $date, $page, $catg, $region, $xy, $url, $title, $yomi, $comment, $date2); $sum_clip = $sum_clip + $num_clip; #98/02/07追加 if ($num_clip >= 1) { $sta_numclip = "done"; } #99/03/26追加 #2001/08/19バグ修正ByNANDRA } } if ($url eq "non") { if ($GLINE eq "on") { $numd = $numsub + 1; $numc= &conv_num($numd,2); if ($GLINE_COLOR eq "") { $text .= "\n"; } } if ($num_clip == 0) #97/12/12追加 { if ($GLINE eq "on") { $text .= "_"; } } ($dummy, $headline) = split (/$GRET_CODE/,$comment); ($str, $headline) = split (/$GTAB_CODE/, $headline); if ($url ne "non" && $url_disp eq "url_yes") { if ($GLINE eq "on") {$text .= ""; $txt_suspend = "
    [URL] $url\\n"; } else {$text .= "
    [URL] $url\
    \n"; } } if ($str eq "headline" && $headline ne "") { if ($G_DD_ON eq "yes") { $text .= "\n"; $text =~ s/\@url\@/$txt_suspend/g; if ($GLINE ne "on") { $text .= "
    "; } if ($GLINE eq "on") { $text .= "
    "; } $sta_headline = "done"; } else { if ($GLINE ne "on") { $text .= " $headline\n"; } else { $text .= "\n"; } $sta_headline = "done"; } } else { if ($GLINE eq "on" && $G_DD_ON eq "yes") { $text =~ s/\@url\@/$txt_suspend/g; } } if ($GLINE ne "on") { $text .= "
    \n"; } else { $text .= "
    \n"; } } } if ($GLINE eq "on") { $text .= "\n
    \@1\@No.\@2\@\@1\@\@th_item\@\@2\@\@1\@\@th_numclip\@\@2\@\@1\@\@th_headline\@\@2\@
    $GPAGE_MARK$numc\$title\ "; } else { $text .= "\n
    $GPAGE_MARK$numc\$title\ "; } } else { $text .= "\n
    $tag_dot\$title\ "; } } else { if ($wpage_on eq "yes") { $url = "../$this_page_dir/$url.html"; } if ($GLINE eq "on") { $numd = $numsub + 1; $numc= &conv_num($numd,2); if ($GLINE_COLOR eq "") { $text .= "
    $GPAGE_MARK$numc\"; } else { $text .= "
    $GPAGE_MARK$numc\"; } } else { $text .= "
    $tag_dot\"; } #登録日インデクスの処理 if ($keyitem eq "update" && $date ne "00/00/00" && $date ne "0000/00/00" && $date ne "") { $date = &conv_date ($date, "mmdd"); $text .= "[$date] "; } #撮影日インデクスの処理 if ($keyitem eq "date" && $date2 ne "00/00/00" && $date2 ne "0000/00/00" && $date2 ne "") { $date2 = &conv_date ($date2, "mmdd"); $text .= "[$date2] "; } #統合HTML対応 2002/09/03 NANDRA if ($GUNITED_HTML eq "on") { $dummy = "#" . $keyitem; } else { $dummy = ""; } if ($GREDIRECT eq "") { $text .= "$title\ "; } else { $text .= "$title\ "; } #98/01/30追加 } $numsub++; if ($date ge $olddate) {$text .= "$tag_new"; $numsub_new++; } if ($GLINE eq "on") { if ($G_DD_ON eq "yes") { $text .= "\@url\@
    "; } else { $text .= ""; } } if ($num_clip >= 1) #97/12/12追加 # 2001/11 NANDRA { if ($GLINE ne "on") { $text .= " ($GTXT1P$num_clip$GTXT1S)"; } else { $text .= "$GTXT1P$num_clip$GTXT1S\"; } $text .= "$headline\n"; if ($GLINE eq "on") { $text .= "$headline\
    \n"; } $text .= "
    \n\n"; if ($fkey ne "") { $txt_fsub .= "($GTXT1P$numsub$GTXT1S"; #98/02/07修正 # 2001/11 NANDRA if ($numsub_new >= 1) { $txt_fsub .= " / $tag_new $GTXT1P$numsub_new$GTXT1S"; } # 2001/11 NANDRA if ($sum_clip >= 1) { $txt_fsub .= " / $GTXTB: $GTXT1P$sum_clip$GTXT1S"; } # 2001/11 NANDRA if ($sum_clip >= 1 && $keyitem eq "cat") { $GCLIP_COUNTER += $sum_clip; } #02/01/11, #02/01/23 Maekawa $txt_fsub .= ")
    \n"; $txt_fsub .= "\n
    \n\n"; if ($GLINE eq "on") { $txt_fsub .= "\n\n"; if ($GLANGUAGE eq "") # 2001/11 NANDRA { $txt_suspend = ""; $txt_suspend .= ""; $txt_suspend .= "\n"; $txt_suspend =~ s/\@th_item\@/項 目/g; # memo 05.03.31ユーザ/サイト/カテゴリ/xxx.htmlの項目 } #99/03/26追加 #2001/02 NANDRA else { $txt_suspend = ""; $txt_suspend .= ""; $txt_suspend .= "\n"; $txt_suspend =~ s/\@th_item\@/:-Title-:/g; } #2001/02 NANDRA $txt_suspend =~ s/\@url\@//g; #99/03/26追加 if ($sta_numclip eq "done") #2001/02 NANDRA { if ($GLANGUAGE eq "") { $txt_suspend =~ s/\@1\@\@th_numclip\@\@2\@/\@1\@クリップ数\@2\@/g; } # 2001/11 NANDRA else { $txt_suspend =~ s/\@1\@\@th_numclip\@\@2\@/\@1\@:-Clip-:\@2\@/g; } } else { if ($GTEXT_COLOR_HEAD eq "") { $txt_suspend =~ s/\\@1\@\@th_numclip\@\@2\@\<\/th\>//g; } else { $txt_suspend =~ s/\\@1\@\@th_numclip\@\@2\@\<\/th\>//g; } $text =~ s/\\_\<\/td\>//g; } if ($sta_headline eq "done") #2001/02 NANDRA { if ($GLANGUAGE eq "") { $txt_suspend =~ s/\@1\@\@th_headline\@\@2\@/\@1\@説 明\@2\@/g; } # 2001/11 NANDRA else { $txt_suspend =~ s/\@1\@\@th_headline\@\@2\@/\@1\@:-Explanation-:\@2\@/g; } } else { $txt_suspend =~ s/\\n\n"; $switch = 2; } else { #TDの処理 if ($switch == 1) { #TD 奇数行目 $text .= "$conf_table{'tr_td'}"; for ($i = 0; $i < $max; $i++) { $atom = $line[$i]; $tmp = $conf_table{'td'}; $tmp =~ s/\_text\_/$conf_table{'td_text'}/g; $tmp =~ s/\_text\_/$atom/g; $text .= "$tmp"; } $text .= "\n"; } else { #TD 偶数行目 $text .= "$conf_table{'tr_td2'}"; for ($i = 0; $i < $max; $i++) { $atom = $line[$i]; $tmp = $conf_table{'td2'}; $tmp =~ s/\_text\_/$conf_table{'td2_text'}/g; $tmp =~ s/\_text\_/$atom/g; $text .= "$tmp"; } $text .= "\n"; } } } $text .= "
    \@1\@No.\@2\@\@1\@\@th_item\@\@2\@\@1\@\@th_numclip\@\@2\@\@1\@\@th_headline\@\@2\@
    \@1\@:-No.-:\@2\@\@1\@\@th_item\@\@2\@\@1\@\@th_numclip\@\@2\@\@1\@\@th_headline\@\@2\@
    \@1\@\@th_headline\@\@2\@\<\/th\>//g; } if ($GTEXT_COLOR_HEAD eq "") { $txt_suspend =~ s/\@1\@//g; $txt_suspend =~ s/\@2\@//g; } else { $txt_suspend =~ s/\@1\@/\/g; $txt_suspend =~ s/\@2\@/\<\/font\>/g; } $txt_fsub .= $txt_suspend; } $txt_fsub .= $text; #$navi = "
    \n$navi"; #00/11/03 $txt_fsub .= &create_sub_foot ($navi); open (FSUB, ">$file_sub") || output_msg("POP-E012", $file_sub); #2002/05/06 NANDRA $txt_fsub = &replace_str ($txt_fsub); #99/10/13 print FSUB $txt_fsub; close (FSUB); } else { $txt_fout .= $text; } } #---------------------------------------------------- #フッタ出力 #---------------------------------------------------- $txt_fout .= &create_main_foot (""); open (FOUT, ">$file_out") || output_msg("POP-E012", $file_out); #2002/05/06 NANDRA $txt_fout = &replace_str ($txt_fout); #2001/05/12 NANDRA インデクス階層のindex.htmlにもフィルター処理を適用 print FOUT $txt_fout; close (FOUT); } ################################################# sub write_page #** 個別ページ生成 ################################################# { my ($path, $keyitem, $this_page_dir, $this_clip_dir, $date, $page, $catg, $region, $xy, $url, $title, $yomi, $comment, $date2, $ext) = @_; my (@records, $record, $delimiter, $machine, $isover, $texthead, $text, $file_page, $str1, $str2, $str3, $str4, $str5, $str6, $str7, $str8, $mime, $file, $dummy, $head, $today, $map_gif, $short, $bgcolor,$reserved_mime, $this_idx_title, $idx_dir, $navi, $navi_a, $navi_bt, $navi_bc, $navi_c, $idx_title, $idx_fkey, @idx_dates, $fkey, $each_keyitem, $tag_chk, $text_tmp, $navi_tmp, $clip_on, $path2, %assoc_date, $date_no, $protocol, $char, $param0, $param1, $param2, $param3, $param4, $param5, $param6, $form_tag, $in_option, $prev, $next, $this_navi, $num_clip, $assoc_date_1, $dir, $folder_on, $ck1, $ck2, @clip_files, $this_clip_file, @clip_list_data, $clip_cnt, $mime2, $idx_opt1, $idx_opt2, $idx_opt3, @idx_opt, $add_option, $clip_done, $compose_mode, $valign, $robot, $tag_ext1, $tag_ext2, $tag_date_chk, $author, $copyright, $contact, $add1, $add2, $site, $fpath, $frpath, $opt_path, $tmp_path); my($mapwi, $gmap_html, $sw_gmap, $gmap_xy); #add(by mogamigawa GMAP) $sw_gmap = "OFF"; #add(by mogamigawa GMAP) $mapwi = 1; #add(by mogamigawa GMAP) &machine; $machine = $GMACHINE; $delimiter = $GDELIMITER; # 拡張版の多階層ディレクトリ等に対応 (2003/02/20) # $fpath は filesディレクトリを含むパス。 # $frpath は filesディレクトリを含む相対パス。(UNIX形式) # $opt_pathはサイト毎のクリップファイル格納パス # ディレクトリチェック追加 (03/03/12) $site = $GSITE; $tmp_path = "$path" . "files"; #2003/03/15 Maekawa if ($GENHANCED ne "" || -e $tmp_path) { $fpath = "$path" . "files$delimiter"; #2003/03/15 Maekawa $frpath = "../files"; $opt_path = "$delimiter$site"; } else { $fpath = "$path"; $frpath = ".."; $opt_path = ""; } #if ($keyitem eq "cat" ) { # open(INFO,"> write_page.log"); #} $tag_date_chk = ""; #02/04/10 Maekawa ($title) = split (/) { # bodyタグまでスキャンして$GTHIS_POPCORNが無ければスキップ last if((/$file_page") || output_msg("POP-E013", $file_page); #2002/05/06 NANDRA if ($isover == 1) { #既存ファイル活用 2002/09/03 NANDRA print FPAGE $text; close (FPAGE); return $num_clip; } #ページ・ヘッダ部生成 #2002/02/24 HEADまわり修正(NANDRA) #2002/09/01 HEAD部にクリップ数を挿入(NANDRA) $texthead = $GDOCTYPE; $texthead .= "\n\n"; $texthead .= $GTHIS_POPCORN; $text = &arrange_metatags(4, $keyitem); # 01/08/14 NANDRA $text .= "$title\\n"; if ($GUNITED_HTML eq "on") { #2002/09/03 統合HTML対応 NANDRA $text .= "\n"; } if ($GSTYLE ne "") { $text .= "$GSTYLE\n"; } #00/09/15 $text .= $GHEAD_STR; $text .= "\n"; if ($GPULLDOWN eq "on") { $text .= &pulldown_head; } $text .= "\n"; $text .= $GBODY_TOP; if ($GEXTRACT eq "on" && $keyitem eq $GINDEX_MAIN) { #02/04/10yamagata1のExtractコメントタグ $text .= "\n"; $text .= "\n"; $text .= "\n"; } if ($GPULLDOWN eq "on") { $text .= "
    \n"; } if ($GHEAD_NAVI ne "no") { $text .= "\@head_navi\@"; } #98/01/28修正 $text .= $GPAGE_TOP; #99/12/12追加 $text .= "
    \n"; if ($GHEAD_PAGE ne "no") { $text .= "$page\\n$GLINE2_PAGE\n"; } #98/01/28修正 if ($GADD_INFO ne "") { $text .= "$GADD_INFO\n
    \n"; } #追加情報表示 #99/08/30追加 if ($GEXTRACT eq "on" && $keyitem eq $GINDEX_MAIN) { #02/04/10yamagata1のExtractコメントタグ $text .= "

    $title\

    \n

    \n"; } else { $text .= "

    $title\

    \n

    \n"; } #ページ・ヘッダ部(インデクス・更新・登録日)生成 ($idx_title, $fkey) = split(/\t/, $GKEY_REGION {$region}); if ($fkey ne "") { # (2003/02/20) $map_gif = "$fpath" . "gif/map/$fkey.gif"; $map_gif = &conv_path ($map_gif); if (-e "$map_gif" && $GHEAD_MAP ne "no") { #98/01/28修正 $text .= "
    \n"; } } $text .= "\@head\@\n

    \n$GLINE_PAGE\n"; #ページ・本体部レイアウト生成 %assoc_date = (); $date_no = 0; @records = split (/$GRET_CODE/, $comment); foreach $record (@records) { ($str1, $str2, $str3, $str4, $str5, $str6, $str7, $str8) = split (/$GTAB_CODE/, $record); #*.ml, *.clip $str1:ファイル, $str2:先頭, $str3:最終, $str4, #$str5, $str6 *.jpg/gif/au/mov $str1:ファイル, $str2:撮影日, #$str3:場所, $str4:タイトル, $str5:ヘッドライン, $str6 if ($compose_mode eq "on") { #00/01/05追加 $text .= "\n
    \n"; } $tag_chk = &tag_chk ($str1); if ($tag_chk eq "yes") { #マクロタグ指定時の処理 if ($str1 eq "xref") { #2001/09/15ifブロック全体を追加 if ($keyitem eq "cat") { &add_xref($str2, $this_page_dir, $date, $page, $catg, $region, $url, $title, $yomi, $comment, $date2, $ext); } } #if ($str1 eq "headline") { } if ($str1 eq "text") { #00/01/05追加 $text .= "$str2\
    \n"; } if ($str1 eq "author") { #02/04/10 Maekawa $author = $str2; } if ($str1 eq "copyright") { #02/04/10 Maekawa $copyright = $str2; } if ($str1 eq "contact") { #02/04/10 Maekawa $contact = $str2; } if ($str1 eq "compose_start") { #00/01/05追加 $compose_mode = "on"; if ($str2 eq "") { $valign = "top"; } else { $valign = "$str2"; } $text .= "\n\n\n\n
    \n"; } if ($str1 eq "compose_end") { #00/01/05追加 $compose_mode = "off"; $text .= "
    \n"; } if ($str1 eq "link") { $text .= &edit_link ($str2, $str3, $str4, $str5, $str6); } if ($str1 eq "link2") { $text .= &edit_link2 ($str2, $str3, $str4, $str5, $str6); } if ($str1 eq "tablequote" && $str2 ne "") { $text .= &edit_tablequote ($str2, $compose_mode); } if ($str1 eq "quote" && $str2 ne "") { $text .= &edit_quote ($str2); } if ($str1 eq "hr") { # 2004/02 insert PopCorn WG $text .= &edit_hr ($str2); } if ($str1 eq "set_vod") # 2004/09/26 Maekawa { $text .= &edit_set_vod ($str2, $str3); #push (@vod_list, $str2); #04/10/02 Maekawa } if ($str1 eq "subtitle") { if ($GCENTER_SUBTITLE eq "yes" || $GCENTER_SUBTITLE eq "on") { $text .= "\\n"; } #99/12/04追加 if ($str3 eq "") { #99/12/05修正 $text .= "

    $str2" . "

    \n"; } else { #99/12/04条件文追加(サブタイトルの代替画像表示) $mime = &get_mime ($str3); # (2003/02/20) $text .= "\n
    \n"; } if ($GCENTER_SUBTITLE eq "yes" || $GCENTER_SUBTITLE eq "on") { $text .= "\<\/center\>\n"; } #99/12/04追加 } if ($str1 eq "folder") { #$str2:MIMEタイプ, $str3:フォルダ名, $str4:日付, $str5:場所, #$str6:タイトル先頭, $str7:リンク指定有無 # (2003/03/17) #$param0 = $fpath . $str2 . $delimiter . $str3; #$param0 = &conv_path ($param0); #00/03/07修正 $param0 = &getMediaAbsPath($path, $str2); $param0 .= $delimiter . $str3; $param0 = &conv_path($param0); $param1 = $str2 . "-" . $str3; $param1 =~ s/\//\-/g; # (2003/02/20) #$param1 = "$fpath" . "clip" . $opt_path . $delimiter . # "$param1" . ".clip"; $param1 = &getMediaAbsPath($path, "clip") . $delimiter . $param1 . ".clip"; $param2 = ""; $param3 = ""; $mime = $str2; $in_option = $str7; # 03/03/17 削除 #&check_dir ("$fpath" . "clip"); &make_folder_clip ("$param0", $str3, "$param1", $str2, $str4, $str5, $str6); #if ($GIMAGECLIP eq "on" && ($mime eq "jpg" || $mime eq "JPG" || $mime eq "jpeg" || $mime eq "JPEG" || $mime eq "gif" || $mime eq "GIF" || $mime eq "png" || $mime eq "PNG" || $GENHANCED ne "")) if ($GIMAGECLIP eq "on" && $mime ne "clip" && $mime ne "html" && $mime ne "table" && $mime ne "ml" && $mime ne "src" && $mime ne "") # 03/03/13 PopCorn WG { # PNG対応 2001/06/06 NANDRA # マルチメディアファイル対応 2003/02/20 PopCorn WG $text .= &edit_imageclip_page1($this_clip_dir, $param1, "", "", "", $in_option, $title); } else { $text .= &edit_clip_page1($this_clip_dir, $param1,"", "","","",$title); } $clip_on = "yes"; push (@clip_files, $param1); push (@clip_list_data, $G_CLIP_LIST); } if ($str1 eq "imageclip" && $str2 ne "folder") { #98/10/25追加 #$param1:パス付きclipファイル名, $param2:先頭ファイル, #$param3:最終ファイル $reserved_mime = "yes"; $clip_on = "yes"; $param0 = $str2; # (2003/02/20) #$param1 = "$fpath" . "clip$opt_path$delimiter$str2"; $param1 = &getClipAbsPath($path, $site, $str2); #03/07/13 Maekawa $param2 = $str3; $param3 = $str4; $in_option = $str5; $G_GET_CLIP_DATE = ""; $text .= &edit_imageclip_page1($this_clip_dir, $param1, $param2, $param3, $catg, $in_option, $title); push (@clip_files, $param1); push (@clip_list_data, $G_CLIP_LIST); if ($G_GET_CLIP_DATE ne "") { if ($assoc_date{$G_GET_CLIP_DATE} eq "" && $date_no eq 0) { $date_no++; $assoc_date {$date_no} .= $G_GET_CLIP_DATE; } } } if ($str1 eq "imageclip" && $str2 eq "folder") { #98/10/28追加 #$str3:MIMEタイプ, $str4:フォルダ名, $str5:日付, #$str6:場所, $str7:タイトル先頭, $str8:リンク指定有無 # (2003/02/21) #$param0 = $fpath . $str3 . $delimiter . $str4; #$param0 = &conv_path ($param0); #00/03/07修正 $param0 = &getClipAbsPath($path, $site, $str3); #03/07/13 Maekawa $param1 = $str3 . "-" . $str4; $param1 =~ s/\//\-/g; # (2003/02/20) #$param1 = "$fpath" . "clip" . $opt_path . $delimiter . "$param1" . ".clip"; $param1 = &getClipAbsPath($path, $site, "$param1" . ".clip"); #03/07/13 Maekawa $param2 = ""; $param3 = ""; &check_dir ("$fpath" . "clip"); &make_folder_clip ("$param0", $str4, "$param1", $str3, $str5, $str6, $str7); #$param1:パス付きclipファイル名, $param2:先頭ファイル, #$param3:最終ファイル $reserved_mime = "yes"; $clip_on = "yes"; $in_option = $str8; $G_GET_CLIP_DATE = ""; $text .= &edit_imageclip_page1($this_clip_dir, $param1, $param2, $param3, $catg, $in_option, $title); push (@clip_files, $param1); push (@clip_list_data, $G_CLIP_LIST); if ($G_GET_CLIP_DATE ne "") { if ($assoc_date{$G_GET_CLIP_DATE} eq "" && $date_no eq 0) { $date_no++; $assoc_date {$date_no} .= $G_GET_CLIP_DATE; } } } if ($str1 eq "title_image") { #99/10/13追加 #$str2:ページタイトルの代替画像 $mime = &get_mime($str2); if ($mime ne "") { # (2003/02/20) $file = "$frpath/$mime/$str2"; $text =~ s/\.*\<\/h1\>/\\\<\/h1\>/iosx; } } if ($str1 eq "gmapxy" ) { #add(by mogamigawa GMAP) &edit_gmapIN($str2, $str3, $mapwi); #add(by mogamigawa GMAP) $gmap_xy = $str2; #add(by mogamigawa GMAP) $mapwi++; #add(by mogamigawa GMAP) $sw_gmap = "ON"; #add(by mogamigawa GMAP) } #add(by mogamigawa GMAP) } if ($tag_chk eq "no") { #MIME指定時の処理 $reserved_mime = ""; $mime = &get_mime($str1); if ($mime ne "") { # (2003/02/20) $file = "$frpath/$mime/$str1"; } # 従来版では画像ファイルの場合 # 拡張版($GENHANCED)ではclipやtable以外の拡張子の場合 #if ((($mime eq "jpg" || $mime eq "JPG" || $mime eq "jpeg" || $mime eq "JPEG" || $mime eq "gif" || $mime eq "GIF" || $mime eq "png" || $mime eq "PNG" ) && $GENHANCED eq "") || ($mime ne "clip" && $mime ne "table" && $mime ne "" && $GENHANCED ne "")) # 03/03/13 PopCorn WG if ($mime ne "clip" && $mime ne "table" && $mime ne "" && $mime ne "txt" && $mime ne "html" && $mime ne "src" && $mime ne "ml") { # PNG対応 2001/06/06 NANDRA # マルチメディアファイル対応 2003/02/20 PopCorn WG $reserved_mime = "yes"; $text .= "
    \n"; #99/11/01追加 #02/01/23 $path追加 Maekawa $text .= &edit_imagelink ($path, $mime, $str1); if ($str2 ne "") { #日付が設定されていれば $ck1 = substr ($str2, 0, 2); $ck2 = substr ($str2, 2, 1); if ($ck2 eq "/" && $ck1 != 00) { if ($ck1 >= 50) { $str2 = "19" . $str2; } else { $str2 = "20" . $str2; } } $short = &get_atom ("date", "SHORT_NAME"); if ($str2 ne "0000/00/00" && $str2 ne "00/00/00") { #99/09/10修正 if ($GEXTRACT eq "on" && $keyitem eq $GINDEX_MAIN && $tag_date_chk eq "") { #02/04/10 Maekawa $tag_ext1 = ""; $tag_ext2 = ""; $tag_date_chk = "done"; } else { $tag_ext1 = $tag_ext2 = ""; } if ($short ne "") { $text .= "
    $short: $tag_ext1$str2$tag_ext2"; } else { $text .= "
    $str2"; } } else { $text .= "
    "; } #"日付 時刻"の場合、$dummyに日付のみ抽出する ($dummy) = split (/ /, $str2); #$dummy = &conv_date ($dummy); if ($dummy ne "") { $str4 = $str4 . "$dummy, "; if ($assoc_date{$dummy} eq "" && $date_no eq 0) { $date_no++; $assoc_date {$date_no} .= $dummy; } } } if ($str3 ne "") { # 97/08/27変更 if ($str2 ne "") { $text .= " $GCAPTION$str3"; } else { $text .= "
    $GCAPTION$str3"; } } #99/12/03ここから追加 #clip_option.datに定義されたオプション項目がある場合は #その挿入位置を\@add_option\@として暫定的に指定する。 $add_option = $GCLIP_OPT{$str1}; #99/11/01追加 ($add_option) = split (/\t/, $add_option); if (add_option ne "") { $text .= "

    \@add_option\@

    "; } #99/12/03ここまで追加 $text .= "\n
    \n

    \n\n"; } if ($mime eq "html") { #00/01/05追加 $char = substr ($str1, 0, 1); $protocol = &check_protocol ($str1); if ($protocol ne "yes" && $char ne "/" && $char ne "\.") { $reserved_mime = "yes"; $str1 = &conv_path ($str1); # (2003/02/20) $text .= &html_from_file("$fpath$mime$delimiter$str1"); } } if ($mime eq "txt" || $mime eq "src") { $reserved_mime = "yes"; $str1 = &conv_path ($str1); # (2003/02/20) #$text .= &text_from_file("$fpath$mime$delimiter$str1", "$mime", $str2); $text .= &text_from_file("$fpath$mime$delimiter$str1", "$mime", "plain"); } if ($mime eq "table") { $reserved_mime = "yes"; $str1 = &conv_path ($str1); # (2003/02/20) $text .= &table_from_file("$fpath$mime$delimiter$str1", $str2); } if ($mime eq "ml" || $mime eq "clip") { #$param1:パス付きCLIPファイル名, $param2:先頭ファイル, #$param3:最終ファイル $reserved_mime = "yes"; $clip_on = "yes"; $param0 = $str1; # (2003/02/20) (03/03/14) #$param1 = "$path$mime$opt_path$delimiter$str1"; $param1 = &getClipAbsPath($path, $site, $str1); #03/07/13 Maekawa $param2 = $str2; $param3 = $str3; $in_option = $str4; #98/06/19 $G_GET_CLIP_DATE = ""; if ($GIMAGECLIP eq "on") { $mime2 = &get_mime_from_clip ($param1); # 03/03/13 マルチメディア対応により、 # 条件判定が不要になった。 PopCorn WG #if ($mime2 eq "jpg" || $mime2 eq "JPG" || $mime2 eq "jpeg" || $mime2 eq "JPEG" || $mime2 eq "gif" || $mime2 eq "GIF" || $mime2 eq "png" || $mime2 eq "PNG" || $GENHANCED ne "" ) #{ # PNG対応 2001/06/06 NANDRA # マルチメディアファイル対応 2003/02/20 PopCorn WG $text .= &edit_imageclip_page1($this_clip_dir, $param1, $param2, $param3, $catg, $in_option, $title); #} #else #{ # $text .= &edit_clip_page1($this_clip_dir, $param1, $param2, $param3, $catg, $in_option, $title); #} } else { $text .= &edit_clip_page1($this_clip_dir, $param1, $param2, $param3, $catg, $in_option, $title); } $clip_done = "done"; #99/12/03追加 push (@clip_files, $param1); push (@clip_list_data, $G_CLIP_LIST); if ($G_GET_CLIP_DATE ne "") { if ($assoc_date{$G_GET_CLIP_DATE} eq "" && $date_no eq 0) { $date_no++; $assoc_date {$date_no} .= $G_GET_CLIP_DATE; } } } #以下は、AタグでリンクするMIMEタイプ if ($reserved_mime ne "yes" && $str1 ne "") { $text .= &edit_link ($str1, $str2, $str3, $str4, $str5); } } } if ( $sw_gmap eq "ON" ) { #add(by mogamigawa GMAP) $GmapMAX = $mapwi; #add(by mogamigawa GMAP) $gmap_html = &edit_gmapOUT($path, $this_page_dir, $url, $title, $gmap_xy); #add(by mogamigawa GMAP) $text .= "
    \n"; # add(地図連携対応) $text .= "\n"; #add(by mogamigawa GMAP) $text .= "
    \n"; #add(by mogamigawa GMAP) ### $text .= "GoogleMap is DISPLAY"; } #add(by mogamigawa GMAP) #ページ・ヘッダ部・インデクス属性の編集 $today = &getdate2("/"); $head = ""; if ($catg ne "" && $catg ne "non") { $short = &get_atom ("cat", "SHORT_NAME"); ($idx_title, $idx_fkey) = split(/\t/, $GKEY_CAT {$catg}); $idx_dir = &get_atom ("cat","DIR"); if ($GEXTRACT eq "on" && $keyitem eq $GINDEX_MAIN) { $tag_ext1 = ""; $tag_ext2 = ""; } else { $tag_ext1 = $tag_ext2 = ""; } $head = $head . "$short: $tag_ext1$catg$tag_ext2\ "; } if ($region ne "" && $region ne "non") { $short = &get_atom ("region", "SHORT_NAME"); ($idx_title, $idx_fkey) = split(/\t/, $GKEY_REGION {$region}); $idx_dir = &get_atom ("region","DIR"); if ($GEXTRACT eq "on" && $keyitem eq $GINDEX_MAIN) { $tag_ext1 = ""; $tag_ext2 = ""; } else { $tag_ext1 = $tag_ext2 = ""; } $head = $head . "$short: $tag_ext1$region$tag_ext2\ "; } # if ($idx_opt1 ne "" && $idx_opt1 ne "non") # { # $short = &get_atom ("idx_opt1", "SHORT_NAME"); # # ($idx_title, $idx_fkey) = split(/\t/, $GKEY_OPT1 {$idx_opt1}); # # 05.03.21 PopCorn WG # ($idx_title, $idx_fkey) = split(/\t/, $GKEY_OPT[1] {$idx_opt1}); # $idx_dir = &get_atom ("idx_opt1","DIR"); # $head = $head . "$short: $idx_opt1\ "; # } # if ($idx_opt2 ne "" && $idx_opt2 ne "non") # { # $short = &get_atom ("idx_opt2", "SHORT_NAME"); # ($idx_title, $idx_fkey) = split(/\t/, $GKEY_OPT2 {$idx_opt2}); # $idx_dir = &get_atom ("idx_opt2","DIR"); # $head = $head . "$short: $idx_opt2\ "; # } # if ($idx_opt3 ne "" && $idx_opt3 ne "non") # { # $short = &get_atom ("idx_opt3", "SHORT_NAME"); # ($idx_title, $idx_fkey) = split(/\t/, $GKEY_OPT3 {$idx_opt3}); # $idx_dir = &get_atom ("idx_opt3","DIR"); # $head = $head . "$short: $idx_opt3\ "; # } for ($i=0;$i<@idx_opt;$i++){ if ($idx_opt[$i] ne "" && $idx_opt[$i] ne "non") { $tmp_num = int ($i +1); $short = &get_atom ("idx_opt$tmp_num", "SHORT_NAME"); ($idx_title, $idx_fkey) = split(/\t/, $GKEY_OPT[$tmp_num]{$idx_opt[$i]}); $idx_dir = &get_atom ("idx_opt$tmp_num","DIR"); $head = $head . "$short: $idx_opt[$i]\ "; } } if ($head ne "") { $head = $head . "
    \n"; } if ($date ne "" && $date ne "non" && $date ne "00/00/00" && $date ne "0000/00/00") { $short = &get_atom ("update", "SHORT_NAME"); if ($GEXTRACT eq "on" && $keyitem eq $GINDEX_MAIN) { $tag_ext1 = ""; $tag_ext2 = ""; } else { $tag_ext1 = $tag_ext2 = ""; } if ($short ne "") { $head = $head . "($short: $tag_ext1$date$tag_ext2 $GTXT2: $today)"; } else { $head = $head . "($date $GTXT2: $today)"; } } if ($GHEAD_DATA ne "no") { $text =~ s/\@head\@/$head/g; } else { $text =~ s/\@head\@//g; } $navi = $this_navi = ""; # ナビゲーション文字列の生成処理。サブルーチン化 2002/09/02 NANDRA #($prev, $next) = split (/\t/, $GPREV_NEXT {$url}); #if ($keyitem eq "cat"){ ($idx_title, $idx_fkey) = # split(/\t/, $GKEY_CAT {$catg}); } #(omitted) # else { $this_navi = $this_navi . # " | $GTXT6\ ]\n"; } #} $this_navi = &edit_navi_str($url, $keyitem, $catg, $region, $idx_opt1, $idx_opt2, $idx_opt3, $assoc_date{1}, $date, $this_page_dir, $yomi); foreach $each_keyitem (@GINDEX_KEY) { if ($each_keyitem eq "cat") { ($idx_title, $idx_fkey) = split(/\t/, $GKEY_CAT {$catg}); $idx_dir = &get_atom ($each_keyitem,"DIR"); $s_name = &get_atom ($each_keyitem,"SHORT_NAME"); if ($idx_title ne "") { $navi = $navi . " | $s_name($idx_title" . ")"; } } if ($each_keyitem eq "region") { ($idx_title, $idx_fkey) = split(/\t/, $GKEY_REGION {$region}); $idx_dir = &get_atom ($each_keyitem,"DIR"); $s_name = &get_atom ($each_keyitem,"SHORT_NAME"); if ($idx_title ne "") { $navi = $navi . " | $s_name($idx_title" . ")"; } } if ($each_keyitem eq "idx_opt1") { ($idx_title, $idx_fkey) = split(/\t/, $GKEY_OPT1 {$idx_opt1}); # 05.03.21 PopCorn WG # ($idx_title, $idx_fkey) = split(/\t/, $GKEY_OPT[1] {$idx_opt1}); $idx_dir = &get_atom ($each_keyitem,"DIR"); $s_name = &get_atom ($each_keyitem,"SHORT_NAME"); if ($idx_title ne "") { # $navi = $navi . " | $s_name($idx_title" . ")"; } } if ($each_keyitem eq "idx_opt2") { ($idx_title, $idx_fkey) = split(/\t/, $GKEY_OPT1 {$idx_opt2}); $idx_dir = &get_atom ($each_keyitem,"DIR"); $s_name = &get_atom ($each_keyitem,"SHORT_NAME"); if ($idx_title ne "") { $navi = $navi . " | $s_name($idx_title" . ")"; } } if ($each_keyitem eq "idx_opt3") { ($idx_title, $idx_fkey) = split(/\t/, $GKEY_OPT1 {$idx_opt3}); $idx_dir = &get_atom ($each_keyitem,"DIR"); $s_name = &get_atom ($each_keyitem,"SHORT_NAME"); if ($idx_title ne "") { $navi = $navi . " | $s_name($idx_title" . ")"; } } if ($each_keyitem =~ m/idx_opt/) { $tmp_num = $each_keyitem; $tmp_num =~ s/idx_opt//; ($idx_title, $idx_fkey) = split(/\t/, $GKEY_OPT[$tmp_num] {$idx_opt[int($tmp_num-1)]}); $idx_dir = &get_atom ($each_keyitem,"DIR"); $s_name = &get_atom ($each_keyitem,"SHORT_NAME"); if ($idx_title ne "") { $navi = $navi . " | $s_name($idx_title" . ")"; } } if ($each_keyitem eq "date") { if ($GDATE_OPTION eq "by-date") { $this_idx_title = &year_month ($assoc_date{1}, "by-date"); } else { $this_idx_title = &year_month ($assoc_date{1}); } ($idx_title, $idx_fkey) = split(/\t/, $GKEY_DATE {$this_idx_title}); $idx_dir = &get_atom ($each_keyitem,"DIR"); $s_name = &get_atom ($each_keyitem,"SHORT_NAME"); if ($idx_title ne "") { $navi = $navi . " | $s_name($idx_title" . ")"; } } if ($each_keyitem eq "update") { if ($GUPDATE_OPTION eq "by-date") { $this_idx_title = &year_month ($date, "by-date"); } else { $this_idx_title = &year_month ($date); } ($idx_title, $idx_fkey) = split(/\t/, $GKEY_UPDATE {$this_idx_title}); $idx_dir = &get_atom ($each_keyitem,"DIR"); $s_name = &get_atom ($each_keyitem,"SHORT_NAME"); if ($idx_title ne "") { $navi = $navi . " | $s_name($idx_title" . ")"; } } } $navi =~ s/^\ \|\ /\[ /; #$navi = $this_navi . "\n$GLINE2_PAGE" . $navi; #2002/09/04 NANDRA ($navi変数を3分割。_aが左側、_btが中央(トピック用)、 #_bcが中央(クリップ用)、_cが右側) $navi_a = ""; if ($GUNITED_HTML eq "on") { $navi_bt = "\n"; $navi_bt .= ""; } else { $navi_bt = $this_navi; } $navi_bc = $this_navi; $navi_c = "\n\n
    \n\n" . $navi; $navi_c .= " ]"; #00/09/17 if (($navi_bc . $navi_c) eq " ]") { $navi_bt = $navi_bc = $navi = ""; } else { $navi_a = "\n\n\n\n
    \n\n\n\n\n
    \n\n"; $navi_c .= "\n
    \n
    \n"; #00/09/17 } $navi_a = "
    \n$navi_a"; $text =~ s/\@head_navi\@/$navi_a$navi_bt$navi_c\n$GLINE_PAGE\n/g; if ($GPULLDOWN eq "on") { $form_tag = &form_start; $text =~ s/\@form_start\@/$form_tag/g; $form_tag = &form_end; $text =~ s/\@form_end\@/$form_tag/g; } if ($GADD_INFO_BODY2 ne "") { $text .= "$GADD_INFO_BODY2\n
    \n"; } #追加情報表示 #99/10/06追加 if ($clip_done eq "") { $text =~ s/\@add_option\@/$add_option/g; } else { $text =~ s/\\@add_option\@\//g; } #99/12/03追加 if ($author ne "") { #02/04/10 Maekawa if ($GEXTRACT eq "on" && $keyitem eq $GINDEX_MAIN) { #yamagata1のExtractコメントタグ $tag_ext1 = ""; $tag_ext2 = ""; } else { $tag_ext1 = $tag_ext2 = ""; } $text .= "
    ($GLABEL_AUTHOR: " . "$tag_ext1$author$tag_ext2)
    \n"; } if ($contact ne "") { #02/04/10 Maekawa $text .= "
    ($GLABEL_CONTACT: $contact)
    \n"; } if ($copyright ne "") { #02/04/10 Maekawa $text .= "
    $GLABEL_COPYRIGHT " . "$copyright. $GLABEL_COPYRIGHT2
    \n"; } if ($GEXTRACT eq "on" && $keyitem eq $GINDEX_MAIN) { #02/04/10,11yamagata1のExtractコメントタグ $text .= "\n"; $text .= "\n"; } $num_clip = 0; if ($clip_on eq "yes") { $clip_cnt = 0; foreach $this_clip_file (@clip_files) { $G_CLIP_LIST = $clip_list_data[$clip_cnt]; #2002/09/04 NANDRA($navi変数分割の対応) $num_clip += &generate_clip_pages ($this_clip_file, $path, $page, $title, $head, $fkey, $url, $this_page_dir, $this_clip_dir, $navi_tmp, $navi_a . $navi_bc . $navi_c, $delimiter, $in_option, $keyitem); $clip_cnt++; } } #2002/09/01 HEAD部にクリップ件数とdateインデクス用日付を挿入(NANDRA) $texthead .= "\n"; $texthead .= "\n"; $text = $texthead . $text; $text = &replace_str ($text); #99/10/13追加 print FPAGE $text; #02/04/11#2002/09/04 NANDRA($navi変数分割の対応) print FPAGE &create_main_foot ($navi_a . $navi_bt . $navi_c, ,$add2); close (FPAGE); $num_clip } ################################################# sub generate_clip_pages #** クリップページ生成 98/05/16 ################################################# { my ($param1, $path, $page, $title, $head, $fkey, $url, $this_page_dir, $this_clip_dir, $navi_tmp, $navi, $delimiter, $in_option, $keyitem)=@_; my ($text_tmp, $map_gif, $num_clip, $path2, $param4, $robot); my ($machine, $fpath, $frpath, $opt_path, $tmp_path); &machine; $machine = $GMACHINE; $delimiter = $GDELIMITER; # 拡張版の多階層ディレクトリ等に対応 (2003/02/20) # $fpath は filesディレクトリを含むパス。 # $frpath は filesディレクトリを含む相対パス。(UNIX形式) # $opt_pathはサイト毎のクリップファイル格納パス # ディレクトリチェック追加 (03/03/12) $site = $GSITE; $tmp_path = "$path" . "files"; #2003/03/15 Maekawa if ($GENHANCED ne "" || -e $tmp_path) { $fpath = "$path" . "files$delimiter"; #2003/03/15 Maekawa $frpath = "../files"; $opt_path = "$delimiter$site"; } else { $fpath = "$path"; $frpath = ".."; $opt_path = ""; } $num_clip = 0; #2002/02/24 HEADまわり修正(NANDRA) $text_tmp = $GDOCTYPE; $text_tmp .= "\n\n"; $text_tmp .= $GTHIS_POPCORN; $text_tmp .= &arrange_metatags(5, $keyitem); # 01/08/14 NANDRA $text_tmp .= "\@title\@\n"; if ($GSTYLE ne "") { $text_tmp .= "$GSTYLE\n"; } #00/09/15 $text_tmp .= $GHEAD_STR; $text_tmp .= "\n"; if ($GPULLDOWN eq "on") { $text_tmp .= &pulldown_head; } $text_tmp .= "\n$GBODY_TOP"; if ($GPULLDOWN eq "on") { $text_tmp .= "\n"; } if ($GHEAD_NAVI ne "no") { $text_tmp .= "\@head_navi\@"; } #98/01/28修正 $text_tmp .= $GPAGE_TOP; #99/12/12追加 $text_tmp .= "
    \n"; if ($GHEAD_PAGE ne "no") { $text_tmp .= "$page\\n$GLINE2_PAGE\n"; } #98/01/28修正 if ($GADD_INFO ne "") { $text_tmp .= "$GADD_INFO\n

    \n"; } #追加情報表示 #99/08/30追加 $text_tmp .= "$title\@serial\@" . "\n

    \@title\@

    \n

    \n"; if ($fkey ne "") { # (2003/02/20) $map_gif = "$fpath" . "gif/map/$fkey.gif"; $map_gif = &conv_path ($map_gif); if (-e "$map_gif" && $GHEAD_MAP ne "no" && $in_option ne "nomap") { #98/01/28修正 # (2003/02/20) $text_tmp .= "
    \n"; } } if ($GHEAD_DATA ne "no") { $text_tmp .= "$head\n"; } #98/01/28修正 $text_tmp .= "

    \n$GLINE_PAGE". "\n"; $text_tmp .= "\@mapfile\@" . "\n"; if ($GCENTER eq "yes" || $GCENTER eq "on" || $GCENTER eq "") { $text_tmp .= "
    " . "\n"; } $text_tmp .= "\@include_data\@ "; $text_tmp .= "\@comment\@" . "\n"; #00/09/17 $navi_tmp = "\n" . "\n\n\n
    \n"; $navi_tmp .= "\n\n\n\n
    \n" . "\n"; $navi_tmp .= "[ $GTXT4\" . "| $GTXT5\ | " . "$GTXT6\ ]"; $navi_tmp .= "\n
    \n
    \n"; $navi_tmp = "
    \n$navi_tmp"; $text_tmp =~ s/\@head_navi\@/$navi_tmp\n$GLINE_PAGE\n/g; if ($navi ne "") { $navi_tmp = $navi_tmp . "\n$GLINE2_PAGE\n"; } if ($GCENTER eq "yes" || $GCENTER eq "on" || $GCENTER eq "") { $text_tmp .= "
    \n"; } if ($GADD_INFO_BODY2 ne "") { $text_tmp .= "$GADD_INFO_BODY2\n
    \n"; } #追加情報表示 #99/10/06追加 $text_tmp .= &create_main_foot ("$navi_tmp$navi"); $param4 = "../$this_page_dir/$url.html"; $path2 = "$this_clip_dir" . $delimiter; $num_clip = &edit_clip_page2 ($this_clip_dir, $param1, $param4, $path, $path2, $text_tmp, $title); #2001/09/15 Maekawa $num_clip } #================================================================== #** Part 2:自動生成メイン処理系サブルーチン #================================================================== ################################################# #sub error_msg #** エラーメッセージ表示 #00/03/10 #2002/05/06 NANDRA 廃止、output_msgに機能継承 ################################################# #{ # my ($msg) = @_; # print $msg; # 1 #} ################################################# sub output_msg #** 標準出力にメッセージを出力 # 2002/05/06 NANDRA 新規 ################################################# #関連G変数 # $GOUTPUT_MSG_NO # "ID_ONLY" メッセージIDとパラメータのみ出力する # それ以外の文字列 メッセージIDと説明を両方出力する # null 説明のみ出力する # @GMSG_LIST 内部用。このsubを最初に実行する際にメッセージリスト # を読み込む # #戻り値: # 出力されたメッセージ文字列 #引数: # msg_id メッセージID # param[1-4] メッセージにパラメータが伴う場合に、そのパラメータ { my ($msg_id, $param1, $param2, $param3, $param4, $param5, $param6) = @_; my (@msg_list, $msg_desc, $id, $desc); if($GMSG_LIST[0] eq "") { @GMSG_LIST = split (/\n/, &output_msg_list); # メッセージリストの取込 } $msg_desc = ""; foreach (@GMSG_LIST) { # メッセージリストをID番号でスキャン next if (/^#/); ($id, $desc) = split (/\t/, $_); if ($msg_id eq $id) { $msg_desc = $desc; last; } } if ($msg_desc eq "") { # ID番号に対応するメッセージが無かった場合の処理 if ($msg_id eq "POP-E999") { # 再帰呼び出しの無限ループを防ぐ die "Error: Misdefine of Message-ID [POP-E999]. " . "Please contact to the developer!"; } else { # POP-E999(メッセージ未定義)を出力する output_msg ("POP-E999", $msg_id); } } # 出力メッセージの構築 if ($GOUTPUT_MSG_NO eq "ID_ONLY") { # IDのみ出力の場合 $msg_desc = $msg_id; if ($param1 ne "") { $msg_desc .= "( %1, %2, %3, %4, %5, %6 )"; } } elsif ($GOUTPUT_MSG_NO ne "") { # IDと説明を両方出力 $msg_desc = $msg_id . ': ' . $msg_desc; } $msg_desc =~ s/%1/$param1/g; $msg_desc =~ s/%2/$param2/g; $msg_desc =~ s/%3/$param3/g; $msg_desc =~ s/%4/$param4/g; $msg_desc =~ s/%5/$param5/g; $msg_desc =~ s/%6/$param6/g; $msg_desc =~ s/\\t/\t/g; #タブ文字処理 # メッセージを出力 print $msg_desc . "\n"; if ($msg_id =~ m/-E/) { # エラーの場合はdieにする die "\n"; } 1 } ################################################# sub machine #** プラットフォーム名返却 #99/10/01 ################################################# { if (-d "C:\\" || -d "\\\\$GNTSERVER\\") { $GMACHINE = "win"; $GDELIMITER = "\\"; } else { if (-d "/") { $GMACHINE = "unix"; $GDELIMITER = "/"; } else { $GMACHINE = "mac"; $GDELIMITER = ":"; } } $GMACHINE } ################################################# sub get_delimiter #** デリミタ返却 #99/10/01 ################################################# { if ($GDELIMITER ne "") { &machine; } $GDELIMITER; } ################################################# sub conv_path #** ローカルパス変換 #99/10/01, 99/10/11 ################################################# { my ($path) = @_; my ($path_h1, $path_h2, $path_new, $len, $char); if ($GMACHINE eq "win") { #$path_h1 = substr ($GPATH_LOCAL, 0, 3); $path_h2 = substr ($path, 0, 3); $char = substr ($path, 1, 1); } $path =~ s/\//$GDELIMITER/g; $path =~ s/\\/$GDELIMITER/g; if ($GMACHINE eq "win") { if ($char eq ":") { $len = length ($path); $path_new = substr ($path, 3, $len); $path_new =~ s/\:/$GDELIMITER/g; $path = $path_h2 . $path_new; } else { $path =~ s/\:/$GDELIMITER/g; } } else { $path =~ s/\:/$GDELIMITER/g; } $path } ################################################# sub conv_delimiter #** デリミタ→/変換 #00/03/16 ################################################# { my ($subfolder) = @_; $subfolder =~ s/\\/\//g; $subfolder =~ s/\:/\//g; $subfolder } ################################################# sub make_cmap #** クリッカブルマップ作成 ################################################# { my ($file_key) = @_; my ($key, $key2, $fkey, $fdata, @cats, $cmap_set, $cmap); $cmap_set = "off"; if (-e $file_key) { #2002/05/06 NANDRA open (FKEY, $file_key) || output_msg("POP-E007", "sub:make_cmap $file_key"); while () { chop; next if /^#/; if (/^■/ || /^\/\//) { s/■//; s/^\/\///; ($key, $key2, $fkey, $fdata) = split (/\t/, $_); if (not /\*/) { push (@cats, "$_"); } if ($fdata ne "") { $cmap_set = "on"; $cmap = $cmap . "\n"; } } else { if (/^□/ || /^\/\//) { s/□//; s/^\/\///; $top = "$_"; $cmap = "\n"; } else { last; } } } $cmap = $cmap . "\n"; close (FKEY); } if ($cmap_set ne "on") { $cmap = ""; } $cmap } ################################################# sub set_all_keys #** 全KEYリスト設定 ################################################# { my ($path, $file_list) = @_; my ($sub, $file_listx, $i, $dir); for ($i = 0; $GINDEX_KEY[$i] ne ""; $i++) { $dir = &get_atom ($GINDEX_KEY[$i], "DIR"); if ($GINDEX_KEY[$i] eq "region") { &set_keylist ("region", $path, $dir); } if ($GINDEX_KEY[$i] eq "cat") { &set_keylist ("cat", $path, $dir); } if ($GINDEX_KEY[$i] eq "abc") { &set_keylist ("abc", $path, $dir); } # if ($GINDEX_KEY[$i] eq "idx_opt1") # { # &set_keylist ("idx_opt1", $path, $dir); # } # if ($GINDEX_KEY[$i] eq "idx_opt2") # { # &set_keylist ("idx_opt2", $path, $dir); # } # if ($GINDEX_KEY[$i] eq "idx_opt3") # { # &set_keylist ("idx_opt3", $path, $dir); # } # 05.03.21 PopCorn WG if ($GINDEX_KEY[$i] =~ m/idx_opt/) { &set_keylist ($GINDEX_KEY[$i], $path, $dir); } if ($GINDEX_KEY[$i] eq "date") { &set_key_date ($path, $file_list); } if ($GINDEX_KEY[$i] eq "update") { &set_key_update ($path, $file_list); } } } ################################################# sub set_keylist #** KEYリスト設定 ################################################# { my ($keyitem, $path, $sub) = @_; my ($delimiter, $file_key, %assoc_key, @array_key, $key, $key2, $fkey, $fdata, $fdata2, $idx_data, $top, $sub2, $machine, $no); &machine; $machine = $GMACHINE; $delimiter = $GDELIMITER; $GIDX_FDATA2 = ""; $sub2 = $sub; $sub = $sub . $delimiter; #$sub2 = $sub; $sub2 =~ s/://g; $sub2 =~ s/\///g; $sub2 = &conv_path ($sub2); $file_key = $path . $GMASTER . $delimiter . $sub2 . ".key"; %assoc_key = (); $no = 0; #2004/01/24 Maekawa #2002/05/06 NANDRA open (FKEY, $file_key) || output_msg("POP-E007", "sub:set_keylist $file_key"); while () { chop; if (/^■/ || /^\*\*/) { $no++; #2004/01/24 Maekawa # ":"が含まれる場合(大分類のケース)に無処理とする条件を #削除 2001/09/10 Maekawa s/■//; s/^\*\*//; $_ =~ s/\n//g; ($key, $key2, $fkey, $fdata, $fdata2) = split (/\t/, $_); if ($key eq "*" || $key eq "" ) { next; } #大項目ラベル処理 #2004/01/27 Maekawa $_ = $key; if (/\:/ && $key2 eq "" && $fkey eq "") {} else { #2004/01/24 欠損値処理 Maekawa if ($key eq "") { $key = "$keyitem$no"; $rtn = &output_msg ("POP-M011", $key); } if ($key2 eq "") { $key2 = $key; $rtn = &output_msg ("POP-M012", $key); } if ($fkey eq "") { $fkey = "$keyitem$no"; $rtn = &output_msg ("POP-M013", $key); } } $assoc_key {$key} .= "$key2\t$fkey\t$fdata\t$fdata2"; push (@array_key, "$key\t$key2\t$fkey\t$fdata\t$fdata2"); #2002/05/06 NANDRA (新着情報のキー名を取得) if ($key eq $GNEWINFO) { $GNEWFKEY = $fkey; } } else { if (/^□/ || /^\/\//) { s/□//; s/^\/\///; $top = "$_"; } else { next if /^#/; last; } } } close (FKEY); if ($keyitem eq "region") { %GKEY_REGION = %assoc_key; @GARRAY_REGION = @array_key; $GMENU_REGION = &edit_pulldown_menu ($GINDEX_DATA {"region"},@array_key); } if ($keyitem eq "cat") { %GKEY_CAT = %assoc_key; @GARRAY_CAT = @array_key; $GMENU_CAT = &edit_pulldown_menu ($GINDEX_DATA {"cat"}, @array_key); } if ($keyitem eq "abc") { %GKEY_ABC = %assoc_key; @GARRAY_ABC = @array_key; $GMENU_ABC = &edit_pulldown_menu ($GINDEX_DATA {"abc"}, @array_key); } if ($keyitem eq "idx_opt1") { %GKEY_OPT1 = %assoc_key; # @GARRAY_OPT1 = @array_key; # $GMENU_OPT1 = &edit_pulldown_menu ($GINDEX_DATA {"idx_opt1"}, @array_key); } if ($keyitem eq "idx_opt2") { %GKEY_OPT2 = %assoc_key; # @GARRAY_OPT2 = @array_key; # $GMENU_OPT2 = &edit_pulldown_menu ($GINDEX_DATA {"idx_opt2"}, @array_key); } if ($keyitem eq "idx_opt3") { %GKEY_OPT3 = %assoc_key; # @GARRAY_OPT3 = @array_key; # $GMENU_OPT3 = &edit_pulldown_menu ($GINDEX_DATA {"idx_opt3"}, @array_key); } # 05.03.21 PopCorn WG if ($keyitem =~ m/idx_opt/) { $tmp_key_num = $keyitem; $tmp_key_num =~ s/idx_opt//; $GKEY_OPT[$tmp_key_num] = \%assoc_key; $GARRAY_OPT[$tmp_key_num] = \@array_key; $GMENU_OPT[$tmp_key_num] = &edit_pulldown_menu ($GINDEX_DATA {$keyitem}, @array_key); } } ############################################################## sub edit_navi_str #** ナビゲーション文字列の生成 # 2002/09/02 write_pageからサブルーチンとして分離(NANDRA) ############################################################## { my ($url, $keyitem, $catg, $region, $idx_opt1, $idx_opt2, $idx_opt3, $assoc_date_1, $date, $this_page_dir, $yomi) = @_; my ($prev, $next, $idx_title, $idx_fkey, $this_idx_title, $idx_dir, $s_name, $hash, $this_navi, @idx_opt); ($prev, $next) = split (/\t/, $GPREV_NEXT {$url}); # open (TEST, ">>/home/asw/test.txt"); # print TEST "*************************************************************\n"; # print TEST "[url]$url\n"; # print TEST "[GPREV_NEXT]$GPREV_NEXT{$url}\n"; # close(TEST); # 05.04.1 PopCorn WG @idx_opt = split(/,/, $yomi); if ($keyitem eq "cat") { ($idx_title, $idx_fkey) = split(/\t/, $GKEY_CAT {$catg}); } if ($keyitem eq "region") { ($idx_title, $idx_fkey) = split(/\t/, $GKEY_REGION {$region}); } # if ($keyitem eq "idx_opt1") # { # ($idx_title, $idx_fkey) = split(/\t/, $GKEY_OPT1 {$idx_opt1}); # } # if ($keyitem eq "idx_opt2") # { # ($idx_title, $idx_fkey) = split(/\t/, $GKEY_OPT2 {$idx_opt2}); # } # if ($keyitem eq "idx_opt3") # { # ($idx_title, $idx_fkey) = split(/\t/, $GKEY_OPT3 {$idx_opt3}); # } # 05.04.01 PopCorn WG if ($keyitem =~ m/idx_opt/){ $tmp_num = $keyitem; $tmp_num =~ s/idx_opt//; $tmp_num2 = int ($tmp_num - 1); ($idx_title, $idx_fkey) = split(/\t/, $GKEY_OPT[$tmp_num] {$idx_opt[$tmp_num2]}); } if ($keyitem eq "date") { $this_idx_title = &year_month ($assoc_date_1); ($idx_title, $idx_fkey) = split(/\t/, $GKEY_DATE {$this_idx_title}); } if ($keyitem eq "update") { $this_idx_title = &year_month ($date); ($idx_title, $idx_fkey) = split(/\t/, $GKEY_UPDATE {$this_idx_title}); } if(($GUNITED_HTML == "on") && ($keyitem ne "cat")) { # UNITED_HTML対応 2002/09/02 NANDRA $hash = "#" . $keyitem; } else { $hash = ""; } $idx_dir = &get_atom ($keyitem,"DIR"); $s_name = &get_atom ($keyitem,"SHORT_NAME"); if ($idx_title ne "") { $this_navi = "[ $GTXT4BP$s_name($idx_title" . ")$GTXT4BS\"; # 2001/11 NANDRA } if ($prev eq "" && $next eq "") { $this_navi = $this_navi . " ]\n"; } else { # 2001/11 NANDRA (ナビゲーションバーが長くなりすぎる場合に改行を入れる) if ($GNAVI_BR eq "yes") { # $GNAVI_BR変数がyesの場合に改行挿入 $this_navi = $this_navi . " ]
    [ "; } else { $this_navi = $this_navi . " | "; } if ($prev eq "") { $this_navi = $this_navi . "$GTXT5\"; } else { $this_navi = $this_navi . "$GTXT5\"; } if ($next eq "") { $this_navi = $this_navi . " | $GTXT6\ ]\n"; } else { $this_navi = $this_navi . " | $GTXT6\ ]\n"; } } return($this_navi); } ################################################# sub edit_pulldown_menu #** プルダウンメニュー設定 #98/04/12追加 ################################################# { my ($idx_data, @array_key) = @_; my ($list, $key, $key2, $fkey, $idx_dir, $idx_title, $idx_short); ($idx_dir, $idx_title, $idx_short) = split (/\t/, $idx_data); $menu = "\n"; $menu; } ################################################# sub get_atom #** KEYデータ要素取得 #98/02/07修正 ################################################# { my ($keyitem, $keyname) = @_; my ($value1, $value2, $value3, $value4, $value5, $value); ($value1, $value2, $value3, $value4, $value5) = split (/\t/, $GINDEX_DATA {$keyitem}); if ($keyname eq "DIR") { $value = $value1; } if ($keyname eq "NAME") { $value = $value2; } if ($keyname eq "SHORT_NAME") { $value = $value3; } if ($keyname eq "PAGE_DIR") { $value = $value4; } if ($keyname eq "CLIP_DIR") { $value = $value5; } $value } ################################################# sub create_main_head #** 総合インデクス・ヘッダ部生成 #98/07/27修正 ################################################# { my ($top, $sub, $path) = @_; my ($text, $date, $navi, $map_jpg, $map_gif, $machine); $machine = $GMACHINE; #02/03/28$subの後ろにパス区切り文字が付くので除去する chop ($sub); $navi = &g_navi; $text = $GDOCTYPE; $text .= "\n\n"; $text .= $GTHIS_POPCORN; $text .= &arrange_metatags(2, ""); # 01/08/14 NANDRA $text .= "$top\\n"; if ($GSTYLE ne "") { $text .= "$GSTYLE\n"; } #00/09/15 $text .= $GHEAD_STR; $text .= "\n"; if ($GPULLDOWN eq "on") { $text .= &pulldown_head; } $text .= "\n"; $text .= "$GBODY_TOP"; $text .= "\n"; if ($GPULLDOWN eq "on") { $text .= "\n"; } $top =~ s/:/
    /g; if ($GHEAD_NAVI ne "no") { $text .= "$navi\n$GLINE_PAGE\n"; } #98/01/28修正 $text .= $GPAGE_TOP; #99/12/12追加 $text .= "
    \n"; if ($GADD_INFO ne "") { $text .= "$GADD_INFO\n
    \n"; } #追加情報表示 #99/08/30追加 $text .= "

    $top\

    \n

    \n"; #02/03/28 Maekawa # 2001/05/13 NANDRA サブルーチン化 $text .= image_txt_insert ($path, $sub, "index"); $text .= "\n

    \n"; #02/03/28 Maekawa $date = &getdate2("/"); if ($date ne "") { $text .= "
    ($GTXT2: " . $date . ")
    \n
    \n"; } $text = &replace_str ($text); $text } ################################################# sub create_main_foot #** 総合インデクス・フッタ部生成 ################################################# { my ($navi) = @_; my ($text, $s_url, $s_title); $text = ""; #追加情報表示 #99/10/06追加 #if ($GADD_INFO_BODY2 ne "") { $text .= "$GADD_INFO_BODY2\n
    \n"; } $text .= $GPAGE_BOTTOM; #99/12/12追加 $text .= "$GLINE_PAGE\n"; if ($navi ne "" && $navi ne "]") { $text .= "$navi\n$GLINE2_PAGE\n"; } $text .= &g_navi . "\n"; ($s_url, $s_title) = split (/\t/, $GADD_NAVI); if ($s_url ne "") { $text .= "$s_title\\n"; } if ($GADD_NAVI2 ne "") { $text .= $GADD_NAVI2; } #00/04/13追加 $text .= "$GLINE2_PAGE\n$GADDRESS"; if ($GPULLDOWN eq "on") { $text .= "\n"; } $text .= "

    \n$GBODY_BOTTOM\<\/html>\n\n"; $text = &replace_str ($text); $text } ################################################# sub create_sub_head #** 個別インデクス・ヘッダ部生成 ################################################# { my ($top, $key, $fkey, $navi, $sub, $path, $keyitem) = @_; my ($text, $date, $map_gif, $map_jpg, $machine, $text1, $text2, $map_txt, $robot); $text = $GDOCTYPE; $text .= "\n\n"; $text .= $GTHIS_POPCORN; $text .= &arrange_metatags(3, $keyitem); # 01/08/14 NANDRA $text .= "$key\\n"; if ($GSTYLE ne "") { $text .= "$GSTYLE\n"; } #00/09/15 $text .= $GHEAD_STR; $text .= "\n"; $machine = $GMACHINE; if ($GPULLDOWN eq "on") { $text .= &pulldown_head; } $text .= "\n"; $text .= "$GBODY_TOP"; if ($GPULLDOWN eq "on") { $text .= "

    \n"; } if ($navi ne "" && $GHEAD_NAVI ne "no") { $text .= "$navi\n$GLINE_PAGE\n"; } #98/01/28修正 $text .= $GPAGE_TOP; #99/12/12追加 $text .= "
    \n$top\\n$GLINE2_PAGE\n"; if ($GADD_INFO ne "") { $text .= "$GADD_INFO\n
    \n"; } #追加情報表示 #99/08/30追加 $text .= "

    $key\

    \n

    \n\n"; if ($fkey ne "") { # 2001/05/13 NANDRA サブルーチン化 $text .= &image_txt_insert ($path, $sub, $fkey); } $date = &getdate2("/"); #if ($date ne "" && $GHEAD_DATA eq "no") { # $text .= "($GTXT2: " . $date . ")\n"; #} #98/01/28修正 if ($date ne "") { $text .= "($GTXT2: " . $date . ")\n"; } #98/01/28修正 $text .= "

    \n"; $text .= "$GLINE_PAGE\n"; $text = &replace_str ($text); $text } ################################################# sub create_sub_foot #** 個別インデクス・フッタ部生成 ################################################# { my ($navi) = @_; my ($text, $date, $s_url, $s_title, $tag_ext1, $tag_ext2); $navi = "
    \n$navi"; #00/11/03 $text = ""; $text .= $GPAGE_BOTTOM; #99/12/12追加 if ($GADD_INFO_BODY2 ne "") { $text .= "$GADD_INFO_BODY2\n
    \n"; } #追加情報表示 #99/10/06追加 $text .= "$GLINE_PAGE\n"; $text .= "$navi\n"; ($s_url, $s_title) = split (/\t/, $GADD_NAVI); if ($s_url ne "") { $text .= "$s_title\\n"; } if ($GADD_NAVI2 ne "") { $text .= $GADD_NAVI2; } #00/09/12追加 $text .= "$GLINE2_PAGE\n"; $text .= "$GADDRESS" . "

    \n"; if ($GPULLDOWN eq "on") { $text .= "

    \n"; } $text .= "$GBODY_BOTTOM\<\/html\>\n\n"; $text = &replace_str ($text); $text } ################################################# sub image_txt_insert #** インデクスヘッダへの画像・テキスト挿入 2001/05/13 NANDRA ################################################# { my ($path, $sub, $fkey) = @_; my ($return, $map_jpg, $map_gif, $map_txt, $text1, $text2); $text1 = $text2 = ""; #ヘッド部への画像取り込み $map_jpg = "$path" . "jpg/map/$sub/$fkey.jpg"; $map_jpg = &conv_path ($map_jpg); if (-e "$map_jpg") { $text1 = "
    \n"; } else { $map_gif = "$path" . "gif/map/$sub/$fkey.gif"; $map_gif = &conv_path ($map_gif); if (-e "$map_gif" && $GHEAD_MAP ne "no") { #98/01/28修正 $text1 = "
    \n"; } else { $map_gif = "$path" . "gif/map/$fkey.gif"; $map_gif = &conv_path ($map_gif); if (-e "$map_gif" && $GHEAD_MAP ne "no") { #98/01/28修正 $text1 = "
    \n"; } } } #ヘッド部へのテキスト取り込み #99/12/28追加 $map_txt = "$path" . "txt/map/$sub/$fkey.txt"; $map_txt = &conv_path ($map_txt); if (-e "$map_txt") { $text2 = &text_from_file("$map_txt", "txt"); } $return = ""; if ($text1 ne "" && $text2 ne "") { $return .= "\n\n\n\n\n
    \n"; $return .= $text1; $return .= "\n"; $return .= $text2; $return .= "
    \n"; } else { if ($text1 ne "" && $text2 eq "") { $return .= $text1; } if ($text1 eq "" && $text2 ne "") { $return .= $text2; } } $return } ################################################# sub g_navi #** グローバルナビゲーション作成 ################################################# { my ($text, $keyitem, $dir, $name, $s_url, $s_title, $menu); ($s_url, $s_title) = split (/\t/, $GSEARCH); $text = ""; #00/09/15 $text .= "\n\n\n\n
    \n"; $text .= "\n\n\n\n
    \n" . "\n"; if ($GHOME_OTHER ne "") { #98/08/10修正 $text .= "[ $GTXT0\"; } else { if ($GHOMEDIR eq "") { $text .= "[ $GTXT0\"; } else { $text .= "[ $GTXT0\"; } } if ($GPULLDOWN eq "on") { $text .= "| "; foreach $keyitem (@GINDEX_KEY) { if ($keyitem eq "cat") { $menu = $GMENU_CAT; } if ($keyitem eq "region") { $menu = $GMENU_REGION; } if ($keyitem eq "abc") { $menu = $GMENU_ABC; } if ($keyitem eq "idx_opt1") { $menu = $GMENU_OPT1; } if ($keyitem eq "idx_opt2") { $menu = $GMENU_OPT2; } if ($keyitem eq "idx_opt3") { $menu = $GMENU_OPT3; } # 05.03.21 PopCorn WG if ($keyitem =~ m/idx_opt/) { $tmp_key_num = $keyitem; $tmp_key_num =~ s/idx_opt//; $menu = $GMENU_OPT[$tmp_key_num]; } if ($keyitem eq "date") { $menu = $GMENU_DATE; } if ($keyitem eq "update") { $menu = $GMENU_UPDATE; } $text .= "$menu"; } } else { foreach $keyitem (@GINDEX_KEY) { $dir = &get_atom ($keyitem, "DIR"); $name = &get_atom ($keyitem, "SHORT_NAME"); $text .= " | $name\"; } } if ($s_url ne "") { $text .= " | $s_title\"; } if ($GNAVI_PART1 ne "") { $text .= &edit_navi_parts($GNAVI_PART1); } #2001/09/16 Maekawa if ($GNAVI_PART2 ne "") { $text .= &edit_navi_parts($GNAVI_PART2); } #2001/09/16 Maekawa if ($GNAVI_PART3 ne "") { $text .= &edit_navi_parts($GNAVI_PART3); } #2001/09/16 Maekawa if ($GNAVI_PART4 ne "") { $text .= &edit_navi_parts($GNAVI_PART4); } #2001/09/16 Maekawa if ($GNAVI_PART5 ne "") { $text .= &edit_navi_parts($GNAVI_PART5); } #2001/09/16 Maekawa $text .= " ]\n"; #00/09/15 $text .= "\n
    \n
    \n"; $text } ################################################# sub edit_navi_parts #** ナビゲーション・パーツ編集 2001/09/16追加 Maekawa ################################################# { my ($parts) = @_; my ($navi, $url, $anchor); ($url, $anchor) = split (/\t/, $parts); $navi = " | $anchor"; $navi } ################################################# sub form_start #** form開始点タグ書き換え 98/04/18追加 ################################################# { my ($text); $text = "\n\n"; $text; } ################################################# sub form_end #** form終了点タグ書き換え 98/04/18追加 ################################################# { my ($text); $text = "\n
    \n"; $text .= "
    \n\n"; #####タイトル##### $text .= "

    $GTITLE\

    \n

    \n"; #####トップ画像##### #02/04/20ここ以降大幅変更 $text .= "\n"; $text .= "
    \n"; #02/04/23 Maekawa #####ヘッドライン行##### # $text .= "\n"; $text .= "\n"; #####目次出力##### $text .= "\n"; if ($GPULLDOWN eq "on") { $type = "pulldown"; } else { $type = "normal"; } #02/03/27 Maekawa $text .= "\n"; #####目次ヘッド行出力##### $text .= "
    "; $text .= ""; $text .= "$GTXT8"; $text .= "
    \n"; #####目次データ行出力##### $text .= "\n"; $cnt = 1; foreach $idx_key (@GINDEX_KEY) { #02/03/27キー指定順に指定キーのみインデクス目次を生成 if ($cnt ==1) { #データ行奇数行属性 $attrib = "bgcolor=\"$GLINE_COLOR\""; } else { #データ偶数行属性 $attrib = "bgcolor=\"beige\""; } $idx_dir = &get_atom ($idx_key,"DIR"); $idx_title = &get_atom ($idx_key,"NAME"); if ($idx_dir ne "") { $text .= "\n"; $text .= "\n"; } $cnt++; if ($cnt >= 3) { $cnt = 1; } } $text .= "
    $idx_title\\n\n"; if ($idx_key eq "cat" && $type eq "pulldown" && $GNEWFKEY ne "") { $text .= " $GNEWINFO\ $tag_new"; } #02/02/22#2002/05/06 NANDRA $text .= "\n
    \n
    \n"; #####件数出力##### $text .= "

    \n(\n"; if ($GLANGUAGE eq "") { $text .= "最終更新日:\n"; } else { $text .= ":-LastUpdate-::\n"; } $text .= "$today\n:\n" . "\n$GTXT1S \n"; $text .= "\n $GTXT1S )

    \n

    \n\n"; # 2001/11 NANDRA $text .= "$GLINE_PAGE\n"; $text .= "
    \n"; #####テキストブロック##### # $text .= "\n"; $text .= "\n"; #####フッタ出力##### $text .= "\n"; #02/04/20無条件処理に変更 $text .= $GPAGE_BOTTOM; #99/12/12追加 $text .= "$GLINE_PAGE\n$GADDRESS\n

    \n"; $text .= "

    \n"; $text .= "$GBODY_BOTTOM\<\/html\>\n"; $text = &replace_str ($text); #2001/11 NANDRA print FILE_TOP $text; close (FILE_TOP); } } ################################################# sub create_toppage_expand #** トップページ新規作成(拡張版) # 2002/03/23 NANDRA 新規 ################################################# { my ($topfile) = @_; my ($text, $idx_dir, $idx_title, $rsub,$tag_new, $today, $file_out, $file_in, $switch); $this_path = &path_file($topfile); #02/01/07 Maekawa ($this_path) = split (/\t/, $this_path); #02/01/07 Maekawa &check_dir($this_path); #02/01/07 Maekawa #topconf.datファイルが無い場合は新規生成 $file_out = $this_path . $GMASTER . $GDELIMITER . $GTOPCONF; unless (-e $file_out) { open (FILE_TOP, ">$file_out") || output_msg("POP-E014", $file_out); print FILE_TOP &topconf_def; close (FILE_TOP); } # $GINDEX_TEMPLATEの値によって: # 雛形ファイルの指定あり → それをindex.htmlにリネームコピー # 指定された雛形ファイルが無い場合 → エラー # "default","デフォルト"の場合 → デフォルト雛形からindex.html # を作り出す # 雛形ファイルの指定なし → デフォルト雛形からindex.htmlを作り出す #2002/05/06変更 NANDRA if ($GINDEX_TEMPLATE ne "") { if($GINDEX_TEMPLATE ne "default" && $GINDEX_TEMPLATE ne "デフォルト") { $switch = "file"; # 指定された雛形ファイル使用 } else { $switch = "default"; # デフォルト雛形使用 } } else { $switch = "default"; # デフォルト雛形使用 } if ($switch eq "file") { $file_in = $this_path . $GINDEX_TEMPLATE; open (FIN, $file_in) || output_msg("POP-E007", "sub:create_toppage_expand $file_in"); open (FILE_TOP, ">$topfile") || output_msg("POP-E014", $topfile); while () { print FILE_TOP $_; } close (FIN); close (FILE_TOP); } elsif ($switch eq "default") { open (FILE_TOP, ">$topfile") || output_msg("POP-E014", $topfile); print FILE_TOP &tophtml_def; close (FILE_TOP); } } ################################################# sub path_file #** パス・ファイル名分割返却 #00/03/16修正 ################################################# { my ($path_file, $level) = @_; my (@path_array, $dir, $i, $cnt); &machine; if ($level eq "") { $level = 2; } #01/04/23修正 $path_file = &conv_path($path_file); #2001/09/24 Maekawa if ($GMACHINE eq "mac") { $path_file =~ s/\:/\//g; } #2001/09/25 Maekawa $path_file =~ s/\\/\//g; @path_array = split (/\//, $path_file); $cnt = @path_array; $cnt = $cnt - $level; #01/04/23修正 foreach ($i = 0; $i <= $cnt; $i++) { $dir .= $path_array[$i] . $GDELIMITER; } $i++; "$dir\t$path_array[$cnt]" } ################################################# sub update_toppage_num #** トップページ件数その他更新 ### &update_toppage_num ($path, $sum, $sum_new, $tag_new); ################################################# { my ($path, $sum, $sum_new, $tag_new, $target_file) = @_; #03/01/20 Maekawa. $target_fileを追加。 my ($topfile, $status, $delimiter, $text, $date, $dir, $idx_dir, $numc, $mime, $file, $fpath, $tmp_path); # 拡張版かどうかのチェック (03/03/12) PopCorn WG # $delimiter = $GDELIMITER; $tmp_path = "$path" . "files"; #2003/03/15 Maekawa if ($GENHANCED ne "" || -e $tmp_path) { $fpath = "files$delimiter"; } else { $fpath = ""; } if ($GHOMEDIR eq "") { if ($target_file eq "") { $topfile = "$path$GHOME"; $tag_new =~ s/\.\.\///g; } else { $topfile = "$path$target_file"; $tag_new =~ s/\.\.\///g; } } else { if ($target_file eq "" ) { $topfile = "$path$GHOMEDIR$delimiter$GHOME"; } else { $topfile = "$path$GHOMEDIR$delimiter$target_file"; } } if ($GHOMEDIR ne "") { $dir = "$path$GHOMEDIR"; &check_dir ($dir); } $idx_dir = &get_atom ("cat","DIR"); $text = ""; $date = &getdate2("/"); #トップページが存在しない時は、トップページを生成する。#98/01/17追加 unless (-e "$topfile") { &create_toppage ($topfile); } open (FILE_TOP, "$topfile") || output_msg("POP-E007", "sub:update_toppage_num $topfile"); while () { $status = ""; if (/--image--/) { #02/04/21トップページ画像 $status = "done"; $text .= "\<\!--image--\>"; $file = $GPATH_LOCAL . "jpg" . $GDELIMITER . "$GSITE.jpg"; $mime = "jpg"; unless (-e $file) { $file = $GPATH_LOCAL . "gif" . $GDELIMITER . "$GSITE.gif"; $mime = "gif"; } if (-e $file) { # (2003/02/21) $text .= "
    " . "
    \n"; } #$text .= "
    \n"; } if (/--headline start--/) { #02/04/21ヘッドライン行 $status = "done"; while () { last if (/--headline end--/); } $text .= "\<\!--headline start--\>\n"; $file = $GPATH_LOCAL . "txt" . $GDELIMITER . $GSITE . "1.txt"; if (-e $file) { $text .= &text_from_file ($file); } $text .= "\n"; $text .= "\<\!--headline end--\>\n"; } if (/--textblock start--/) { #02/04/21テキストブロック $status = "done"; while () { last if (/--textblock end--/); } $text .= "\<\!--textblock start--\>\n"; $file = $GPATH_LOCAL . "txt" . $GDELIMITER . $GSITE . "2.txt"; if (-e $file) { $text .= &text_from_file ($file); } $text .= "\n"; $text .= "\<\!--textblock end--\>\n"; } if (/--sum--/) { $status = "done"; $numc = &num_comma ($sum); $text .= "\<\!--sum--\>$numc\n"; } if (/--numbers--/) { $status = "done"; $numc = &num_comma ($sum); $text .= "\<\!--numbers--\>$numc\n"; } if (/--new--/) { $status = "done"; $numc = &num_comma ($sum_new); $text .= "\<\!--new--\> $tag_new $numc\n"; } if (/--date--/) { $status = "done"; $text .= "\<\!--date--\>$date\n"; } #99/03/13追加 if (/--sum\=$idx_dir--/) { $status = "done"; $numc = &num_comma ($sum); $text .= "\<\!--sum\=$idx_dir--\>$numc\n"; } if (/--numbers\=$idx_dir--/) { $status = "done"; $numc = &num_comma ($sum); $text .= "\<\!--numbers\=$idx_dir--\>$numc\n"; } if (/--new\=$idx_dir--/) { $status = "done"; $numc = &num_comma ($sum_new); $text .= "\<\!--new\=$idx_dir--\> $tag_new $sum_new\n"; } if (/--date\=$idx_dir--/) { $status = "done"; $text .= "\<\!--date\=$idx_dir--\>$date\n"; } if ($status ne "done") { $text .= "$_"; } } close (FILE_TOP); open (FILE_TOP, ">$topfile") || output_msg("POP-E017", $topfile); print FILE_TOP $text; close (FILE_TOP); $GSUM_COUNTER = $sum; } ################################################# sub update_toppage_clips #** トップページ・映像クリップ件数更新 #97/06/28追加 ### &update_toppage_clips ($path, $sum, $target_file); ################################################# { #02/12/29$target_file(書き込み対象のファイル指定)追加 my ($path, $sum, $target_file) = @_; my ($topfile, $status, $delimiter, $text, $date, $idx_dir, $sum_all, $sum_page, $dummy, $numc); $delimiter = $GDELIMITER; if ($GHOMEDIR eq "") { if ($target_file eq "") { $topfile = "$path$GHOME"; } else { $topfile = "$path$target_file"; } } else { if ($target_file eq "") { $topfile = "$path$GHOMEDIR$delimiter$GHOME"; } else { $topfile = "$path$GHOMEDIR$delimiter$target_file"; } } $idx_dir = &get_atom ("cat","DIR"); $text = ""; unless (-e "$topfile") { &create_toppage ($topfile); } #02/01/07 open (FILE_TOP, $topfile) || output_msg("POP-E007", "sub:update_toppage_clips $topfile"); while () { $sum_all = 0; $status = ""; if (/--subpages--/ || /--clips--/) { $status = "done"; $numc = &num_comma ($sum); $text .= "<\!--clips-->$numc\n"; } #99/03/13追加 if (/--subpages\=$idx_dir--/ || /--clips\=$idx_dir--/) { $status = "done"; $numc = &num_comma ($sum); $text .= "<\!--clips\=$idx_dir-->$numc\n"; } if (/--sum--/) { $status = "done"; chop; $sum_all = $GSUM_COUNTER + $sum; $numc = &num_comma ($sum_all); $text .= "\<\!--sum--\>$numcl\n"; } if (/--sum\=$idx_dir--/) { $status = "done"; chop; $sum_all = $GSUM_COUNTER + $sum; $numc = &num_comma ($sum_all); $text .= "\<\!--sum\=$idx_dir--\>$numcl\n"; } if ($status ne "done") { $text .= "$_"; } } close (FILE_TOP); open (FILE_TOP, ">$topfile") || output_msg("POP-E017", $topfile); if ($GFILTER_TO_TOP eq "2") { $text = &replace_str ($text); } print FILE_TOP $text; close (FILE_TOP); } ################################################# sub update_toppage_navi #** トップページ目次ナビ更新 #97/06/15追加, 98/04/12修正, 2001/05/13修正(NANDRA), 2002/03/23修正(NANDRA)トップ拡張機能に対応 ### &update_toppage_navi ($keyitem, $path, $sub, $sub_navi, $target_file); ################################################# { #02/12/29$target_file追加 my ($keyitem, $path, $sub, $sub_navi, $target_file) = @_; #2001/05/13 NANDRA ($addtext追加) 2002/03/23 NANDRA ($tagstr追加) my ($topfile, $status, $delimiter, $topfile, $text, $addtext, $date, $menu, $tagstr); $delimiter = $GDELIMITER; if ($GHOMEDIR eq "") { #02/12/29$target_file対応 if ($target_file eq "") { $topfile = "$path$GHOME"; } else { $topfile = "$path$target_file"; } } else { if ($target_file eq "") { $topfile = "$path$GHOMEDIR$delimiter$GHOME"; } else { $topfile = "$path$GHOMEDIR$delimiter$target_file"; } } $text = ""; $sub =~ s/\///g; $sub =~ s/://g;; $sub =~ s/\\//g; $sub_navi =~ s/\[\ \ \|/\[/; if ($GHOMEDIR eq "") { $sub_navi =~ s/\.\.\///g; } unless (-e "$topfile") { &create_toppage ($topfile); } #02/01/07 open (FILE_TOP, $topfile) || output_msg("POP-E007", "sub:update_toppage_navi $topfile"); if ($GUSE_TOPCONF eq "on") { # トップ拡張機能onのときはタグ文字列を変える 2002/03/23 NANDRA $tagstr = "navi::" . $keyitem; } else { $tagstr = $sub; } while () { $status = ""; $addtext = ""; #2001/05/13 NANDRA if (/--$tagstr--/ || /--$tagstr:normal--/ || /--$tagstr:pulldown--/) { $status = "done"; #if ($GPULLDOWN eq "on") if ((/--$tagstr--/ && ($GPULLDOWN eq "on")) || (/--$tagstr:pulldown--/)) { #01/03/18 if ($keyitem eq "cat") { $menu = $GMENU_CAT; } if ($keyitem eq "region") { $menu = $GMENU_REGION; } if ($keyitem eq "abc") { $menu = $GMENU_ABC; } if ($keyitem eq "date") { $menu = $GMENU_DATE; } if ($keyitem eq "update") { $menu = $GMENU_UPDATE; } # if ($keyitem eq "idx_opt1") { $menu = $GMENU_OPT1; } # if ($keyitem eq "idx_opt2") { $menu = $GMENU_OPT2; } # if ($keyitem eq "idx_opt3") { $menu = $GMENU_OPT3; } # 05.03.31 PopCorn WG if ($keyitem =~ m/idx_opt/){ $tmp_num = $keyitem; $tmp_num =~ s/idx_opt//; $menu = $GMENU_OPT[$tmp_num]; } if ($GHOMEDIR eq "") { $menu =~ s/\.\.\///g; } $menu =~ s/\n//g; if (/--$tagstr:pulldown--/) { #01/03/18 #2001/05/13 NANDRA $addtext = "<\!--$tagstr:pulldown-->$menu\n"; } else { $addtext = "<\!--$tagstr-->$menu\n"; } #01/03/18 #2001/05/13 NANDRA } else { if (/--$tagstr:normal--/) { #01/03/18 if ($sub_navi eq "[ ]") { #2001/05/13NANDRA $addtext = "<\!--$tagstr:normal-->\n"; } else { $sub_navi =~ s/\n//g; $addtext = "<\!--$tagstr:normal-->
    " . "$sub_navi\

    \n"; } #00/11/20 #2001/05/13NANDRA } else { if ($sub_navi eq "[ ]") { $addtext = "<\!--$tagstr-->\n"; } else { $sub_navi =~ s/\n//g; $addtext = "<\!--$tagstr-->
    " . "$sub_navi\

    \n"; } #00/11/20 #2001/05/13NANDRA } } if ($GFILTER_TO_TOP eq "1") { $addtext = &replace_str ($addtext); } #2001/05/12 NANDRA トップファイルにもフィルター処理を適用 } if ($status ne "done") { $addtext = "$_"; } #2001/05/13NANDRA $text .= $addtext; #2001/05/13NANDRA } close (FILE_TOP); open (FILE_TOP, ">$topfile") || output_msg("POP-E017", $topfile); print FILE_TOP $text; close (FILE_TOP); } ################################################# sub update_toppage_other #** トップページ更新機能拡張 # 2002/02/11追加(NANDRA) ### &update_toppage_other ($path); ################################################# { my ($path, $target_file) = @_; #02/12/29$target_file追加 my ($topfile, $status, $delimiter, $text, $idx_dir, $temptxt, $file_in, @topparam1, @topparam2, @topparam3); $delimiter = $GDELIMITER; $topparam1 = $topparam2 = $topparam3 = (); @topparam1 = (); @topparam2 = (); @topparam3 = (); if ($GHOMEDIR eq "") { $topfile = "$path$GHOME"; } else { $topfile = "$path$GHOMEDIR$delimiter$GHOME"; } if ($GHOMEDIR eq "") { #02/12/29$target_file対応 if ($target_file eq "") { $topfile = "$path$GHOME"; } else { $topfile = "$path$target_file"; } } else { if ($target_file eq "") { $topfile = "$path$GHOMEDIR$delimiter$GHOME"; } else { $topfile = "$path$GHOMEDIR$delimiter$target_file"; } } $idx_dir = &get_atom ("cat","DIR"); $text = ""; #topconf.datファイルの読み込み $file_in = $path . $GMASTER . $GDELIMITER . $GTOPCONF; if (-e $file_in) { open (FIN, $file_in) || output_msg("POP-E007", "sub:update_toppage_other \$file_in:$file_in"); while () { last if (/^END/); chop; next if /^#/; ($str0, $str3) = split (/\=/, $_); ($str1, $str2) = split (/\./, $str0); push (@topparam1, $str1); push (@topparam2, $str2); push (@topparam3, $str3); } push (@topparam1, "END_OF_TOPCONF_DATA"); } unless (-e "$topfile") { &create_toppage ($topfile); } open (FILE_TOP, $topfile) || output_msg("POP-E007", "sub:update_toppage_other \$topfile:$topfile"); while () { if ($status ne "ignore") { $status = "thru"; } #===この7行はテンプレートです=== # if (/--hogehoge--/) # { # 更新位置タグの種類をここに指定 # $status = "subst"; # 置換処理済フラグを立てる # $temptxt = "HOGEHOGE"; # 置換先となる文字列をここで定義 # # 出力用変数に追加書き # $text .= "<\!--hogehoge-->$temptxt\n"; # } if (/--add2head--/) { $status = "ignore"; # 置換処理済フラグをignoreにする $temptxt = ""; $temptxt .= $GTHIS_POPCORN; $temptxt .= &arrange_metatags(1, ""); $temptxt .= "$GTITLE\\n"; if ($GSTYLE ne "") { $temptxt .= "$GSTYLE\n"; } $temptxt .= $GHEAD_STR; $temptxt .= "\n"; if ($GPULLDOWN eq "on") { $temptxt .= &pulldown_head; } $text .= "<\!--add2head-->\n$temptxt\n"; # 出力用変数に追加書き } if (/\/head/ || /\/HEAD/) { $status = "thru"; # 置換処理済フラグをthruにもどす } if (/--gtitle--/) { $status = "subst"; $temptxt = $GTITLE; $text .= "<\!--gtitle-->$temptxt\n"; } if (/--newinfo--/) { my ($tag_new, $rsub); $status = "subst"; # 置換処理済フラグを立てる $tag_new = $GTAG_NEW; if ($GHOMEDIR eq "") { $rsub = ""; $tag_new =~ s/\.\.\///g; } else { $rsub = "../"; } if ($GNEWFKEY ne "") { $temptxt = "$GNEWINFO\ $tag_new"; } else { $temptxt = ""; } $text .= "<\!--newinfo-->$temptxt\n"; # 出力用変数に追加書き } if (/--indextitle::/) { $status = "subst"; if ($GHOMEDIR eq "") { $rsub = ""; } else { $rsub = "../"; } ($dummy, $keyitem) = split (/--indextitle::/, $_); ($keyitem, $dummy) = split (/--/, $keyitem); $temptxt = &get_atom ($keyitem,"NAME"); $tempurl = &get_atom ($keyitem,"DIR"); $text .= "<\!--indextitle::$keyitem-->"; # 出力用変数に追加書き if ($tempurl ne "") { $text .= "$temptxt\\n"; } else { $text .= "\n"; } } if (/--img::/ || /--msg::/) { $status = "subst"; $temptxt = ""; $srcparam = ""; $textparam = ""; $widthparam = ""; $heightparam = ""; $borderparam = ""; $boldparam = ""; $italicparam = ""; $hrefparam = ""; $otherparam = ""; if (/--img::/) { $imgmsg = "img"; } else { $imgmsg = "msg"; } ($dummy, $objname) = split (/::/, $_); ($objname, $dummy) = split (/--/, $objname); for ($i = 0 ; $i < 1000 ; $i++) { last if ($topparam1[$i] eq "END_OF_TOPCONF_DATA"); if ($topparam1[$i] eq $objname) { if ($topparam2[$i] eq "") { if ( $imgmsg eq "img") { $srcparam = "src=\"$topparam3[$i]\" "; } else { $textparam = $topparam3[$i]; } } elsif ($topparam2[$i] eq "src") { $srcparam = "src=\"$topparam3[$i]\" "; } elsif ($topparam2[$i] eq "href") { $hrefparam = "href=\"$topparam3[$i]\" "; } elsif ($topparam2[$i] eq "width") { $widthparam = "width=\"$topparam3[$i]\" "; } elsif ($topparam2[$i] eq "height") { $heightparam = "height=\"$topparam3[$i]\" "; } elsif ($topparam2[$i] eq "border") { $borderparam = "border=\"$topparam3[$i]\" "; } elsif ($topparam2[$i] eq "bold") { $boldparam = $topparam3[$i]; } elsif ($topparam2[$i] eq "italic") { $italicparam = $topparam3[$i]; } elsif ($topparam2[$i] eq "text") { if ( $imgmsg eq "img") { $altparam = "alt=\"$topparam3[$i]\" "; } else { $textparam = $topparam3[$i]; } } else { $otherparam .= "$topparam2[$i]=\"$topparam3[$i]\" "; } } } if ($imgmsg eq "img" && $srcparam ne "") { $temptxt = ""; } elsif ($textparam ne "") { $temptxt = $textparam; if ($boldparam eq "yes") { $temptxt = "" . $temptxt . "<\/b>"; } if ($italicparam eq "yes") { $temptxt = "" . $temptxt . "<\/i>"; } } if ($hrefparam ne "") { $temptxt = "" . $temptxt . "<\/a>"; } $text .= "<\!--" . $imgmsg . "::" . $objname . "-->$temptxt\n"; } # Hide If NULL タグ 2002/02/24 NANDRA if (/--HIN::/ || /--HIN_BEGIN::/ || /--HIN_END::/ || /--XHIN::/) { $status = "subst"; # 置換処理済フラグを立てる ($dummy, $objname) = split (/::/, $_, 2); ($objname, $temptxt) = split (/--/, $objname, 2); ($dummy, $temptxt) = split (/>/, $temptxt, 2); $dummy = ""; # パラメータがインデクス種別の場合 2002/03/23 NANDRA if ($objname eq "cat" || $objname eq "region" || $objname eq "date" || $objname eq "update" || $objname eq "idx_opt1") { $dummy = $GINDEX_DATA {$objname}; } else { # パラメータがtopconfオブジェクトの場合 for ($i = 0 ; $i < 1000 ; $i++) { last if ($topparam1[$i] eq "END_OF_TOPCONF_DATA"); if ($topparam1[$i] eq $objname) { if ($topparam2[$i] eq "" || $topparam2[$i] eq "text" || $topparam2[$i] eq "src") { $dummy .= $topparam3[$i]; } } } } # 元テキスト文字列の処理 ($temptxt_a, $temptxt_b) = split(/--\[\[/, $temptxt, 2); if ($temptxt ne $temptxt_a) { ($temptxt, $temptxt_a) = split(/\]\]--/, $temptxt_b, 2); } else { ($temptxt, $temptxt_b) = split(/\n/, $temptxt, 2); } if (/--HIN::/) { if ($dummy eq "") { # 該当オブジェクトが空だった場合 $text .= "<\!--HIN::" . $objname . "-->\n"; } else { # 該当オブジェクトが有効な場合 $text .= "<\!--HIN::" . $objname . "-->$temptxt\n"; } } elsif (/--XHIN::/) { #2002/05/06 NANDRA (HINの逆。該当オブジェクトが有効な場合に #コメントアウトする) if ($dummy ne "") { # 該当オブジェクトが有効な場合 $text .= "<\!--XHIN::" . $objname . "-->\n"; } else { # 該当オブジェクトが空だった場合 $text .= "<\!--XHIN::" . $objname . "-->$temptxt\n"; } } elsif (/--HIN_BEGIN::/) { if ($dummy eq "") { # 該当オブジェクトが空だった場合 $text .= "<\!--HIN_BEGIN::" . $objname . "--\n"; } else { # 該当オブジェクトが有効な場合 $text .= "<\!--HIN_BEGIN::" . $objname . "-->\n"; } } else { if ($dummy eq "") { # 該当オブジェクトが空だった場合 $text .= "--HIN_END::" . $objname . "-->\n"; } else { # 該当オブジェクトが有効な場合 $text .= "<\!--HIN_END::" . $objname . "-->\n"; } } } if (/--navi::/) { # 2002/03/23 NANDRA 無効な目次ナビを除去 ($dummy, $objname) = split (/::/, $_, 2); ($objname, $dummy) = split (/--/, $objname, 2); if ($GINDEX_DATA {$objname} eq "") { $status = "subst"; $text .= "<\!--navi::$objname-->\n"; } } if ($status eq "thru") { $text .= "$_"; } } close (FILE_TOP); open (FILE_TOP, ">$topfile") || output_msg("POP-E017", $topfile); if ($GFILTER_TO_TOP eq "2") { $text = &replace_str ($text); } #2001/05/12 NANDRA トップファイルにもフィルター処理を適用 print FILE_TOP $text; close (FILE_TOP); } ################################################# sub set_key_update #** 登録年月キーリスト作成 97/06/03追加 ###LISTファイルから重複のない年月のリストをグローバル変数にセットする。 ###&set_key_update ("mmdb:kasumigaura:", "kasumigaura.list", "mac"); ################################################# { #重複分削除抽出 my ($path, $file_list) = @_; my ($delimiter, @list, @return, $date, $yymm, $yymm_old, $i, $machine, %assoc_key, @array_key, $yymm1, $yymm2, $idx_data); &machine; $delimiter = $GDELIMITER; $file_list = $path . $GMASTER . $delimiter . $file_list . "3"; #3は登録日降順リストファイル $yymm = $yymm_old = ""; if ($file_list eq "") { output_msg("POP-E011"); } open (FIN, $file_list) || output_msg("POP-E007", "sub:set_key_update $file_list"); while () { chop; ($date) = split (/\t/,$_); if ($GUPDATE_OPTION eq "by-date") { $yymm = $date; } else { $yymm = &conv_date ($date, "yymm"); } if ($yymm ne $yymm_old) { push (@list, $yymm); } $yymm_old = $yymm; } close (FIN); #リスト作成(降順ソート、重複分をさらに削除) if ($GSORT_NAVI eq "reverse") { @list = reverse sort (@list); } else { @list = sort (@list); } $yymm = $yymm_old = ""; for ($i=0; $list[$i] ne ""; $i++) { $yymm = $list[$i]; if ($yymm ne $yymm_old) { if ($GUPDATE_OPTION eq "by-date") { $yymm1 = &year_month ($yymm, "by-date"); } else { $yymm1 = &year_month ($yymm); } $yymm2 = $yymm; $yymm2 =~ s/\///g; if ($yymm1 ne "") { # $yymm1 1996年8月 / $yymm 1996/08 / $yymm2 199608 $assoc_key {$yymm1} .= "$yymm\t$yymm2"; push (@array_key, "$yymm1\t$yymm\t$yymm2"); } } $yymm_old = $yymm; } %GKEY_UPDATE = %assoc_key; @GARRAY_UPDATE = @array_key; $GMENU_UPDATE = &edit_pulldown_menu ($GINDEX_DATA {"update"}, @array_key); } ################################################# sub set_key_date #** 撮影年月キーリスト作成 97/06/10追加 ###LISTファイルのコメントデータから重複のない撮影年月のリストをセットする。 #&set_key_date ("mmdb:kasumigaura:", "kasumigaura.list"); ################################################# { #重複分削除抽出 my ($path, $file_list) = @_; my (@data, $delimiter, $date, %assoc_date, $file_mime, @records, $record, $machine, %assoc_key, @array_key, $yymm, $yymm1, $yymm2, $dummy, $clip_1st_file, $file_in, $mime, $fclip_file, $fclip_date, $start_file, $yy, $mm, $dd, $option); my ($site, $fpath, $frpath, $opt_path, $tmp_path); &machine; $delimiter = $GDELIMITER; # 拡張版の多階層ディレクトリ等に対応 (2003/02/20) # $fpath は filesディレクトリを含むパス。 # $frpath は filesディレクトリを含む相対パス。(UNIX形式) # $opt_pathはサイト毎のクリップファイル格納パス # ディレクトリチェック追加(03/03/12) $site = $GSITE; $tmp_path = "$path" . "files"; #2003/03/15 Maekawa if ($GENHANCED ne "" || -e $tmp_path ) { $fpath = "$path" . "files$delimiter"; #2003/03/15 Maekawa $frpath = "../files"; $opt_path = "$delimiter$site"; } else { $fpath = "$path"; $frpath = ".."; $opt_path = ""; } $file_list = $path . $GMASTER . $delimiter . $file_list; if ($file_list eq "") { output_msg("POP-E011"); } #2002/05/06 NANDRA "入力ファイルが設定されていません。 open (FIN, $file_list) || output_msg("POP-E007", "sub:set_key_date $file_list"); while () { @data = split (/\t/, $_); $comment = $data[8]; @records = split (/$GRET_CODE/, $comment); foreach $record (@records) { ($file_mime, $date, $clip_1st_file) = split (/$GTAB_CODE/, $record); $mime = &get_mime($file_mime); if ($file_mime eq "imageclip") { #マクロタグimageclipの時は第二要素がクリップファイル $file_mime = $date; $mime = &get_mime($file_mime); } else { if ($mime eq "ml" || $mime eq "clip") { $clip_1st_file = $date; } } if ($mime eq "ml" || $mime eq "clip") { #CLIPファイルから撮影年月を取得 # (2003/02/20) #$file_in = "$fpath$mime$opt_path$delimiter$file_mime"; #$file_in = &conv_path ($file_in); $file_in = &getClipAbsPath($path, $site, $file_mime); #03/07/13 Maekawa if (-e $file_in) { $start_file = $clip_1st_file; open (FCLIP, $file_in) || output_msg("POP-E007", "sub:set_key_date $file_in"); while ($_ = ) { ($fclip_file, $fclip_date) = split (/\t/, $_); $fclip_date = &conv_date ($fclip_date); if ($start_file eq "") { last; } if ($fclip_file eq $start_file) { last; } } $_ = $fclip_date; if (/^[0-9][0-9]\// || /^[0-9][0-9][0-9][0-9]\//) { #コメントから撮影年月を取得 # $yymm1 1996年8月 / $yymm 1996/08 / $yymm2 199608 ($yy, $mm, $dd) = split (/\//, &conv_date($_)); if ($GDATE_OPTION eq "by-date") { $yymm = $yy . "/". $mm . "/". $dd; } else { $yymm = $yy . "/". $mm; } next if (/^00\//); if ($assoc_date {$yymm} eq "") { $assoc_date {$yymm} .= $yymm; } } } } else { next if ($date eq ""); $_ = $date; if (/^[0-9][0-9]\// || /^[0-9][0-9][0-9][0-9]\//) { #コメントから撮影年月を取得 ($yy, $mm, $dd) = split (/\//, &conv_date($_)); if ($GDATE_OPTION eq "by-date") { $yymm = $yy . "/". $mm . "/". $dd; } else { $yymm = $yy . "/". $mm; } next if (/^00\//); if ($assoc_date {$yymm} eq "") { $assoc_date {$yymm} .= $yymm; } } } } } close (FIN); if ($GSORT_NAVI eq "reverse") { foreach $yymm (reverse sort keys (%assoc_date)) { if ($GDATE_OPTION eq "by-date") { $yymm1 = &year_month ($yymm, "by-date"); } else { $yymm1 = &year_month ($yymm); } $yymm2 = $yymm; $yymm2 =~ s/\///g; if ($yymm1 ne "") { $assoc_key {$yymm1} .= "$yymm\t$yymm2"; push (@array_key, "$yymm1\t$yymm\t$yymm2"); } } } else { foreach $yymm (sort keys (%assoc_date)) { if ($GDATE_OPTION eq "by-date") { $yymm1 = &year_month ($yymm, "by-date"); } else { $yymm1 = &year_month ($yymm); } $yymm2 = $yymm; $yymm2 =~ s/\///g; if ($yymm1 ne "") { $assoc_key {$yymm1} .= "$yymm\t$yymm2"; push (@array_key, "$yymm1\t$yymm\t$yymm2"); } } } %GKEY_DATE = %assoc_key; @GARRAY_DATE = @array_key; $GMENU_DATE = &edit_pulldown_menu ($GINDEX_DATA {"date"}, @array_key); } ################################################# sub set_clip_option #** クリップオプションリスト設定 99/11/01追加 ################################################# { my ($path) = @_; my ($file_in, $file_mime, $data); $file_in = $path . $GMASTER . $GDELIMITER . "clip_option.dat"; %GCLIP_OPT = (); if (-e $file_in) { open (FIN, $file_in); while () { last if (/^END/); chop; next if /^#/; ($file_mime, $data) = split (/\t/, $_); $GCLIP_OPT {$file_mime} .= $data; } close (FIN); } } ################################################# sub conv_num #** 数字固定桁数返却 97/08/29追加、99/03/13修正 ################################################# { my ($num, $keta) = @_; my ($num_c); $num = $num + 0; $num_c = $num; if ($keta == 2) { if ($num < 10) { $num_c = "0" . $num; } if ($num >= 10) { $num_c = $num; } } if ($keta eq "" || $keta == 3) { #省略時3桁 if ($num < 10) { $num_c = "00" . $num; } if ($num >= 10 && $num < 100) { $num_c = "0" . $num; } if ($num >= 100) { $num_c = $num; } } if ($keta == 4) { if ($num < 10) { $num_c = "000" . $num; } if ($num >= 10 && $num < 100) { $num_c = "00" . $num; } if ($num >= 100 && $num < 1000) { $num_c = "0" . $num; } if ($num >= 1000) { $num_c = $num; } } if ($keta == 5) { if ($num < 10) { $num_c = "0000" . $num; } if ($num >= 10 && $num < 100) { $num_c = "000" . $num; } if ($num >= 100 && $num < 1000) { $num_c = "00" . $num; } if ($num >= 1000 && $num < 10000) { $num_c = "0" . $num; } if ($num >= 10000) { $num_c = $num; } } $num_c } ################################################# sub num_comma #** 数字の位取り 99/03/13追加 ################################################# { my ($num) = @_; my ($len, $str, $a, $i); $num = $num + 0; $num = $num; $len = length ($num); $d = $len; for ($i = 1; $i <= $len; $i++) { $str = substr($num,$d,1) . $str; $d--; $a = $i % 3; if ($a == 1 && $i > 1) { $str = "," . $str; } } $str = substr($num,0,1) . $str; $str } ################################################# sub pulldown_head #** プルダウン・スクリプト返却 98/04/11追加 ################################################# { my ($text); $text = "\n"; $text } ################################################# sub pulldown_list #** プルダウン・選択肢テンプレート返却 98/04/11追加 ################################################# { my ($text); $text = ""; $text } ################################################# sub set_replace_str #** 置換文字列設定 ################################################# { my ($path) = @_; my ($file_in, $str1, $str2); $GFILTER1 = $GFILTER2 = (); $GFILTERING = "off"; @GFILTER1 = (); #00/03/03追加 # 2001/11 NANDRA 言語設定ファイルへの対応 if ($GLANGUAGE ne "") { $file_in = $path . $GMASTER . $GDELIMITER . $GLANGUAGE . ".dat"; if (-e $file_in) { open (FIN, $file_in) || output_msg("POP-E007", "sub:set_replace_str \$file_in:$file_in"); while () { last if (/^END/); chop; next if /^#/; ($str1, $str2) = split (/\t/, $_); if ($str1 eq "DATE_ORDER") { $GDATEFORMAT = $str2; } elsif ($str1 eq "MONTH_ORDER") { $GMONTHFORMAT = $str2; } elsif ($str1 eq "NAVI_BR") { $GNAVI_BR = $str2; } else { push (@GFILTER1, $str1); push (@GFILTER2, $str2); $GFILTERING = "on"; } } } } # 2001/05/12 NANDRA フィルターファイル名のG変数化 $file_in = $path . $GMASTER . $GDELIMITER . $GFILTER; if (-e $file_in) { open (FIN, $file_in) || output_msg("POP-E007", "sub:set_replace_str \$file_in:$file_in"); while () { last if (/^END/); chop; next if /^#/; ($str1, $str2) = split (/\t/, $_); push (@GFILTER1, $str1); push (@GFILTER2, $str2); $GFILTERING = "on"; } } } ################################################# sub replace_str #** 文字列置換 99/10/13追加 ################################################# { my ($text) = @_; my ($max, $i, $sw, @lines, $rep_start, $rep_end); #02/01/23 Maekawa $rep_start = "
    "; $rep_end = "<\/td><\/tr><\/table>"; $text =~ s/\<\/th\>\\<\/th\>\<\/tr\>/\<\/th\>\<\/tr\>/g; #00/03/03追加 $text =~ s/\<\/td\>\\<\/td\>\<\/tr\>/\<\/td\>\<\/tr\>/g; #00/03/03追加 $text =~ s/$GSOURCE_START\/$rep_start/g; #02/01/23 Maekawa $text =~ s/$GSOURCE_END\/$rep_end/g; #02/01/23 Maekawa $text =~ s/$GSOURCE_START\/$rep_start\/g; #02/01/23 Maekawa $text =~ s/$GSOURCE_END\/$rep_end\/g; #02/01/23 Maekawa if ($GFILTERING eq "on") { $max = @GFILTER1; $max--; for ($i = 0; $i <= $max; $i++) { $text =~ s/$GFILTER1[$i]/$GFILTER2[$i]/g; } } #else #00/03/03追加 #02/01/23elseブロック削除 $text } ################################################# sub replace_stylesheet #** スタイルシート部分置換 ################################################# { my ($line, $obj, $attrib, $value) = @_; my (@strs, $str, $newstr, $this); $line =~ s/\n/___/g; $line =~ s/\:/ \: /g; #$line =~ s/[A-Z]/[a-z]/g; $_ = $line; if (m/$obj(.+)/i) { $str = $1; @strs = split (/\;/, $str); $newstr = ""; foreach $this (@strs) { #print "$this\n"; $this =~ s/ $attrib(.+)/ $attrib: $value/i; $newstr .= "$this;"; } if ($newstr ne ";") { chop $newstr; } $_ =~ s/$str/$newstr/g; } $line = $_; $line =~ s/___/\n/g; $line; } ################################################# sub get_file_info #** ファイル情報取得 99/10/14追加 ################################################# { my ($file, $item) = @_; my ($dev, $ino, $mode, $nlink, $uid, $gid, $rdev, $size, $atime, $mtime, $ctime, $blksize, $blocks, $return); ($dev, $ino, $mode, $nlink, $uid, $gid, $rdev, $size, $atime, $mtime, $ctime, $blksize, $blocks) = stat ($file); if (-e $file) { if ($item eq "dev") { $return = $dev; } if ($item eq "ino") { $return = $ino; } if ($item eq "mode") { $return = $mode; } if ($item eq "nlink") { $return = $nlink; } if ($item eq "uid") { $return = $uid; } if ($item eq "gid") { $return = $gid; } if ($item eq "rdev") { $return = $rdev; } if ($item eq "size") { $return = $size; } if ($item eq "atime") { $return = $atime; } if ($item eq "mtime") { $return = $mtime; } if ($item eq "ctime") { $return = $ctime; } if ($item eq "blksize") { $return = $blksize; } if ($item eq "blocks") { $return = $blocks; } } else { $return = ""; } $return } ################################################# sub conv_size #** バイト数変換 99/10/14追加 ################################################# { #$kmg : "Bytes", "KB", "MB", "GB", "TB", ""(最適単位) my ($size, $kmg) = @_; my ($return, $n1, $n2, $n3); last if ($size eq ""); if ($kmg eq "Bytes") { $size = $size; } if ($kmg eq "KB") { $size = $size/(10**3); } if ($kmg eq "MB") { $size = $size/(10**6); } if ($kmg eq "GB") { $size = $size/(10**9); } if ($kmg eq "TB") { $size = $size/(10**12); } if ($kmg eq "") { if ($size < (10**3)) { $kmg = "Bytes"; } else { if ($size < (10**6)) { $size = $size/(10**3); $kmg = "KB"; } else { if ($size < (10**9)) { $size = $size/(10**6); $kmg = "MB"; } else { $size = $size/(10**9); $kmg = "GB"; } } } } ($n1, $n2) = split (/\./,$size); ($n2, $n3) = substr($n2, 0,1); $n1 = &num_comma ($n1); if ($kmg ne "Bytes" && $kmg ne "KB") { $n1 .= "\." . $n2; } if ($kmg eq "Bytes") { $kmg = " Bytes"; } $return = $n1 . $kmg; $return } ################################################# sub imageview_win #** 画像ウィンドウ表示JavaScript返却 #2004/01/27, #2004/04/29 scrolling, resizableに変更 ################################################# { return "var new1,win1p;\nfunction imageview (img,xv,yv)\n{\n\tif (win1p==\"on\")\n\t{\n\t\tif (new1.closed) {}\n\t\telse {new1.close();}\n\t}\n\twin1p = \"on\";\n\txw=xv+50;\n\tyw=yv+80;\n\tnew1=window.open(\"\", \"imgv\", \"resizable=1,scrollbars=1,width=\"+xw+\",height=\"+yw+\"\");\n\tif(navigator.appVersion.charAt(0)>=3){new1.focus()};\n\tnew1.document.clear();\n\tnew1.document.write(\"Image Viewer\");\n\tnew1.document.write(\"
    \");\n\tnew1.document.write(\"
    \")\n\tnew1.document.write(\"\");\n\tnew1.document.close();\n}\n"; } #================================================================== #** Part 3:日付処理サブルーチン #================================================================== ################################################# sub getdate #** 現在日付取得 形式:Jan. 19, 1997 ################################################# { my ($return,%mon_list,$sec,$min,$hour,$mday,$month,$year,$mon); %mon_list = (1,"Jan.",2,"Feb.",3,"Mar.",4,"Apr.",5,"May",6,"June", 7,"July",8,"Aug.",9,"Sep.",10,"Oct.",11,"Nov.",12,"Dec."); ($sec,$min,$hour,$mday,$month,$year) = localtime(time); $year = $year + 1900; #00/01/05修正 $month += 1; $mon = $mon_list {$month}; "$mon $mday, $year"; } ################################################# sub getdate2 #** 現在日付取得・デリミタ指定可 ### デフォルト:970122 getdate2("/")→"97/01/22" ################################################# { my ($dlmt) = @_; my ($sec,$min,$hour,$mday,$month,$year,$mon); ($sec,$min,$hour,$mday,$month,$year) = localtime(time); $year = $year + 1900; #00/01/05修正 $month += 1; if ($month < 10) { $month = "0" . $month; } if ($mday < 10) { $mday = "0" . $mday; } "$year$dlmt$month$dlmt$mday" } ################################################# sub getdatetime #** 現在日付時刻取得 #02/09/01追加 NANDRA ### 形式:2002/07/06 13:30:00 ################################################# { my ($sec,$min,$hour,$mday,$month,$year,$mon); ($sec,$min,$hour,$mday,$month,$year) = localtime(time); $year = $year + 1900; $month += 1; if ($month < 10) { $month = "0" . $month; } if ($mday < 10) { $mday = "0" . $mday; } "$year/$month/$mday $hour:$min:$sec" } ################################################# sub conv_date #** 2000年問題対応:西暦4桁変換 #98/02/27追加 ### conv_date ("97/01/22")→"1997/01/22" ################################################# { my ($date, $form) = @_; my ($conv_date, $yyyy, $yy, $mm, $dd, $chars); $date =~ s/\n//g; $date =~ s/\t//g; $date =~ s/ //g; if ($date eq "") { $date = "0000/00/00"; } $date =~ s/0/0/g; $date =~ s/1/1/g; $date =~ s/2/2/g; $date =~ s/3/3/g; $date =~ s/4/4/g; $date =~ s/5/5/g; $date =~ s/6/6/g; $date =~ s/7/7/g; $date =~ s/8/8/g; $date =~ s/9/9/g; $date =~ s///\//g; ($yy, $mm, $dd) = split (/\//, $date); $dd = substr ($dd, 0, 2); if ($dd < 0 || $dd > 31) { $dd = "00"; } if ($mm < 0 || $mm > 12) { $mm = "00"; } $mm = &conv_num ($mm, 2); $dd = &conv_num ($dd, 2); if ($yy <= 99 && $yy != 00) { if ($yy >= 50) { $yyyy = 1900 + $yy; } else { $yyyy = 2000 + $yy; } } else { if ($yy == 00 && $mm >= 01 && $mm <= 12) { $yyyy = 2000; } else { #00/01/05修正 $yyyy = $yy; } } if ($form eq "mmdd") { $conv_date = "$mm/$dd"; } else { if ($form eq "yymm") { $conv_date = "$yyyy/$mm"; } else { $conv_date = "$yyyy/$mm/$dd"; } } if ($conv_date eq "//") { $conv_date = ""; } if ($conv_date eq "0000/00/00") { $conv_date = ""; } $chars = substr ($dd, 0,3); #99/03/19修正 if ($chars eq "NAN") { $conv_date = ""; } $conv_date } ################################################# sub gettime #** 現在時刻取得 形式:20:50:30 ################################################# { my (%mon_list,$sec,$min,$hour,$mday,$month,$year,$mon); %mon_list = (1,"Jan.",2,"Feb.",3,"Mar.",4,"Apr.",5,"May",6,"June", 7,"July",8,"Aug.",9,"Sep.",10,"Oct.",11,"Nov.",12,"Dec."); $year += 1900; #99/12/04追加 ($sec,$min,$hour,$mday,$month,$year) = localtime(time); "$hour:$min:$sec" } ################################################# sub getolddate #** New表示のための2週前日付取得 ################################################# { my (@day_list,$sec,$min,$hour,$mday,$month,$year,$mon); @day_list = (0,31,28,31,30,31,30,31,31,30,31,30,31); ($sec,$min,$hour,$mday,$month,$year) = localtime(time); $year = $year + 1900; #00/01/05修正 $month += 1; if ($GNEW_DAYS eq "") { $GNEW_DAYS = 14; } #00/04/24 if ($mday > 14) { $mday = $mday - $GNEW_DAYS; } elsif ($month == 1) { $year -= 1; $month = 12; $mday = $day_list[$month] - ($GNEW_DAYS - $mday); } else { $month -= 1; $mday = $day_list[$month] - ($GNEW_DAYS - $mday); } #if ($year < 10) { $year = "0" . $year; } if ($month < 10) { $month = "0" . $month; } if ($mday < 10) { $mday = "0" . $mday; } "$year/$month/$mday" } ################################################# sub year_month #** 年月返却 96/08/10 → 1996年8月 # 2001/11(NANDRA) 多言語対応 MM/DD/YYYYやDD/MM/YYYYにも対応 ################################################# { my ($date, $option) = @_; my ($year, $month, $day, $zero, $return, $yhead); $date =~ s/\n//g; $date =~ s/\t//g; $date =~ s/ //g; ($year, $month, $day) = split (/\//, $date); $zero = substr ($month, 0, 1); if ($zero eq "0") { $month = substr ($month, 1, 1); } $zero = substr ($day, 0, 1); if ($zero eq "0") { $day = substr ($day, 1, 1); } if ($year <= 99 && $year != 0) { if ($year >= 50) { $year = 1900 + $year; } else { $year = 2000 + $year; } } if ($year == 00 && $month >= 01 && $month <= 12) { $year = 2000; } #00/01/05修正 if ($year eq "00" || $year eq "0000") { $return = ""; return( $return ); } if ($month eq "0") { if ($GLANGUAGE eq "") { # 2001/11 NANDRA $return = "$year年"; } else { $return = ":-Year-P-:$year:-Year-S-:"; } return( $return ); } if ($option eq "by-date") { if ($GLANGUAGE eq "") { if ($day ne "0") { $return = "$year年$month月$day日"; } else { $return = "$year年$month月"; } } else { if ($day ne "0") { # 年月日書式編集 2001/11 NANDRA if ($GDATEFORMAT eq "M/D/Y") { $return = ":-Date-P-:$GMONTHNAME[$month]:-Date-1-:" . "$day:-Date-2-:$year:-Date-S-:"; } elsif ($GDATEFORMAT eq "D/M/Y") { $return = ":-Date-P-:$day:-Date-1-:$GMONTHNAME[$month]" . ":-Date-2-:$year:-Date-S-:"; } else { # Y/M/D $return = ":-Date-P-:$year:-Date-1-:$GMONTHNAME[$month]" . ":-Date-2-:$day:-Date-S-:"; } } else { # 年月書式編集 2001/11 NANDRA if ($GMONTHFORMAT eq "M/Y") { $return = ":-Month-P-:$GMONTHNAME[$month]:-Month-1-:" . "$year:-Month-S-:"; } else { # Y/M $return = ":-Month-P-:$year:-Month-1-:$GMONTHNAME[$month]" . ":-Month-S-:"; } } } } else { if ($GLANGUAGE eq "") { # 2001/11 NANDRA if ($day ne "0") { $return = "$year年$month月"; } else { $return = "$year年"; } } else { if ($day ne "0") { # 年月書式編集 2001/11 NANDRA if ($GMONTHFORMAT eq "M/Y") { $return = ":-Month-P-:$GMONTHNAME[$month]:-Month-1-:" . "$year:-Month-S-:"; } else { # Y/M $return = ":-Month-P-:$year:-Month-1-:$GMONTHNAME[$month]" . ":-Month-S-:"; } } else { $return = ":-Year-P-:$year:-Year-S-:"; } } } $return } ################################################# sub get_clip_date #** 映像クリップ撮影日取得 97/06/21追加 ################################################# #(例) print &get_clip_date ("mmdb:kasumigaura-x:ml:920815.ml", # "920815/c-006.jpg") . "\n"; { my ($file_in, $file_top) = @_; my ($char, $flag, $file_mime, $date, $place, $title, $comment, $return, $dummy, $file_html, $file_html2, $num, $num_c); $num = 1; $file_in =~ s/\//$GDELIMITER/g; #00/01/15 open (FCLIP, $file_in) || return ""; #2003/04/17 Maekawa while ($_ = ) { ($file_mime) = split (/\t/, $_); if ($file_top eq $file_mime && $file_top ne "") { $flag = "yes"; last; } if ($file_top eq "" && $file_mime ne "") { $flag = "yes"; last; } } if ($flag eq "yes") { $char = chop; if ($char ne "\n") { $_ = $_ . $char; } ($file_mime, $date, $place, $title, $comment) = split (/\t/, $_); } $date } ################################################# sub p_time #** 時刻差返却 #99/03/15追加 ### p_time ("01:33:55", "01:23:59") → "00:10:04" ################################################# { my ($time1, $time2) = @_; my ($hh1, $hh2, $mm1, $mm2, $ss1, $ss2, $ss3, $hh, $mm, $ss); ($hh1, $mm1, $ss1) = split (/\:/, $time1); ($hh2, $mm2, $ss2) = split (/\:/, $time2); if ($hh1 > $hh2) { $hh2 += 24; } $ss1 = $ss1 + $mm1*60 + $hh1*3600; $ss2 = $ss2 + $mm2*60 + $hh2*3600; $ss3 = $ss2 - $ss1; $ss = $ss3 % 60; $mm = (($ss3 - $ss) % 3600) / 60 ; $hh = ($ss3 - $ss - $mm*60) / 3600; if ($ss < 10) { $ss = "0" . $ss; } if ($mm < 10) { $mm = "0" . $mm; } "$hh:$mm:$ss" } #================================================================== #** Part 4:マクロタグ処理サブルーチン #================================================================== ################################################# sub tag_chk #** マクロタグチェック 97/04/27追加 ################################################# { my ($tag) = @_; my ($return, $str); $return = "no"; $str = substr ($tag, 0, 6); if ($tag eq "gmapxy") { $return = "yes"; } if ($tag eq "headline") { $return = "yes"; } if ($tag eq "email") { $return = "yes"; } if ($tag eq "subtitle") { $return = "yes"; } if ($tag eq "tablequote") { $return = "yes"; } if ($tag eq "quote") { $return = "yes"; } if ($tag eq "link") { $return = "yes"; } if ($tag eq "link2") { $return = "yes"; } if ($tag eq "folder") { $return = "yes"; } if ($tag eq "imageclip") { $return = "yes"; } if ($tag eq "title_image") { $return = "yes"; } if ($str eq "_clip_") { $return = "pass"; } #画像なしクリップの場合 if ($tag eq "compose_start") { $return = "yes"; } if ($tag eq "compose_end") { $return = "yes"; } if ($tag eq "xref") { $return = "yes"; } #2001/09/15 Maekawa if ($tag eq "text") { $return = "yes"; } if ($tag eq "author") { $return = "yes"; } #02/04/10 Maekawa if ($tag eq "copyright") { $return = "yes"; } #02/04/10 Maekawa if ($tag eq "contact") { $return = "yes"; } #02/04/10 Maekawa if ($tag eq "hr") { $return = "yes"; } # 2004/02/24 insert PopCorn WG if ($tag eq "set_vod") { $return = "yes"; } # 2004/09/26 insert Maekawa $return } ################################################# sub add_xref #** マクロタグ処理 クロスリファレンスDBソース生成 #2001/09/15追加 Maekawa ################################################# #$GDB_EXPORT(他サイト)にメタDBソースをエキスポートする #$GDB_XREF(自サイト)にメタDBソースをリフレクトする { my ($index, $this_page_dir, $date, $page, $catg, $region, $url, $title, $yomi, $comment, $update, $ext) = @_; my ($today, $txt_ex, $txt_ref, $idx_dir, @list, $this_index, $url_ex, $url_ref, $idx, $pg); $txt_ex = $txt_ref = ""; $today = &getdate2("/"); @list = split (/\,/, $index); foreach $this_index (@list) { ($idx, $pg) = split (/\=/, $this_index); if ($pg ne "") { $title = $pg; } if ($GPATH_EXPORT eq "") { $url_ex = "$GURL$this_page_dir/$url.html"; } else { $url_ex = "$GPATH_EXPORT$this_page_dir/$url.html"; } $txt_ex .= "■$page\n$idx\n$region\t\n" . $url_ex . "\n$title\n$yomi\n$date\nheadline\t$page($today更新)\n\n"; } foreach $this_index (@list) { ($idx, $pg) = split (/\=/, $this_index); if ($pg ne "") { $title = $pg; } if ($GPATH_XREF eq "") { $url_ref = "$GURL$this_page_dir/$url.html"; } else { $url_ref = "$GPATH_XREF$this_page_dir/$url.html"; } $txt_ref .= "■$page\n$idx\n$region\t\n" . $url_ref . "\n$title\n$yomi\n$date\n\n"; } if ($GDB_EXPORT ne "") { open (FDB_EXPORT, ">>$GDB_EXPORT"); print FDB_EXPORT $txt_ex; close (FDB_EXPORT); } if ($GDB_XREF ne "") { open (FDB_XREF, ">>$GDB_XREF"); print FDB_XREF $txt_ref; close (FDB_XREF); } } ################################################# sub edit_link #** マクロタグ処理 リンク設定 97/05/13追加 ################################################# { my ($file_in, $date, $rgn, $title, $caption, $option) = @_; my ($return, $dummy, $mime, $file, $char, $protocol, $txt_suspend); my ($machine, $delimiter, $fpath, $frpath, $opt_path, $tmp_path); &machine; $machine = $GMACHINE; $delimiter = $GDELIMITER; # 拡張版の多階層ディレクトリ等に対応 (2003/02/20) # $fpath は filesディレクトリを含むパス。 # $frpath は filesディレクトリを含む相対パス。(UNIX形式) # $opt_pathはサイト毎のクリップファイル格納パス # ディレクトリチェック追加 (03/03/12) $site = $GSITE; $tmp_path = "$path" . "files"; #2003/03/15 Maekawa if ($GENHANCED ne "" || -e $tmp_path) { $fpath = "$path" . "files$delimiter"; #2003/03/15 Maekawa $frpath = "../files"; $opt_path = "$delimiter$site"; } else { $fpath = "$path"; $frpath = ".."; $opt_path = ""; } $return = ""; $mime = &get_mime($file_in); $char = substr ($file_in, 0, 1); $date = &conv_date ($date); if ($option ne "") { $option = " " . $option; } if ($mime ne "") { $protocol = &check_protocol ($file_in); if ($protocol eq "yes" || $char eq "/") { $file = "$file_in"; } else { if ($mime eq "html") { $file = "$file_in"; } else { # (2003/02/20) $file = "$frpath/$mime/$file_in"; } } } else { $file = "$file_in"; } if ($GLINE ne "on") { if ($title ne "") { $return = "[$date] $title\"; } else { $return = "[$date] $file_in\"; } if ($caption ne "") { $return .= " $caption"; } $return .= "
    \n"; } else { if ($title eq "このページの$GTXTE" || $title eq "このページの$GTXTD") { $return = "\n"; } else { #00/05/03 $return = "
    \n"; } if ($file_in eq "head") { $txt_suspend = "\n"; if ($GTEXT_COLOR_HEAD eq "") { $txt_suspend =~ s/\@1\@//g; $txt_suspend =~ s/\@2\@//g; } else { $txt_suspend =~ s/\@1\@/\/g; $txt_suspend =~ s/\@2\@/\<\/font\>/g; } } else { if ($title ne "") { $txt_suspend .= "" . "\n"; } else { $txt_suspend .= "" . "\n"; } } $return .= $txt_suspend; $return .= "
    \@1\@日付\@2\@\@1\@ページ・タイトル\@2\@
    $date\" . "$title\
    $date\" . "$file_in\
    \n"; } $return =~ s/\[\]//g; $return } ################################################# sub edit_link2 #** マクロタグ処理2 リンク設定→別ウィンドウ表示 98/07/17追加, 98/12/20修正 ################################################# { my ($file_in, $date, $rgn, $title, $caption) = @_; my ($return, $dummy, $mime, $file, $char, $protocol, $option); $option = " target=\"page_win\""; $return = &edit_link ($file_in, $date, $rgn, $title, $caption, $option); $return } ################################################# sub edit_tablequote #** マクロタグ処理 tablequote設定 97/07/02本体から分離,98/03/08修正,00/01/05修正 ################################################# { my ($comment, $compose_mode) = @_; my ($text, $td_tag, $this_width); if ($compose_mode eq "on") { $this_width = ""; } else { if ($GTQ_WIDTH ne "") { #99/12/12追加 $this_width = $GTQ_WIDTH; } else { if ($GWIDTH ne "") { #99/12/12追加 if ($GWIDTH >= 600) { $this_width = $GWIDTH - 24; } else { $this_width = $GWIDTH; } } } } if ($this_width ne "") { if ($GTQ_COLOR eq "") { $td_tag = "
    "; } else { $td_tag = ""; } } else { if ($GTQ_COLOR eq "") { $td_tag = ""; } else { $td_tag = ""; } } $text = ""; if ($GCENTER eq "yes" || $GCENTER eq "on" || $GCENTER eq "") { $text .= "
    \n"; } if ($this_width ne "") { $text .= "\n"; } else { #99/12/12追加 $text .= "
    \n"; } #99/12/12追加, 00/11/20 $text .= "\n$td_tag\n
    \n"; if ($GTQ_COLOR_TEXT ne "") { $text .= ""; } #01/04/23追加 $text .= $comment; if ($GTQ_COLOR_TEXT ne "") { $text .= ""; } #01/04/23追加 $text .="\n"; if ($GLANGUAGE eq "") { $text .= "\n
      \n"; } else { $text .= "\n

    \n"; } $text .= "\n\n

    \n
    \n"; if ($GCENTER eq "yes" || $GCENTER eq "on" || $GCENTER eq "") { $text .= "
    \n"; } $text } ################################################# sub edit_quote #** マクロタグ処理 quote設定 98/02/24追加 ################################################# { my ($comment) = @_; my ($text, $td_tag); $text = ""; $text .= "
    \n$comment\n
    \n
    \n"; $text } ################################################# sub edit_hr #** マクロタグ処理 区切り線設定 2004/02/24 insert PopCorn WG ################################################# { my ($comment) = @_; my ($text, $td_tag); ($width_hr,$size_hr) = split (/,/, $comment); $text = ""; $text .= "
    \n
    \n"; $text } ################################################# sub edit_vod_list #** マクロタグ処理 VODクリップリスト編集 2004/10/02 Maekawa #マクロタグset_vodに対応したテキストファイル等のクリップファイルを作成する ################################################# { my ($module); foreach $module (@_) { } } ################################################# sub edit_set_vod #** マクロタグ処理 VODブロック編集 2004/09/26 Maekawa, 2004/10/02, 2005/01/10修正 #ビデオオンデマンド用のデータ一式を所定形式に整形し返却する #(例) folder/sample.wmv が指定されていれば、以下のとおり照合させ処理する。 # s/folder/sample.jpg をサムネール # s/folder/sample.wmv を低速ムービー(Sサイズ) # folder/sample.wmv を中速ムービー(Mサイズ) # l/folder/sample.wmv を高速ムービー(Lサイズ) # folder/sample.txt をテキスト全文 # meta/folder/sample.txt をメタ(属性)データ # folder/sample_連番.jpg を関連画像(複数) # folder/sample_連番.txt を関連テキスト(複数) # テキスト全文、メタデータ、関連画像、関連テキストはクリップファイルに展開する ################################################# { my ($comment, $title) = @_; my ($text, $td_tag); ($movie) = split (/,/, $comment); ($movie) = split (/\t/, $movie); $mime = &get_mime ($movie); $machine = $GMACHINE; $delimiter = $GDELIMITER; # 拡張版の多階層ディレクトリ対応 # $fpath は filesディレクトリを含むパス。 # $frpath は filesディレクトリを含む相対パス。(UNIX形式) # $opt_pathはサイト毎のクリップファイル格納パス $site = $GSITE; $tmp_path = "$path" . "files"; if ($GENHANCED ne "" || -e $tmp_path) { $fpath = "$path" . "files$delimiter"; $frpath = "../files"; $opt_path = "$delimiter$site"; } else { $fpath = "$path"; $frpath = ".."; $opt_path = ""; } #ムービーのローカルパス設定 $path_movie = "$GPATH_LOCAL$fpath$mime/$movie"; $path_movie = &conv_path($path_movie); $url_movie = "$frpath/$mime/$movie"; #ムービー(Sサイズ:低速)のローカルパスとURL(相対パス)設定 $path_movie_s = "$GPATH_LOCAL$fpath$mime/s/$movie"; $path_movie_s = &conv_path($path_movie_s); $url_movie_s = "$frpath/$mime/s/$movie"; #ムービー(Lサイズ:高速)のローカルパスとURL(相対パス)設定 $path_movie_l = "$GPATH_LOCAL$fpath$mime/l/$movie"; $path_movie_l = &conv_path($path_movie_l); $url_movie_l = "$frpath/$mime/l/$movie"; #静止画サムネール(Sサイズ)のローカルパスとURL(相対パス)設定 $icon_jpg = $movie; $icon_jpg=~ s/\.$mime/\.jpg/; $path_jpg_s = "$GPATH_LOCAL$fpath" . "jpg/s/" . "$icon_jpg"; $path_jpg_s = &conv_path($path_jpg_s); $url_jpg_s = "$frpath/jpg/s/$icon_jpg"; #Lサイズ画像のローカルパスとURL(相対パス)設定 $path_jpg_l = "$GPATH_LOCAL$fpath" . "jpg/$GDIR_LSIZE/" . "$icon_jpg"; $path_jpg_l = &conv_path($path_jpg_l); $url_jpg_l = "$frpath/jpg/$GDIR_LSIZE/$icon_jpg"; #メタデータのローカルパスとURL(相対パス)設定 $meta = $movie; $meta=~ s/\.$mime/\.txt/; $meta = "$GPATH_LOCAL$fpath" . "txt/meta/" . "$meta"; $meta = &conv_path($meta); $url_meta = "$frpath/txt/meta/$meta"; #テキスト全文のローカルパスとURL(相対パス)設定 $fulltext = $movie; $fulltext=~ s/\.$mime/\.txt/; $clip_fulltext = $fulltext; $fulltext = "$GPATH_LOCAL$fpath" . "txt/" . "$fulltext"; $fulltext = &conv_path($fulltext); #テキスト全文展開のHTMLファイルとURL(相対パス)設定 $html = $movie; $html=~ s/\.$mime/\.html/; $html =~ s/\//\-/g; $url_html = "../page2/$html"; #メタデータ取得 if ($title ne "") { $m_title ="$title"; } else { $m_title ="$movie"; } $m_abstract ="データはありません。"; $m_person =""; $m_source =""; $m_link =""; $m_link_url =""; if (-e $meta) { open (META, $meta); while () { chomp; if (/【タイトル】/) { ($mtag, $m_title) = split (/\t/, $_); } if (/【アブストラクト】/) { ($mtag, $m_abstract) = split (/\t/, $_); } if (/【出演者】/) { ($mtag, $m_person) = split (/\t/, $_); } if (/【リンク】/) { ($mtag, $m_link, $m_link_url) = split (/\t/, $_); } if (/【出典】/) { ($mtag, $m_source) = split (/\t/, $_); } } close (META); } #出力データ生成 $text = ""; $text .= "\n\n"; $text .= "\n"; $text .= "\n"; $text .= "\n"; $text .= "\n"; $text .= "\n"; $text .= "\n"; $text .= "
    \n"; $text .= "$m_title [ "; $text .= "動画再生 | "; if (-e $fulltext) { $text .= "全文\表\示 | "; } else { $text .= "全文\表\示 | "; } $text .= "詳細情報 | "; if (-e $path_jpg_l) { $text .= "画像拡大 | "; } $text .= " ]
    \n"; $text .= "\n"; $text .= "
    \"動画再生\"\"動画低速\"\"動画中速\"\"動画高速\"\n"; $text .= "
    \n"; $text .= ""; if ($m_person ne "") { $text .= "$m_person\n
    \n"; } $text .= "$m_abstract"; if ($m_link ne "" && $m_link_url ne "") { $text .= "
    \"リンク先\"$m_link\n"; } $text .= "
    \n"; $text .= "
    \n"; $text =~ s/\| \]/ \]/g; $text } ################################################# sub edit_imageclip_page1 #** マクロタグ処理(imageclip) 映像クリップ(画像配列)一覧作成 98/10/25 ################################################# { my ($this_clip_dir, $file_in, $file_top, $file_bottom, $catg, $in_option, $page_title) = @_; my ($char, $flag, $file_mime, $file_img, $date, $place, $title, $comment, $option, $star, $return, $return1, $return2, $dummy, $file_html, $file_html2, $num, $num_c, $mime, $no_blk, $delimiter, $file_img_s1, $file_img_s, $local_file_img, $clip_mark, $len_dir, $len_str, $chr_dir, $path_l, $len_l, $path_this, $len_this, $file_mime_m); my ($machine, $path, $fpath, $frpath, $opt_path, $icon_jpg, $local_icon, $tmp_path); # アイコン存在チェック用 my ($icon_path, $icon_flag); &machine; $machine = $GMACHINE; $delimiter = $GDELIMITER; if ($machine eq "mac" || $machine eq "win") { $path = $GPATH_LOCAL; } else { $path = $GPATH_SERVER; } # 拡張版の多階層ディレクトリ等に対応 (2003/02/20) # $fpath は filesディレクトリを含むパス。 # $frpath は filesディレクトリを含む相対パス。(UNIX形式) # $opt_pathはサイト毎のクリップファイル格納パス # ディレクトリチェック追加(03/03/12) $site = $GSITE; #$tmp_path = "$path$delimiter" . "files"; $tmp_path = "$path" . "files"; #2003/03/15 Maekawa if ($GENHANCED ne "" || -e $tmp_path) { $fpath = "$path" . "files$delimiter"; $frpath = "../files"; $opt_path = "$delimiter$site"; } else { $fpath = "$path"; $frpath = ".."; $opt_path = ""; } #機種を取得 &machine; $delimiter = $GDELIMITER; $star = "★"; $G_CLIP_LIST = ""; if ($GCLIP_MARK ne "") { $clip_mark = $GCLIP_MARK; } else { $clip_mark = "\#"; } $file_in =~ s/\//$GDELIMITER/g; #00/01/15 $len_dir = length ($GDIR_LSIZE); #00/04/16 $len_dir++; $return1 = $return2 = ""; #クリップファイルを取得 open (FIMAGECLIP, $file_in) # || output_msg("POP-E007", "sub:edit_imageclip_page1 $file_in"); || return ""; #2003/04/17暫定処置 #2002/05/06 NANDRA "$file_inをオープンできませんでした。 while ($_ = ) { ($file_mime) = split (/\t/, $_); if ($file_top eq $file_mime && $file_top ne "") { $flag = "yes"; last; } if ($file_top eq "" && $file_mime ne "") { $flag = "yes"; last; } } #フラグがyesだったら。 if ($flag eq "yes") { $num = 0; $G_GET_CLIP_DATE = $date; if ($GWIDTH ne "") { $return = "\n"; } else { $return = "
    \n"; } $no_blk = 0; $char = chop; if ($char ne "\n") { $_ = $_ . $char; } ($file_mime, $date, $place, $title, $comment, $option) = split (/\t/, $_); unless (/^#/ || $title eq "−" || $title eq "--" || $title eq "-") { $date = &conv_date ($date); ($file_html, $mime) = split (/\./, $file_mime); $file_img_s1 = $file_mime; $chr_dir = substr ($file_img_s1, 0, $len_dir); #00/04/16 if ($chr_dir eq "$GDIR_LSIZE\/") { #00/04/16 $len_str = length ($file_img_s1); $file_img_s1 = substr ($file_img_s1, $len_dir, $len_str - $len_dir); } #02/03/26Lサイズ画像パスの時、 #Mサイズパスに読み替え、後続処理でSサイズパスに変換 $path_l = "$GDIR_LSIZE/"; $len_l = length ($path_l); $path_this = substr ($file_mime, 0, $len_l); ### 追加 2003/02/06 ### 画像ファイル以外は、アイコン画像表示にする。 $icon_flag = 1; #if ($mime ne "jpg" && $GENHANCED ne "") if ($mime ne "jpg" && $mime ne "JPG" && $mime ne "jpeg" && $mime ne "JPEG" && $mime ne "gif" && $mime ne "GIF" && $mime ne "png" && $mime ne "PNG" ) { $icon_jpg = $file_mime; $icon_jpg =~ s/$mime/jpg/; $local_icon = "$fpath" . "jpg/$GDIR_SSIZE/$icon_jpg"; $local_icon =~ s/\:/$delimiter/g; $local_icon =~ s/\//$delimiter/g; if (-e $local_icon) { $file_img = "$frpath/jpg/$GDIR_SSIZE/$icon_jpg"; } else { $file_img = "../icon/$mime" . "_icon.jpg"; $icon_path = "$path/icon/$mime" . "_icon.jpg"; $icon_path =~ s/\:/$delimiter/g; $icon_path =~ s/\//$delimiter/g; if(-e $icon_path) { $icon_flag = 1; } else { $icon_flag = 0; } } } elsif ($path_l eq $path_this) { ### $len_this = length ($file_mime); $len_this -= $len_l; $file_mime_m = substr ($file_mime, $len_l, $len_this); # (2003/02/20) $file_img = "$frpath/$mime/$GDIR_SSIZE/$file_mime_m"; } else { # (2003/02/20) $file_img = "$frpath/$mime/$GDIR_SSIZE/$file_mime"; } # (2003/02/20) $file_img_s = "$frpath/$mime/$GDIR_SSIZE/$file_img_s1"; # (2003/02/20) $local_file_img = "$fpath" . "$mime/$GDIR_SSIZE/$file_img_s1"; $local_file_img =~ s/\:/$delimiter/g; $local_file_img =~ s/\//$delimiter/g; if (-e $local_file_img) { $file_img = $file_img_s; } #02/04/24 Maekawa $file_html2 = &get_clip_fname ($file_html, "chk"); $file_html = "../$this_clip_dir/$file_html2"; $num++; $num_c = &conv_num($num,2); $date = &conv_date ($date); if ($GSTAR ne "") { $title =~ s/$star/$GSTAR/g; } $no_blk++; if ($title eq "") { if ($GCLIP_TITLE_SETTING eq "on") { if ($GCLIP_SEQNO eq "on") { $title = "$page_title#$num_c"; } else { $title = "$page_title"; } #02/04/24 Maekawa } else { $title = $file_html2; } } if ($GLINE eq "on" && $GLINE_COLOR ne "") { if ($GIMAGECLIP_LINK eq "off") { #99/12/04追加 if ($in_option eq "link_on") { #00/01/16追加 $return1 .= "\n"; #アイコン無し 03/03/05 if($icon_flag) { $return2 .= "\n"; } else { $return2 .= "\n"; } } else { $return1 .= "\n"; if($icon_flag) { $return2 .= "\n"; } else { $return2 .= "\n"; } } } else { if ($in_option eq "link_off") { #00/01/16追加 $return1 .= "\n"; if($icon_flag) { $return2 .= "\n"; } else { $return2 .= "\n"; } } else { $return1 .= "\n"; if($icon_flag) { $return2 .= "\n"; } else { $return2 .= "\n"; } } } } else { if ($GIMAGECLIP_LINK eq "off") { #99/12/04追加 if ($in_option eq "link_on") { #00/01/16追加 $return1 .= "\n"; if($icon_flag) { $return2 .= "\n"; } else { $return2 .= "\n"; } } else { $return1 .= "\n"; if($icon_flag) { $return2 .= "\n"; } else { $return2 .= "\n"; } } } else { if ($in_option eq "link_off") { #00/01/16追加 $return1 .= "\n"; if($icon_flag) { $return2 .= "\n"; } else { $return2 .= "\n"; } } else { $return1 .= "\n"; if($icon_flag) { $return2 .= "\n"; } else { $return2 .= "\n"; } } } } $G_CLIP_LIST .= "$_$GSPR_CODE"; } if ($file_bottom ne $file_mime) { while () { $char = chop; if ($char ne "\n") { $_ = $_ . $char; } ($file_mime, $date, $place, $title, $comment, $option) = split (/\t/, $_); $date = &conv_date ($date); last if ( ($file_bottom eq $file_mime) && (/^#/ || $title eq "−" || $title eq "--" || $title eq "-") ); next if (/^#/ || $title eq "−" || $title eq "--" || $title eq "-"); ($file_html, $mime) = split (/\./, $file_mime); $file_img_s1 = $file_mime; #00/04/16 $chr_dir = substr ($file_img_s1, 0, $len_dir); if ($chr_dir eq "$GDIR_LSIZE\/") { #00/04/16 $len_str = length ($file_img_s1); $file_img_s1 = substr ($file_img_s1, $len_dir, $len_str - $len_dir); } #02/03/26Lサイズ画像パスの時、Mサイズ #パスに読み替え、後続処理でSサイズパスに変換 $path_l = "$GDIR_LSIZE/"; $len_l = length ($path_l); $path_this = substr ($file_mime, 0, $len_l); ### 追加 2003/02/06 ### 画像ファイル以外は、アイコン画像表示にする。 $icon_flag = 1; #if ($mime ne "jpg" && $GENHANCED ne "") if ($mime ne "jpg" && $mime ne "JPG" && $mime ne "jpeg" && $mime ne "JPEG" && $mime ne "gif" && $mime ne "GIF" && $mime ne "png" && $mime ne "PNG" ) { $icon_jpg = $file_mime; $icon_jpg =~ s/$mime/jpg/; $local_icon = "$fpath/jpg/$GDIR_SSIZE/$icon_jpg"; $local_icon =~ s/\:/$delimiter/g; $local_icon =~ s/\//$delimiter/g; if (-e $local_icon) { $file_img = "$frpath/jpg/$GDIR_SSIZE/$icon_jpg"; } else { $file_img = "../icon/$mime" . "_icon.jpg"; $icon_path = "$path/icon/$mime" . "_icon.jpg"; $icon_path =~ s/\:/$delimiter/g; $icon_path =~ s/\//$delimiter/g; if(-e $icon_path) { $icon_flag = 1; } else { $icon_flag = 0; } } } elsif ($path_l eq $path_this) { ### $len_this = length ($file_mime); $len_this -= $len_l; $file_mime_m = substr ($file_mime, $len_l, $len_this); # (2003/02/20) $file_img = "$frpath/$mime/$GDIR_SSIZE/$file_mime_m"; } else { # (2003/02/20) $file_img = "$frpath/$mime/$GDIR_SSIZE/$file_mime"; } # (2003/02/20) $file_img_s = "$frpath/$mime/$GDIR_SSIZE/$file_img_s1"; # (2003/02/20) $local_file_img = "$fpath$mime/$GDIR_SSIZE/$file_img_s1"; $local_file_img =~ s/\:/$delimiter/g; $local_file_img =~ s/\//$delimiter/g; if (-e $local_file_img) { $file_img = $file_img_s; } #02/04/24 Maekawa $file_html2 = &get_clip_fname ($file_html, "chk"); $file_html = "../$this_clip_dir/$file_html2"; $num++; $num_c = &conv_num($num,2); $date = &conv_date ($date); if ($GSTAR ne "") { $title =~ s/$star/$GSTAR/g; } $no_blk++; if ($title eq "") { if ($GCLIP_TITLE_SETTING eq "on") { if ($GCLIP_SEQNO eq "on") { $title = "$page_title#$num_c"; } else { $title = "$page_title"; } #02/04/24 Maekawa } else { $title = $file_html2; } } if ($GLINE eq "on" && $GLINE_COLOR ne "") { if ($GIMAGECLIP_LINK eq "off") { #99/12/04追加 if ($in_option eq "link_on") { #00/01/16追加 $return1 .= "\n"; if($icon_flag) { $return2 .= "\n"; } else { $return2 .= "\n"; } } else { $return1 .= "\n"; if($icon_flag) { $return2 .= "\n"; } else { $return2 .= "\n"; } } } else { if ($in_option eq "link_off") { #00/01/16追加 $return1 .= "\n"; if($icon_flag) { $return2 .= "\n"; } else { $return2 .= "\n"; } } else { $return1 .= "\n"; if($icon_flag) { $return2 .= "\n"; } else { $return2 .= "\n"; } } } } else { if ($GIMAGECLIP_LINK eq "off") { #99/12/04追加 if ($in_option eq "link_on") { #00/01/16追加 $return1 .= "\n"; if($icon_flag) { $return2 .= "\n"; } else { $return2 .= "\n"; } } else { $return1 .= "\n"; if($icon_flag) { $return2 .= "\n"; } else { $return2 .= "\n"; } } } else { if ($in_option eq "link_off") { #00/01/16追加 $return1 .= "\n"; if($icon_flag) { $return2 .= "\n"; } else { $return2 .= "\n"; } } else { $return1 .= "\n"; if($icon_flag) { $return2 .= "\n"; } else { $return2 .= "\n"; } } } } if ($no_blk == $GIMAGECLIP_NUM) { $return .= "\n$return1\n\n$return2\n"; $no_blk = 0; $return1 = $return2 = ""; } $G_CLIP_LIST .= "$_$GSPR_CODE"; last if ($file_bottom eq $file_mime); } } } if ($no_blk >= 1) { $return .= "\n$return1\n\n$return2\n"; $no_blk = 0; $return1 = $return2 = ""; } #00/04/23 $return .= "
    $clip_mark$num_c $title
    $mime
    $clip_mark$num_c $title
    $mime
    $clip_mark$num_c $title
    $mime
    $clip_mark$num_c $title
    $mime
    $clip_mark$num_c $title
    $mime
    $clip_mark$num_c $title
    $mime
    $clip_mark$num_c $title
    $mime
    $clip_mark$num_c $title
    $mime
    $clip_mark$num_c $title
    $mime
    $clip_mark$num_c $title
    $mime
    $clip_mark$num_c $title
    $mime
    $clip_mark$num_c $title
    $mime
    $clip_mark$num_c $title
    $mime
    $clip_mark$num_c $title
    $mime
    $clip_mark$num_c $title
    $mime
    $clip_mark$num_c $title
    $mime
    \n"; $return1 = "\n\n\n\n
    \n($GTXT1P$num$GTXT1S)" . "
    \n"; #99/12/12追加 # 2001/11 NANDRA if ($GCENTER_IMAGECLIP eq "yes" || $GCENTER_IMAGECLIP eq "on" || $GCENTER_IMAGECLIP eq "") { $return1 .= "\\n"; } #99/12/04追加 $return = $return1 . $return; if ($GCENTER_IMAGECLIP eq "yes" || $GCENTER_IMAGECLIP eq "on" || $GCENTER_IMAGECLIP eq "") { $return .= "\<\/center\>\n"; } #99/12/04追加 $return =~ s/\[\] //g; $return =~ s/\[\/\/\] //g; $return .= "
    \n"; if ($num eq "" || $num == 0) { $return = ""; } #02/10/03 Maekawa $return } ################################################# #最上川フォーラムコンテンツ作成(地図連携対応) sub edit_gmapIN #新規作成 ################################################# { #変数宣言@ my($str2,$str3,$wi) = @_; $Gmaptext[$wi] = "AddGMarker(map,$str2,\"$str3\");\n"; } ################################################# #最上川フォーラムコンテンツ作成(地図連携対応) sub edit_gmapOUT #新規作成 ################################################# { #変数宣言@ # my ($path, $keyitem, $this_page_dir, $this_clip_dir, # $date, $page, $catg, $region, $xy, $url, $title, # $yomi, $comment, $date2, $gmap_xy) = @_; my ($path, $this_page_dir, $url, $title, $gmap_xy) = @_; #変数宣言A my ($delimiter, $machine, $site, $fpath, $frpath, $opt_path, $tmp_path, $file, $file_page, $site, $map_html_fnm, $idx, $gmap_key); my ($url_path , $out_path, $gmap_page ); $gmap_key = $GMAPKEY; &machine; $machine = $GMACHINE; $delimiter = $GDELIMITER; $site = $GSITE; $tmp_path = "$path" . "files"; if ($GENHANCED ne "" || -e $tmp_path) { $fpath = "$path" . "files$delimiter"; $frpath = "../files"; $opt_path = "$delimiter$site"; } else { $fpath = "$path"; $frpath = ".."; $opt_path = ""; } $tag_date_chk = ""; ($title) = split (/$file_page"); print GMAP_FILE "\n"; print GMAP_FILE "\n"; print GMAP_FILE "\n"; print GMAP_FILE "Google Maps JavaScript API Example - simple\n"; print GMAP_FILE "\n"; print GMAP_FILE "\n"; print GMAP_FILE "\n"; print GMAP_FILE "
    \n"; print GMAP_FILE "\n"; print GMAP_FILE " \n"; print GMAP_FILE "\n"; close (GMAP_FILE); if ( $G_PUB_FLG eq "on" ) { $url_path = $G_URL_PUB; } else { $url_path = $G_URL; } $gmap_page = $url_path . $delimiter . $this_page_dir . $delimiter . $url . "map.html"; return $gmap_page; } #================================================================== #** Part 5:MIME/拡張MIME処理サブルーチン #================================================================== ################################################# sub edit_imagelink #** インライン画像タグ編集 99/11/01追加 ################################################# { my ($path, $mime, $file_mime) = @_; my ($file, $img, $filename, $ext, $filename2, $filename3, $mmod, $lsize, $len1, $len2, $len, $filepath, $text, $text2); my ($machine, $delimiter, $fpath, $frpath, $opt_path, $icon_jpg, $local_icon, $tmp_path, $ofilepath, $opath, $ofile, $ourl); # アイコンの存在チェック用 my ($icon_path); &machine; $machine = $GMACHINE; $delimiter = $GDELIMITER; # 拡張版の多階層ディレクトリ等に対応 (2003/02/20) # $fpath は filesディレクトリを含むパス。 # $frpath は filesディレクトリを含む相対パス。(UNIX形式) # $opt_pathはサイト毎のクリップファイル格納パス # ディレクトリチェック追加(03/03/12) $site = $GSITE; #$tmp_path = "$path$delimiter" . "files"; $tmp_path = "$path" . "files"; #2003/03/15 Maekawa if ($GENHANCED ne "" || -e $tmp_path) { $fpath = "$path" . "files$delimiter"; #2003/03/15 Maekawa $frpath = "../files"; $opt_path = "$delimiter$site"; } else { $fpath = "$path"; $frpath = ".."; $opt_path = ""; } ($filename, $ext) = split (/\./, $file_mime); $filename2 = $filename; $text = ""; $protocol = &check_protocol ($file_mime); #01/03/28 if ($protocol eq "yes") { #01/03/28 URL指定の場合 $img = ""; $text = "$img\ "; } else { if ($GMOD_LSIZE ne "") { #Lサイズ版修飾子が指定されている場合、Mサイズ版画像 #からLサイズ版画像にリンクする。 if ($GMOD_MSIZE eq "") { $lsize = $filename . $GMOD_LSIZE . "\." . $ext; } else { $len1 = length ($GMOD_LSIZE); $len2 = length ($filename); $len = $len2 - $len1; $filename3 = substr ($filename, 0, $len); $mmod = substr ($filename, $len, $len1); if ($GMOD_MSIZE eq $mmod) { $lsize = $filename3 . $GMOD_LSIZE . "\." . $ext; } else { $lsize = $filename . $GMOD_LSIZE . "\." . $ext; } } # (2003/02/21) $filepath = "$fpath$mime$GDELIMITER$lsize"; $filepath = &conv_path ($filepath); ### ### Added 2003/02/07 #if ($mime ne "jpg" && $GENHANCED ne "") if ($mime ne "jpg" && $mime ne "JPG" && $mime ne "jpeg" && $mime ne "JPEG" && $mime ne "gif" && $mime ne "GIF" && $mime ne "png" && $mime ne "PNG" ) { $file_mime =~ s/ /\%20/g; $file = "$frpath/$mime/$file_mime"; $icon_jpg = $file_mime; $icon_jpg =~ s/$mime/jpg/; $local_icon = "$fpath/jpg/$GDIR_SSIZE/$icon_jpg"; $local_icon =~ s/\:/$delimiter/g; $local_icon =~ s/\//$delimiter/g; if (-e $local_icon) { $img = ""; $text = "$img\ " } else { $img = ""; $icon_path = "$path/icon/$mime" . "_icon.jpg"; $icon_path =~ s/\:/$delimiter/g; $icon_path =~ s/\//$delimiter/g; if(-e $icon_path) { $text = "$img\ " } else { $text = "
    $mime
    " } } ; } elsif (-e $filepath) { ### $file_mime =~ s/ /\%20/g; $lsize =~ s/ /\%20/g; # (2003/02/20) $file = "$frpath/$mime/$file_mime"; $img = ""; # (2003/02/20) $text = "$img\ "; } else { $file_mime =~ s/ /\%20/g; # (2003/02/20) $file = "$frpath/$mime/$file_mime"; $img = ""; $text = "$img "; } } else { #Lサイズ版修飾子が指定されていない場合、普通にMサイズ #版を表示、さらにLサイズ版があればLサイズ画像にリンク $file_mime =~ s/ /\%20/g; # (2003/02/20) mod 2005/04/25 グループファイル対応 $target = ""; if ($mime ne "group"){ $file = "$frpath/$mime/$file_mime"; } else { my @tmp_filename = split ("/", $file_mime); open (GRP, "<$frpath/$mime/$tmp_filename[1]"); while (){ chop; $file = "$frpath/$mine$_"; } close GRP; $target = " target=\"_blank\"" } # 追加 2003/02/06 # 画像以外の場合のページ表示&リンク修正 #if ($mime eq "jpg" ) if ($mime eq "jpg" || $mime eq "JPG" || $mime eq "jpeg" || $mime eq "JPEG" || $mime eq "gif" || $mime eq "GIF" || $mime eq "png" || $mime eq "PNG" ) { # 画像のときは従来どおり。 $img = ""; #02/01/23Lサイズ画像リンク # (2003/02/20) $filepath = "$fpath$mime/$GDIR_LSIZE/$file_mime"; #Lサイズ画像ローカルパス $filepath = &conv_path ($filepath); #ローカルパスのデリミタを変換 $opath = &path_file($file_mime, 2); #パスのみ取得 ($opath, $ofile) = split (/\t/, $opath); $ofile = &path_file($file_mime, 1); #ファイル名のみ取得 ($dummy, $ofile) = split (/\t/, $ofile); $ofilepath = "$fpath$mime/$GDIR_OSIZE/$opath" . "image/jpeg/$ofile"; #2004/02/08PushCornのOサイズ画像ローカルパス $ofilepath = &conv_path ($ofilepath); #ローカルパスのデリミタを変換 $ourl = "$frpath/$mime/$GDIR_OSIZE/$opath" . "image/jpeg/$ofile"; #IMGタグ用のURL if (-e $ofilepath) {} else { $ofilepath = "$fpath$mime/$GDIR_OSIZE/$file_mime"; #2004/02/07PopCorn用のOサイズ画像ローカルパス $ofilepath = &conv_path ($ofilepath); #ローカルパスのデリミタを変換 $ourl = "$frpath/$mime/$GDIR_OSIZE/$file_mime"; } $text2 = ""; if ((-e $filepath) || (-e $ofilepath)) { $text2 .= "
    →画像\表\示"; } if (-e $filepath) { # (2003/02/20) #$text = "$img\ "; #画像表示ウィンドウによるリンク #2004/01/27 Maekawa $text = "$img\"; $text2 .= " [ Lサイズ\ ]\n"; } else { $text = "$img "; } #2004/02/07Oサイズが存在している時にはOサイズ画像のウィンドウ表示をさらに追加 if (-e $ofilepath) { $text2 .= " [ オリジナル\ ]\n"; } $text .= $text2; } else { $icon_jpg = $file_mime; $icon_jpg =~ s/$mime/jpg/; $local_icon = "$fpath/jpg/$GDIR_SSIZE/$icon_jpg"; $local_icon =~ s/\:/$delimiter/g; $local_icon =~ s/\//$delimiter/g; if (-e $local_icon) { $img = ""; $text = "$img\"; } else { $img = ""; $icon_path = "$path/icon/$mime" . "_icon.jpg"; $icon_path =~ s/\:/$delimiter/g; $icon_path =~ s/\//$delimiter/g; if(-e $icon_path) { $text = "$img\ " } else { $text = "
    $mime\
    " } } } } } $text } ################################################# sub get_mime_from_clip #** クリップ内MIME取得 99/04/13追加 ################################################# { my ($file_in) = @_; my ($file_mime, $mime, $dummy, $title); $file_in = &conv_path ($file_in); #open (FCLIP, $file_in) || output_msg("POP-E007", "sub:get_mime_from_clip $file_in"); open (FCLIP, $file_in) || return ""; #2003/04/17returnは暫定処理 while ($_ = ) { ($file_mime, $dummy, $dummy, $title) = split (/\t/, $_); next if (/^#/ || $title eq "−" || $title eq "--" || $title eq "-"); $_ = $file_mime; last if (/\./); } close (FCLIP); $mime = &get_mime ($file_mime); # print $file_mime;# . ":" . $mime; # DEBUG用 2001/8 NANDRA $mime } ################################################# sub get_mime #** MIME取得 99/04/13追加 01/08/15 xxxx.html#partname という形式のファイル名に対応(by NANDRA) ################################################# { my ($file_mime) = @_; my (@dir, @str, @part, $num, $mime); $file_mime =~ s/\:/\//g; #$file_mime =~ s/\\/\//g; @dir = split (/\//, $file_mime); $num = @dir; $num--; @str = split (/\./, $dir[$num]); $num = @str; $num--; $mime = $str[$num]; $mime =~ s/ //g; @part = split (/\#/, $mime); #01/08/15 $mime = $part[0]; #01/08/15 $mime } ################################################# sub html_from_file #** HTMLファイル入力(html) 00/01/05追加, 01/08/14 BODY部のみ抜き取るように修正(by NANDRA) ################################################# { my ($file) = @_; my ($text, $part, @parts, $i, $n); if (split(/\#/, $file) == 2) { $file = @_[0]; $part = @_[1]; } else { $file = @_[0]; $part = ""; } open (TEXTFILE, $file) || output_msg("POP-E007", "sub:html_from_file $file"); while () { $text .= $_; } close (TEXTFILE); if ( $part eq "" ) { $text =~ s/<[ \t\n\r\f]*\/?body[^>]*>//gis; if (split(//, $text) == 3) { $text = @_[1]; } else { #2002/05/06 NANDRA #"$fileのBODYタグが不正です。BODY部抽出処理は行なわれません output_msg("POP-M007", $file); } #$text = '' . $text; } else { $text =~ s/<[ \t\n\r\f]*a name/<\/body/gis; $n = split(//, $text); @parts = @_; $text = ""; for ( $i = 0 ; $i < $n ; ++$i ) { $_ = @parts[$i]; if (/name[ \t\n\r\f]*=[ \t\n\r\f]*\"$part\"/is) { $text = $_; last; } } if ( $text eq "" ) { #2002/05/06 NANDRA "$fileの中に$partという章はありませんでした output_msg("POP-E018", $file, $part); } } $text; } ################################################# sub text_from_file #** テキストファイル入力(txt, src) 97/04/22追加, 98/03/02 option対応, 99/10/13表組機能 ################################################# { my ($file, $mime, $option, $file_mime) = @_; my ($text, $num, $mode, $max, $i, @table_tmp, $rtn, $text2, $line, $buf, @lines, $txt_tmp, $txt_tmp2, $txt_each, @table, $xtitle, $xdate, $xplace, $xoption); $rtn = open (TEXTFILE, $file); if ($rtn != 1) { # Alert! No file: $file 2002/05/06 NANDRA $rtn = &output_msg ("POP-M005", $file); return ""; } $num = 1; $max = 0; $mode = "off"; while (read TEXTFILE, $buf, 16384) { $text .= $buf; } #2002/01/20 Maekawa $text = &filter_source_code($text); #2002/01/20 Maekawa @lines = split (/\n/, $text); $text = ""; foreach $_ (@lines) { if ($num == 1 && /^#/) #2004/01/18 "pre"が無視されるバグの対応 Maekawa { ($xtitle, $xdate, $xplace, $xoption) = split (/\t/, $_); if ($xoption ne "") { $option = $xoption; } } $_ .= "\n"; unless ($num == 1 && /^#/) { next if (/^\/\#/); #99/12/06追加 先頭が/#はコメント行 @table = split (/\t/, $_); $max = @table; $max--; if ($max == 0) { if ($mode eq "on") { #02/03/27 #@table_tmpを$tmpに変換, table_from_fileの第3引数を配列で #なくした(区切り文字は$GRET_CODE) $txt_tmp = join ("$GRET_CODE", @table_tmp); $text .= &table_from_file ("", "", $txt_tmp); } if ($option eq "" || $option eq "plain" || $option eq "set_vod") { #$_ =~ s/\n\n/

    \n/g; $_ =~ s/\n/
    \n/g; } $text .= $_; $mode = "off"; } else { if ($mode eq "off") { @table_tmp = (); } $mode = "on"; chop; next if (/^#/); next if (//); if ($option eq "source") { $text .= "$_\n"; } else { #00/11/19 push (@table_tmp, $_); } } } $num++; } close (TEXTFILE); $txt_tmp2 = ""; #02/03/27table_from_fileの第3引数を配列でなくした #(区切り文字は$GRET_CODE) $txt_tmp2 = join ("$GRET_CODE", @table_tmp); if ($txt_tmp2 ne $txt_tmp) { $text .= &table_from_file ("", "", $txt_tmp2); } #02/04/15条件追加 if ($mime eq "txt") { if ($option eq "source") {#00/11/19修正 #2002/01/20置換処理を関数に独立 $text = &replace_source_code ($text); } if ($option eq "pre") { $text = "

    \n\n" . $text . "\n\n
    \n\n"; } if ($option eq "set_vod") #04/10/03VOD編集対応 { $movie = $file_mime; $movie =~ s/\.txt/\.wmv/g; $text1 = &edit_set_vod($movie); $text1 .= "

    全文テキスト

    \n"; $text = "$text1\n\n" . $text . "\n\n\n\n"; } } $text } ################################################# sub replace_source_code #** ソースコード文字列置換 #2002/01/20 Maekawa ################################################# { my ($text) = @_; my ($space, $lt, $gt, $amp, $amp2, $quot, $tag_alt, $delstr); if ($GLANGUAGE eq "japanese" || $GLANGUAGE eq "") { $space = ' '; } else { $space = ' '; } $lt = '<'; $gt = '>'; $amp = '&'; $amp2 = '_&_&_'; $quot = '"'; $tag_alt = "[TAB]"; $delstr = '\n
    \n'; $text =~ s/$delstr//g; $text =~ s/ /$space/g; $text =~ s/&/$amp2/g; $text =~ s//$gt/g; $text =~ s/"/$quot/g; $text =~ s/\n\n/

    /g; $text =~ s/\n/
    /g; $text =~ s/$amp2/$amp/g; $text =~ s/\t/$tag_alt/g; $text } ################################################# sub filter_source_code #** 範囲指定ソースコード文字列置換 #2002/01/20 Maekawa ################################################# { my ($text) = @_; my (@lines, $sw, $max, $i); # フィルター前処理 #2002/01/20 Maekawa if ($GSOURCE_START ne "") { @lines = split (/\n/, $text); $sw = "off"; $max = @lines; $max--; for ($i = 0; $i <= $max; $i++) { $_ = $lines[$i]; if (/$GSOURCE_START/) { $sw = "on"; next; } if ($sw eq "on") { if (/$GSOURCE_END/) { $sw = "off"; next; } $lines[$i] = &replace_source_code ($lines[$i]); } } $text = join ("\n", @lines); } $text } ################################################# sub table_from_file #** テーブル入力(table) 97/06/08追加, 99/12/06修正 ################################################# #02/03/27table_from_fileの第3引数を配列でなくした(区切り文字は$GRET_CODE) { my ($file, $conf, $txt_tmp) = @_; my ($text, $max, @line, $num, %path_conf, %conf_table, $tag, $data, @width, $th_text, $td_text, $cnt, $switch, $i, $atom, $tmp, $char, $len, @records, @table_tmp); $max = 1; @table_tmp = split (/$GRET_CODE/, $txt_tmp); #02/03/27 Maekawa if ($file ne "") { open (TABLEFILE, $file) || output_msg("POP-E007", "sub:table_from_file(1) $file"); while () { next if (/^#/); next if (//); @line = split (/\t/, $_); $num = @line; if ($max < $num) { $max = $num; } } close (TABLEFILE); } else { foreach $_ (@table_tmp) { next if (/^#/); next if (//); @line = split (/\t/, $_); $num = @line; if ($max < $num) { $max = $num; } } } %conf_table = &modify_table ($conf); if ($file ne "") { open (TABLEFILE, $file) || output_msg("POP-E007", "sub:table_from_file(2) $file"); @records = (); while () { chop; next if (/^#/); next if (//); push (@records, $_); } close (TABLEFILE); } else { @records = @table_tmp; } if ($GCENTER_TABLE eq "yes" || $GCENTER_TABLE eq "on") { $text = "

    \n" . $conf_table{'table'}; } else { $text = "$conf_table{'table'}"; } $cnt = 0; $switch = 2; foreach $_ (@records) { @line = split (/\t/, $_); $cnt++; if ($switch == 1) { $switch = 2; } else { $switch = 1; } $char = substr ($_, 0,1); if ($char eq "\/") { #THの処理 $text .= "$conf_table{'tr_th'}"; for ($i = 0; $i < $max; $i++) { $atom = $line[$i]; if ($i == 0) { $len = length ($atom); $atom = substr ($atom, 1, $len); } $tmp = $conf_table{'th'}; $tmp =~ s/\_text\_/$conf_table{'th_text'}/g; $tmp =~ s/\_text\_/$atom/g; $text .= "$tmp"; } $text .= "
    \n"; if ($GTABLE_FRAME ne "") { $text .= "\n\n"; } #00/01/25追加 if ($GCENTER_TABLE eq "yes" || $GCENTER_TABLE eq "on") { $text .= "\n"; } $text } ################################################# sub default_table #** テーブル属性初期値設定 99/12/06追加 ################################################# { my ($table1, $table2); %GDEFAULT_TABLE = (); #初期値設定 #02/04/21 Maekawa if ($GTABLE_TR_TH eq "") { $GTABLE_TR_TH = "bgcolor=\"gray\" align=\"left\" valign=\"top\""; } if ($GTABLE_TH_TEXT eq "") { $GTABLE_TH_TEXT = "white"; } if ($GTABLE_TR_TD eq "") { $GTABLE_TR_TD = "bgcolor=\"#e4e7dd\""; } if ($GTABLE_TR_TD2 eq "") { $GTABLE_TR_TD = "bgcolor=\"#f5f8ee\""; } if ($GTABLE eq "") { $table2 = "\n"; } else { $table2 = "
    \n"; } #00/01/25追加 テーブルの外枠表示のための下地テーブル if ($GTABLE_FRAME ne "") { $table1 = "
    \n"; if ($GTABLE_FRAME_COLOR eq "") { $table1 .= "\n"; } else { $GDEFAULT_TABLE{'tr_th'} = "\n"; } if ($GTABLE_TR_TD eq "") { $GDEFAULT_TABLE{'tr_td'} = "\n"; } else { $GDEFAULT_TABLE{'tr_td'} = "\n"; } if ($GTABLE_TR_TD2 eq "") { $GDEFAULT_TABLE{'tr_td2'} = "\n"; } else { $GDEFAULT_TABLE{'tr_td2'} = "\n"; } if ($GTABLE_TH eq "") { $GDEFAULT_TABLE{'th'} = "\_text\_\<\/th\>\n"; } else { $GDEFAULT_TABLE{'th'} = ""; } else { $return .= ""; } $return .= ""; if ($clip_headline ne "") { $return .= ""; $headline_chk = "yes"; } else { $return .= ""; } $return .= "\n"; } else { $return .= "[$date] $clip_mark$num_c $title\
    \n"; } $G_CLIP_LIST .= "$_$GSPR_CODE"; } if ($file_bottom ne $file_mime) { while ($_ = ) { last if (/^END/); $char = chop; if ($char ne "\n") { $_ = $_ . $char; } ($file_mime, $date, $place, $title, $comment, $option, $c, $c, $c, $c, $c, $c, $clip_headline) = split (/\t/, $_); next if ($file_mime eq ""); next if (/^#/ || $title eq "−" || $title eq "--" || $title eq "-"); $date = &conv_date ($date); # 2001/08 NANDRA $file_html2 = &get_clip_fname ($file_mime, "chk"); $file_html = "../$this_clip_dir/$file_html2"; # 2001/08 NANDRA $num++; $num_c = &conv_num($num,2); $date = &conv_date ($date); if ($GSTAR ne "") { $title =~ s/$star/$GSTAR/g; } if ($title eq "") { if ($GCLIP_TITLE_SETTING eq "on") { if ($GCLIP_SEQNO eq "on") { $title = "$page_title#$num_c"; } else { $title = "$page_title"; } #02/04/24 Maekawa } else { $title = $file_html2; } } if ($GLINE eq "on") { if ($GLINE_COLOR eq "") { $return .= ""; } else { $return .= ""; } $return .= "" . ""; if ($clip_headline ne "") { $return .= ""; $headline_chk = "yes"; } else { $return .= ""; } $return .= "\n"; } else { $return .= "[$date] $clip_mark$num_c $title\
    \n"; } $G_CLIP_LIST .= "$_$GSPR_CODE"; last if ($file_bottom eq $file_mime); } } } #削除02/01/11 Maekawa  #if ($catg ne "$GNEWINFO" && $catg ne "皆さんの書き込みがあるページ" #&& $keyitem eq "cat") #削除02/01/11 Maekawa  #{ $GCLIP_COUNTER = $GCLIP_COUNTER + $num; } #98/02/01修正 if ($GLINE eq "on") { $txt_suspend = "
    \n"; } else { $table1 .= "
    \n"; } } $GDEFAULT_TABLE{'table'} = $table1 . $table2; if ($GTABLE_TR_TD2 eq "") { $GTABLE_TR_TD2 = $GTABLE_TR_TD; } if ($GTABLE_TD2_TEXT eq "") { $GTABLE_TD2_TEXT = $GTABLE_TD_TEXT; } $GDEFAULT_TABLE{'width'} = $GTABLE_WIDTH; if ($GTABLE_TH_TEXT eq "") { $GDEFAULT_TABLE{'th_text'} = "\_text\_"; } else { $GDEFAULT_TABLE{'th_text'} = "" . "\_text\_\<\/font>"; } if ($GTABLE_TD_TEXT eq "") { $GDEFAULT_TABLE{'td_text'} = "\_text\_"; } else { $GDEFAULT_TABLE{'td_text'} = "" . "\_text\_\<\/font>"; } if ($GTABLE_TD2_TEXT eq "") { $GDEFAULT_TABLE{'td2_text'} = "\_text\_"; } else { $GDEFAULT_TABLE{'td2_text'} = "" . "\_text\_\<\/font>"; } if ($GTABLE_TR_TH eq "") { $GDEFAULT_TABLE{'tr_th'} = "
    \_text\_\<\/th\>\n"; } if ($GTABLE_TD eq "") { $GDEFAULT_TABLE{'td'} = "\_text\_\<\/td\>\n"; } else { $GDEFAULT_TABLE{'td'} = "\_text\_\<\/td\>\n"; } if ($GTABLE_TD2 eq "") { $GDEFAULT_TABLE{'td2'} = "\_text\_\<\/td\>\n"; } else { $GDEFAULT_TABLE{'td2'} = "\_text\_\<\/td\>\n"; } } ################################################# sub modify_table #** テーブル属性初期値変更 99/12/06追加 ################################################# { my ($conf) = @_; my ($text, $max, @line, $num, %path_conf, %conf_table, $tag, $data, @width, $th_text, $td_text, $cnt, $switch, $i, $atom, $tmp, $char); #テーブル初期値設定 %conf_table = %GDEFAULT_TABLE; if ($conf eq "") { %conf_table = %GDEFAULT_TABLE; } else { $path_conf = $GPATH_LOCAL . "conf" . $GDELIMITER . $conf; if (-e $path_conf) { open (CONF, $path_conf) || output_msg("POP-E007", "sub:modify_table $path_conf"); while () { chop; next if (/^#/); next if (//); ($tag, $data) = split (/\t/, $_); if ($tag ne "width" && $tag ne "th_text" && $tag ne "td_text") { if ($data ne "") { $data = " " . $data; } else { $data = ""; } } if ($tag eq "width") { $conf_table{$tag} = $data; } if ($tag eq "th_text") { if ($data eq "") { $conf_table{$tag} = "\_text\_"; } else { $conf_table{$tag} = "" . "\_text\_\<\/font>"; } } if ($tag eq "td_text") { if ($data eq "") { $conf_table{$tag} = "\_text\_"; } else { $conf_table{$tag} = "" . "\_text\_\<\/font>"; } } if ($tag eq "table") { $conf_table{$tag} = "\n"; } if ($tag eq "tr_th") { $conf_table{$tag} = "\n"; } if ($tag eq "tr_td") { $conf_table{$tag} = "\n"; } if ($tag eq "tr_td2") { $conf_table{$tag} = "\n"; } if ($tag eq "th") { $conf_table{$tag} = "\_text\_\<\/th\>\n"; } if ($tag eq "td") { $conf_table{$tag} = "\_text\_\<\/td\>\n"; } if ($tag eq "td2") { $conf_table{$tag} = "\_text\_\<\/td\>\n"; } } } else { %conf_table = %GDEFAULT_TABLE; } } close (CONF); %conf_table } ################################################# sub edit_clip_page1 #** MIME処理(clip) 映像クリップ一覧作成 97/05/21追加, 98/04/11修正 ################################################# { my ($this_clip_dir, $file_in, $file_top, $file_bottom, $catg, $in_option, $page_title) = @_; my ($char, $flag, $file_mime, $date, $place, $title, $comment, $option, $star, $c, $headline_chk, $return, $dummy, $file_html, $file_html2, $num, $num_c, $clip_mark, $clip_link, $clip_headline); $star = "★"; $G_CLIP_LIST = ""; $headline_chk = "no"; if ($GCLIP_MARK ne "") { $clip_mark = $GCLIP_MARK; } else { $clip_mark = "\#"; } $file_in =~ s/\//$GDELIMITER/g; #00/01/15 open (FCLIP, $file_in) || output_msg("POP-E007", "sub: edit_clip_page1 $file_in"); while ($_ = ) { last if (/^END/); ($file_mime, $date, $place, $title, $comment, $option) = split (/\t/, $_); next if ($file_mime eq ""); next if (/^#/ || $title eq "−" || $title eq "--" || $title eq "-"); ($file_mime) = split (/\t/, $_); if ($file_top eq $file_mime && $file_top ne "") { $flag = "yes"; last; } if ($file_top eq "" && $file_mime ne "") { $flag = "yes"; last; } } if ($flag eq "yes") { $num = 0; $G_GET_CLIP_DATE = $date; if ($GLINE eq "on") { $return = ""; } $char = chop; if ($char ne "\n") { $_ = $_ . $char; } ($file_mime, $date, $place, $title, $comment, $option, $c, $c, $c, $c, $c, $c, $clip_headline) = split (/\t/, $_); if (not /^#/ && $title ne "−" && $title ne "--" && $title ne "-") { $date = &conv_date ($date); $file_html2 = &get_clip_fname ($file_mime, "chk"); # 2001/08 NANDRA $file_html = "../$this_clip_dir/$file_html2"; # 2001/08 NANDRA $num++; $num_c = &conv_num($num,2); $date = &conv_date ($date); if ($GSTAR ne "") { $title =~ s/$star/$GSTAR/g; } if ($title eq "") { if ($GCLIP_TITLE_SETTING eq "on") { if ($GCLIP_SEQNO eq "on") { $title = "$page_title#$num_c"; } else { $title = "$page_title"; } #02/04/24 Maekawa } else { $title = $file_html2; } } if ($GLINE eq "on") { if ($GLINE_COLOR eq "") { $return .= "
    $date\$clip_mark$num_c\" . "$title\" . "$clip_headline\
    $date\$clip_mark$num_c\$title\" . "$clip_headline\
    \n"; if ($GLINE_COLOR_HEAD eq "") { $txt_suspend .= ""; } else { $txt_suspend .= ""; } $txt_suspend .= ""; if ($headline_chk eq "yes") { $txt_suspend .= ""; } else { $txt_suspend .= ""; } $txt_suspend .= "\n"; if ($GTEXT_COLOR_HEAD eq "") { $txt_suspend =~ s/\@1\@//g; $txt_suspend =~ s/\@2\@//g; } else { $txt_suspend =~ s/\@1\@/\/g; $txt_suspend =~ s/\@2\@/\<\/font\>/g; } } # 2001/11 NANDRA $return = "($GTXT1P$num$GTXT1S)
    \n" . $txt_suspend . $return; $return =~ s/\[\] //g; $return =~ s/\[\/\/\] //g; if ($GLINE eq "on") { $return .= "
    \@1\@$GTXT7\@2\@\@1\@No.\@2\@\@1\@$GTXTC\@2\@\@1\@説 明\@2\@
    \n"; } $return .= "
    \n"; $return =~ s/<\/th><\/tr>\n/\n/g; #00/11/20 $return =~ s/<\/td><\/tr>\n/\n/g; #00/11/20 if ($num eq "" || $num == 0) { $return = ""; } #02/10/03 Maekawa $return } ################################################# sub edit_clip_page2 #** MIME処理(clip) 映像クリップページ一括作成 97/05/21追加, 98/04/11修正 ################################################# { my ($this_clip_dir, $file_in, $up, $path, $path2, $text_tmp, $page_title) = @_; my ($data, $this, $char, $flag, $file_mime, $date, $place, $title, $comment, $option, $dummy, $file_html, $file_html_old, $text, $text_old, $delimiter, $star, @clip_array, $mime, $next, $prev, $serial, $serial_c, $file_map, $local_file_map, $include_text, $txtfile, $xref); &machine; $delimiter = $GDELIMITER; unless (-d "$path$path2") { &check_dir ("$path$path2"); } $file_in =~ s/\//$GDELIMITER/g; #00/01/15 # open (FCLIP, $file_in) || output_msg("POP-E007", "sub:edit_clip_page2 $file_in"); open (FCLIP, $file_in) || return ""; #203/04/17暫定処置 $return = "\@numbers\@
    \n"; $serial = 0; @clip_array = split (/$GSPR_CODE/, $G_CLIP_LIST); foreach $data (@clip_array) { #2001/09/15修正 Maekawa ($file_mime, $date, $place, $title, $comment, $option,,,,,,,,,$xref) = split (/\t/, $data); next if ($file_mime eq ""); next if (/^#/ || $title eq "−" || $title eq "--" || $title eq "-"); $this = &get_clip_fname ($file_mime, "get"); if ($serial == 0) { $serial++; $prev = $up; $text = &edit_clip_page3 ($file_mime, $data, $prev, $path, $serial, $delimiter, $text_tmp, $page_title); $this = &get_clip_fname ($file_mime, "get"); } else { $serial++; $text = &edit_clip_page3 ($file_mime, $data, $prev, $path, $serial, $delimiter, $text_tmp, $page_title); open (FPAGE2, ">$path$path2$prev") || output_msg("POP-E019", "$path$path2$prev"); $text_old =~ s/\@next\@/$this/g; print FPAGE2 $text_old; close (FPAGE2); } $text_old = $text; $prev = $this; #マルチインデクス対応メタDBソースへエキスポート #2001/09/15修正 Maekawa if ($xref ne "") { &add_xref($xref, $this_clip_dir, $date, $page, $catg, $region, $this, $title, $yomi, $comment, $date2, $ext); } } if ($serial >= 1) { open (FPAGE2, ">$path$path2$this") || output_msg("POP-E019", "$path$path2$this"); $text_old =~ s/\@next\@/$up/g; print FPAGE2 $text_old; close (FPAGE2); } $serial } ################################################# sub get_clip_fname #** MIME処理(clip) 映像クリップファイル名 98/04/11追加 ################################################# { #ユニークモード:"(値なし)"(省略値)ユニーク化しないで返却、 #"chk"ユニークチェックをし新たな枝番を付けて返却、"get"ユニーク枝番を返却、 my ($file_mime, $umode) =@_; #02/04/24$mode(ユニーク処理モード)追加 my ($this, $mime); $file_mime =~ s/\.html\#/-/i; # HTML部分指定への対応 2001/08 NANDRA ($this, $mime) = split (/\./, $file_mime); #MIMEファイル重複時の処理 #02/04/24 Maekawa if ($umode eq "chk") { $this = &chk_fname_unique ($this); } else { if ($umode eq "get") { $this = &get_fname_unique ($this); } } $this =~ s/\//\-/g; $this =~ s/\%20/_/g; $this =~ s/ /_/g; $this = $this . ".html"; $this; } ################################################# sub chk_fname_unique #** MIME処理(clip) MIMEファイル名重複チェック&枝番付加返却 #02/04/24 Maekawa ################################################# { my ($file_mime) =@_; my ($protocol); if ($GLIST_CLIP{$file_mime} eq "") { #MIMEファイル名の重複チェック $GLIST_CLIP{$file_mime} = 1; } else { $protocol = &check_protocol ($file_mime); unless ($protocol eq "yes" || $catg eq "エイリアス") { #ファイル名重複の時は重複数をHTMLファイル名に付加する。 $GLIST_CLIP{$file_mime} += 1; #print "put $file_mime #$GLIST_CLIP{$file_mime}\n"; #<== $file_mime .= "_$GLIST_CLIP{$file_mime}"; } } $file_mime } ################################################# sub get_fname_unique #** MIME処理(clip) MIMEファイル名枝番付加返却 #02/04/24 Maekawa ################################################# { my ($file_mime) =@_; my ($protocol); $protocol = &check_protocol ($file_mime); unless ($protocol eq "yes" || $catg eq "エイリアス") { #ファイル名重複の時は重複数をHTMLファイル名に付加する。 #print "get $file_mime #$GLIST_CLIP{$file_mime}\n"; #<== if ($GLIST_CLIP{$file_mime} >=2) { $file_mime .= "_$GLIST_CLIP{$file_mime}"; } } $file_mime } ################################################# sub edit_clip_page3 #** MIME処理(clip) 映像クリップ個別ページ編集 98/04/11モジュール分割 ################################################# # 修正 2003/02/07 { my ($file_mime, $data, $prev, $path, $serial, $delimiter, $text_tmp, $page_title) =@_; my ($text, $text_old, $txtfile, $include_text, $char, $alttitle, $file_mime_head, $date, $place, $title, $comment, $option, $this, $mime, $form_tag, $file_map, $local_file_map, $file_html, $serial_c, $star, $mime_chk, $clip_link, $clip_headline, $clip_mark, $inline_img); my ($machine, $fpath, $frpath, $opt_path, $tmp_path); &machine; $machine = $GMACHINE; $delimiter = $GDELIMITER; # 拡張版の多階層ディレクトリ等に対応 (2003/02/20) # $fpath は filesディレクトリを含むパス。 # $frpath は filesディレクトリを含む相対パス。(UNIX形式) # $opt_pathはサイト毎のクリップファイル格納パス # ディレクトリチェック追加(03/03/12) $site = $GSITE; $tmp_path = "$path" . "files"; #2003/03/15 Maekawa if ($GENHANCED ne "" || -e $tmp_path) { $fpath = "$path" . "files$delimiter"; #2003/03/15 Maekawa $frpath = "../files"; $opt_path = "$delimiter$site"; } else { $fpath = "$path"; $frpath = ".."; $opt_path = ""; } $_ = $data; if ($GCLIP_MARK ne "") { $clip_mark = $GCLIP_MARK; } else { $clip_mark = "\#"; } $star = "★"; $char = chop; if ($char ne "\n") { $_ = $_ . $char; } ($file_mime, $date, $place, $title, $comment, $option) = split (/\t/, $_); $date = &conv_date ($date); #($this, $mime) = split (/\./, $file_mime); $mime = &get_mime ($file_mime); # 2001/08 NANDRA $this = &get_clip_fname ($file_mime, "get"); ($clip_link, $clip_headline) = split (/\t/, $CLIP_OPT {$file_mime}); #97/09/15追加 $file_map = ""; # (2003/02/20) $local_file_map = "$fpath" . "gif/map/$this" . ".gif"; $local_file_map = &conv_path ($local_file_map); if (-e $local_file_map) { # (2003/02/20) $file_map = "$frpath/gif/map/$this" . ".gif"; $file_map = "\n\n
    \n<\/center>\n"; } $file_html = "$path$path2$this"; if ($GSTAR ne "") { $title =~ s/$star//g; } $text = $text_tmp; if ($comment ne "") { $comment = &edit_tablequote ($comment); } if ($clip_link ne "") { $comment = $clip_link . "\n

    \n" . $comment; } #99/11/07追加 $serial_c = &conv_num($serial,2); if ($title ne "") { $text =~ s/\@title\@/$title/g; } else { if ($GCLIP_TITLE_SETTING eq "on") { if ($GCLIP_SEQNO eq "on") { $alttitle = "$page_title". "#" . "$serial_c"; $text =~ s/\@title\@/$alttitle/g; } else { $alttitle = "$page_title"; $text =~ s/\@title\@/$alttitle/g; } } else { $text =~ s/\@title\@/$file_mime/g; } } $mime_chk = ""; if ($mime eq "txt") { $mime_chk = "done"; # (2003/02/20) $txtfile = "$fpath$mime$delimiter$file_mime"; $txtfile = &conv_path ($txtfile); $include_text = &text_from_file ($txtfile, $mime, $option); #$text =~ # s/\@include_data\@/ \\\n\n$include_text\n\n\\<\/table\>\n/g; #####======================================= $text =~ s/\@include_data\@/ \\\\n\n$include_text\n\n\<\/td\>\<\/tr\>\<\/table\>\n/g; } if ($mime eq "html") { $mime_chk = "done"; # (2003/02/20) $txtfile = "$fpath$mime$delimiter$file_mime"; $txtfile = &conv_path ($txtfile); $include_text = &html_from_file ($txtfile, $mime, $option); $text =~ s/\@include_data\@/ \\\n\n$include_text\n\n\\<\/table\>\n/g; } if ($mime eq "table") { $mime_chk = "done"; # ASWINODW (2003/02/20) $txtfile = "$fpath$mime$delimiter$file_mime"; $txtfile = &conv_path ($txtfile); $include_text = &table_from_file ($txtfile); $text =~ s/\@include_data\@/$include_text\n\n/g; } if ($mime_chk ne "done") { $text =~ s/\@include_data\@/\@inline_img\@\n\$GTXT7: \@date\@ \@place\@\\n/g; } $text =~ s/\@serial\@/$clip_mark$serial_c/g; $text =~ s/\@mapfile\@/$file_map/g; $file_mime_head = substr ($file_mime, 0, 6); if ($file_mime_head eq "_clip_") { #画像ファイル名未設定の場合 #99/09/27 $text =~ s/\@inline_img\@\n\$GTXT7: \@date\@ \@place\@//g; } else { #画像ファイル名が設定されている場合 #02/01/23$path追加 $inline_img = &edit_imagelink ($path, $mime, $file_mime); $text =~ s/\@inline_img\@/$inline_img/g; } $text =~ s/\@date\@/$date/g; if ($date eq "") { $text =~ s/$GTXT7: //g; } $text =~ s/\@place\@/$place/g; $add_option = $GCLIP_OPT{$file_mime}; #99/11/01追加 ($add_option) = split (/\t/, $add_option); if (add_option ne "") { $comment = $add_option . "

    " . $comment; } $text =~ s/\@comment\@/$comment/g; $text =~ s/\@prev\@/$prev/g; if ($GPULLDOWN eq "on") { $form_tag = &form_start; $text =~ s/\@form_start\@/$form_tag/g; $form_tag = &form_end; $text =~ s/\@form_end\@/$form_tag/g; } $text = &replace_str ($text); #99/10/13 $text; } ################################################# sub make_folder_clip #** MIME処理(folder) ディレクトリ→clipリスト作成 97/06/20追加, 98/04/05, 98/10/02, 99/03/12修正 ################################################# { my ($folder, $subfolder, $file_clip, $mime, $date, $place, $title, $catg, $opt1, $title_head, $header) = @_; # $catg以下を追加 #2001/12/10マスタクリップ1行目データ # の付加項目 my (@allfiles, $this_file, $num, $num_c, $this_title, $path_file, $delimiter, $title2, $option, $mime_chk, $char2, $this_file2, @allfiles2, $check_path); &machine; $header = "01ファイル 02日付 03地域 04タイトル " . "05コメント 06オプション "; #2001/12/10 Maekawa $header .= "07時刻 08代替タイトル 09分類 10登録年月日 " . "11トピックID 12トピックタイトル 13ヘッドライン " . "14代表画(●)"; $delimiter = $GDELIMITER; if ($place eq "non") { $place = ""; } #2001/09/24 Maekawa #opendir (DIR, "$folder") || die "ディレクトリ$folderがありません。$!"; opendir (DIR, "$folder") || &output_msg ("POP-M006", $folder); #2002/05/06 NANDRA @allfiles = readdir (DIR); @allfiles = sort (@allfiles); #99/10/06追加 closedir (DIR); if ($subfolder ne "") { $subfolder = "$subfolder" . "/"; } $subfolder = &conv_delimiter ($subfolder); #00/03/16修正 $file_clip = &conv_path ($file_clip); #2001/09/24 Maekawa $check_path = &path_file($file_clip); #2001/09/24 Maekawa ($check_path) = split (/\t/, $check_path); #2001/09/24 Maekawa unless (-e $check_path) { &check_dir ($check_path); } #2001/09/24 Maekawa open (F_CLIP, ">$file_clip") || output_msg("POP-E010", $file_clip); #2002/05/06 NANDRA print F_CLIP "#$header\n"; #2001/12/10 Maekawa #if ($title_head ne "") { # $title = $title_head; $title_head = ""; #} #02/01/11 Maekawa $num = 0; foreach $this_file (@allfiles) { next if ($this_file eq "Icon\n"); #01/03/20 Mac対応 $char = substr ($this_file, 0, 1); next if ($char eq "\%" || $this_file eq "\." || $this_file eq "\.\."); if (-d "$folder$delimiter$this_file") { #フォルダが2階層の場合 opendir (DIR2, "$folder$delimiter$this_file") || output_msg("POP-E020", "$folder$delimiter$this_file"); #2002/05/06 NANDRA #"ディレクトリ$folder$delimiter$this_fileがありません @allfiles2 = readdir (DIR2); @allfiles2 = sort (@allfiles2); #99/10/06追加 closedir (DIR2); foreach $this_file2 (@allfiles2) { next if ($this_file2 eq "Icon\n"); #01/03/20 Mac対応 $this_file2 =~ s/ /\%20/g; $char2 = substr ($this_file2, 0, 1); next if ($char2 eq "\%" || $this_file2 eq "\." || $this_file2 eq "\.\."); $num++; if ($mime eq "txt" || $mime eq "table") { #クリップ対象がテキストファイルの場合、 # #で始まる先頭行を抽出 ($path_file) = split (/\./, $this_file2); $path_file = "$folder$delimiter$this_file" . "$delimiter$path_file.$mime"; ($this_title, $date, $place, $option) = split (/\t/, &get_clipinfo_from_text( $path_file, $num)); } else { #JPEG, GIFなどの場合 ($path_file) = split (/\./, $this_file2); $path_file = "$folder$delimiter$this_file" . "$delimiter$path_file.$mime"; $num_c = &conv_num($num); if ($title ne "") { $this_title = "$title\#$num_c"; } } $_ = $this_file2; next if (not /\.$mime/); if ($num == 1) { #2001/12/10 Maekawa print F_CLIP "$subfolder$this_file/$this_file2" . "\t$date\t$place\t$this_title\t\t$opt1\t\t" . "\t$catg\t\t\t$title_head\n"; } else { print F_CLIP "$subfolder$this_file/$this_file2" . "\t$date\t$place\t$this_title\t\t$option\n"; } } } else { #フォルダが1階層の場合 $num++; $this_file =~ s/ /\%20/g; if ($mime eq "txt" || $mime eq "table") { #クリップ対象がテキストファイルの場合、 # #で始まる先頭行を抽出 ($path_file) = split (/\./, $this_file); $path_file = "$folder$delimiter$path_file.$mime"; ($this_title, $date, $place, $option) = split (/\t/, &get_clipinfo_from_text ( $path_file, $num)); } else { #JPEG, GIFなどの場合 $num_c = &conv_num($num); if ($title ne "") { $this_title = "$title\#$num_c"; } } $_ = $this_file; if (/\.$mime/) { if ($num == 1) { #2001/12/10 Maekawa print F_CLIP "$subfolder$this_file\t$date\t" . "$place\t$this_title\t\t$opt1\t\t\t" . "$catg\t\t\t$title_head\n"; } else { print F_CLIP "$subfolder$this_file\t$date\t" . "$place\t$this_title\t\t$option\n"; } } } } close (F_CLIP); } ################################################# sub get_clipinfo_from_text #** テキスト・クリップ情報取得 99/03/12 ################################################# { my ($path_file, $num) = @_; my ($title, $date, $place, $option, $num_c, $this_title); open (FTXTFILE2, "$path_file") || &output_msg ("POP-M005", $path_file); #2002/05/06 NANDRA while () { if (/^#/) { s/^#//; chop; ($title, $date, $place, $option) = split (/\t/, $_); if ($title ne "") { $this_title = "$title"; } else { $num_c = &conv_num($num); $this_title = "$title\#$num_c"; } } last; } close (FTXTFILE2); "$this_title\t$date\t$place\t$option"; } ################################################# sub copy_textclipfile #** クリップテキストファイルコピー #99/04/11 ################################################# { my ($file_mime2, $mime2, $path) = @_; my ($dir2, @dir3, $dir3, $i, $file_from, $file_to, $dir_num, $delimiter, $rtn); my ($site, $fpath, $frpath, $opt_path, $tmp_path); &machine; $delimiter = $GDELIMITER; # 拡張版の多階層ディレクトリ等に対応 (2003/02/20) # $fpath は filesディレクトリを含むパス。 # $frpath は filesディレクトリを含む相対パス。(UNIX形式) # $opt_pathはサイト毎のクリップファイル格納パス # ディレクトリチェック追加(03/03/12) $site = $GSITE; $tmp_path = "$path" . "files"; #2003/03/15 Maekawa if ($GENHANCED ne "" || -e $tmp_path) { $fpath = "$path" . "files$delimiter"; #2003/03/15 Maekawa $frpath = "../files"; $opt_path = "$delimiter$site"; } else { $fpath = "$path"; $frpath = ".."; $opt_path = ""; } # (2003/02/21) $dir2 = $fpath . $mime2 . $delimiter . "$GDIR_LSIZE"; $dir2 =~ s/\//$delimiter/g; &check_dir($dir2); @dir3 = split (/\//, $file_mime2); $dir_num = @dir3; $dir_num--; for ($i=0; $i < $dir_num; $i++) { $dir2 .= "$delimiter$dir3[$i]"; &check_dir($dir2); } $i++; #ファイルをコピー # (2003/02/21) $file_from = $fpath . $mime2 . $delimiter . $file_mime2; $file_from =~ s/\//$delimiter/g; # (2003/02/21) $file_to = $file_mime = $fpath . $mime2 . $delimiter . "$GDIR_LSIZE" . $delimiter . $file_mime2; $file_to =~ s/\//$delimiter/g; if (-e $file_from) { $rtn = open (FILE_FROM, $file_from); if ($rtn != 1) { $rtn = &output_msg("POP-M005", $file_from); close (FILE_FROM); return ""; } #2002/05/06 NANDRA open (FILE_TO, ">$file_to") || output_msg("POP-E014", $file_to); #2002/05/06 NANDRA "$file_toの作成に失敗しました。 while () {print FILE_TO $_; } close (FILE_FROM); close (FILE_TO); } } ################################################# sub check_protocol #** プロトコルチェック 98/03/14追加 ################################################# { my ($url) = @_; my ($protocol, $return); $return = ""; ($protocol) = split (/\:/, $url); if ($protocol eq "http") { $return = "yes"; } if ($protocol eq "ftp") { $return = "yes"; } if ($protocol eq "mailto") { $return = "yes"; } if ($protocol eq "gopher") { $return = "yes"; } if ($protocol eq "archie") { $return = "yes"; } if ($protocol eq "nntp") { $return = "yes"; } if ($protocol eq "telnet") { $return = "yes"; } if ($protocol eq "file") { $return = "yes"; } #2001/09/15 Maekawa #02/04/22以下を追加 if ($protocol eq "rtsp") { $return = "yes"; } if ($protocol eq "nntp") { $return = "yes"; } if ($protocol eq "https") { $return = "yes"; } $return } #================================================================== #** Part 6:初期データ作成の省力化ツール #================================================================== ################################################# sub make_clip_db #** 初期DBソース&クリップファイル生成 #2001/09/24 Maekawa ################################################# # $site サイトのフォルダ名 # $site_t サイトのタイトル # $path サイトのローカルパス # $mime MIMEタイプ(画像形式) # $folder MIMEファイル(画像)の格納フォルダ名 # $catg 分類インデクスキー # $rgn 地域インデクスキー # $title_head 生成ページの仮のタイトル先頭 # $date 撮影年月日(yyyy/mm/dd) # $clip_num 1ページ当たりのクリップ数 # $master マスタフォルダ名 # $db_file マスタのDBソースファイル名 # $add_pattern 追加DBソースの追加パターン(省略値"add_to_bottom") { my ($site, $site_t, $path, $mime, $folder, $catg, $rgn, $title_head, $date, $clip_num, $master, $db_file, $add_pattern) = @_; my ($add_db, $imgclip_sw, $folder2, $folder3, $clipfile, $update, $file_add, $file_db); my ($machine, $delimiter, $fpath, $frpath, $opt_path, $tmp_path); &machine; $machine = $GMACHINE; $delimiter = $GDELIMITER; # 拡張版の多階層ディレクトリ等に対応 (2003/02/20) # $fpath は filesディレクトリを含むパス。 # $frpath は filesディレクトリを含む相対パス。(UNIX形式) # $opt_pathはサイト毎のクリップファイル格納パス # ディレクトリチェック追加(03/03/12) $site = $GSITE; $tmp_path = "$path" . "files"; #2003/03/15 Maekawa if ($GENHANCED ne "" || -e $tmp_path) { $fpath = "$path" . "files$delimiter"; #2003/03/15 Maekawa $frpath = "../files"; $opt_path = "$delimiter$site"; } else { $fpath = "$path"; $frpath = ".."; $opt_path = ""; } if ($site ne "") { $GSITE = $site; } else { output_msg("POP-E021"); } #2002/05/06 NANDRA "サイトフォルダ名を指定して下さい if ($path eq "") { output_msg("POP-E022"); } #2002/05/06 NANDRA "ローカルパスを指定して下さい if ($folder eq "") { output_msg("POP-E023"); } #2002/05/06 NANDRA "MIME格納フォルダ名を指定して下さい #&set_default($path); if ($mime eq "") { $mime = "jpg"; } if ($clip_num eq "") { $clip_num = 20; } if ($master eq "") { $master = "master"; } if ($db_file eq "") { $db_file = $site . ".db"; } if ($add_pattern eq "") { $add_pattern = "add_to_bottom"; } $GPATH_LOCAL = "$path$GDELIMITER"; $add_db = "add.db"; $file_add = "$path$GDELIMITER$master$GDELIMITER$add_db"; $file_add = &conv_path($file_add); $file_db = "$path$GDELIMITER$master$GDELIMITER$db_file"; $file_db = &conv_path($file_db); $imgclip_sw = $GIMAGECLIP; $GIMAGECLIP = "off"; $folder2 = "$fpath$GDELIMITER$mime$GDELIMITER$folder"; $folder2 = &conv_path($folder2); $folder3 = &conv_path($folder); $clipfile = "$fpath$GDELIMITER" . "clip" . $opt_path . "$GDELIMITER$folder.clip"; $clipfile = &conv_path($clipfile); $update = &getdate2("/"); #画像フォルダのクリップファイルを生成 &make_folder_clip ($folder2, $folder3, $clipfile, $mime, $date, $rgn, ""); #クリップファイルからDBソースを生成 &make_dbdata($clipfile, $file_add, $site_t, $catg, $rgn, $folder, $date, $update, $title_head, $clip_num); $GIMAGECLIP = $imgclip_sw; #生成したDBソースをマスタのDBソースに追加 &filemerge($file_add, $file_db, $add_pattern); } ################################################# sub make_clip_dbdata #** クリップ&DB初期データ作成 #99/09/26 #どうもmake_clip_dbと殆ど差がないのでそのうち没にします! #2001/09/24 Maekawa ################################################# { my ($site, $site_t, $path, $mime, $folder, $date, $catg, $place, $title, $num, $imageclip) = @_; my ($clipfile, $mimefolder, $dbfile, $datafile, $update, $delimiter); my ($fpath, $frpath, $opt_path, $tmp_path); &machine; $delimiter = $GDELIMITER; # 拡張版の多階層ディレクトリ等に対応 (2003/02/20) # $fpath は filesディレクトリを含むパス。 # $frpath は filesディレクトリを含む相対パス。(UNIX形式) # $opt_pathはサイト毎のクリップファイル格納パス # ディレクトリチェック追加(03/03/12) $site = $GSITE; $tmp_path = "$path" . "files"; #2003/03/15 Maekawa if ($GENHANCED ne "" || -e $tmp_path) { $fpath = "$path" . "files$delimiter"; $frpath = "../files"; $opt_path = "$delimiter$site"; } else { $fpath = "$path"; $frpath = ".."; $opt_path = ""; } # (2003/02/20) #$clipfile = "$fpath$delimiter" . "clip$opt_path$delimiter$folder.clip"; $clipfile = &getClipAbsPath($path, $site, "$folder.clip"); #03/07/13 Maekawa $mimefolder = "$path$delimiter$mime$opt_path$delimiter$folder"; $dbfile = "$path$delimiter". "master$delimiter" . "add.db"; $datafile = "$path$delimiter". "master$delimiter" . "last.dat"; $clipfile = &conv_path ($clipfile); #00/03/07修正 $mimefolder = &conv_path ($mimefolder); #00/03/07修正 $dbfile = &conv_path ($dbfile); #00/03/07修正 $datafile = &conv_path ($datafile); #00/03/07修正 $update = &getdate2("/"); &make_folder_clip ($mimefolder, $folder, $clipfile, $mime, $date, $place, ""); &make_dbdata($clipfile, $dbfile, $site_t, $catg, $place, $folder, $date, $update, $title, $num); open (FOUT, ">$datafile") || output_msg("POP-E014", $datafile); print FOUT "$clipfile\n"; print FOUT "$dbfile\n"; close FOUT; } ################################################# sub make_dbdata #** DB初期データ作成 #98/10/25 ################################################# { my ($clipfile, $addfile, $site, $catg, $region, $folder, $date, $update, $title, $num, $num_max) = @_; my ($text); $text = &edit_dbdata ($clipfile, $site, $catg, $region, $folder, $date, $update, $title, $num, $num_max); open (FADD, ">$addfile") || output_msg("POP-E014", $addfile); print FADD "$text"; close (FADD); } ################################################# sub edit_dbdata #** DB初期データ編集 #98/10/25, 00/07/11修正 ################################################# { my ($clipfile, $site, $catg, $region, $folder, $date, $update, $title, $num, $new_label) = @_; my ($text, $page_no, $this_img, $cnt, $cntall, $first, $numc, $folderc, $region2); $folder = &conv_delimiter ($folder); #00/03/16修正 $num_head = 0; $num_bottom = $num_head + $num -1; if ($region ne "") { $resion2 = $region; } else { $region = "non"; $resion2 = ""; } #2001/09/24 Maekawa $text = "#-----------------------------------\n"; $text .= "# $catg:$title #$update\n"; $text .= "#-----------------------------------\n"; open (FCLIP, "$clipfile") || output_msg("POP-E007", "sub:edit_dbdata $clipfile"); $cntall = $page_no = 0; while () { $cnt++; $cntall++; ($this_img) = split (/\t/, $_); if ($cnt == 1) { $page_no++; $first = $this_img; } if ($cnt >= $num) { $folderc = $folder; #00/04/23 $folderc =~ s/\//\-/g; #00/04/23 $cnt = 0; $text .= "■$site\n"; if ($new_on eq "on") { $text .= "$GNEWINFO,"; } #00/07/11 $text .= "$catg\n"; $text .= "$region \n"; if ($page_no < 10) { $numc = "0" . "$page_no"; } else { $numc = "$page_no"; } $text .= "$folderc-$numc\n"; $text .= "$title#$numc\n"; $text .= "non\n"; $text .= "$update\n"; $text .= "headline \n"; $text .= "$first $date $region2\n"; #2001/09/24 Maekawa $text .= "tablequote \n"; $text .= "subtitle 映像クリップ\n"; if ($GIMAGECLIP eq "on") { $text .= "imageclip "; } $text .= "$folder.clip $first $this_img\n"; $text .= "\n"; } } if ($cnt >= 1) { $folderc = $folder; #00/04/23 $folderc =~ s/\//\-/g; #00/04/23 $text .= "■$site\n"; if ($new_on eq "on") { $text .= "$GNEWINFO,"; } #00/07/11 $text .= "$catg\n"; $text .= "$region \n"; if ($page_no < 10) { $numc = "0" . "$page_no"; } else { $numc = "$page_no"; } $text .= "$folderc-$numc\n"; $text .= "$title#$numc\n"; $text .= "non\n"; $text .= "$update\n"; $text .= "headline \n"; $text .= "$first $date $region2\n"; #2001/09/24 Maekawa $text .= "tablequote \n"; $text .= "subtitle 映像クリップ\n"; if ($GIMAGECLIP eq "on") { $text .= "imageclip "; } $text .= "$folder.clip $first $this_img\n"; $text .= "\n"; } close (FCLIP); output_msg("UTL-A001", $clipfile, $page); #2002/05/06 NANDRA $text } ################################################# sub clipmaster2clip #** マスタクリップ→クリップ生成 99/03/09追加, #01/05/03 $img_markを追加 ################################################# { my ($clipmaster_file, $newclip_file,$interval_sec, $page_title) = @_; my ($clippath, $delimiter, $char, $file_mime, $date, $region, $title, $comment, $option, $time, $title_alt, $catg, $update, $file_mime_old, $date_old, $region_old, $title_old, $comment_old, $option_old, $time_old, $title_alt_old, $catg_old, $update_old, $old, $num_done, $cnt_all, $tno_old, $tno_c, $ano_old, $ano_c, $title_c, $catg_c, $add_catg, $img_mark, $img_mark_old, $page_id, $page_id_old, $page_title_old, $clip_headline, $clip_headline_old); $cnt_all = $num_done = $tno_old = $ano_old = 0; open (FIN, "$clipmaster_file") || output_msg("POP-E007", "sub:clipmaster2clip $clipmaster_file"); open (FOUT, ">$newclip_file") || output_msg("POP-E010", $newclip_file); if ($GS_VERSION_TEXT ne "") { $GALT_LABEL = $GS_VERSION_TEXT; } if ($GS_VERSION eq "on") { # Lサイズ版処理 if ( $GALT_LABEL eq "") { $add_catg = " $GALT_LABEL\="; } else { $add_catg = "$GALT_LABEL\="; } } else { $add_catg = ""; } while () { last if (/^END/); next if (/^#/); #01/05/03追加 $char = chop; if ($char ne "\n") { $_ = $_ . $char; } ($file_mime, $date, $region, $title, $comment, $option, $time, $title_alt, $catg, $update, $page_id, $page_title, $clip_headline, $img_mark) = split (/\t/, $_); next if ($file_mime eq ""); next if ($title eq "−" || $title eq "--" || $title eq "-"); #01/05/03 $cnt_all++; if ($cnt_all == 1) { #データ1件目の処理 #1件目のデータの退避 $file_mime_old = $file_mime; $date_old = $date; $region_old = $region; $title_old = $title; $comment_old = $comment; $option_old = $option; $time_old = $time; $title_alt_old = $title_alt; $catg_old = $catg; if ($update eq "") { $update = &getdate2("/"); } $update_old = $update; $page_id_old = $page_id; $page_title_old = $page_title; $option_old = $option; $clip_headline_old = $clip_headline; $img_mark_old = $img_mark; } else { #データ2件目以降の処理 if ($date eq "") { $date = $date_old; } if ($region eq "") { $region = $region_old; } if ($title eq "") { $title = $title_old; } if ($option eq "") { $option = $option_old; } #01/05/03追加 if ($update eq "") { $update = $update_old; } if ($page_title eq "") { $page_title = $page_title_old; } #01/05/03追加 if ($time eq "") { $time = &get_next_time ($date_old, $date, $time_old, $file_mime_old, $file_mime, $interval_sec); } if ($catg eq "") { $catg = $catg_old; } #タイトルの設定 if ($title_alt_old ne "") { #代替タイトルが設定されている場合 if ($title_alt_old eq $title_alt) { #代替タイトルが連続している(後に続いている)場合 $ano_old++; $ano_c = &conv_num ($ano_old); $title_c = $title_alt_old . "#$ano_c"; } else { #代替タイトルが1つ、または複数件の最後の場合 if ($title_alt_old ne $title_alt) { $ano_old++; $ano_c = &conv_num ($ano_old); if ($ano_old == 1) { $title_c = $title_alt_old; } else { $title_c = $title_alt_old . "#$ano_c"; } $ano_old = 0; } } } else { #代替タイトルがない場合(タイトルを出力) if ($title_old ne "") { #01/05/03条件追加 $ano_old = 0; $tno_old++; $tno_c = &conv_num ($tno_old); $title_c = $title_old . "#$tno_c"; } else { #01/05/03追加 $title_c = ""; } } #クリップ出力 $catg_c = "$add_catg$catg_old"; print FOUT "$file_mime_old\t$date_old $time_old\t$region_old\t" . "$title_c\t$comment_old\t$option_old\t$time_old\t" . "$title_alt_old\t$catg_c\t$update_old\t$page_id_old\t" . "$page_title_old\t$clip_headline_old\t$img_mark_old\n"; if ($title_old ne $title) { $tno_old = 0; #タイトル連番の初期化 } #1件前のデータの退避 $file_mime_old = $file_mime; $date_old = $date; $region_old = $region; $title_old = $title; $comment_old = $comment; $option_old = $option; $time_old = $time; $title_alt_old = $title_alt; $catg_old = $catg; $update_old = $update; $page_id_old = $page_id; $page_title_old = $page_title; $option_old = $option; $img_mark_old = $img_mark; $clip_headline_old = $clip_headline; } } $tno_old++; $tno_c = &conv_num ($tno_old); if ($title_old ne "") { $title_c = $title_old . "#$tno_c"; } else { $title_old = ""; } #01/05/03追加(バグ修正) $catg_c = "$add_catg$catg_old"; print FOUT "$file_mime_old\t$date_old $time_old\t$region_old\t" . "$title_c\t$comment_old\t$option_old\t$time_old\t$title_alt_old\t" . "$catg_c\t$update_old\t$page_id_old\t$page_title_old\t" . "$clip_headline_old\t$img_mark_old\n"; output_msg("UTL-A002", $cnt_all, $newclip_file); #2002/05/06 NANDRA close (FIN); close (FOUT); } ################################################# sub mclip2db #** マスタクリップ→新規DBソース&クリップファイル生成 #2001/12/10 Maekawa ################################################# #【機能】 #マスタクリップからクリップファイルと新規DBソース(ファイル名add.db)を自動生成する。 #DBソースファイルが指定されている場合は新規DBソースを追加書きする。 #【引数】 # $site サイトのフォルダ名(必須) # $site_t サイトのタイトル(省略可)=なるべく省略しないように! # $path サイトのローカルパス(必須) # $mclip マスタクリップファイル名(必須) # $clipname クリップファイル名 # $clip_num 1ページ当たりのクリップ数(省略値20) # $master マスタフォルダ名(省略値"master") # $db_file 追加書きするマスタのDBソースファイル名(省略の場合は追加書きしない) # $add_pattern 追加DBソースの追加パターン"add_to_top", "add_to_bottom"のいずれか(省略値"add_to_bottom") #【返却値】なし { my ($site, $site_t, $path, $mclip, $clipname, $clip_num, $master, $db_file, $add_pattern) = @_; my ($db_add, $path_mclip, $path_clip, $path_db_add, $path_db_file); &machine; $db_add = "add.db"; if ($master eq "") { if ($GMASTER eq "") { $master = "master"; } else { $master = "$GMASTER"; } } if ($clip_num eq "") { $clip_num = 20; } #$path_mclip = "$fpath" . "clip$GDELIMITER$mclip"; #$path_clip = "$path" . "clip$GDELIMITER$clipname"; #$path_mclip = "$fpath" . "clip$GDELIMITER$site$GDELIMITER$mclip"; $path_mclip = &getClipAbsPath($path, $site, "$mclip"); #03/07/13 Maekawa #$path_clip = "$fpath" . "clip$GDELIMITER$site$GDELIMITER$clipname"; $path_clip = &getClipAbsPath($path, $site, "$clipname"); #03/07/13 Maekawa $path_db_add = "$path$master$GDELIMITER$db_add"; $path_db_file = "$path$master$GDELIMITER$db_file"; $path_mclip = &conv_path($path_mclip); $path_clip = &conv_path($path_clip); $path_db_add = &conv_path($path_db_add); $path_db_file = &conv_path($path_db_file); $clipname = &conv_delimiter($clipname); #print "1)$path_mclip\n 2)$path_clip\n 3)$path_db_add\n " . # "4)$path_db_file\n 5)$clipname\n"; <== #引数:マスタクリップ,クリップファイル &clipmaster2clip ($path_mclip, $path_clip); #追加するテンポラリDBソースを空っぽに &fileinit("$path_db_add"); #クリップ→DBデータ作成 &make_dbdata_x($path_clip, $clipname, $path_db_add, $site_t, $clip_num); if ($db_file ne "") { if ($add_pattern eq "") { $add_pattern = "add_to_bottom"; } &filemerge($path_db_add, $path_db_file, $add_pattern); } } ################################################# sub folders2mclip #** マルチフォルダ→マスタクリップ生成 #2001/12/10#03/07/13 Maekawa ################################################# # $site サイトのフォルダ名 # $site_t サイトのタイトル # $path サイトのローカルパス # $mime MIMEタイプ(画像形式) # $folders_list MIMEファイル(画像)の格納フォルダ名のリスト(カンマ区切り) # $mclip マスタクリップファイル名 # $catg 分類インデクスキー # $rgn 地域インデクスキー # $opt1 オプションインデクス1キー # $date 撮影年月日(yyyy/mm/dd) # $title_head トピックタイトル先頭部 { my ($site, $site_t, $path, $mime, $folders_list, $mclip, $catg, $rgn, $opt1, $date, $title_head) = @_; my ($clipname, $db_add, $imgclip_sw, $folder, $folder2, $folder3, $update, $file_add, $file_db, $tmpfile, @folders, $check_path); my ($machine, $delimiter, $fpath, $frpath, $opt_path, $tmp_path); &machine; $machine = $GMACHINE; $delimiter = $GDELIMITER; # 拡張版の多階層ディレクトリ等に対応 (2003/02/20) # $fpath は filesディレクトリを含むパス。 # $frpath は filesディレクトリを含む相対パス。(UNIX形式) # $opt_pathはサイト毎のクリップファイル格納パス # ディレクトリチェック追加(03/03/12) if ($site eq "") { $site = $GSITE; } #03/07/13 Maekawa $tmp_path = "$path" . "files"; #2003/03/15 Maekawa if ($GENHANCED ne "" || -e $tmp_path) { $fpath = "$path" . "files$delimiter"; #2003/03/15 Maekawa $frpath = "../files"; $opt_path = "$delimiter$site"; } else { $fpath = "$path"; $frpath = ".."; $opt_path = ""; } if ($site ne "") { $GSITE = $site; } else { #2002/05/06 NANDRA "サイトフォルダ名を指定して下さい output_msg("POP-E021"); } if ($path eq "") { #2002/05/06 NANDRA "ローカルパスを指定して下さい output_msg("POP-E022"); } if ($folders_list eq "") { #2002/05/06 NANDRA "MIME格納フォルダ名を指定して下さい output_msg("POP-E023"); } #&set_default($path); if ($mime eq "") { $mime = "jpg"; } if ($clip_num eq "") { $clip_num = 20; } if ($master eq "") { $master = "master"; } if ($db_file eq "") { $db_file = $site . ".db"; } if ($add_pattern eq "") { $add_pattern = "add_to_bottom"; } $folders_list =~ s/ //g; $folders_list =~ s/\t//g; $folders_list =~ s/\"//g; @folders = split (/,/,$folders_list); $GPATH_LOCAL = "$path"; $db_add = "add.db"; $file_add = "$path$master$GDELIMITER$db_add"; $file_add = &conv_path($file_add); $file_db = "$path$master$GDELIMITER$db_file"; $file_db = &conv_path($file_db); # (2003/02/20) #$tmpfile = "$fpath" . "clip" . $opt_path . "$GDELIMITER" . "add.clip"; #$tmpfile = &conv_path($tmpfile); $tmpfile = &getClipAbsPath($path, $site, "add.clip"); $clipname = $mclip; # (2003/02/20) #$mclip = "$fpath" . "clip" . $opt_path . "$GDELIMITER" . "$mclip"; #$mclip = &conv_path($mclip); $mclip = &getClipAbsPath($path, $site, "$mclip"); #生成するクリップファイルを初期化 $check_path = &path_file ($mclip, 2); ($check_path) = split (/\t/, $check_path); &check_dir ($check_path); &fileinit ($mclip); $imgclip_sw = $GIMAGECLIP; $GIMAGECLIP = "off"; $update = &getdate2("/"); #画像フォルダのクリップファイルとDBソースを生成 foreach $folder (@folders) { $folder2 = "$fpath$mime$GDELIMITER$folder"; $folder2 = &conv_path($folder2); $folder3 = &conv_path($folder); &make_folder_clip ($folder2, $folder3, $tmpfile, $mime, $date, $rgn, "", $catg, $opt1, $title_head); #生成したテンポラリクリップをクリップファイルに追加 &filemerge($tmpfile, $mclip, $add_pattern); } } ################################################# sub folders2mclip2db #** マルチフォルダ→マスタクリップ→DBソース生成 #2002/01/04 Maekawa ################################################# # $site サイトのフォルダ名 # $site_t サイトのタイトル # $path サイトのローカルパス # $mime MIMEタイプ(画像形式) # $folders_list MIMEファイル(画像)の格納フォルダ名のリスト(カンマ区切り) # $mclip マスタクリップファイル名 # $clipfile クリップファイル名 # $catg 分類インデクスキー # $rgn 地域インデクスキー # $opt1 オプションインデクス1キー # $date 撮影年月日(yyyy/mm/dd) # $title_head トピックタイトル先頭部 # $clip_num 1ページ当たりのクリップ数(省略値20) # $master マスタフォルダ名(省略値"master") # $db_file 追加書きするマスタのDBソースファイル名(省略の場合は追加書きしない) # $add_pattern 追加DBソースの追加パターン"add_to_top", "add_to_bottom"のいずれか(省略値"add_to_bottom") { my ($site, $site_t, $path, $mime, $folders_list, $mclip, $clipfile, $catg, $rgn, $opt1, $date, $title_head, $clip_num, $master, $db_file, $add_pattern) = @_; #マスタクリップ生成 &folders2mclip($site, $site_t, $path, $mime, $folders_list, $mclip, $catg, $rgn, $opt1, $date, $title_head); #マスタクリップからクリップファイル&DBソース生成 &mclip2db ($site, $site_t, $path, $mclip, $clipfile, $clip_num, $master,$db_file, $add_pattern); } ################################################# sub div_clip #** クリップデータ間引き処理 99/03/10追加 ################################################# { my ($clip_file, $new_clip_file,$num) = @_; my ($cnt, $char, $file_mime, $date, $place, $title, $comment, $option, $old, $num_done, $cnt_all); open (FIN, $clip_file) || output_msg("POP-E009", $clip_file); open (FOUT, ">$new_clip_file") || output_msg("POP-E010", $new_clip_file); $cnt = $num_done = 0; while () { last if (/^END/); $cnt++; $char = chop; if ($char ne "\n") { $_ = $_ . $char; } ($file_mime, $date, $place, $title, $comment, $option) = split (/\t/, $_); next if ($file_mime eq ""); next if (/^#/ || $title eq "−" || $title eq "--" || $title eq "-"); if ($cnt == 1) { print FOUT "$_\n"; $num_done++; $cnt_all++; } else { $cnt_all++; if ($cnt == $num) { $cnt = 0; } } $old = $_; } #2002/05/06 NANDRA output_msg("UTL-A003", $num, $num_done, $cnt_all, $new_clip_file); close (FIN); close (FOUT); } ################################################# sub make_dbdata_x #** DB初期データ作成x #99/03/10追加 ################################################# { my ($clipfile, $clipname, $addfile, $site, $num_max, $site_title_option, $add_idx) = @_; my ($text); $text = &edit_dbdata_x ($clipfile, $clipname, $site, $num_max, $addfile, $site_title_option, $add_idx); #2002/05/06 NANDRA "$addfileの作成に失敗しました open (FADD, ">$addfile") || output_msg("POP-E014", $addfile); print FADD "$text"; close (FADD); } ################################################# sub edit_dbdata_x #** DB初期データ編集x #99/03/10追加 99/09/09修正 ################################################# { my ($clipfile, $clipname, $site, $num_max, $addfile, $site_title_option, $add_idx) = @_; my ($text, $catg_no, $this_img, $cnt, $cnt_all, $first, $numc, $file_mime, $date, $region, $title, $comment, $option, $time, $title_alt, $catg, $update, $file_mime_old, $date_old, $region_old, $title_old, $update_old, $comment_old, $option_old, $time_old, $title_alt_old, $catg_old, $catg_c,$dummy, $today, $char, $datex, $num_head, $num_bottom, $num, $folder, $page_seq_noc, $page_seq_no, $clip_headline, $img_mark, $sel_img, $page_id, $page_title, $page_id_old, $page_title_old, $first_option, $first_page_id, $first_comment); $num_head = 0; $num_bottom = $num_head + $num -1; $text = ""; $today = &getdate2("/"); $clipname =~ s/\:/\//g; $clipname =~ s/\\/\//g; #01/05/03追加 ($folder) = split (/\./, $clipname); $folder =~ s/\//-/g; #01/05/03追加 open (FCLIP, "$clipfile") || output_msg("POP-E007", "sub:edit_dbdata_x $clipfile"); $cnt = $cnt_all = 0; $catg_no = 1; $page_seq_no = 1; if ($site_title_option ne "") { $site .= $site_title_option; } while () { last if (/^END/); $char = chop; if ($char ne "\n") { $_ = $_ . $char; } ($file_mime, $date, $region, $title, $comment, $option, $time, $title_alt, $catg, $update, $page_id, $page_title, $clip_headline, $img_mark) = split (/\t/, $_); next if ($file_mime eq ""); next if (/^#/ || $title eq "−" || $title eq "--" || $title eq "-"); ($datex) = split (/ /, $date); $cnt++; $cnt_all++; if ($cnt_all == 1) { #データ1件目の処理 #1件目のデータの退避 $first = $file_mime_old = $file_mime; $first_option = $option_old = $option; $first_page_id = $page_id_old = $page_id; $first_comment = $comment_old = $comment; $date_old = $datex; $region_old = $region; $catg_old = $catg; if ($update eq "") { $update = $today; } else { if ($update eq "\@\@today\@\@") { $update = $today; } } $update_old = $update; $page_title_old = $page_title; $cnt=0; $text .= "#-----------------------------------\n"; $text .= "# $catg:$title #$update\n"; $text .= "#-----------------------------------\n"; } else {#データ2件目以降の処理 if ($cnt == 1) { $first = $file_mime_old; $first_option = $option_old; $first_page_id = $page_id_old; $first_comment = $comment_old; } if ($catg_old ne $catg || $region_old ne $region || $date_old ne $datex || $page_title_old ne $page_title || $cnt >= $num_max) { $cnt = 0; $numc = &conv_num ($catg_no); $page_seq_noc = &conv_num ($page_seq_no,2); ($dummy, $catg_c) = split (/\=/, $catg_old); if ($catg_c eq "") { $catg_c = $dummy } $text .= "■$site\n"; #if ($update_old eq $today && $update_old ne "00/00/00" #&& $update_old ne "0000/00/00") #01/05/03 条件なしに変更 #{ # $text .= "$GNEWINFO,$catg_old\n"; #} #else #{ if ($add_idx ne "") { $text .= "$add_idx,"; } $text .= "$catg_old\n"; #} $text .= "$region_old \n"; if ($catg_no < 10) { $numc = "0" . "$catg_no"; } else { $numc = "$catg_no"; } if ($first_page_id eq "") { $text .= "$folder-$page_seq_noc\n"; } else {#99/09/09修正 $text .= "$first_page_id\n"; } if ($page_title_old eq "") { $text .= "$catg_c#$numc\n"; } else { #99/09/09修正 $text .= "$page_title_old\n"; } if ($first_option eq "") { $text .= "non\n"; } else { #99/09/09修正 $text .= "$first_option\n"; } $text .= "$update_old\n"; $text .= "headline \n"; if ($sel_img eq "") { $sel_img = $first; } #01/05/03追加 $text .= "$sel_img $date_old $region_old\n"; if ($first_comment eq "") { $text .= "tablequote \n"; } else { $text .= "tablequote $first_comment\n"; } $first_comment = ""; if ($first ne $file_mime_old) { #クリップが2件以上の場合 #99/09/10修正 $text .= "subtitle 映像クリップ\n"; if ($GIMAGECLIP eq "on") { $text .= "imageclip "; } $text .= "$clipname $first $file_mime_old\n"; } else { #クリップが1件の場合 unless ($GCLIP_GENERATE eq "no") { #クリップページ生成指定がnoでないなら $text .= "subtitle 映像クリップ\n"; if ($GIMAGECLIP eq "on") { $text .= "imageclip "; } $text .= "$clipname $first $file_mime_old\n"; } } $text .= "\n"; $page_seq_no++; if ($catg_old eq $catg) { $catg_no++; } else { $catg_no = 1; } $sel_img = ""; #01/05/03追加 } } #1件前のデータの退避 $file_mime_old = $file_mime; $date_old = $datex; $region_old = $region; $catg_old = $catg; $update_old = $update; $page_id_old = $page_id; $page_title_old = $page_title; $option_old = $option; if ($first_option eq "" && $option_old ne "") { $first_option = $option_old; } $comment_old = $comment; if ($first_comment eq "" && $comment_old ne "") { $first_comment = $comment_old; } if ($img_mark ne "") { $sel_img = $file_mime; } #01/05/03追加 } if ($cnt >= 1) { $cnt = 0; $numc = &conv_num ($catg_no); $page_seq_noc = &conv_num ($page_seq_no,2); ($dummy, $catg_c) = split (/\=/, $catg_old); if ($catg_c eq "") { $catg_c = $dummy}; $text .= "■$site\n"; #if ($update_old eq $today && $update_old ne "00/00/00" #&& $update_old ne "0000/00/00") #01/05/03 条件なしに変更 #{ # $text .= "$GNEWINFO,$catg_old\n"; #} #else #{ if ($add_idx ne "") { $text .= "$add_idx,"; } $text .= "$catg_old\n"; #} $text .= "$region_old \n"; if ($catg_no < 10) { $numc = "0" . "$catg_no"; } else { $numc = "$catg_no"; } if ($first_page_id eq "") { $text .= "$folder-$page_seq_noc\n"; } else { $text .= "$first_page_id\n"; } if ($page_title_old eq "") { $text .= "$catg_c#$numc\n"; } else { #99/09/09修正 $text .= "$page_title_old\n"; } if ($first_option eq "") { $text .= "non\n"; } else { #99/09/09修正 $text .= "$first_option\n"; } $text .= "$update_old\n"; $text .= "headline \n"; if ($sel_img eq "") { $sel_img = $first; } #01/05/03追加 $text .= "$sel_img $date_old $region_old\n"; if ($first_comment eq "") { $text .= "tablequote \n"; } else { $text .= "tablequote $first_comment\n"; } if ($first ne $file_mime_old) { #クリップが2件以上の場合 #99/09/10修正 $text .= "subtitle 映像クリップ\n"; if ($GIMAGECLIP eq "on") { $text .= "imageclip "; } $text .= "$clipname $first $file_mime_old\n"; } else { #クリップが1件の場合 unless ($GCLIP_GENERATE eq "no") { #クリップページ生成指定がnoでないなら #クリップページを生成する $text .= "subtitle 映像クリップ\n"; if ($GIMAGECLIP eq "on") { $text .= "imageclip "; } $text .= "$clipname $first $file_mime_old\n"; } } $text .= "\n"; } close (FCLIP); output_msg("UTL-A004", $page_seq_no, $cnt_all, $addfile); $text } ################################################# sub get_next_time #** クリップ次時刻返却 99/03/09追加 ################################################# { #工事中関数 my ($date_old, $date, $time_old, $file_mime_old, $file_mime, $interval_sec) = @_; my ($dummy, $time_data, $folder1, $folder2, $mins1, $mins2, $seqno1, $seqno2, $hh, $mm, $ss, $nexttime); "" } ################################################# sub filetrans #** ファイル・文字列置換 99/01/02追加 ################################################# #使用例 # require 'popcorn.pl'; # &filetrans ("mmdb:mmy:kasumigaura:master:kasumigaura.db", # "mmdb:mmy:kasumigaura:master:kasumi-new.db", #"■マッピング霞ヶ浦", "■マッピング霞ヶ浦\*"); { my ($fname1, $fname2, $word1, $word2) = @_; if ($word1 eq "") { #2002/05/06 NANDRA "変換前の文字列が未設定です output_msg("UTL-E001"); } if ($word2 eq "") { #2002/05/06 NANDRA "変換後の文字列が未設定です output_msg("UTL-E002"); } open (FILE_FROM, $fname1) || output_msg("UTL-E003", $fname1); open (FILE_TO, ">$fname2") || output_msg("UTL-E004", $fname2); while () { s/$word1/$word2/g; print FILE_TO $_; } close (FILE_TO); close (FILE_FROM); } ################################################# sub arrange_metatags #** METAタグアレンジ 01/08/14追加(NANDRA) ################################################# #第一引数:階層 # 1:トップ 2:総合インデクス 3:個別インデクス 4:ページ 5:クリップ #第二引数:インデクス種別 # cat,region,date,update,idx_opt1のどれか #参照するG変数 # $GVERSION:バージョン番号 # $GCHARSET:キャラクタセット(デフォルトは'Shift_JIS') # $GROBOT_TAG:ロボット抑止タグ # $GROBOT_EXCLUSION_LEVEL:ロボット抑止レベル # $GROBOT_INCLUSION_*(ロボット制限を緩和) #戻り値:METAタグの入った文字列 #現在対応しているMETAタグ:キャラクタセット、GENERATOR、ROBOT抑制 { my ($kaiso, $idx_type) = @_; my ($text, $robot_flg); ## キャラクタセット $text = "\n"; } else { $text .= $GCHARSET . "\">\n"; } ## GENERATORタグ $text .= "\n"; ## PAGERANKタグ(PopCorn独自:デバッグ用に作成) #$text .= "\n"; ## ROBOT抑制タグ制御(EXCLUSION) $robot_flg = "off"; if ($GROBOT_EXCLUSION_LEVEL == 1) { # 全て制限 $robot_flg = "on"; } elsif ($GROBOT_EXCLUSION_LEVEL == 2) { # トップページのみ対象外 if ( $kaiso > 1 ) { $robot_flg = "on"; } } elsif ($GROBOT_EXCLUSION_LEVEL == 3) { # 各インデクスのトップまで対象外 if ( $kaiso > 2 ) { $robot_flg = "on"; } } elsif ($GROBOT_EXCLUSION_LEVEL == 4) { # 分類インデクスまで対象外 if ( $kaiso > 3 ) { $robot_flg = "on"; } elsif ( $kaiso == 3 && $idx_type ne "cat" ) { $robot_flg = "on"; } } elsif ($GROBOT_EXCLUSION_LEVEL == 5) { # 分類インデクス配下のページまで対象外 if ( $kaiso > 4 ) { $robot_flg = "on" } elsif ( $kaiso >= 3 && $idx_type ne "cat" ) { $robot_flg = "on"; } } elsif ($GROBOT_EXCLUSION_LEVEL == 6) { # 分類インデクス配下のクリップまで if ( $kaiso > 2 && $idx_type ne "cat" ) { $robot_flg = "on"; } } elsif ($GROBOT_EXCLUSION_LEVEL == 7) { # 他のインデクスまで対象外 if ( $kaiso > 3 ) { $robot_flg = "on"; } } elsif ($GROBOT_EXCLUSION_LEVEL == 8) { # 他のインデクス配下のページまで対象外 if ( $kaiso > 4 ) { $robot_flg = "on"; } } ## ROBOT抑制タグ制御(INCLUSION) if ( $kaiso == 3 ) { # 分類インデクス if ( $GROBOT_INCLUSION_CAT eq "on" && $idx_type eq "cat" ) { $robot_flg = "off"; } # 地域インデクス if ( $GROBOT_INCLUSION_REGION eq "on" && $idx_type eq "region" ) { $robot_flg = "off"; } # 撮影日インデクス if ( $GROBOT_INCLUSION_DATE eq "on" && $idx_type eq "date" ) { $robot_flg = "off"; } # 登録日インデクス if ( $GROBOT_INCLUSION_UPDATE eq "on" && $idx_type eq "update" ) { $robot_flg = "off"; } # オプションインデクス1 if ( $GROBOT_INCLUSION_IDX_OPT1 eq "on" && $idx_type eq "idx_opt1" ) { $robot_flg = "off"; } } # 分類インデクス配下のページ if ( $GROBOT_INCLUSION_PAGE eq "on" && $kaiso == 4 && $idx_type eq "cat" ) { $robot_flg = "off"; } # 全てのインデクス配下のページ if ( $GROBOT_INCLUSION_PAGE_ALL eq "on" && $kaiso == 4 ) { $robot_flg = "off"; } # 分類インデクス配下のクリップ if ( $GROBOT_INCLUSION_CLIP eq "on" && $kaiso == 5 && $idx_type eq "cat" ) { $robot_flg = "off"; } # 実際にROBOTタグを挿入 if ( $robot_flg eq "on" ) { $text .= $GROBOT_TAG . "\n"; } $text; } #================================================================== #** Part 7:デバッギング #================================================================== ################################################# sub debug_assoc #** 連想配列の表示 98/02/07追加 ################################################# { my (%assoc) = @_; foreach (sort keys %assoc) { print "$_=$assoc{$_}\n"; } } ################################################# sub debug_array #** 配列の表示 99/03/13追加 ################################################# { my (@arr) = @_; my ($rec); foreach $rec (@arr) { print "$rec\n"; } } ################################################# sub conv_db_freebsd #** DBソース変換(FreeBSD対応) 00/03/10追加 ################################################# { my ($file_in, $file_out) = @_; my ($no); open (IN, $file_in) || die "$file_inをオープンできませんでした。$!"; open (OUT, ">$file_out") || die "ファイル$file_outの作成に失敗しました。$!"; $no = 0; while () { last if (/^END/); next if /^#/; if (/^■/ || /^\*\*/) { #カラム1:ページ名 $no = 1; s/\n/ \n/; print OUT $_; } else { next if /^#/; $no = $no + 1; if ($no == 2) { #カラム2:分類 s/\n/ \n/; s/\,/ \,/g; print OUT $_; } if ($no == 3) { #カラム3:地域 s/\n/ \n/; s/\,/ \,/g; s/\t/ \t/g; print OUT $_; } if ($no == 4) { #カラム4:ファイル名… print OUT $_; } if ($no == 5) { #カラム5:タイトル s/\n/ \n/; print OUT $_; } if ($no == 6) { #カラム6:よみ if (/non\n/ || /\n/) { print OUT $_; } else { s/\n/ \n/; print OUT $_; } } if ($no == 7) { #カラム7:登録年月日 print OUT $_; } if ($no >= 8) { if (/^\n/) { #空白行がデータ1件の区切り print OUT $_; } else { #マクロタグ+MIMEタイプに対応したDBソースの #各データ8行目以降の扱い if (/[a-zA-Z0-9][a-zA-Z0-9]\n/ || /\t\n/) { print OUT $_; } else { s/\n/ \n/; s/\,/ \,/g; print OUT $_; } } } } } close (IN); close (OUT); } ################################################# sub conv_key_freebsd #** インデクスキー変換(FreeBSD対応) 00/03/10追加 ################################################# { my ($file_in, $file_out) = @_; my ($no, $this, @list); open (IN, $file_in) || die "$file_inをオープンできませんでした。$!"; open (OUT, ">$file_out") || die "ファイル$file_outの作成に失敗しました。$!"; while () { last if (/^END/); next if /^#/; if (/^■/ || /^\*\*/) { #カラム1:ページ名 @list = split (/\t/, $_); $no = 1; foreach $this (@list) { if ($no == 1) { print OUT "$this "; } else { print OUT "\t$this"; } $no++; } } else { if (/^□/ || /^\/\//) { s/\n/ \n/; print OUT $_; } } } close (IN); close (OUT); } ################################################# #最上川フォーラムコンテンツ作成(RSS連携対応) sub rss_generate #新規作成 ################################################# { my ($path, $file_in, $sub, $keyitem, $url_disp) = @_; my ($date, $page, $catg, $region, $xy, $url, $title, $yomi, $comment, $date2, $ext, $this_page_dir); my (@records, @records2, $record, $record2, $delimiter, $machine, $file_page, $str1, $str2, $str3, $str4, $str5, $str6, $str7, $str8, $dir); &machine; $machine = $GMACHINE; $delimiter = $GDELIMITER; $site = $GSITE; $this_page_dir = &get_atom($keyitem, "PAGE_DIR"); $dir = $path . "$this_page_dir"; &check_dir ($dir); $file_in = $path . $GMASTER . $delimiter . $file_in; #rss用リストファイル読み込み open (FIN, $file_in) || output_msg("POP-E007", "sub:rss_generate $file_in"); while ($_ = ) { push (@records, $_); } close (FIN); foreach $record (@records) { ($date, $page, $catg, $region, $xy, $url, $title, $yomi, $comment, $date2) = split (/\t/, $record); if ($catg eq $GNEWINFO ) { next; } $GL_IDX++; #add(by mogamigawa RSS) if ($GL_IDX eq 1 ) { #add(by mogamigawa RSS) #(分類ページTOP画面URL) $GL_TPAGE = $delimiter."index.html"; #add(by mogamigawa RSS) #(サイト名) $GL_PAGE = $page; #add(by mogamigawa RSS) $GL_PAGE =~ s/]]>/]]>/g; #add(by mogamigawa RSS) } #(個別ページURL) $GL_LINK[$GL_IDX] = $delimiter . $this_page_dir . $delimiter . "$url$ext.html"; #add(by mogamigawa RSS) #(登録日) $GL_DATE[$GL_IDX] = $date; #add(by mogamigawa RSS) $GL_DATE[$GL_IDX] =~ s/\//-/g; #add(by mogamigawa RSS) #(トピックのタイトル) $GL_TITEL[$GL_IDX] = $title; #add(by mogamigawa RSS) $GL_TITEL[$GL_IDX] =~ s/]]>/]]>/g; #add(by mogamigawa RSS) @records2 = split (/$GRET_CODE/, $comment); foreach $record2 (@records2) { ($str1, $str2, $str3, $str4, $str5, $str6, $str7, $str8) = split (/$GTAB_CODE/, $record2); #*.ml, *.clip $str1:ファイル, $str2:先頭, $str3:最終, $str4, #$str5, $str6 *.jpg/gif/au/mov $str1:ファイル, $str2:撮影日, #$str3:場所, $str4:タイトル, $str5:ヘッドライン, $str6 #マクロタグ指定時の処理 if ($str1 eq "text") { $GL_TEXT[$GL_IDX] = $str2; #add(by mogamigawa RSS) $GL_TEXT[$GL_IDX] =~ s/]]>/]]>/g; #add(by mogamigawa RSS) } if ($str1 eq "tablequote" && $str2 ne "") { $GL_tablequote[$GL_IDX] = $str2; #add(by mogamigawa RSS) $GL_tablequote[$GL_IDX] =~ s/]]>/]]>/g; #add(by mogamigawa RSS) } if ($str1 eq "quote" && $str2 ne "") { $GL_quote[$GL_IDX] = $str2; #add(by mogamigawa RSS) $GL_quote[$GL_IDX] =~ s/]]>/]]>/g; #add(by mogamigawa RSS) } if ($str1 eq "subtitle") { $GL_subtitle[$GL_IDX] = $str2; #add(by mogamigawa RSS) $GL_subtitle[$GL_IDX] =~ s/]]>/]]>/g; #add(by mogamigawa RSS) } } } $GL_MAX = $GL_IDX; #add(by mogamigawa RSS) } ################################################# #最上川フォーラムコンテンツ作成(RSS連携対応) sub rss_write #新規作成 ################################################# { my ($path , $indexkey) = @_; #変数宣言 my ($site,$delimiter,$out_file_nm,$idx,$max,$ans1); my ($page,$link,$titel,$discription,$date,$publisher,$creater,$tpage); my ($url_path , $out_path); if ( $G_PUB_FLG eq "on" ) { $url_path = $G_URL_PUB; } else { $url_path = $G_URL; } $site = $GSITE; $delimiter = $GDELIMITER; $tpage = $url_path . $GL_TPAGE; $page = $GL_PAGE; if ( $indexkey eq 'cat' ) { $out_file_nm = "$path$site.rss.xml"; } else { $out_file_nm = "$path$site-$indexkey.rss.xml"; } $max = $GL_MAX+1; #output is 10records if ( $max > 10 ) { $ans1 = $max - 10; } else { $ans1 = 1; } open (RPAGE, ">$out_file_nm"); print RPAGE "\n"; print RPAGE "\n"; print RPAGE "\n"; print RPAGE "$tpage\n"; print RPAGE "<![CDATA[$page]]>\n"; print RPAGE "\n"; print RPAGE "\n"; #ここはループ for ($idx = $ans1; $idx < $max; $idx++) { $link = $url_path . $GL_LINK[$idx]; print RPAGE "\n"; } print RPAGE "\n"; print RPAGE "\n"; print RPAGE "\n"; #ここはループ for ($idx = $ans1; $idx < $max; $idx++) { $link = $url_path . $GL_LINK[$idx]; print RPAGE "\n"; $titel = $GL_TITEL[$idx]; print RPAGE "<![CDATA[$titel]]>\n"; $link = $url_path . $GL_LINK[$idx]; print RPAGE "$link\n"; if ( $GL_tablequote[$idx] ne "" ) { $decscription = $GL_tablequote[$idx]; } elsif ( $GL_text[$idx] ne "" ) { $decscription = $GL_text[$idx]; } elsif ( $GL_quote[$idx] ne "" ) { $decscription = $GL_quote[$idx]; } elsif ( $GL_subtitle[$idx] ne "" ) { $decscription = $GL_subtitle[$idx]; } else { $decscription = ""; } print RPAGE "\n"; $date = $GL_DATE[$idx]; print RPAGE "$date\n"; print RPAGE "$GPUBLISHER\n"; print RPAGE "$GPERSON\n"; print RPAGE "\n"; } print RPAGE "\n"; close (RPAGE); } #================================================================== #** Part 8:ヒアドキュメント #================================================================== ################################################# sub topconf_def #** デフォルト topconf.dat 定義 # 2002/05/06 NANDRA 新規 ################################################# { return << "END_OF_TOPCONF"; ####################################################################### # topconf.dat デフォルト(Ver2002.0506以降用) 2002/05/06 ####################################################################### #←(このように行頭が#マークになっている行はコメント行です) ##▼メインサイトへのリンク… ## ページ左上と下中央に、親サイトへのリンクを張ることができます。 ## src属性を設定すればバナー画像も入ります(widthとheightでサイズ指定) RetBtn.text=PopCorn RetBtn.href=http://www.mmdb.net/popcorn/ #RetBtn.src=gif/banar_w.gif #RetBtn.width=80 #RetBtn.height=23 #RetBtn.border=0 ##▼トップ画像 ## srcには画像ファイル名(PopCornルートフォルダからの相対パス) ## widthとheightには画像サイズ、textには説明文を設定します ## ※ レイアウト上、600*110ピクセル程度の横長画像をお勧めします #topimage.src=jpg/600_110.jpg #topimage.width=600 #topimage.height=110 #topimage.text=トップ画像 ##▼トップ解説タイトル ## 灰色地の部分に入る文字列を指定します welcome_msg.text=このトップページの仕上げ方法 ##▼トップ解説 INFO1.text= このトップページにある各種の記述は、master フォルダにある topconf.dat ファイル(テキストファイル)で定義されています。これをテキストエディタで編集して、サイトの再生成を行なえば、その変更が反映されます。 INFO2.text= INFO3.text= ##▼「内容に関するお問い合わせ」 INFO4.text=このサイトの構\築には、Multimedia Mapping支援/生涯学習支援ツール「PopCorn」を使用いたしました INFO5.text=PopCornについてはこちらのサイトをご覧下さい INFO5.href=http://www.mmdb.net/popcorn/ ##▼「サイト担当者」 INFO6.text=担当者名(またはグループ名) INFO6.bold=yes INFO7.text=担当者の連絡先メールアドレス INFO7.href=mailto: END_OF_TOPCONF } ################################################# sub tophtml_def #** デフォルト雛形HTML定義 # 2002/05/06 NANDRA 新規 ################################################# { return << "END_OF_TOPHTML";



    ■このサイトの目次

      

    ( 現在のデータ数: 件 ( 件 )+クリップ 件 )

    ■内容に関するお問い合わせは



    ■サイト担当者






    Contact:

    END_OF_TOPHTML } ################################################# sub output_msg_list #** 出力メッセージリスト # 2002/05/06 NANDRA 新規 ################################################# { return << "END_OF_MSGLIST"; #===================================================================== # 出力メッセージリスト(popcorn.pl中にヒアドキュメントとして記述) #===================================================================== # ・先頭が#マークの行は注釈行です # ・書式は1メッセージ1行で、メッセージID[TAB]メッセージとします # ・パラメータ付きのメッセージの場合、メッセージ本文中に%1,%2...を #  埋め込めば、そこにパラメータ文字列が自動挿入されます # # ※メッセージIDのルール # ・例 POP-E001 # ・ハイフンの前の英字3桁がPOPだとPopCornを示す # ・ハイフン直後の英字1桁: #     E…エラー(処理途中で強制終了をひきおこすもの) #     M…問題あり(処理は継続されるもの。いわゆるWarning) #     A…案内(エラーやWarningではない、正常な案内メッセージ) # ・6〜8桁目:連番(順不同) #     ただし、ここが999の場合は、該当メッセージ番号が無かった #     場合のデフォルトメッセージとします #===================================================================== #-----「エラー」メッセージのリスト POP-E001 ディレクトリ %1 がありません。ディレクトリの作成もできませんでした。 POP-E002 サイト名を\$GSITEに設定して下さい。 POP-E003 タイトルを\$GTITLEに設定して下さい。 POP-E004 インデクスのキーを\@GINDEX_KEYに設定して下さい。 POP-E005 当フォルダのパスを\$GPATH_LOCALに設定して下さい。 POP-E006 \$GPATH_LOCALまたは\$GPATH_SERVERが設定されていません POP-E007 %1をオープンできませんでした。 POP-E008 リスト%1の作成に失敗しました。 POP-E009 クリップファイル%1をオープンできませんでした。 POP-E010 クリップファイル%1の作成に失敗しました。 POP-E011 入力ファイルが設定されていません。 POP-E012 HTMLソースファイル%1の作成に失敗しました。 POP-E013 HTML個別ページ%1の作成に失敗しました。 POP-E014 %1の作成に失敗しました。 POP-E015 %1の初期化に失敗しました。 POP-E016 %1への追加書きに失敗しました。 POP-E017 %1の書き込みに失敗しました。 POP-E018 テキスト(またはHTML)ファイル %1 の中に %2 という章はありませんでした。 POP-E019 HTML個別クリップページ%1の作成に失敗しました。 POP-E020 ディレクトリ %1 がありません POP-E021 サイトフォルダ名を指定して下さい POP-E022 ローカルパスを指定して下さい POP-E023 MIME格納フォルダ名を指定して下さい POP-E999 %1 は未定義のメッセージIDです(プログラムミスの可能\性が高いので、開発者に連絡してください) # #-----「問題あり」メッセージのリスト(アラートメッセージ)#2004/01/24メッセージを日本語化 POP-M001 言語設定ファイル %1.dat が見つかりません。デフォルト言語版(日本語)としてページ生成を実行します POP-M002 おやおや。カードIDが重複していますよ。重複IDは %1 です。先頭から: %2 番目です。 POP-M003 次のカードIDのタイトルを付けてください。 カードID:%1 。先頭から %2 番目のカードです。 POP-M004 おやおや。カードIDが未定義です。先頭から %1 番目のカードです。 POP-M005 次のファイルがありません。ファイル名: %1 POP-M006 次のフォルダが見つかりません。フォルダ名: %1 POP-M007 HTMLファイル %1 のBODYタグが一対になっていません。BODY部抽出処理を省略します #2004/01/24 追加 Maekawa POP-M008 フォルダ種別"%1"に対応するサイトフォルダIDを定義してください。フォルダIDは英数字で"cat", "rgn"などとします。 POP-M009 フォルダ種別"%1"に対応するフォルダ名を定義してください。フォルダ名の例:カテゴリフォルダ、地域フォルダ、… POP-M010 フォルダ種別"%1"に対応するフォルダ名略称を定義してください。略称の例:カテゴリ、地域、… POP-M011 フォルダ名を定義して下さい。仮の名前を "%1" としました。 POP-M012 フォルダ名「%1」の略称を定義してください。 POP-M013 フォルダ名「%1」のIDを定義してください。 #-----「案内」メッセージのリスト POP-A001 PopCorn (ver. %1): %2 - Started at %3 %4 POP-A002 popcorn.pl => %1 \\t %2...done POP-A003 Number of clips: %1 POP-A004 Finished : %1 - at %2 %3 (ps time %4) POP-A010 Created a new directory: %1 #-----小道具サブルーチン(サイト自動生成に直接関わらないsub)専用メッセージ # (メッセージの先頭には該当するサブルーチン名を入れて下さい) UTL-E001 [filetrans] 変換前の文字列が未設定です UTL-E002 [filetrans] 変換後の文字列が未設定です UTL-E003 [filetrans] %1をオープンできませんでした UTL-E004 [filetrans] %1の作成に失敗しました UTL-A001 [popcorn.pl\'edit_dbdata] => %1: \\t %2...done UTL-A002 [popcorn.pl\'clipmaster2clip] => %1...done (%2) UTL-A003 [popcorn.pl\'div_clip] (by %1) => %2 of %3...done (%4) UTL-A004 [popcorn.pl\'edit_dbdata_x] => %1 pages, %2 clips ...done (%3) #===================================================================== END_OF_MSGLIST } 1