root/trunk/install/php/showlibc.php

リビジョン 83, 7.7 kB (コミッタ: sorshi, コミット時期: 16 年 前)

foltiaHD最初のリリース。
デジタル録画はFriio/Friio BS/CSのみに対応。
ivtvは1.0系使用になりました。

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 <?php
44 if (file_exists  ( "./iui/iui.css"  )){
45     $useragent = $_SERVER['HTTP_USER_AGENT'];
46 }
47 if(ereg("iPhone",$useragent)){
48 print "<meta name=\"viewport\" content=\"width=320; initial-scale=1.0; maximum-scale=1.0; user-scalable=no;\"/>
49 <link rel=\"apple-touch-icon\" type=\"image/png\" href=\"./img/icon.png\" />
50 <style type=\"text/css\" media=\"screen\">@import \"./iui/iui.css\";</style>
51 <script type=\"application/x-javascript\" src=\"./iui/iui.js\"></script>";
52 }else{
53 print "<meta http-equiv=\"Content-Style-Type\" content=\"text/css\">
54 <link rel=\"stylesheet\" type=\"text/css\" href=\"graytable.css\">
55 <script src=\"http://images.apple.com/main/js/ac_quicktime.js\" language=\"JavaScript\" type=\"text/javascript\"></script>
56 <link rel=\"alternate\" type=\"application/rss+xml\" title=\"RSS\" href=\"./folcast.php?tid=$tid\" />
57 ";
58 }
59 if ($tid == "") {
60     print "<title>foltia:Lib</title>
61 </head><body BGCOLOR=\"#ffffff\" TEXT=\"#494949\" LINK=\"#0047ff\" VLINK=\"#000000\" ALINK=\"#c6edff\" > \n";
62         printhtmlpageheader();
63         die_exit("再生可能番組がありません<BR>");
64     }
65 $now = date("YmdHi");   
66
67 $query = "
68 SELECT foltia_program.title 
69 FROM  foltia_program   
70 WHERE foltia_program.tid = $tid 
71 ";
72 $rs = m_query($con, $query, "DBクエリに失敗しました");
73 $maxrows = pg_num_rows($rs);
74 if ($maxrows == 0 ){
75  $syobocaldb = `curl "http://cal.syoboi.jp/db?Command=TitleLookup&TID=$tid" | head -2 `;
76 $syobocaldb = mb_convert_encoding($syobocaldb, "EUC-JP", "UTF-8");
77     $syobocaldb = preg_match("/<Title>.*<\/Title>/", $syobocaldb,$title);
78     $title = $title[0];
79     $title = strip_tags($title);
80     $title htmlspecialchars($title) ;
81 }else{
82 $rowdata = pg_fetch_row($rs, 0);
83 $title = $rowdata[0];
84 $title htmlspecialchars($title) ;
85 }
86 //ヘッダ続き
87 print "<title>foltia:Lib $tid:$title</title></head>";
88 $serveruri = getserveruri();
89
90 if(ereg("iPhone",$useragent)){
91     print "<body onclick=\"console.log('Hello', event.target);\">
92     <div class=\"toolbar\">
93         <h1 id=\"pageTitle\"></h1>
94         <a id=\"backButton\" class=\"button\" href=\"#\"></a>
95     </div>
96 ";
97 }else{
98
99 print "<body BGCOLOR=\"#ffffff\" TEXT=\"#494949\" LINK=\"#0047ff\" VLINK=\"#000000\" ALINK=\"#c6edff\" >
100 <div align=\"center\">
101 ";
102     printhtmlpageheader();
103 print "  <p align=\"left\"><font color=\"#494949\" size=\"6\">録画ライブラリ番組個別表示</font></p>
104   <hr size=\"4\">
105 <p align=\"left\">再生可能ムービーを表示します。<br>";
106 if ($tid == 0){
107 print "$title 【<A HREF = \"./folcast.php?tid=$tid\">この番組のFolcast</A> [<a href=\"itpc://$serveruri/folcast.php?tid=$tid\">iTunesに登録</a>】 <br>\n";
108 }else{
109
110 print "<a href=\"http://cal.syoboi.jp/tid/" .
111                      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";
112 }
113 }// endif if(ereg("iPhone",$useragent))
114
115 //確認
116 if (file_exists ("$recfolderpath/$tid.localized")){
117 //    print "ディレクトリは存在します\n";
118 }else{
119 //    print "ディレクトリはありません\n";
120         print "再生可能番組がありません<BR>\n</body></html>";
121     exit;
122 }                     
123
124 //新仕様/* 2006/10/26 */
125 if (file_exists("./selectcaptureimage.php") ) {
126     $sbpluginexist = 1;
127 }
128 $serverfqdn = getserverfqdn();
129
130 $query = "
131 SELECT
132 foltia_program.tid,
133 foltia_program.title,
134 foltia_subtitle.countno,
135 foltia_subtitle.subtitle,
136 foltia_subtitle.startdatetime ,
137 foltia_subtitle.m2pfilename ,
138 foltia_subtitle.pid ,
139 foltia_mp4files.mp4filename
140 FROM foltia_mp4files 
141 LEFT JOIN foltia_subtitle
142 ON   foltia_mp4files.mp4filename = foltia_subtitle.pspfilename   
143 LEFT JOIN foltia_program 
144 ON foltia_mp4files.tid = foltia_program.tid
145 WHERE foltia_mp4files.tid = $tid 
146 ORDER BY \"startdatetime\" ASC
147 ";
148
149 $rs = "";
150 $rs = m_query($con, $query, "DBクエリに失敗しました");
151 $maxrows = pg_num_rows($rs);
152 if ($maxrows > 0 ){
153 if(ereg("iPhone",$useragent)){
154     print "<ul id=\"home\" title=\"$title\" selected=\"true\">";
155 }else{
156 print "
157   <table BORDER=\"0\" CELLPADDING=\"0\" CELLSPACING=\"2\" WIDTH=\"100%\">
158     <tbody>
159 ";
160 }
161 for ($row = 0; $row < $maxrows; $row++) {
162     $rowdata = pg_fetch_row($rs, $row);
163
164 $title = $rowdata[1];
165
166 if ($rowdata[2]== "" ){
167     $count = "[話数]";
168 }else{
169     $count = $rowdata[2];
170 }
171 if ($rowdata[3]== "" ){
172     $subtitle = "[サブタイトル]";
173 }else{
174     $subtitle = $rowdata[3];
175 }
176 $onairdate $rowdata[4];
177
178 $tid = htmlspecialchars($rowdata[0]);
179 $title = htmlspecialchars($title);
180 $count = htmlspecialchars($count);
181 $subtitle = htmlspecialchars($subtitle);
182 $onairdate = htmlspecialchars($onairdate);
183 $pid = htmlspecialchars($rowdata[6]);
184 $fName = htmlspecialchars($rowdata[7]);
185 if (ereg(".MP4", $fName)){
186     $thumbnail = $fName;
187     $thumbnail = ereg_replace(".MP4", ".THM", $thumbnail);
188 }
189 if ($onairdate == ""){
190 $onairdate = "[放送日]";
191 }else{
192 $day = substr($onairdate,0,4)."/".substr($onairdate,4,2)."/".substr($onairdate,6,2);
193 $time = substr($onairdate,8,2).":".substr($onairdate,10,2);
194 $onairdate = "$day $time";
195 }
196 //Starlight Breaker向け拡張
197 //$debug_pg_num_rows = pg_num_rows ($rs );
198 $caplink = "";
199
200 if (($sbpluginexist == 1) && (pg_num_rows ($rs ) > 0)){
201  //$capimgpath = htmlspecialchars(preg_replace("/.m2p/", "", $rowdata[5]));
202  $capimgpath = htmlspecialchars(preg_replace("/.m2./", "", $rowdata[5]));
203     
204     if (($capimgpath != "") && (file_exists("$recfolderpath/$tid.localized/img/$capimgpath") )){
205     $caplink = " / <a href = \"./selectcaptureimage.php?pid=$rowdata[6]\">キャプ</a>";
206     }else{
207     $caplink = " / キャプなし";
208     }
209 }else{
210 $caplink = "";
211 }//end if sb
212
213 if (file_exists("$recfolderpath/$tid.localized/mp4/$thumbnail") ){
214     $imgsrcuri = "$httpmediamappath/$tid.localized/mp4/$thumbnail\" alt=\"$title $count $subtitle";
215 }else{
216     $imgsrcuri = "./img/no-thumbnail-img.png\" alt=\"NO IMAGE";
217 }
218
219 if(ereg("iPhone",$useragent)){
220
221 print "<li><a href=\"http://$serverfqdn/$httpmediamappath/$tid.localized/mp4/$fName\" target=\"_self\">$count $subtitle $onairdate</a></li>\n";
222
223 }else{
224 print "  <tr>
225     <td rowspan=\"4\" width=\"170\"><a href = \"$httpmediamappath/$tid.localized/mp4/$fName\" target=\"_blank\"><img src = \"$imgsrcuri\" width=\"160\" height=\"120\"></a></td>
226     <td>$count</td>
227   </tr>
228   <tr>
229 ";
230     if ($tid == 0){
231     print "\n    <td>$subtitle</td>";
232     }else{
233     print "\n    <td><a href = \"http://cal.syoboi.jp/tid/$tid/time#$pid\" target=\"_blank\">$subtitle</a></td>";
234     }//if
235 print "  </tr>
236   <tr>
237     <td>$onairdate</td>
238   </tr>
239   <tr>
240     <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>
241   </tr>
242 ";
243
244 }//endif iPhone
245
246 }//for
247 }else{
248 print "録画ファイルがありません<br>\n";
249 }//if
250
251 if(ereg("iPhone",$useragent)){
252     print "<li><a href=\"http://$serveruri/showlib.php\" target=\"_self\">一覧へ戻る</a></li>\n";
253     print "</ul>\n";
254 }else{
255     print "</tbody></table>\n";
256 }
257 ?>
258 </body>
259 </html>
260
261    
Note: リポジトリブラウザについてのヘルプは TracBrowser を参照してください。
track feed