Index: trunk/install/php/showplaylist.php =================================================================== --- trunk/install/php/showplaylist.php (リビジョン 126) +++ trunk/install/php/showplaylist.php (リビジョン 1) @@ -14,25 +14,9 @@  省略時、録画順にソートされる。  titleのときに、番組順ソートされる。 - rawのときに、DBに記録されている番組録画情報ではなくディレクトリにあるm2p/m2tファイルを全て表示する。 + rawのときに、DBに記録されている番組録画情報ではなくディレクトリにあるm2pファイルを全て表示する。 DCC-JPL Japan/foltia project */ - -include("./foltialib.php"); -$con = m_connect(); - -if ($useenvironmentpolicy == 1){ - if (!isset($_SERVER['PHP_AUTH_USER'])) { - header("WWW-Authenticate: Basic realm=\"foltia\""); - header("HTTP/1.0 401 Unauthorized"); - redirectlogin(); - exit; - } else { - login($con,$_SERVER['PHP_AUTH_USER'],$_SERVER['PHP_AUTH_PW']); - } -}//end if login - - ?> @@ -43,53 +27,25 @@ foltia:recorded file list "; - -/////////////////////////////////////////////////?????? -//1ページの表示レコード数 -$lim = 300; -//クエリ取得 -$p = getgetnumform(p); -//ページ取得の計算 -list($st,$p,$p2) = number_page($p,$lim); -//////////////////////////////////////////////////???? - + include("./foltialib.php"); +$con = m_connect(); $now = date("YmdHi"); + ?>
- -

録画一覧表示


再生可能番組リストを表示します。
- "; -////////////////////////////////////////// - - ?>

@@ -97,6 +53,6 @@ - - + + @@ -104,5 +60,4 @@ - - + - -\n"; -if(($fName == ".") or ($fName == "..") ){ continue; } -if ((ereg(".m2.+", $fName))|| (ereg(".aac", $fName))){ - $filesplit = split("-",$fName); - -if (preg_match("/^\d+$/", $filesplit[0])) {// print "File is looks like good:preg
\n"; + if(($fName == ".") or ($fName == "..") ){ continue; } + if (ereg(".m2p", $fName)){ + $filesplit = split("-",$fName); + if ($filesplit[1] == ""){ $query = " @@ -143,15 +94,12 @@ FROM foltia_subtitle , foltia_program WHERE foltia_program.tid = foltia_subtitle.tid - AND foltia_subtitle.tid = ? -"; -//$rs = m_query($con, $query, "DBクエリに失敗しました"); -$rs = sql_query($con, $query, "DBクエリに失敗しました",array($filesplit[0])); - $rall = $rs->fetchAll(); - $rowdata = $rall[0]; + AND foltia_subtitle.tid = $filesplit[0] +"; +$rs = m_query($con, $query, "DBクエリに失敗しました"); +$rowdata = pg_fetch_row($rs, $row); //print" $fName./$rowdata[1]//$rowdata[2]
\n"; $title = $rowdata[1]; $subtitle = ""; $count = ""; - }else{ @@ -161,11 +109,9 @@ FROM foltia_subtitle , foltia_program WHERE foltia_program.tid = foltia_subtitle.tid - AND foltia_subtitle.tid = ? - AND foltia_subtitle.countno = ? -"; -//$rs = m_query($con, $query, "DBクエリに失敗しました"); -$rs = sql_query($con, $query, "DBクエリに失敗しました",array($filesplit[0],$filesplit[1])); - $rall = $rs->fetchAll(); - $rowdata = $rall[0]; + AND foltia_subtitle.tid = $filesplit[0] + AND foltia_subtitle.countno = $filesplit[1] +"; +$rs = m_query($con, $query, "DBクエリに失敗しました"); +$rowdata = pg_fetch_row($rs, $row); //print" $fName./$rowdata[1]/$rowdata[2]/$rowdata[3]
\n"; $title = $rowdata[1]; @@ -194,13 +140,8 @@ print "\n "; -}else{ - //print "File is looks like BAD:preg
\n"; -}// - }//ereg }//foreach print " \n
削除 ファイル名話数 サブタイ
\n
\n\n\n"; exit; - }elseif ($list== "title"){//新仕様 $query = " @@ -216,5 +157,5 @@ AND foltia_subtitle.m2pfilename = foltia_m2pfiles.m2pfilename ORDER BY foltia_subtitle.tid DESC , foltia_subtitle.startdatetime ASC -LIMIT $lim OFFSET $st + "; @@ -232,32 +173,14 @@ AND foltia_subtitle.m2pfilename = foltia_m2pfiles.m2pfilename ORDER BY foltia_subtitle.startdatetime DESC -LIMIT $lim OFFSET $st "; } -//$rs = m_query($con, $query, "DBクエリに失敗しました"); -$rs = sql_query($con, $query, "DBクエリに失敗しました"); -$rowdata = $rs->fetch(); - -///////////////////////////////////////// -//テーブルの総数取得 - $query2 = " -SELECT COUNT(*) AS cnt FROM foltia_subtitle , foltia_program , foltia_m2pfiles -WHERE foltia_program.tid = foltia_subtitle.tid - AND foltia_subtitle.m2pfilename = foltia_m2pfiles.m2pfilename - "; -$rs2 = sql_query($con, $query2, "DB\?\ィ\e?E?oCO???T????"); -$rowdata2 = $rs2->fetch(); - if (! $rowdata2) { - die_exit("番組データがありません
"); - } -//1O?o?eAA -$dtcnt = $rowdata2[0]; - -///////////////////////////////////////// - -if ($rowdata) { - - do { +$rs = m_query($con, $query, "DBクエリに失敗しました"); +$maxrows = pg_num_rows($rs); + +if ($maxrows > 0){ +for ($row = 0; $row < $maxrows; $row++) { +$rowdata = pg_fetch_row($rs, $row); + $tid = htmlspecialchars($rowdata[0]); $title = htmlspecialchars($rowdata[1]); @@ -267,39 +190,24 @@ $pid = htmlspecialchars($rowdata[5]); //-- - - print " -
"; -if (ereg("syabas",$useragent)){ -print "$fName"; -} -else{ -print "$fName
"; -} -if ($tid > 0){ -print"$title +
+$fName
+$title $count
$subtitle
"; -}else{ -print"$title -$count
-$subtitle
"; -} - if (file_exists("./selectcaptureimage.php") ) { - $capimgpath = preg_replace("/.m2.+/", "", $fName); + $capimgpath = preg_replace("/.m2p/", "", $fName); +// list($citid,$cicountno,$cidate,$citime) = split("-", $capimgpath); +// if($cicountno == ""){ +// $cicountno = "x"; +// } +// $capimgpath = "$citid"."-"."$cicountno"."-"."$cidate"."-"."$citime"; print " キャプ\n"; } - print "\n "; - -//} - - - } while ($rowdata = $rs->fetch()); -}else{ - +}//for +}else{ print " @@ -315,17 +223,6 @@ \n"; -////////////////////////////////////////////////////////////////////// -//クエリ代入 -$query_st = $list; -//Autopageing処理とページのリンクを表示 -list($p2,$page) = page_display($query_st,$p,$p2,$lim,$dtcnt,""); -////////////////////////////////////////////////////////////////////// -print "
"; //Auto pager終わり - - //番組ソートの時、未読番組のタイトルだけ表示 -//if ($list== "title" && $p2 > $page){ if ($list== "title"){ - $query = " SELECT distinct @@ -338,8 +235,9 @@ "; -//$rs = m_query($con, $query, "DBクエリに失敗しました"); -$rs = sql_query($con, $query, "DBクエリに失敗しました"); - $rowdata = $rs->fetch(); - if ($rowdata) { +$rs = m_query($con, $query, "DBクエリに失敗しました"); +$maxrows = pg_num_rows($rs); + + +if ($maxrows > 0){ print "

未読タイトルを表示します。
@@ -354,16 +252,20 @@ "; - do { +for ($row = 0; $row < $maxrows; $row++) { +$rowdata = pg_fetch_row($rs, $row); + $tid = htmlspecialchars($rowdata[0]); $title = htmlspecialchars($rowdata[1]); + + print "$tid$title\n"; - } while ($rowdata = $rs->fetch()); +}//for print "\n"; }//if maxrows }//if title - -?> +?> +