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