&'バグ修正 * Ver 2.00 2004-09-18 1) rollスライドショー追加 * 2) アルバム管理用xmlファイルフォーマットの変更 * Ver 3.00 2005-03-21 DB使用方式に変更 * * Copyright (C) 2003-2005 Shingo.Ishizumi All Right Reserved */ $mid_file = array("null", "midi/yukiyama.mid", "midi/tabizi.mid", "midi/koujyou.mid", "midi/oborotukiyo.mid", "midi/ryosyuu.mid", "midi/yuyake.mid", "midi/feeling-sh.mid", "midi/kondoru.mid"); $mid_titl = array("なし", "雪山賛歌", "旅路", "荒城の月               ", "朧月夜", "旅愁", "夕焼けこやけ", "feeling", "コンドルが飛んでいく"); $category_titl = array("山", "沢", "海", "湖", "空", "星                   ", "花", "木", "祭り", "動物", "人物", "建物", "ヌード", "その他"); $mode = $_GET['mode']; pg_connect($connect_string); switch ($mode) { case "img": /* 画像入力画面 */ break; case "data": /* データ入力画面 */ header("Content-Type:text/html\n"); print("\n"); print("\n"); print("\n"); print("\n"); print("スライドショーの作成 データ入力\n"); print("\n"); printf("\n"); // ディレクトリ名を作成 $fp2 = fopen("data/lock1.loc", "w"); flock($fp2, LOCK_EX); $fp1 = fopen("data/count.txt", "r"); if ($fp1 == false) { printf("

\n"); printf("ファイル(count.txt)の読み込みに失敗しました。もう一度お試し下さい。

\n"); printf("
\n"); printf(" \n"); printf("「もっと、遥かな山旅を」 \n"); printf("[山の旅人たちのスライドショー] \n"); printf("
\n"); printf("\n"); printf("\n"); return; } else { $buffer = fgets($fp1, 128); $tmp1 = explode(" ", $buffer); fclose($fp1); $access = $tmp1[0]; $count = $tmp1[1]; $slide = $tmp1[2]; $comp = $tmp1[3]; } $count++; $dir = sprintf("data/%04d", $count); $fp1 = fopen("data/count.txt", "w"); fwrite($fp1, "$access $count $slide $comp"); fclose($fp1); mkdir($dir); chmod ($dir, 0777); flock($fp2, LOCK_UN); fclose($fp2); $file_no = 0; for ($i = 0; $i < 8; $i++) { if ($img[$i] != "") { $sz = getimagesize($img[$i]); $nm = explode(".", $img_name[$i]); switch ($img_type[$i]) { case "image/pjpeg": case "image/jpeg": case "image/jpg": $wid[$file_no] = $sz[0]; $hig[$file_no] = $sz[1]; $txt[$file_no] = $nm[0]; $file_no++; $img_file = sprintf("%s/%03d.jpg", $dir, $file_no); $rc = copy($img[$i], $img_file); chmod ($img_file, 0666); break; case "image/gif": $wid[$file_no] = $sz[0]; $hig[$file_no] = $sz[1]; $txt[$file_no] = $nm[0]; $file_no++; $src_file = sprintf("%s.gif", $img[$i]); $rc = copy($img[$i], $src_file); $img_file = sprintf("%s/%03d.jpg", $dir, $file_no); $convert_cmd=sprintf("/usr/local/bin/convert %s %s", $src_file, $img_file); system($convert_cmd); chmod ($img_file, 0666); $rc = unlink($src_file); break; case "image/x-png": $wid[$file_no] = $sz[0]; $hig[$file_no] = $sz[1]; $txt[$file_no] = $nm[0]; $file_no++; $src_file = sprintf("%s.png", $img[$i]); $rc = copy($img[$i], $src_file); $img_file = sprintf("%s/%03d.jpg", $dir, $file_no); $convert_cmd=sprintf("/usr/local/bin/convert %s %s", $src_file, $img_file); system($convert_cmd); chmod ($img_file, 0666); $rc = unlink($src_file); break; default: break; } } } if ($file_no == 0) { printf("

\n"); printf("有効なファイルがありません。もう一度jpgファイルをアップロードしてください。

\n"); printf("
\n"); printf(" \n"); printf("「もっと、遥かな山旅を」 \n"); printf("[山の旅人たちのスライドショー] \n"); printf("
\n"); } else { for ($i = 0; $i < $file_no; $i++) { $img_file = sprintf("%s/%03d.jpg", $dir, $i+1); /*** 2005-03-05 ***/ if (($wid[$i] > 800) || ($hig[$i] > 800)) { // 800 * 800 $convert_cmd=sprintf("/usr/local/bin/convert -geometry 800x800 %s %s", $img_file, $img_file); system($convert_cmd); chmod ($img_file, 0666); } /******************/ // 100 * 100 $imgs_file = sprintf("%s/%03ds.jpg", $dir, $i+1); $convert_cmd=sprintf("/usr/local/bin/convert -geometry 100x100 %s %s", $img_file, $imgs_file); system($convert_cmd); chmod ($imgs_file, 0666); // 50 * 50 $imgs_file = sprintf("%s/%03d-0.jpg", $dir, $i+1); $convert_cmd=sprintf("/usr/local/bin/convert -geometry 50x50 %s %s", $img_file, $imgs_file); system($convert_cmd); chmod ($imgs_file, 0666); /*** 2004-08-11 *** // 116 * 156 $imgs_file = sprintf("%s/%03d-1.jpg", $dir, $i+1); $convert_cmd=sprintf("/usr/local/bin/convert -geometry 116x156 %s %s", $img_file, $imgs_file); system($convert_cmd); chmod ($imgs_file, 0666); // 128 * 156 $imgs_file = sprintf("%s/%03d-2.jpg", $dir, $i+1); $convert_cmd=sprintf("/usr/local/bin/convert -geometry 128x156 %s %s", $img_file, $imgs_file); system($convert_cmd); chmod ($imgs_file, 0666); // 172 * 194 $imgs_file = sprintf("%s/%03d-3.jpg", $dir, $i+1); $convert_cmd=sprintf("/usr/local/bin/convert -geometry 172x194 %s %s", $img_file, $imgs_file); system($convert_cmd); chmod ($imgs_file, 0666); // 236 * 264 $imgs_file = sprintf("%s/%03d-4.jpg", $dir, $i+1); $convert_cmd=sprintf("/usr/local/bin/convert -geometry 236x264 %s %s", $img_file, $imgs_file); system($convert_cmd); chmod ($imgs_file, 0666); // 236 * 316 $imgs_file = sprintf("%s/%03d-5.jpg", $dir, $i+1); $convert_cmd=sprintf("/usr/local/bin/convert -geometry 236x316 %s %s", $img_file, $imgs_file); system($convert_cmd); chmod ($imgs_file, 0666); ********************/ } printf("
\n"); printf("
\n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); for ($i = 0; $i < $file_no; $i++) { if (($i % 4) == 0) printf(" \n"); $img_file = sprintf("%s/%03d.jpg", $dir, $i+1); $imgs_file = sprintf("%s/%03ds.jpg", $dir, $i+1); printf(" \n"); if ((($i+1) % 4) == 0) printf(" \n"); } if (($i % 4) != 0) printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf("
\n"); printf(" 山の旅人たちのスライドショー - データ入力
\n"); printf(" (今日は倒れた旅人たちも、生まれ変わって歩き出すよ。)\n"); printf("

\n"); printf(" スライドショーの題名: \n"); printf("

\n"); printf(" \n", $wid[$i]); printf(" \n", $hig[$i]); printf("
\n", $txt[$i]); printf(" \n"); printf(" \n"); printf("
\n"); printf(" ", $img_file); printf(" \"%s\"\n",$imgs_file ,$txt[$i]); printf("
\n"); printf("

\n"); /* クッキーを読み込む */ $cookie = explode(",", $YAMA_TABI_SLIDE); $name = i18n_convert($cookie[1], "SJIS"); $hp = i18n_convert($cookie[3], "SJIS"); printf(" 名前(ニックネーム):
\n", $name); printf(" メールアドレス:
\n", $cookie[2]); printf(" ホームページ名:
\n", $hp); if ($cookie[4] != "") { printf(" ホームページURL:
\n", $cookie[4]); } else { printf(" ホームページURL:
\n"); } printf(" パスワード:
\n"); printf(" BGM:
\n"); printf(" カテゴリー: \n"); printf("
\n"); printf(" \n", $count); printf(" \n", $dir); printf(" \n", $file_no); printf(" \n"); printf("

\n"); printf(" \n"); printf("  \n"); printf(" 「もっと、遥かな山旅を」 \n"); printf(" [山の旅人たちのスライドショー] \n"); printf(" \n"); printf("
\n"); printf(" \n"); printf(" \"ここで一言\"\n"); printf("
\n"); printf(" \n"); printf("
\n"); } print("\n"); print("\n"); printf("\n"); printf("\n"); break; case "comp": /* データ入力完了画面 */ $slide_no = $_POST['slide_no']; $dir = $_POST['dir']; $file_no = $_POST['file_no']; $euc_slide = htmlspecialchars($_POST['slide']); $slide = i18n_convert($euc_slide, "SJIS"); $txt = $_POST['txt']; $wid = $_POST['wid']; $hig = $_POST['hig']; $euc_name = htmlspecialchars($_POST['name']); $name = i18n_convert($euc_name, "SJIS"); $mail = htmlspecialchars($_POST['mail']); $euc_hp = htmlspecialchars($_POST['hp']); $hp = i18n_convert($euc_hp, "SJIS"); $url_tmp = $_POST['url']; $url = str_replace ("~", "%7e", $url_tmp); $pass = $_POST['pass']; $midifile = $_POST['midifile']; $tmp = explode("/", $midifile); $midi = $tmp[1]; $euc_category = $_POST['category']; /* クッキーをどうぞ */ $cookie=sprintf("0,%s,%s,%s,%s", $name, $mail, $hp, $url); SetCookie("YAMA_TABI_SLIDE", $cookie, time() + (1*365*24*3600)); header("Content-Type:text/html\n"); print("\n"); print("\n"); print("\n"); print("\n"); print("スライドショーの作成 データ入力完了\n"); print("\n"); printf("\n"); if ($slide_no == "") { printf("

\n"); printf("入力パラメータが異常です。もう一度お試し下さい。

\n"); printf("
\n"); printf(" \n"); printf("「もっと、遥かな山旅を」 \n"); printf("[山の旅人たちのスライドショー] \n"); printf("
\n"); printf("\n"); printf("\n"); return; } $date = date("Y-m-d H:i:s"); $dst_file = sprintf("%s/fade.swf", $dir); $rc = copy("fade.swf", $dst_file); $dst_file = sprintf("%s/zoom.swf", $dir); $rc = copy("zoom.swf", $dst_file); $dst_file = sprintf("%s/roll.swf", $dir); $rc = copy("roll.swf", $dst_file); $dst_file = sprintf("%s/slide.js", $dir); $rc = copy("slide.js", $dst_file); // album.xml ファイルの作成 2005-03-04変更 $xml_file = $dir."/album.xml"; $fp1 = fopen($xml_file, "w"); if ($fp1 == false) { printf("

\n"); printf("ファイル(%s)のオープンに失敗しました。もう一度お試し下さい。

\n", $xml_file); printf("
\n"); printf(" \n"); printf("「もっと、遥かな山旅を」 \n"); printf("[山の旅人たちのスライドショー] \n"); printf("
\n"); printf("\n"); printf("\n"); return; } fwrite($fp1, "\n"); fwrite($fp1, "\n"); fwrite($fp1, " \n"); fwrite($fp1, " \n"); fwrite($fp1, " 山の旅人たちのスライドショー \n"); fwrite($fp1, " 山の旅人たちのスライドショー スライドショーの作成も可能です。\n"); fwrite($fp1, " もっと、遙かな山旅を\n"); fwrite($fp1, " 写真集\n"); fwrite($fp1, " \n"); fwrite($fp1, " \n"); fwrite($fp1, " \n"); fwrite($fp1, " \n"); fwrite($fp1, " \n"); fwrite($fp1, " \n"); fwrite($fp1, " $slide\n"); fwrite($fp1, " $name\n"); fwrite($fp1, " Comment\n"); fwrite($fp1, " $hp\n"); fwrite($fp1, " \n"); fwrite($fp1, " \n"); fwrite($fp1, " \n"); fwrite($fp1, " Fade\n"); fwrite($fp1, " Zoom\n"); fwrite($fp1, " Roll\n"); fwrite($fp1, " \n"); for ($i = 0; $i < $file_no; $i++) { $no = $i+1; $x_no = sprintf("%03d", $no); $jpg = sprintf("%03d.jpg", $no); $jpgs = sprintf("%03ds.jpg", $no); $text = i18n_convert($txt[$i], "SJIS"); fwrite($fp1, " \n"); fwrite($fp1, " $text\n"); fwrite($fp1, " \n"); fwrite($fp1, " \n"); fwrite($fp1, " \n"); fwrite($fp1, " \n"); fwrite($fp1, " \n"); fwrite($fp1, " \n"); fwrite($fp1, " \n"); } fwrite($fp1, " \n"); fwrite($fp1, "\n"); fclose($fp1); chmod ($xml_file, 0666); /*** slide.xml ファイルの作成 ***/ $strDir = dirname(__FILE__); // 2005-03-04 $strXml = $strDir."/data/album2-1.xml"; $strXml = $strDir."/".$dir."/album.xml"; $strXsl = $strDir."/data/slide_xml.xsl"; $objPrc = xslt_create(); xslt_set_encoding($objPrc, "SJIS"); $arg = array(); $param = array("AlbumNo"=>"0001", "Kind"=>"fade"); $param[AlbumNo] = $slide_no; $dst_file = $strDir."/".$dir."/slide.xml"; $result = xslt_process($objPrc, $strXml, $strXsl, $dst_file, $arg, $param); // fade.html ファイルの作成 $strXsl = $strDir."/data/slide_fade.xsl"; $param[AlbumNo] = $slide_no; $param[Kind] = "fade"; $dst_file = $strDir."/".$dir."/fade.html"; $result = xslt_process($objPrc, $strXml, $strXsl, $dst_file, $arg, $param); // zoom.html ファイルの作成 $param[Kind] = "zoom"; $dst_file = $strDir."/".$dir."/zoom.html"; $result = xslt_process($objPrc, $strXml, $strXsl, $dst_file, $arg, $param); // roll.html ファイルの作成 $param[Kind] = "roll"; $dst_file = $strDir."/".$dir."/roll.html"; $result = xslt_process($objPrc, $strXml, $strXsl, $dst_file, $arg, $param); // index.html ファイルの作成 $param[Kind] = "index"; $dst_file = $strDir."/".$dir."/index.html"; $result = xslt_process($objPrc, $strXml, $strXsl, $dst_file, $arg, $param); // n.htm ファイルの作成 $strXsl = $strDir."/data/photo.xsl"; $param = array("AlbumNo"=>"0001", "ImageNo"=>"001"); $param[AlbumNo] = $slide_no; for ($i = 0; $i < $file_no; $i++) { $no = $i+1; $x_no = sprintf("%03d", $no); $param[ImageNo] = $x_no; $dst_file = $strDir."/".$dir."/".$x_no.".html"; $result = xslt_process($objPrc, $strXml, $strXsl, $dst_file, $arg, $param); } /*** 2005-02-28 ***/ $datetime = date("Y-m-d H:i:s"); $sql = "insert into slide values( $slide_no,0001,'$euc_slide','$datetime','$euc_name','$mail','$pass','', 'Comment','$euc_hp','$url','','http://yama-tabi.net/',001,'jpg','$midi', 400,274,0.2,150,'null', 320,218,0.3,80,200,100,50,30,'null', 500,340,1.0,1,'null', '$euc_category', $file_no,'$txt[0]','$txt[1]','$txt[2]','$txt[3]','$txt[4]','$txt[5]','$txt[6]','$txt[7]', 1,1)"; $id = pg_exec($sql); if ($id == false) { printf("

\n"); printf("データベースへの書き込みに失敗しました。もう一度お試し下さい。

\n"); printf("
\n"); printf(" \n"); printf("「もっと、遥かな山旅を」 \n"); printf("[山の旅人たちのスライドショー] \n"); printf("
\n"); printf("\n"); printf("\n"); return; } /*******************/ printf("
\n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); for ($i = 0; $i < $file_no; $i++) { $no = $i+1; printf(" \n"); printf(" \n", $no); printf(" \n"); printf(" \n"); } printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf("
\n"); printf(" 山の旅人たちのスライドショー - データ入力完了
\n"); printf(" ありがとうございます。次のURLにスライドショーを作成しました。\n"); printf("

 Index \n"); printf(" http://yama-tabi.net/cgi/slide/%s/index.html\n", $dir, $dir); printf("
 Fade \n"); printf(" http://yama-tabi.net/cgi/slide/%s/fade.html\n", $dir, $dir); printf("
 Zoom \n"); printf(" http://yama-tabi.net/cgi/slide/%s/zoom.html\n", $dir, $dir); printf("
 Roll \n"); printf(" http://yama-tabi.net/cgi/slide/%s/roll.html\n", $dir, $dir); printf("
 %03d \n"); printf(" http://yama-tabi.net/cgi/slide/%s/%03d.html\n", $dir, $no, $dir, $no); printf("

\n"); printf("
\n"); printf("  \n"); printf(" 「もっと、遥かな山旅を」 \n"); printf(" [山の旅人たちのスライドショー] \n"); printf("
\n"); printf("
\n"); printf(" \n"); printf(" \"ここで一言\"\n"); printf("
\n"); printf("
\n"); printf("\n"); printf("\n"); break; case "pass": /* パスワード入力 */ $no = $_GET['no']; header("Content-Type:text/html\n"); print("\n"); print("\n"); print("\n"); print("\n"); print("スライドショーの修正 パスワード入力\n"); print("\n"); printf("\n"); printf("
\n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf("
\n"); printf(" 山の旅人たちのスライドショー - パスワード入力
\n"); printf("

\n"); printf("
\n"); printf(" 修正  \n"); printf(" 削除\n"); printf("

パスワード\n"); printf(" \n", $no); printf(" \n"); printf(" \n"); printf("

\n"); printf("

\n"); printf("
\n"); printf("  \n"); printf(" 「もっと、遥かな山旅を」 \n"); printf(" [山の旅人たちのスライドショー] \n"); printf("
\n"); printf("
\n"); printf(" \n"); printf(" \"ここで一言\"\n"); printf("
\n"); printf("
\n"); printf("\n"); printf("\n"); break; case "conf": /* パスワード確認 */ $action = $_POST['action']; $slide_no = $_POST['slide_no']; $pass = $_POST['pass']; header("Content-Type:text/html\n"); print("\n"); print("\n"); print("\n"); print("\n"); print("スライドショーの修正 パスワード確認\n"); print("\n"); printf("\n"); $slide_flag = 0; /*** 2005-03-03 ***/ $sql = "select * from slide where no = $slide_no"; $id = pg_exec($sql); if ($id != false) { $ps = pg_result($id, 0, "passwd"); if (($pass == $ps) || ($pass == $pass_slide)) $slide_flag = 2; else $slide_flag = 1; } /*******************/ switch ($slide_flag) { case 0: /* スライド無し */ printf("
\n"); printf("
\n"); printf("対応するスライドがありません。\n"); printf("
\n"); printf(" \n"); printf("「もっと、遥かな山旅を」 \n"); printf("[山の旅人たちのスライドショー] \n"); printf("
\n"); printf("
\n"); printf("\n"); printf("\n"); return; break; case 1: /* パスワード一致せず */ printf("
\n"); printf("
\n"); printf("パスワードが一致しません。\n"); printf("
\n"); printf(" \n"); printf("「もっと、遥かな山旅を」 \n"); printf("[山の旅人たちのスライドショー] \n"); printf("
\n"); printf("
\n"); printf("\n"); printf("\n"); return; break; } if ($action == "delete") { /*** 2005-03-03 ***/ $title = i18n_convert(pg_result($id, 0, "title"), "SJIS", "EUC"); /******************/ printf("
\n"); printf("
\n"); printf("スライドショー 「%s」 を本当に削除しますか?

\n", $title); printf("
\n"); printf(" \n", $slide_no); printf(" \n"); printf("
\n"); printf("
\n"); printf("
\n"); printf("
\n"); printf(" \n"); printf("「もっと、遥かな山旅を」 \n"); printf("[山の旅人たちのスライドショー] \n"); printf("
\n"); printf("
\n"); printf("\n"); printf("\n"); return; } else { // update /*** 2005-03-03 ***/ $dir = sprintf("data/%04d", $slide_no); $slide = i18n_convert(pg_result($id, 0, "title"), "SJIS", "EUC"); $date = pg_result($id, 0, "t_date"); $name = i18n_convert(pg_result($id, 0, "author"), "SJIS", "EUC"); $mail = pg_result($id, 0, "mail"); $pass = pg_result($id, 0, "passwd"); $hp = i18n_convert(pg_result($id, 0, "hp"), "SJIS", "EUC"); $url = pg_result($id, 0, "hp_url"); $midi = pg_result($id, 0, "bgm"); $fade_wid = pg_result($id, 0, "fade_wid"); $fade_hig = pg_result($id, 0, "fade_hig"); $fade_spd = pg_result($id, 0, "fade_spd"); $fade_wat = pg_result($id, 0, "fade_wat"); $zoom_wid = pg_result($id, 0, "zoom_wid"); $zoom_hig = pg_result($id, 0, "zoom_hig"); $zoom_spd = pg_result($id, 0, "zoom_spd"); $zoom_wat = pg_result($id, 0, "zoom_wat"); $zoom_max = pg_result($id, 0, "zoom_max"); $zoom_md1 = pg_result($id, 0, "zoom_md1"); $zoom_md2 = pg_result($id, 0, "zoom_md2"); $zoom_min = pg_result($id, 0, "zoom_min"); $roll_wid = pg_result($id, 0, "roll_wid"); $roll_hig = pg_result($id, 0, "roll_hig"); $roll_spd = pg_result($id, 0, "roll_spd"); $roll_wat = pg_result($id, 0, "roll_wat"); $file_no = pg_result($id, 0, "img_cnt"); $txt[0] = i18n_convert(pg_result($id, 0, "txt1"), "SJIS", "EUC"); $txt[1] = i18n_convert(pg_result($id, 0, "txt2"), "SJIS", "EUC"); $txt[2] = i18n_convert(pg_result($id, 0, "txt3"), "SJIS", "EUC"); $txt[3] = i18n_convert(pg_result($id, 0, "txt4"), "SJIS", "EUC"); $txt[4] = i18n_convert(pg_result($id, 0, "txt5"), "SJIS", "EUC"); $txt[5] = i18n_convert(pg_result($id, 0, "txt6"), "SJIS", "EUC"); $txt[6] = i18n_convert(pg_result($id, 0, "txt7"), "SJIS", "EUC"); $txt[7] = i18n_convert(pg_result($id, 0, "txt8"), "SJIS", "EUC"); $xml_file = $dir."/album.xml"; $dom = domxml_open_file($xml_file); if ($dom) { // Imageオブジェクトの取得 $Image = $dom->get_elements_by_tagname("Image"); for ($i = 0; $i < $file_no; $i++) { $wid[$i] = $Image[$i]->get_attribute("Width"); $hig[$i] = $Image[$i]->get_attribute("Height"); } } /******************/ printf("
\n"); printf("
\n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); for ($i = 0; $i < $file_no; $i++) { if (($i % 4) == 0) printf(" \n"); $img_file = sprintf("%s/%03d.jpg", $dir, $i+1); $imgs_file = sprintf("%s/%03ds.jpg", $dir, $i+1); printf(" \n"); if ((($i+1) % 4) == 0) printf(" \n"); } if (($i % 4) != 0) printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf("
\n"); printf(" 山の旅人たちのスライドショー - データ修正
\n"); printf(" (今日は倒れた旅人たちも、生まれ変わって歩き出すよ。)\n"); printf("

\n"); printf(" スライドショーの題名: \n", $slide); printf("

\n"); printf(" \n", $wid[$i]); printf(" \n", $hig[$i]); printf("
\n", $txt[$i]); printf(" \n"); printf(" \n"); printf("
\n"); printf(" ", $img_file); printf(" \"%s\"\n",$imgs_file ,$txt[$i]); printf("
\n"); printf("

\n"); printf(" 名前(ニックネーム):
\n", $name); printf(" メールアドレス:
\n", $mail); printf(" ホームページ名:
\n", $hp); printf(" ホームページURL:
\n", $url); printf(" パスワード:
\n", $pass); printf(" BGM:
\n"); printf(" カテゴリー: \n"); printf("

\n"); printf(" Fade(フェード) \n"); printf(" Width(幅):  \n", $fade_wid); printf(" Height(高さ):  \n", $fade_hig); printf(" Speed(速さ):  \n", $fade_spd); printf(" Wait(待ち):  

\n", $fade_wat); printf(" ※Speed(速さ)を大きくすると、フェードの変化が速くなります。\n"); printf("

\n"); printf(" Zoom(ズーム)  \n"); printf(" Width(幅):  \n", $zoom_wid); printf(" Height(高さ):  \n", $zoom_hig); printf(" Speed(速さ):  \n", $zoom_spd); printf(" Wait(待ち):  

\n", $zoom_wat); printf(" ※Speed(速さ)を大きくすると、ズームの変化が速くなります。\n"); printf("  \n", $zoom_max); printf("  \n", $zoom_md1); printf("  \n", $zoom_md2); printf("  \n", $zoom_min); printf("

\n"); printf(" Roll(ロール)   \n"); printf(" Width(幅):  \n", $roll_wid); printf(" Height(高さ):  \n", $roll_hig); printf(" Speed(速さ):  \n", $roll_spd); printf(" Wait(待ち):  

\n", $roll_wat); printf(" ※Speed(速さ)を大きくすると、ロールの変化が速くなります。\n"); printf("

\n"); printf(" \n", $slide_no); printf(" \n", $dir); printf(" \n", $date); printf(" \n", $file_no); printf(" \n"); printf("

\n"); printf(" \n"); printf("  \n"); printf(" 「もっと、遥かな山旅を」 \n"); printf(" [山の旅人たちのスライドショー] \n"); printf(" \n"); printf("
\n"); printf(" \n"); printf(" \"ここで一言\"\n"); printf("
\n"); printf(" \n"); printf("
\n"); print("\n"); print("\n"); printf("\n"); printf("\n"); return; } break; case "update": /* スライドの修正完了画面 */ $slide_no = $_POST['slide_no']; $date = $_POST['date']; $dir = $_POST['dir']; $file_no = $_POST['file_no']; $euc_slide = htmlspecialchars($_POST['slide']); $slide = i18n_convert($euc_slide, "SJIS"); $txt = $_POST['txt']; $wid = $_POST['wid']; $hig = $_POST['hig']; $euc_name = htmlspecialchars($_POST['name']); $name = i18n_convert($euc_name, "SJIS"); $mail = htmlspecialchars($_POST['mail']); $euc_hp = htmlspecialchars($_POST['hp']); $hp = i18n_convert($euc_hp, "SJIS"); $url_tmp = $_POST['url']; $url = str_replace ("~", "%7e", $url_tmp); $pass = $_POST['pass']; $midifile = $_POST['midifile']; $tmp = explode("/", $midifile); $midi = $tmp[1]; $fade_wid = $_POST['fade_wid']; $fade_hig = $_POST['fade_hig']; $fade_spd = $_POST['fade_spd']; $fade_wat = $_POST['fade_wat']; $zoom_wid = $_POST['zoom_wid']; $zoom_hig = $_POST['zoom_hig']; $zoom_spd = $_POST['zoom_spd']; $zoom_wat = $_POST['zoom_wat']; $zoom_max = $_POST['zoom_max']; $zoom_md1 = $_POST['zoom_md1']; $zoom_md2 = $_POST['zoom_md2']; $zoom_min = $_POST['zoom_min']; $roll_wid = $_POST['roll_wid']; $roll_hig = $_POST['roll_hig']; $roll_spd = $_POST['roll_spd']; $roll_wat = $_POST['roll_wat']; /* クッキーをどうぞ */ $cookie=sprintf("0,%s,%s,%s,%s", $name, $mail, $hp, $url); SetCookie("YAMA_TABI_SLIDE", $cookie, time() + (1*365*24*3600)); header("Content-Type:text/html\n"); print("\n"); print("\n"); print("\n"); print("\n"); print("スライドショーの修正 データ修正完了\n"); print("\n"); printf("\n"); if ($slide_no == "") { printf("

\n"); printf("入力パラメータが異常です。もう一度お試し下さい。

\n"); printf("
\n"); printf(" \n"); printf("「もっと、遥かな山旅を」 \n"); printf("[山の旅人たちのスライドショー] \n"); printf("
\n"); printf("\n"); printf("\n"); return; } // album.xml ファイルの作成 2005-03-04変更 $xml_file = $dir."/album.xml"; $fp1 = fopen($xml_file, "w"); if ($fp1 == false) { printf("

\n"); printf("ファイル(%s)のオープンに失敗しました。もう一度お試し下さい。

\n", $xml_file); printf("
\n"); printf(" \n"); printf("「もっと、遥かな山旅を」 \n"); printf("[山の旅人たちのスライドショー] \n"); printf("
\n"); printf("\n"); printf("\n"); return; } fwrite($fp1, "\n"); fwrite($fp1, "\n"); fwrite($fp1, " \n"); fwrite($fp1, " \n"); fwrite($fp1, " 山の旅人たちのスライドショー \n"); fwrite($fp1, " 山の旅人たちのスライドショー スライドショーの作成も可能です。\n"); fwrite($fp1, " もっと、遙かな山旅を\n"); fwrite($fp1, " 写真集\n"); fwrite($fp1, " \n"); fwrite($fp1, " \n"); fwrite($fp1, " \n"); fwrite($fp1, " \n"); fwrite($fp1, " \n"); fwrite($fp1, " \n"); fwrite($fp1, " $slide\n"); fwrite($fp1, " $name\n"); fwrite($fp1, " Comment\n"); fwrite($fp1, " $hp\n"); fwrite($fp1, " \n"); fwrite($fp1, " \n"); fwrite($fp1, " \n"); fwrite($fp1, " Fade\n"); fwrite($fp1, " Zoom\n"); fwrite($fp1, " Roll\n"); fwrite($fp1, " \n"); for ($i = 0; $i < $file_no; $i++) { $no = $i+1; $x_no = sprintf("%03d", $no); $jpg = sprintf("%03d.jpg", $no); $jpgs = sprintf("%03ds.jpg", $no); $text = i18n_convert($txt[$i], "SJIS"); fwrite($fp1, " \n"); fwrite($fp1, " $text\n"); fwrite($fp1, " \n"); fwrite($fp1, " \n"); fwrite($fp1, " \n"); fwrite($fp1, " \n"); fwrite($fp1, " \n"); fwrite($fp1, " \n"); fwrite($fp1, " \n"); } fwrite($fp1, " \n"); fwrite($fp1, "\n"); fclose($fp1); chmod ($xml_file, 0666); /*** slide.xml ファイルの作成 ***/ $strDir = dirname(__FILE__); // 2005-03-04 $strXml = $strDir."/data/album2-1.xml"; $strXml = $strDir."/".$dir."/album.xml"; $strXsl = $strDir."/data/slide_xml.xsl"; $objPrc = xslt_create(); xslt_set_encoding($objPrc, "SJIS"); $arg = array(); $param = array("AlbumNo"=>"0001", "Kind"=>"fade"); $param[AlbumNo] = $slide_no; $dst_file = $strDir."/".$dir."/slide.xml"; $result = xslt_process($objPrc, $strXml, $strXsl, $dst_file, $arg, $param); // fade.html ファイルの作成 $strXsl = $strDir."/data/slide_fade.xsl"; $param[AlbumNo] = $slide_no; $param[Kind] = "fade"; $dst_file = $strDir."/".$dir."/fade.html"; $result = xslt_process($objPrc, $strXml, $strXsl, $dst_file, $arg, $param); // zoom.html ファイルの作成 $param[Kind] = "zoom"; $dst_file = $strDir."/".$dir."/zoom.html"; $result = xslt_process($objPrc, $strXml, $strXsl, $dst_file, $arg, $param); // roll.html ファイルの作成 $param[Kind] = "roll"; $dst_file = $strDir."/".$dir."/roll.html"; $result = xslt_process($objPrc, $strXml, $strXsl, $dst_file, $arg, $param); // index.html ファイルの作成 $param[Kind] = "index"; $dst_file = $strDir."/".$dir."/index.html"; $result = xslt_process($objPrc, $strXml, $strXsl, $dst_file, $arg, $param); // n.htm ファイルの作成 $strXsl = $strDir."/data/photo.xsl"; $param = array("AlbumNo"=>"0001", "ImageNo"=>"001"); $param[AlbumNo] = $slide_no; for ($i = 0; $i < $file_no; $i++) { $no = $i+1; $x_no = sprintf("%03d", $no); $param[ImageNo] = $x_no; $dst_file = $strDir."/".$dir."/".$x_no.".html"; $result = xslt_process($objPrc, $strXml, $strXsl, $dst_file, $arg, $param); } /*** 2005-02-28 ***/ $sql = "update slide set title = '$euc_slide', author = '$euc_name', mail = '$mail', passwd = '$pass', hp = '$euc_hp', hp_url = '$url', bgm = '$midi', fade_wid = $fade_wid, fade_hig = $fade_hig, fade_spd = $fade_spd, fade_wat = $fade_wat, zoom_wid = $zoom_wid, zoom_hig = $zoom_hig, zoom_spd = $zoom_spd, zoom_wat = $zoom_wat, zoom_max = $zoom_max, zoom_md1 = $zoom_md1, zoom_md2 = $zoom_md2, zoom_min = $zoom_min, roll_wid = $roll_wid, roll_hig = $roll_hig, roll_spd = $roll_spd, roll_wat = $roll_wat, txt1 = '$txt[0]', txt2 = '$txt[1]', txt3 = '$txt[2]', txt4 = '$txt[3]', txt5 = '$txt[4]', txt6 = '$txt[5]', txt7 = '$txt[6]', txt8 = '$txt[7]', update_cnt = update_cnt + 1 where no = $slide_no"; $id = pg_exec($sql); /*******************/ printf("
\n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); for ($i = 0; $i < $file_no; $i++) { $no = $i+1; $x_no = sprintf("%03d", $no); printf(" \n"); printf(" \n", $x_no); printf(" \n"); printf(" \n"); } printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf("
\n"); printf(" 山の旅人たちのスライドショー - データ修正完了
\n"); printf(" ありがとうございます。次のURLのスライドショーを修正しました。
\n"); printf(" 修正が反映されない場合ブラウザの[リロード]ボタンを押してみてください。\n"); printf("

 Index \n"); printf(" http://yama-tabi.net/cgi/slide/%s/index.html\n", $dir, $dir); printf("
 Fade \n"); printf(" http://yama-tabi.net/cgi/slide/%s/fade.html\n", $dir, $dir); printf("
 Zoom \n"); printf(" http://yama-tabi.net/cgi/slide/%s/zoom.html\n", $dir, $dir); printf("
 Roll \n"); printf(" http://yama-tabi.net/cgi/slide/%s/roll.html\n", $dir, $dir); printf("
 %s \n"); printf(" http://yama-tabi.net/cgi/slide/%s/%s.html\n", $dir, $x_no, $dir, $x_no); printf("

\n"); printf("
\n"); printf("  \n"); printf(" 「もっと、遥かな山旅を」 \n"); printf(" [山の旅人たちのスライドショー] \n"); printf("
\n"); printf("
\n"); printf(" \n"); printf(" \"ここで一言\"\n"); printf("
\n"); printf("
\n"); printf("\n"); printf("\n"); break; case "delete": /* スライド削除 */ $slide_no = $_POST['slide_no']; header("Content-Type:text/html\n"); print("\n"); print("\n"); print("\n"); print("\n"); print("スライドショーの削除 削除完了\n"); print("\n"); printf("\n"); /*** 2005-03-03 ***/ $sql = "select * from slide where no = $slide_no"; $id = pg_exec($sql); $title = i18n_convert(pg_result($id, 0, "title"), "SJIS", "EUC"); $sql = "update slide set update_cnt = 0 where no = $slide_no"; $id = pg_exec($sql); /*******************/ printf("
\n"); printf("
\n"); printf("スライドショー 「%s」 を削除しました。

\n", $title); printf("
\n"); printf("
\n"); printf("
\n"); printf(" \n"); printf("「もっと、遥かな山旅を」 \n"); printf("[山の旅人たちのスライドショー] \n"); printf("
\n"); printf("
\n"); printf("\n"); printf("\n"); break; default: /* トップページ */ // アクセス数のカウント $fp2 = fopen("lock1.loc", "w"); flock($fp2, LOCK_EX); $fp1 = fopen("count.txt", "r"); if ($fp1 == false) { $access = "0"; } else { $access = fgets($fp1, 128); } if ($access == false) $access = "0"; $access++; $fp1 = fopen("count.txt", "w"); fwrite($fp1, "$access"); fclose($fp1); flock($fp2, LOCK_UN); fclose($fp2); header("Content-Type:text/html\n"); printf("\n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" 山の旅人たちのスライドショー\n"); printf(" \n"); printf(" \n"); printf("
\n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); $sql = "select * from slide where update_cnt > 0 order by t_date desc"; $id = pg_exec($sql); $rows = pg_numrows($id); printf(" \n"); printf(" \n"); printf(" \n"); $start = $_GET['start']; $end = $_GET['end']; if (($start == 0) && ($end == 0)) { $start = 1; $end = 20; } if ($start > 0) $start--; if ($end > $rows) $end = $rows; for ($r = $start; $r < $end; $r++) { $no = pg_result($id, $r, "no"); $title = i18n_convert(pg_result($id, $r, "title"), "SJIS", "EUC"); $t_date = pg_result($id, $r, "t_date"); $author = i18n_convert(pg_result($id, $r, "author"), "SJIS", "EUC"); printf(" \n"); printf(" \n"); printf(" \n"); $tmp1 = explode(" ", $t_date); printf(" \n"); printf(" \n"); printf(" \n"); } printf(" \n"); printf(" \n", $access); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf("
\n"); printf(" 山の旅人たちのスライドショー\n"); printf("
\n"); printf(" (時はゆくとも命果てるまで、君よ夢をこころに若き旅人よ。)\n"); printf("
\n"); printf("
\n"); printf("
\n"); printf(" \n"); printf(" 山の旅人たちのスライドショー - 画像入力\n"); printf(" \n"); printf("
\n"); printf(" (スライドショーの作成)\n"); printf("
\n"); printf("
\n"); printf("  \n"); printf(" \n"); printf(" \n"); printf("
\n"); printf(" \n"); printf("
\n"); printf("
\n"); printf(" "); $blk_no = (int)($rows / 20); for ($i = 0; $i < $blk_no; $i++) { printf("[%03d-%03d] ", $rows-(($i+1)*20)+1, $rows-($i*20), $i*20+1, ($i+1)*20); } if ((int)($rows % 20) != 0) { printf("[%03d-%03d]", 1, $rows-($blk_no*20), $blk_no*20+1, $rows); } printf("\n"); printf("
\n"); printf("
\n"); printf(" \"%s\"\n", $no, $no, $title); printf(" \n"); printf(" %03d. \n", $rows-$r, $no); printf(" %s\n", $title); printf(" \n"); printf("
\n"); printf(" index \n", $no); printf(" fade \n", $no); printf(" zoom \n", $no); printf(" roll \n", $no); printf("
%s (%s)\n", $tmp1[0], $author); printf(" \n"); printf(" 修正\n", $no); printf("
\n"); printf("
\n"); printf(" "); $blk_no = (int)($rows / 20); for ($i = 0; $i < $blk_no; $i++) { printf("[%03d-%03d] ", $rows-(($i+1)*20)+1, $rows-($i*20), $i*20+1, ($i+1)*20); } if ((int)($rows % 20) != 0) { printf("[%03d-%03d]", 1, $rows-($blk_no*20), $blk_no*20+1, $rows); } printf("\n"); printf("
%05d
\n"); printf("
\n"); printf("  \n"); printf(" 「もっと、遥かな山旅を」 \n"); printf("
\n"); printf("
\n"); printf(" \"ここで一言\"\n"); printf("
\n"); printf("
\n"); printf("
\n"); printf(" 本ページのデザインは、Photo Library Network を参考にしております。\n"); printf("
\n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf("
4版Ver 3.002005-03-21\n"); printf(" バージョン3をリリース
\n"); printf(" ・データベース使用方式に変更
\n"); printf("
3版Ver 2.002004-09-18\n"); printf(" バージョン2をリリース
\n"); printf(" ・Rollスライドショーを追加
\n"); printf(" ・アルバム管理用xmlファイルフォーマットの変更
\n"); printf("
2版Ver 1.102003-12-08\n"); printf(" 正式リリース
\n"); printf(" Fade速度のデフォルト値などを変更、バグ修正
\n"); printf("
初版Ver 1.002003-11-25新規作成(βベーター・リリース)
\n"); printf("
\n"); printf("
\n"); printf("
\n"); printf(" \n"); printf(" \n"); printf("\n"); break; } pg_close(); ?>