root/trunk/install/php/showlibc.php

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

MP4ライブラリ表示画面での
・サムネールがない場合に代替画像表示する機能を追加。(./img/no-thumbnail-img.png)
・HTML修正。
・キャプチャ画像の存在判定を修正。

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