Index: trunk/install/php/folcast.php =================================================================== --- trunk/install/php/folcast.php (リビジョン 133) +++ trunk/install/php/folcast.php (リビジョン 1) @@ -20,20 +20,9 @@ header('Content-Type: application/rss+xml'); -header('Content-Disposition: attachment; filename="folcast.xml"'); -include("./foltialib.php"); + + 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 -*/ + $now = date("YmdHi"); $nowrfc822 = date("r"); @@ -51,29 +40,24 @@ $query = " SELECT foltia_program.tid,foltia_program.title, -foltia_subtitle.countno , foltia_subtitle.subtitle , foltia_subtitle.startdatetime, foltia_subtitle.pspfilename,foltia_subtitle.lengthmin,foltia_subtitle.enddatetime FROM foltia_subtitle , foltia_program WHERE \"pspfilename\" LIKE 'M%%' AND foltia_program.tid = foltia_subtitle.tid AND foltia_program.tid = $tid -ORDER BY enddatetime DESC - limit ? offset 0 -"; +foltia_subtitle.countno , foltia_subtitle.subtitle , foltia_subtitle.startdatetime, foltia_subtitle.pspfilename,foltia_subtitle.lengthmin,foltia_subtitle.enddatetime FROM foltia_subtitle , foltia_program WHERE \"pspfilename\" ~~ 'M4V%%' AND foltia_program.tid = foltia_subtitle.tid AND foltia_program.tid = $tid +ORDER BY \"enddatetime\" DESC +offset 0 limit $max + "; $titlequery = " SELECT foltia_program.tid,foltia_program.title FROM foltia_program -WHERE foltia_program.tid = ? +WHERE foltia_program.tid = $tid "; -// $titlers = m_query($con, $query, "DBクエリに失敗しました"); - $titlers = sql_query($con, $query, "DBクエリに失敗しました",array($tid)); -// $titlers = sql_query($con, $titlequery, "DBクエリに失敗しました",array($tid)); - $rowdata = $titlers->fetch(); - $rsstitle = htmlspecialchars($rowdata[1]); + $titlers = m_query($con, $query, "DBクエリに失敗しました"); + $rowdata = pg_fetch_row($titlers, 0); + $rsstitle = $rowdata[1]; }else{ $query = " SELECT foltia_program.tid,foltia_program.title, -foltia_subtitle.countno , foltia_subtitle.subtitle , foltia_subtitle.startdatetime, foltia_subtitle.pspfilename,foltia_subtitle.lengthmin,foltia_subtitle.enddatetime FROM foltia_subtitle , foltia_program WHERE \"pspfilename\" LIKE 'M%%' AND foltia_program.tid = foltia_subtitle.tid ORDER BY enddatetime DESC -limit ? offset 0 +foltia_subtitle.countno , foltia_subtitle.subtitle , foltia_subtitle.startdatetime, foltia_subtitle.pspfilename,foltia_subtitle.lengthmin,foltia_subtitle.enddatetime FROM foltia_subtitle , foltia_program WHERE \"pspfilename\" ~~ 'M4V%%' AND foltia_program.tid = foltia_subtitle.tid ORDER BY \"enddatetime\" DESC +offset 0 limit $max "; - - - $rsstitle = "新規録画"; }//if @@ -82,14 +66,14 @@ - $rsstitle:Folcast + Folcast ($rsstitle) DCC-JPL Japan/foltia project http://www.dcc-jpl.com/soft/foltia/ フォルティアが未読処理をお助けしちゃいます - foltia video podcast :$rsstitle:Folcast + foltia video podcast :Folcast ($rsstitle) フォルティアが未読処理をお助けしちゃいます ja foltia - $rsstitle:Folcast + Folcast ($rsstitle) foltia@dcc-jpl.com @@ -101,12 +85,14 @@ print $header; -// $rs = m_query($con, $query, "DBクエリに失敗しました"); - $rs = sql_query($con, $query, "DBクエリに失敗しました",array($max)); -$rowdata = $rs->fetch(); + $rs = m_query($con, $query, "DBクエリに失敗しました"); + $maxrows = pg_num_rows($rs); -if (! $rowdata) { +if ($maxrows == 0) { //die_exit("No items"); }else{ - do { + +for ($row = 0; $row < $maxrows; $row++) { + $rowdata = pg_fetch_row($rs, $row); + //$title = mb_convert_encoding($rowdata[1],"UTF-8", "EUC-JP"); $tid = $rowdata[0]; @@ -133,11 +119,6 @@ $mp4thmname = ereg_replace(".MP4", ".THM", $mp4thmname); $mp4thmnameuri = "http://". getserverfqdn() . $httpmediamappath ."/$tid.localized/mp4/$mp4thmname"; - -if (file_exists("$recfolderpath/$tid.localized/mp4/$mp4filename")) { - $mp4filestat = stat("$recfolderpath/$tid.localized/mp4/$mp4filename"); - $mp4filesize = $mp4filestat[7]; -} else { - $mp4filesize = 0; -} +$mp4filestat = stat("$recfolderpath/$tid.localized/mp4/$mp4filename"); +$mp4filesize = $mp4filestat[7]; if ($rowdata[0] == 0 ){//EPG録画 @@ -166,5 +147,5 @@ print $item ; - } while ($rowdata = $rs->fetch()); //do +}//for }//if