1 |
<?php |
---|
2 |
|
---|
3 |
|
---|
4 |
|
---|
5 |
|
---|
6 |
|
---|
7 |
|
---|
8 |
|
---|
9 |
|
---|
10 |
|
---|
11 |
|
---|
12 |
|
---|
13 |
|
---|
14 |
|
---|
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 |
} |
---|
31 |
|
---|
32 |
?> |
---|
33 |
|
---|
34 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> |
---|
35 |
<html lang="ja"> |
---|
36 |
<head> |
---|
37 |
<meta http-equiv="Content-Type" content="text/html; charset=EUC-JP"> |
---|
38 |
<?php |
---|
39 |
if (file_exists ( "./iui/iui.css" )){ |
---|
40 |
$useragent = $_SERVER['HTTP_USER_AGENT']; |
---|
41 |
} |
---|
42 |
if(ereg("iPhone",$useragent)){ |
---|
43 |
print "<meta name=\"viewport\" content=\"width=320; initial-scale=1.0; maximum-scale=1.0; user-scalable=no;\"/> |
---|
44 |
<link rel=\"apple-touch-icon\" type=\"image/png\" href=\"./img/icon.png\" /> |
---|
45 |
|
---|
46 |
<style type=\"text/css\" media=\"screen\">@import \"./iui/iui.css\";</style> |
---|
47 |
<script type=\"application/x-javascript\" src=\"./iui/iui.js\"></script>"; |
---|
48 |
}else{ |
---|
49 |
print "<meta http-equiv=\"Content-Style-Type\" content=\"text/css\"> |
---|
50 |
<link rel=\"stylesheet\" type=\"text/css\" href=\"graytable.css\"> |
---|
51 |
<link rel=\"alternate\" type=\"application/rss+xml\" title=\"RSS\" href=\"./folcast.php\" />"; |
---|
52 |
} |
---|
53 |
?> |
---|
54 |
<title>foltia:MP4 Lib</title> |
---|
55 |
</head> |
---|
56 |
|
---|
57 |
<?php |
---|
58 |
$now = date("YmdHi"); |
---|
59 |
if(ereg("iPhone",$useragent)){ |
---|
60 |
print "<body onclick=\"console.log('Hello', event.target);\"> |
---|
61 |
<div class=\"toolbar\"> |
---|
62 |
<h1 id=\"pageTitle\"></h1> |
---|
63 |
<a id=\"backButton\" class=\"button\" href=\"#\"></a> |
---|
64 |
</div> |
---|
65 |
"; |
---|
66 |
}else{ |
---|
67 |
print "<body BGCOLOR=\"#ffffff\" TEXT=\"#494949\" LINK=\"#0047ff\" VLINK=\"#000000\" ALINK=\"#c6edff\" > |
---|
68 |
<div align=\"center\"> |
---|
69 |
"; |
---|
70 |
printhtmlpageheader(); |
---|
71 |
print " <p align=\"left\"><font color=\"#494949\" size=\"6\">録画ライブラリ表示</font></p> |
---|
72 |
<hr size=\"4\"> |
---|
73 |
<p align=\"left\">再生可能ライブラリを表示します。<br> |
---|
74 |
"; |
---|
75 |
} |
---|
76 |
|
---|
77 |
|
---|
78 |
$query = " |
---|
79 |
SELECT foltia_mp4files.tid,foltia_program.title , count(foltia_mp4files.mp4filename) |
---|
80 |
FROM foltia_mp4files , foltia_program |
---|
81 |
WHERE foltia_program.tid = foltia_mp4files.tid |
---|
82 |
GROUP BY foltia_mp4files.tid ,foltia_program.title |
---|
83 |
ORDER BY foltia_mp4files.tid DESC |
---|
84 |
"; |
---|
85 |
|
---|
86 |
$rs = m_query($con, $query, "DBクエリに失敗しました"); |
---|
87 |
|
---|
88 |
$maxrows = pg_num_rows($rs); |
---|
89 |
|
---|
90 |
if ($maxrows > 0 ){ |
---|
91 |
if(ereg("iPhone",$useragent)){ |
---|
92 |
print "<ul id=\"home\" title=\"録画ライブラリ表示\" selected=\"true\">"; |
---|
93 |
}else{ |
---|
94 |
print " |
---|
95 |
<table BORDER=\"0\" CELLPADDING=\"0\" CELLSPACING=\"2\" WIDTH=\"100%\"> |
---|
96 |
<thead> |
---|
97 |
<tr> |
---|
98 |
<th align=\"left\">TID</th> |
---|
99 |
<th align=\"left\">タイトル(内容リンク)</th> |
---|
100 |
<th align=\"left\">内容数</th> |
---|
101 |
<th align=\"left\">リンク</th> |
---|
102 |
</tr> |
---|
103 |
</thead> |
---|
104 |
<tbody> |
---|
105 |
"; |
---|
106 |
} |
---|
107 |
for ($row = 0; $row < $maxrows; $row++) { |
---|
108 |
$rowdata = pg_fetch_row($rs, $row); |
---|
109 |
$title = $rowdata[1]; |
---|
110 |
$counts = $rowdata[2]; |
---|
111 |
$tid = htmlspecialchars($rowdata[0]); |
---|
112 |
$title = htmlspecialchars($title); |
---|
113 |
$counts = htmlspecialchars($counts); |
---|
114 |
|
---|
115 |
if(ereg("iPhone",$useragent)){ |
---|
116 |
print "<li><a href=\"showlibc.php?tid=$tid\" target=\"_self\">$title</a></li>\n"; |
---|
117 |
}else{ |
---|
118 |
print " |
---|
119 |
<tr> |
---|
120 |
<td>$tid<br></td> |
---|
121 |
<td><a href=\"showlibc.php?tid=$tid\">$title</a></td> |
---|
122 |
<td>$counts<br></td> |
---|
123 |
<td><a href=\"http://cal.syoboi.jp/tid/$tid\" target=\"_blank\">しょぼかる-$tid</a><br></td> |
---|
124 |
</tr>\n |
---|
125 |
"; |
---|
126 |
} |
---|
127 |
} |
---|
128 |
|
---|
129 |
if(ereg("iPhone",$useragent)){ |
---|
130 |
print "</ul>\n</body>\n</html>\n"; |
---|
131 |
}else{ |
---|
132 |
print " |
---|
133 |
</tbody> |
---|
134 |
</table> |
---|
135 |
</body> |
---|
136 |
</html> |
---|
137 |
"; |
---|
138 |
} |
---|
139 |
|
---|
140 |
}else{ |
---|
141 |
print "録画ファイルが存在しません。</body></html>"; |
---|
142 |
|
---|
143 |
} |
---|
144 |
/* |
---|
145 |
//旧仕様 |
---|
146 |
//ディレクトリからファイル一覧を取得 |
---|
147 |
exec ("ls $recfolderpath | grep localized | sort -r", $libdir); |
---|
148 |
//print "libdir:$libdir<BR>\n"; |
---|
149 |
|
---|
150 |
foreach($libdir as $fName) { |
---|
151 |
|
---|
152 |
if(($fName == ".") or ($fName == "..") ){ continue; } |
---|
153 |
if (ereg(".localized", $fName)){ |
---|
154 |
$filesplit = split("\.",$fName); |
---|
155 |
$query = " |
---|
156 |
SELECT |
---|
157 |
foltia_program.tid,foltia_program.title |
---|
158 |
FROM foltia_program |
---|
159 |
WHERE foltia_program.tid = $filesplit[0] |
---|
160 |
"; |
---|
161 |
$rs = m_query($con, $query, "DBクエリに失敗しました"); |
---|
162 |
$rowdata = pg_fetch_row($rs, $row); |
---|
163 |
//print" $fName./$rowdata[1]/$rowdata[2]/$rowdata[3]<BR>\n"; |
---|
164 |
$title = $rowdata[1]; |
---|
165 |
|
---|
166 |
$tid = htmlspecialchars($rowdata[0]); |
---|
167 |
$title = htmlspecialchars($title); |
---|
168 |
//-- |
---|
169 |
print " |
---|
170 |
<tr> |
---|
171 |
<td>$tid<br></td> |
---|
172 |
<td><a href=\"showlibc.php?tid=$tid\">$title</a></td> |
---|
173 |
<td>"; |
---|
174 |
//計数 |
---|
175 |
$counts = system ("ls $recfolderpath/$fName/mp4/*.MP4 | wc -l"); |
---|
176 |
print "<br></td> |
---|
177 |
<td><a href=\"http://cal.syoboi.jp/tid/$tid\" target=\"_blank\">しょぼかる-$tid</a><br></td> |
---|
178 |
</tr>\n |
---|
179 |
"; |
---|
180 |
}//end if ereg m2p |
---|
181 |
}//end foreach |
---|
182 |
//旧仕様ココまで |
---|
183 |
*/ |
---|
184 |
//$d->close(); |
---|
185 |
?> |
---|
186 |
|
---|