| 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 |
<meta http-equiv="Content-Style-Type" content="text/css"> |
|---|
| 39 |
<link rel="stylesheet" type="text/css" href="graytable.css"> |
|---|
| 40 |
<link rel="alternate" type="application/rss+xml" title="RSS" href="./folcast.php" /> |
|---|
| 41 |
<title>foltia:MP4 Lib</title> |
|---|
| 42 |
</head> |
|---|
| 43 |
|
|---|
| 44 |
<?php |
|---|
| 45 |
$now = date("YmdHi"); |
|---|
| 46 |
|
|---|
| 47 |
?> |
|---|
| 48 |
<body BGCOLOR="#ffffff" TEXT="#494949" LINK="#0047ff" VLINK="#000000" ALINK="#c6edff" > |
|---|
| 49 |
<div align="center"> |
|---|
| 50 |
<?php |
|---|
| 51 |
printhtmlpageheader(); |
|---|
| 52 |
?> |
|---|
| 53 |
<p align="left"><font color="#494949" size="6">録画ライブラリ表示</font></p> |
|---|
| 54 |
<hr size="4"> |
|---|
| 55 |
<p align="left">再生可能ライブラリを表示します。<br> |
|---|
| 56 |
|
|---|
| 57 |
<? |
|---|
| 58 |
|
|---|
| 59 |
$query = " |
|---|
| 60 |
SELECT foltia_mp4files.tid,foltia_program.title , count(foltia_mp4files.mp4filename) |
|---|
| 61 |
FROM foltia_mp4files , foltia_program |
|---|
| 62 |
WHERE foltia_program.tid = foltia_mp4files.tid |
|---|
| 63 |
GROUP BY foltia_mp4files.tid ,foltia_program.title |
|---|
| 64 |
ORDER BY foltia_mp4files.tid DESC |
|---|
| 65 |
"; |
|---|
| 66 |
|
|---|
| 67 |
$rs = m_query($con, $query, "DBクエリに失敗しました"); |
|---|
| 68 |
|
|---|
| 69 |
$maxrows = pg_num_rows($rs); |
|---|
| 70 |
|
|---|
| 71 |
if ($maxrows > 0 ){ |
|---|
| 72 |
print " |
|---|
| 73 |
<table BORDER=\"0\" CELLPADDING=\"0\" CELLSPACING=\"2\" WIDTH=\"100%\"> |
|---|
| 74 |
<thead> |
|---|
| 75 |
<tr> |
|---|
| 76 |
<th align=\"left\">TID</th> |
|---|
| 77 |
<th align=\"left\">タイトル(内容リンク)</th> |
|---|
| 78 |
<th align=\"left\">内容数</th> |
|---|
| 79 |
<th align=\"left\">リンク</th> |
|---|
| 80 |
</tr> |
|---|
| 81 |
</thead> |
|---|
| 82 |
<tbody> |
|---|
| 83 |
"; |
|---|
| 84 |
for ($row = 0; $row < $maxrows; $row++) { |
|---|
| 85 |
$rowdata = pg_fetch_row($rs, $row); |
|---|
| 86 |
$title = $rowdata[1]; |
|---|
| 87 |
$counts = $rowdata[2]; |
|---|
| 88 |
$tid = htmlspecialchars($rowdata[0]); |
|---|
| 89 |
$title = htmlspecialchars($title); |
|---|
| 90 |
$counts = htmlspecialchars($counts); |
|---|
| 91 |
|
|---|
| 92 |
print " |
|---|
| 93 |
<tr> |
|---|
| 94 |
<td>$tid<br></td> |
|---|
| 95 |
<td><a href=\"showlibc.php?tid=$tid\">$title</a></td> |
|---|
| 96 |
<td>$counts<br></td> |
|---|
| 97 |
<td><a href=\"http://cal.syoboi.jp/tid/$tid\" target=\"_blank\">しょぼかる-$tid</a><br></td> |
|---|
| 98 |
</tr>\n |
|---|
| 99 |
"; |
|---|
| 100 |
} |
|---|
| 101 |
print " |
|---|
| 102 |
</tbody> |
|---|
| 103 |
</table> |
|---|
| 104 |
</body> |
|---|
| 105 |
</html> |
|---|
| 106 |
"; |
|---|
| 107 |
}else{ |
|---|
| 108 |
print "録画ファイルが存在しません。</body></html>"; |
|---|
| 109 |
|
|---|
| 110 |
} |
|---|
| 111 |
/* |
|---|
| 112 |
//旧仕様 |
|---|
| 113 |
//ディレクトリからファイル一覧を取得 |
|---|
| 114 |
exec ("ls $recfolderpath | grep localized | sort -r", $libdir); |
|---|
| 115 |
//print "libdir:$libdir<BR>\n"; |
|---|
| 116 |
|
|---|
| 117 |
foreach($libdir as $fName) { |
|---|
| 118 |
|
|---|
| 119 |
if(($fName == ".") or ($fName == "..") ){ continue; } |
|---|
| 120 |
if (ereg(".localized", $fName)){ |
|---|
| 121 |
$filesplit = split("\.",$fName); |
|---|
| 122 |
$query = " |
|---|
| 123 |
SELECT |
|---|
| 124 |
foltia_program.tid,foltia_program.title |
|---|
| 125 |
FROM foltia_program |
|---|
| 126 |
WHERE foltia_program.tid = $filesplit[0] |
|---|
| 127 |
"; |
|---|
| 128 |
$rs = m_query($con, $query, "DBクエリに失敗しました"); |
|---|
| 129 |
$rowdata = pg_fetch_row($rs, $row); |
|---|
| 130 |
//print" $fName./$rowdata[1]/$rowdata[2]/$rowdata[3]<BR>\n"; |
|---|
| 131 |
$title = $rowdata[1]; |
|---|
| 132 |
|
|---|
| 133 |
$tid = htmlspecialchars($rowdata[0]); |
|---|
| 134 |
$title = htmlspecialchars($title); |
|---|
| 135 |
//-- |
|---|
| 136 |
print " |
|---|
| 137 |
<tr> |
|---|
| 138 |
<td>$tid<br></td> |
|---|
| 139 |
<td><a href=\"showlibc.php?tid=$tid\">$title</a></td> |
|---|
| 140 |
<td>"; |
|---|
| 141 |
//計数 |
|---|
| 142 |
$counts = system ("ls $recfolderpath/$fName/mp4/*.MP4 | wc -l"); |
|---|
| 143 |
print "<br></td> |
|---|
| 144 |
<td><a href=\"http://cal.syoboi.jp/tid/$tid\" target=\"_blank\">しょぼかる-$tid</a><br></td> |
|---|
| 145 |
</tr>\n |
|---|
| 146 |
"; |
|---|
| 147 |
}//end if ereg m2p |
|---|
| 148 |
}//end foreach |
|---|
| 149 |
//旧仕様ココまで |
|---|
| 150 |
*/ |
|---|
| 151 |
//$d->close(); |
|---|
| 152 |
?> |
|---|
| 153 |
|
|---|