root/trunk/install/php/showlibc.php

リビジョン 23, 5.7 kB (コミッタ: sorshi, コミット時期: 18 年 前)

録画ライブラリ、サブタイトルへのリンク追加、ページタイトルに番組名表示。

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     if (file_exists("$recfolderpath/$tid.localized/img/$capimgpath") ){
171     $caplink = " / <a href = \"./selectcaptureimage.php?pid=$rowdata[6]\">キャプ</a>";
172     }else{
173     $caplink = " / キャプなし";
174     }
175 }else{
176 $caplink = "";
177 }//end if sb
178
179 print "  <tr>
180     <td rowspan=\"4\" width=\"170\"><a href = \"$httpmediamappath/$tid.localized/mp4/$fName\" target=\"_blank\"><img src = \"$httpmediamappath/$tid.localized/mp4/$thumbnail\" width = \"160\" height = \"120\"></A></td>
181     <td>$count</td>
182   </tr>
183   <tr>
184 ";
185 if ($tid == 0){
186 print "\n    <td>$subtitle</td>";
187 }else{
188 print "\n    <td><a href = \"http://cal.syoboi.jp/tid/$tid/time#$pid\" target=\"_blank\">$subtitle</a></td>";
189 }//if
190 print "  </tr>
191   <tr>
192     <td>$onairdate</td>
193   </tr>
194   <tr>
195     <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>
196   </tr>
197 ";
198
199 }//for
200 }else{
201 print "録画ファイルがありません<br>\n";
202 }//if
203 ?>
204     </tbody>
205 </table>
206
207
208 </body>
209 </html>
210
Note: リポジトリブラウザについてのヘルプは TracBrowser を参照してください。
track feed