root/trunk/install/php/showlibc.php

リビジョン 74, 6.4 kB (コミッタ: sorshi, コミット時期: 17 年 前)

番組別FolcastにiTunesに追加メニューが正常動作していなかったところを修正。

Line 
1 <?php
2 /*
3  Anime recording system foltia
4  http://www.dcc-jpl.com/soft/foltia/
5
6 showlibc.php
7
8 目的
9 録画ライブラリ番組を個別表示します。
10
11 引数
12 tid:タイトルID
13
14  DCC-JPL Japan/foltia project
15
16 */
17
18 include("./foltialib.php");
19 $con = m_connect();
20
21 if ($useenvironmentpolicy == 1){
22     if (!isset($_SERVER['PHP_AUTH_USER'])) {
23         header("WWW-Authenticate: Basic realm=\"foltia\"");
24         header("HTTP/1.0 401 Unauthorized");
25         redirectlogin();
26         exit;
27     } else {
28     login($con,$_SERVER['PHP_AUTH_USER'],$_SERVER['PHP_AUTH_PW']);
29     }
30 }//end if login
31
32 $tid = getgetnumform(tid);
33
34 if ($tid == "") {
35     header("Status: 404 Not Found",TRUE,404);
36 }
37
38 ?>
39 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
40 <html lang="ja">
41 <head>
42 <meta http-equiv="Content-Type" content="text/html; charset=EUC-JP">
43 <meta http-equiv="Content-Style-Type" content="text/css">
44 <link rel="stylesheet" type="text/css" href="graytable.css">
45 <script src="http://images.apple.com/main/js/ac_quicktime.js" language="JavaScript" type="text/javascript"></script>
46 <?php
47 print "<link rel=\"alternate\" type=\"application/rss+xml\" title=\"RSS\" href=\"./folcast.php?tid=$tid\" />
48 ";
49         if ($tid == "") {
50     print "<title>foltia:Lib</title>
51 </head><body BGCOLOR=\"#ffffff\" TEXT=\"#494949\" LINK=\"#0047ff\" VLINK=\"#000000\" ALINK=\"#c6edff\" > \n";
52         printhtmlpageheader();
53         die_exit("再生可能番組がありません<BR>");
54         }
55 $now = date("YmdHi");   
56
57 $query = "
58 SELECT foltia_program.title 
59 FROM  foltia_program   
60 WHERE foltia_program.tid = $tid 
61 ";
62 $rs = m_query($con, $query, "DBクエリに失敗しました");
63 $maxrows = pg_num_rows($rs);
64 if ($maxrows == 0 ){
65  $syobocaldb = `curl "http://cal.syoboi.jp/db?Command=TitleLookup&TID=$tid" | head -2 `;
66 $syobocaldb = mb_convert_encoding($syobocaldb, "EUC-JP", "UTF-8");
67     $syobocaldb = preg_match("/<Title>.*<\/Title>/", $syobocaldb,$title);
68     $title = $title[0];
69     $title = strip_tags($title);
70     $title htmlspecialchars($title) ;
71 }else{
72 $rowdata = pg_fetch_row($rs, 0);
73 $title = $rowdata[0];
74 $title htmlspecialchars($title) ;
75 }
76 //ヘッダ続き
77 print "<title>foltia:Lib $tid:$title</title>
78 </head>
79 <body BGCOLOR=\"#ffffff\" TEXT=\"#494949\" LINK=\"#0047ff\" VLINK=\"#000000\" ALINK=\"#c6edff\" >
80 <div align=\"center\">
81 ";
82     printhtmlpageheader();
83 print "  <p align=\"left\"><font color=\"#494949\" size=\"6\">録画ライブラリ番組個別表示</font></p>
84   <hr size=\"4\">
85 <p align=\"left\">再生可能ムービーを表示します。<br>";
86
87 $serveruri = getserveruri();
88 if ($tid == 0){
89 print "$title 【<A HREF = \"./folcast.php?tid=$tid\">この番組のFolcast</A> [<a href=\"itpc://$serveruri/folcast.php?tid=$tid\">iTunesに登録</a>】 <br>\n";
90 }else{
91
92 print "<a href=\"http://cal.syoboi.jp/tid/" .
93                      htmlspecialchars($tid)  . "\" target=\"_blank\">$title</a> 【<A HREF = \"./folcast.php?tid=$tid\">この番組のFolcast</A> [<a href=\"itpc://$serveruri/folcast.php?tid=$tid\">iTunesに登録</a>]】 <br>\n";
94 }
95 //確認
96 if (file_exists ("$recfolderpath/$tid.localized")){
97 //    print "ディレクトリは存在します\n";
98 }else{
99 //    print "ディレクトリはありません\n";
100         print "再生可能番組がありません<BR>\n</body></html>";
101     exit;
102 }                     
103
104
105
106 //新仕様/* 2006/10/26 */
107 if (file_exists("./selectcaptureimage.php") ) {
108     $sbpluginexist = 1;
109 }
110 $serverfqdn = getserverfqdn();
111
112 $query = "
113 SELECT
114 foltia_program.tid,
115 foltia_program.title,
116 foltia_subtitle.countno,
117 foltia_subtitle.subtitle,
118 foltia_subtitle.startdatetime ,
119 foltia_subtitle.m2pfilename ,
120 foltia_subtitle.pid ,
121 foltia_mp4files.mp4filename
122 FROM foltia_mp4files 
123 LEFT JOIN foltia_subtitle
124 ON   foltia_mp4files.mp4filename = foltia_subtitle.pspfilename   
125 LEFT JOIN foltia_program 
126 ON foltia_mp4files.tid = foltia_program.tid
127 WHERE foltia_mp4files.tid = $tid 
128 ORDER BY \"startdatetime\" ASC
129 ";
130
131 $rs = "";
132 $rs = m_query($con, $query, "DBクエリに失敗しました");
133 $maxrows = pg_num_rows($rs);
134 if ($maxrows > 0 ){
135 print "
136   <table BORDER=\"0\" CELLPADDING=\"0\" CELLSPACING=\"2\" WIDTH=\"100%\">
137     <tbody>
138 ";
139
140 for ($row = 0; $row < $maxrows; $row++) {
141     $rowdata = pg_fetch_row($rs, $row);
142
143 $title = $rowdata[1];
144
145 if ($rowdata[2]== "" ){
146     $count = "[話数]";
147 }else{
148     $count = $rowdata[2];
149 }
150 if ($rowdata[3]== "" ){
151     $subtitle = "[サブタイトル]";
152 }else{
153     $subtitle = $rowdata[3];
154 }
155 $onairdate $rowdata[4];
156
157 $tid = htmlspecialchars($rowdata[0]);
158 $title = htmlspecialchars($title);
159 $count = htmlspecialchars($count);
160 $subtitle = htmlspecialchars($subtitle);
161 $onairdate = htmlspecialchars($onairdate);
162 $pid = htmlspecialchars($rowdata[6]);
163 $fName = htmlspecialchars($rowdata[7]);
164 if (ereg(".MP4", $fName)){
165     $thumbnail = $fName;
166     $thumbnail = ereg_replace(".MP4", ".THM", $thumbnail);
167 }
168 if ($onairdate == ""){
169 $onairdate = "[放送日]";
170 }else{
171 $day = substr($onairdate,0,4)."/".substr($onairdate,4,2)."/".substr($onairdate,6,2);
172 $time = substr($onairdate,8,2).":".substr($onairdate,10,2);
173 $onairdate = "$day $time";
174 }
175 //Starlight Breaker向け拡張
176 //$debug_pg_num_rows = pg_num_rows ($rs );
177 $caplink = "";
178
179 if (($sbpluginexist == 1) && (pg_num_rows ($rs ) > 0)){
180  $capimgpath = htmlspecialchars(preg_replace("/.m2p/", "", $rowdata[5]));
181     
182     if (($capimgpath != "") && (file_exists("$recfolderpath/$tid.localized/img/$capimgpath") )){
183     $caplink = " / <a href = \"./selectcaptureimage.php?pid=$rowdata[6]\">キャプ</a>";
184     }else{
185     $caplink = " / キャプなし";
186     }
187 }else{
188 $caplink = "";
189 }//end if sb
190
191 if (file_exists("$recfolderpath/$tid.localized/mp4/$thumbnail") ){
192     $imgsrcuri = "$httpmediamappath/$tid.localized/mp4/$thumbnail\" alt=\"$title $count $subtitle";
193 }else{
194     $imgsrcuri = "./img/no-thumbnail-img.png\" alt=\"NO IMAGE";
195 }
196
197
198 print "  <tr>
199     <td rowspan=\"4\" width=\"170\"><a href = \"$httpmediamappath/$tid.localized/mp4/$fName\" target=\"_blank\"><img src = \"$imgsrcuri\" width=\"160\" height=\"120\"></a></td>
200     <td>$count</td>
201   </tr>
202   <tr>
203 ";
204 if ($tid == 0){
205 print "\n    <td>$subtitle</td>";
206 }else{
207 print "\n    <td><a href = \"http://cal.syoboi.jp/tid/$tid/time#$pid\" target=\"_blank\">$subtitle</a></td>";
208 }//if
209 print "  </tr>
210   <tr>
211     <td>$onairdate</td>
212   </tr>
213   <tr>
214     <td><a href =\"$httpmediamappath/$tid.localized/mp4/$fName\" target=\"_blank\">$fName</A> / <script language=\"JavaScript\" type=\"text/javascript\">QT_WriteOBJECT_XHTML('http://g.hatena.ne.jp/images/podcasting.gif','16','16','','controller','FALSE','href','http://$serverfqdn/$httpmediamappath/$tid.localized/mp4/$fName','target','QuickTimePlayer','type','video/mp4');</script> $caplink</td>
215   </tr>
216 ";
217
218 }//for
219 }else{
220 print "録画ファイルがありません<br>\n";
221 }//if
222 ?>
223     </tbody>
224 </table>
225
226 </body>
227 </html>
228
Note: リポジトリブラウザについてのヘルプは TracBrowser を参照してください。
track feed