root/trunk/install/php/showplaylist.php

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

パッチ適用:チケット #4 Syabas(Mediawiz,LinkPlayer?,etc...)での再生対応パッチ http://www.dcc-jpl.com/foltia/ticket/4

Line 
1 <?php
2 /*
3  Anime recording system foltia
4  http://www.dcc-jpl.com/soft/foltia/
5
6 showplaylist.php
7
8 目的
9 録画したmpeg2の番組一覧を表示します。
10
11
12 オプション
13 list:
14  省略時、録画順にソートされる。
15  titleのときに、番組順ソートされる。
16  rawのときに、DBに記録されている番組録画情報ではなくディレクトリにあるm2pファイルを全て表示する。
17
18  DCC-JPL Japan/foltia project
19
20 */
21 ?>
22 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
23 <html lang="ja">
24 <head>
25 <meta http-equiv="Content-Type" content="text/html; charset=EUC-JP">
26 <meta http-equiv="Content-Style-Type" content="text/css">
27 <link rel="stylesheet" type="text/css" href="graytable.css">
28 <?php
29 include("./foltialib.php");
30
31 // Syabas 判定
32 $useragent = $_SERVER['HTTP_USER_AGENT'];
33
34 //ディスク空き容量によって背景色表示変更
35 warndiskfreearea();
36
37 print "<title>foltia:recorded file list</title>
38 </head>";
39
40 $con = m_connect();
41 $now = date("YmdHi");   
42 ?>
43 <body BGCOLOR="#ffffff" TEXT="#494949" LINK="#0047ff" VLINK="#000000" ALINK="#c6edff" >
44 <div align="center">
45 <?php
46     printhtmlpageheader();
47 ?>
48   <p align="left"><font color="#494949" size="6">録画一覧表示</font></p>
49   <hr size="4">
50 <p align="left">再生可能番組リストを表示します。<br>
51 <?php
52 if ($demomode){
53 }else{
54     printdiskusage();
55     printtrcnprocesses();
56 }
57 ?>
58 <form name="deletemovie" method="POST" action="./deletemovie.php">
59 <p align="left"><input type="submit" value="項目削除" ></p>
60
61   <table BORDER="0" CELLPADDING="0" CELLSPACING="2" WIDTH="100%">
62     <thead>
63         <tr>
64             <th align="left">削除</th>
65             <th align="left"><A HREF="./showplaylist.php">ファイル名</A></th>
66             <th align="left"><A HREF="./showplaylist.php?list=title">タイトル</A></th>
67             <th align="left">話数</th>
68             <th align="left">サブタイ</th>
69 <?php
70 if (file_exists("./selectcaptureimage.php") ) {
71 print "            <th align=\"left\">キャプ</th>\n";
72 }
73 ?>
74         </tr>
75     </thead>
76
77     <tbody>
78
79
80 <?
81 $list = getgetform('list');
82
83 //旧仕様
84 if($list == "raw"){
85 exec ("ls -t  $recfolderpath/*.m2p", $m2pfiles);
86
87
88 foreach($m2pfiles as $pathfName) {
89 $fNametmp = split("/",$pathfName);
90 $fName = array_pop($fNametmp);
91 //print "FILENAME:$fName<BR>\n";
92
93         if(($fName == ".") or ($fName == "..") ){ continue; }
94     if (ereg(".m2p", $fName)){
95         $filesplit = split("-",$fName);
96     
97 if ($filesplit[1] == ""){
98 $query = "
99 SELECT
100 foltia_program.tid,foltia_program.title,foltia_subtitle.subtitle 
101 FROM foltia_subtitle , foltia_program   
102 WHERE foltia_program.tid = foltia_subtitle.tid 
103  AND foltia_subtitle.tid = $filesplit[0]
104 ";
105 $rs = m_query($con, $query, "DBクエリに失敗しました");
106 $rowdata = pg_fetch_row($rs, $row);
107 //print" $fName./$rowdata[1]//$rowdata[2]<BR>\n";
108 $title = $rowdata[1];
109 $subtitle = "";
110 $count = "";
111 }else{
112
113 $query = "
114 SELECT
115 foltia_program.tid,foltia_program.title,foltia_subtitle.countno,foltia_subtitle.subtitle 
116 FROM foltia_subtitle , foltia_program   
117 WHERE foltia_program.tid = foltia_subtitle.tid 
118  AND foltia_subtitle.tid = $filesplit[0]
119  AND foltia_subtitle.countno = $filesplit[1]
120 ";
121 $rs = m_query($con, $query, "DBクエリに失敗しました");
122 $rowdata = pg_fetch_row($rs, $row);
123 //print" $fName./$rowdata[1]/$rowdata[2]/$rowdata[3]<BR>\n";
124 $title = $rowdata[1];
125 $count = $rowdata[2];
126 $subtitle = $rowdata[3];
127 }//if 話数あるかどうか
128
129 $tid = htmlspecialchars($rowdata[0]);
130 $title = htmlspecialchars($title);
131 $count = htmlspecialchars($count);
132 $subtitle = htmlspecialchars($subtitle);
133
134 //--
135 print "
136 <tr>
137 <td><INPUT TYPE='checkbox' NAME='delete[]' VALUE='$fName'><br></td>
138 <td><A HREF=\"$httpmediamappath/$fName\">$fName</A><br></td>
139 <td><a href=\"http://cal.syoboi.jp/tid/$tid\" target=\"_blank\">$title</a></td>
140 <td>$count<br></td>
141 <td>$subtitle<br></td>";
142     if (file_exists("./selectcaptureimage.php") ) {
143 //    $capimgpath = preg_replace("/.m2p/", "", $fName);
144     print "            <td align=\"left\"> N/A </td>\n";
145     }
146
147 print "</tr>\n
148 ";
149 }//ereg
150 }//foreach
151 print "    </tbody>\n</table>\n</FORM>\n</body>\n</html>\n";
152 exit;
153 }elseif ($list== "title"){//新仕様
154 $query = "
155 SELECT
156 foltia_program.tid,
157 foltia_program.title,
158 foltia_subtitle.countno,
159 foltia_subtitle.subtitle  ,
160 foltia_m2pfiles.m2pfilename  ,
161 foltia_subtitle.pid   
162 FROM foltia_subtitle , foltia_program , foltia_m2pfiles
163 WHERE foltia_program.tid = foltia_subtitle.tid 
164  AND foltia_subtitle.m2pfilename = foltia_m2pfiles.m2pfilename
165 ORDER BY foltia_subtitle.tid  DESC , foltia_subtitle.startdatetime  ASC
166
167
168 ";
169 }else{
170 $query = "
171 SELECT
172 foltia_program.tid,
173 foltia_program.title,
174 foltia_subtitle.countno,
175 foltia_subtitle.subtitle  ,
176 foltia_m2pfiles.m2pfilename  ,
177 foltia_subtitle.pid   
178 FROM foltia_subtitle , foltia_program , foltia_m2pfiles
179 WHERE foltia_program.tid = foltia_subtitle.tid 
180  AND foltia_subtitle.m2pfilename = foltia_m2pfiles.m2pfilename
181 ORDER BY foltia_subtitle.startdatetime DESC
182 ";
183 }
184
185 $rs = m_query($con, $query, "DBクエリに失敗しました");
186 $maxrows = pg_num_rows($rs);
187
188 if ($maxrows > 0){
189 for ($row = 0; $row < $maxrows; $row++) {
190 $rowdata = pg_fetch_row($rs, $row);
191
192 $tid = htmlspecialchars($rowdata[0]);
193 $title = htmlspecialchars($rowdata[1]);
194 $count = htmlspecialchars($rowdata[2]);
195 $subtitle = htmlspecialchars($rowdata[3]);
196 $fName  = htmlspecialchars($rowdata[4]);
197 $pid  = htmlspecialchars($rowdata[5]);
198 //--
199 print "
200 <tr>
201 <td><INPUT TYPE='checkbox' NAME='delete[]' VALUE='$fName'><br></td>";
202 if (ereg("syabas",$useragent)){
203 print "<td><A HREF=\"./view_syabas.php?pid=$pid\" vod=playlist>$fName</td>";
204 }
205 else{
206 print "<td><A HREF=\"$httpmediamappath/$fName\">$fName</A><br></td>";
207 }
208 if ($tid > 0){
209 print"<td><a href=\"http://cal.syoboi.jp/tid/$tid\" target=\"_blank\">$title</a></td>
210 <td>$count<br></td>
211 <td><a href = \"http://cal.syoboi.jp/tid/$tid/time#$pid\" target=\"_blank\">$subtitle</a><br></td>";
212 }else{
213 print"<td>$title</td>
214 <td>$count<br></td>
215 <td>$subtitle<br></td>";
216 }
217     if (file_exists("./selectcaptureimage.php") ) {
218     $capimgpath = preg_replace("/.m2p/", "", $fName);
219     print "            <td align=\"left\"><a href=\"./selectcaptureimage.php?pid=$pid\">キャプ</a></td>\n";
220     }
221 print "</tr>\n
222 ";
223 }//for
224 }else{
225 print "
226 <tr>
227 <td COLSPAN=\"5\">ファイルがありません</td>
228 </tr>
229 ";
230
231
232 }//end if
233
234 print "</tbody>
235 </table>
236 </FORM>\n";
237
238 //番組ソートの時、未読番組のタイトルだけ表示
239 if ($list== "title"){
240 $query = "
241 SELECT distinct
242 foltia_program.tid,
243 foltia_program.title
244 FROM foltia_subtitle , foltia_program , foltia_m2pfiles
245 WHERE foltia_program.tid = foltia_subtitle.tid 
246  AND foltia_subtitle.m2pfilename = foltia_m2pfiles.m2pfilename
247 ORDER BY foltia_program.tid DESC
248 ";
249
250 $rs = m_query($con, $query, "DBクエリに失敗しました");
251 $maxrows = pg_num_rows($rs);
252
253
254 if ($maxrows > 0){
255 print "<hr>
256 <p align=\"left\">未読タイトルを表示します。<br>
257   <table BORDER=\"0\" CELLPADDING=\"0\" CELLSPACING=\"2\" WIDTH=\"100%\">
258     <thead>
259         <tr>
260             <th align=\"left\">TID</th>
261             <th align=\"left\">タイトル</th>
262         </tr>
263     </thead>
264     <tbody>
265 ";
266
267 for ($row = 0; $row < $maxrows; $row++) {
268 $rowdata = pg_fetch_row($rs, $row);
269
270 $tid = htmlspecialchars($rowdata[0]);
271 $title = htmlspecialchars($rowdata[1]);
272
273
274 print "<tr><td>$tid</td><td>$title</td></tr>\n";
275
276 }//for
277 print "</tbody></table>\n";
278 }//if maxrows
279 }//if title
280
281 ?>
282    
283
284 </body>
285 </html>
286
Note: リポジトリブラウザについてのヘルプは TracBrowser を参照してください。
track feed