Index: trunk/install/php/reservecomp.php
===================================================================
--- trunk/install/php/reservecomp.php (リビジョン 128)
+++ trunk/install/php/reservecomp.php (リビジョン 1)
@@ -17,19 +17,4 @@
*/
-
-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
-
?>
@@ -44,4 +29,5 @@
fetch();
-if (! $rowdata) {
+ $query = "select title from foltia_program where tid='$tid'";
+ $rs = m_query($con, $query, "DBクエリに失敗しました");
+ $maxrows = pg_num_rows($rs);
+
+ if ($maxrows == 0) {
$title = "(未登録)";
}else{
+ $rowdata = pg_fetch_row($rs, 0);
$title = htmlspecialchars($rowdata[0]);
}
@@ -86,5 +71,5 @@
-「」を番組予約モードで予約しました。
+「=$title?>」を番組予約モードで予約しました。
予約スケジュール
@@ -129,10 +114,11 @@
}
$rs = m_query($con, $query, "DBクエリに失敗しました");
-$rowdata = $rs->fetch();
-if (! $rowdata) {
+ $maxrows = pg_num_rows($rs);
+
+ if ($maxrows == 0) {
echo("放映予定はいまのところありません
");
}
else{
- $maxcols = $rs->columnCount();
+ $maxcols = pg_num_fields($rs);
?>
@@ -153,11 +139,14 @@
\n");
+ /* pg_fetch_row で一行取り出す */
+ $rowdata = pg_fetch_row($rs, $row);
+
for ($col = 0; $col < $maxcols; $col++) { /* 列に対応 */
echo("".htmlspecialchars($rowdata[$col])."
| \n");
}
echo("\n");
- } while ($rowdata = $rs->fetch());
+ }
}//end if
?>
@@ -172,31 +161,39 @@
//既存が予約あって、新着が全局予約だったら
if ($station ==0){
+ $query = "
+SELECT
+ *
+FROM foltia_tvrecord
+WHERE tid = '$tid'
+";
+ $rs = m_query($con, $query, "DBクエリに失敗しました");
+ $maxrows = pg_num_rows($rs);
+ if ($maxrows > 0){
//既存局を消す
$query = "DELETE
FROM foltia_tvrecord
-WHERE tid = ?
-";
-// $rs = m_query($con, $query, "DBクエリに失敗しました");
- $rs = sql_query($con, $query, "DBクエリに失敗しました",array($tid));
+WHERE tid = '$tid'
+";
+ $rs = m_query($con, $query, "DBクエリに失敗しました");
+ }
}//endif
$query = "
SELECT
-count(*)
+ *
FROM foltia_tvrecord
-WHERE tid = ? AND stationid = ?
-";
-// $rs = m_query($con, $query, "DBクエリに失敗しました");
- $rs = sql_query($con, $query, "DBクエリに失敗しました",array($tid,$station));
- $maxrows = $rs->fetchColumn(0);
+WHERE tid = '$tid' AND stationid = '$station'
+";
+ $rs = m_query($con, $query, "DBクエリに失敗しました");
+ $maxrows = pg_num_rows($rs);
+
if ($maxrows == 0) { //新規追加
- $query = "INSERT INTO foltia_tvrecord values (?,?,?,?)";
-// $rs = m_query($con, $query, "DB書き込みに失敗しました");
- $rs = sql_query($con, $query, "DB書き込みに失敗しました",array($tid,$station,$bitrate,$usedigital));
+ $query = "INSERT INTO foltia_tvrecord values ('$tid','$station','$bitrate')";
+ $rs = m_query($con, $query, "DB書き込みに失敗しました");
}else{//修正 (ビットレート)
$query = "UPDATE foltia_tvrecord SET
- bitrate = ? , digital = ? WHERE tid = ? AND stationid = ? ";
-// $rs = m_query($con, $query, "DB書き込みに失敗しました");
- $rs = sql_query($con, $query, "DB書き込みに失敗しました",array( $bitrate, $usedigital , $tid , $station ));
+ bitrate = '$bitrate' WHERE tid = '$tid' AND stationid = '$station'
+ ";
+ $rs = m_query($con, $query, "DB書き込みに失敗しました");
}
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
Index: trunk/install/php/foltia_config2.php.template
===================================================================
--- trunk/install/php/foltia_config2.php.template (リビジョン 135)
+++ trunk/install/php/foltia_config2.php.template (リビジョン 1)
@@ -17,16 +17,12 @@
$recfolderpath = '/home/foltia/php/tv'; //録画ファイルの保存先のパス。
$httpmediamappath = '/tv'; //ブラウザから見える録画ファイルのある位置。
- $recunits = 0; //搭載アナログキャプチャカードチャンネル数
-
- $protectmode = 0; //未使用:(ブラウザからの予約削除を禁止するなどの保護モードで動作します)
+ $protectmode = 1; //未使用:(ブラウザからの予約削除を禁止するなどの保護モードで動作します)
$demomode = 0; //未使用:(ユーザインターフェイスだけ動作するデモモードで動作します)
- $useenvironmentpolicy = 0 ;//環境ポリシーを使うかどうか
- $environmentpolicytoken = "";//環境ポリシーのパスワードに連結されるセキュリティコード
- $perltoolpath = $toolpath ;//perl版の初期設定の位置。デフォルトではphpと同じ位置
- $usedigital = 1;//Friioなどでデジタル録画をするか 1:する 0:しない
// データベース接続設定
-// define("DSN", "pgsql:host=localhost dbname=foltia user=foltia password= ");
-define("DSN", "sqlite:/home/foltia/foltia.sqlite");
+ define("DATABASE_NAME", "foltia");
+ define("DBHOST", "localhost");
+ define("USER_NAME" , "foltia" );
+ define("USER_PASSWORD", "passwd" );
// $mylocalip = "192.168.0.177" ; //動いている機械のIPアドレス
Index: trunk/install/php/delreserve.php
===================================================================
--- trunk/install/php/delreserve.php (リビジョン 128)
+++ trunk/install/php/delreserve.php (リビジョン 1)
@@ -17,19 +17,4 @@
*/
-
-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
-
?>
@@ -44,13 +29,16 @@
");
}
- $sid = getgetnumform("sid");
+$sid = getgetnumform(sid);
if ($sid == "") {
die_exit("局がありません
");
}
+$con = m_connect();
$now = date("YmdHi");
?>
@@ -69,13 +57,14 @@
foltia_tvrecord.stationid
FROM foltia_tvrecord , foltia_program , foltia_station
-WHERE foltia_tvrecord.tid = foltia_program.tid AND foltia_tvrecord.stationid = foltia_station .stationid AND foltia_tvrecord.tid = ? AND foltia_tvrecord.stationid = ? ";
+WHERE foltia_tvrecord.tid = foltia_program.tid AND foltia_tvrecord.stationid = foltia_station .stationid AND foltia_tvrecord.tid = $tid AND foltia_tvrecord.stationid = $sid ";
-// $rs = m_query($con, $query, "DBクエリに失敗しました");
- $rs = sql_query($con, $query, "DBクエリに失敗しました",array($tid,$sid));
-$rowdata = $rs->fetch();
-
-if (! $rowdata ) {
+ $rs = m_query($con, $query, "DBクエリに失敗しました");
+ $maxrows = pg_num_rows($rs);
+
+ if ($maxrows == 0) {
die_exit("登録番組がありません
");
}
+ $rowdata = pg_fetch_row($rs, 0);
+
$tid = htmlspecialchars($rowdata[0]);
$stationname = htmlspecialchars($rowdata[1]);
@@ -105,8 +94,6 @@
DELETE
FROM foltia_tvrecord
-WHERE foltia_tvrecord.tid = ? AND foltia_tvrecord.stationid = ? ";
-$rs->closeCursor();
-// $rs = m_query($con, $query, "DBクエリに失敗しました");
- $rs = sql_query($con, $query, "DBクエリに失敗しました",array($tid,$sid));
+WHERE foltia_tvrecord.tid = $tid AND foltia_tvrecord.stationid = $sid ";
+ $rs = m_query($con, $query, "DBクエリに失敗しました");
}
@@ -128,7 +115,7 @@
- |
- |
- |
+ =$title?> |
+ =$stationname?> |
+ =$bitrate?> |
@@ -164,14 +151,15 @@
FROM foltia_subtitle , foltia_program ,foltia_station
WHERE foltia_program.tid = foltia_subtitle.tid AND foltia_station.stationid = foltia_subtitle.stationid
- AND foltia_subtitle.startdatetime >= ? AND foltia_program.tid = ?
+ AND foltia_subtitle.startdatetime >= '$now' AND foltia_program.tid ='$tid'
ORDER BY foltia_subtitle.startdatetime ASC
";
-// $rs = m_query($con, $query, "DBクエリに失敗しました");
- $rs = sql_query($con, $query, "DBクエリに失敗しました",array($now,$tid));
-$rowdata = $rs->fetch();
-if (! $rowdata) {
+ $rs = m_query($con, $query, "DBクエリに失敗しました");
+ $maxrows = pg_num_rows($rs);
+
+ if ($maxrows == 0) {
echo("放映予定はありません
");
-}else{
- $maxcols = $rs->columnCount();
+ }
+ else{
+ $maxcols = pg_num_fields($rs);
?>
@@ -191,11 +179,14 @@
\n");
+ /* pg_fetch_row で一行取り出す */
+ $rowdata = pg_fetch_row($rs, $row);
+
for ($col = 0; $col < $maxcols; $col++) { /* 列に対応 */
echo("".htmlspecialchars($rowdata[$col])."
| \n");
}
echo("\n");
- } while ($row = $rs->fetch());
+ }
}//end if
?>
Index: trunk/install/php/deletemovie.php
===================================================================
--- trunk/install/php/deletemovie.php (リビジョン 124)
+++ trunk/install/php/deletemovie.php (リビジョン 1)
@@ -15,19 +15,4 @@
*/
-
-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
-
?>
@@ -41,4 +26,6 @@
録画番組削除
-削除番組はありません。\n";
-}else{
+次の番組を削除しました。
-$userclass = getuserclass($con);
-if ( $userclass <= 1){
-
-print "次の番組を削除しました。
-
+
- ファイル名 |
- タイトル |
- 話数 |
- サブタイ |
+ ファイル名 |
+ タイトル |
+ 話数 |
+ サブタイ |
- ";
+
+
+
+
+//--
foreach ($delete as $fName) {
-if( preg_match('/.MP4$/',$fName)){ //拡張子がMP4なら録画ライブラリ番組個別表示での削除 (showlibc.php)
+ $filesplit = split("-",$fName);
+
+if ($filesplit[1] == ""){
$query = "
-SELECT
-foltia_subtitle.pspfilename,
-foltia_program.title,
-foltia_subtitle.countno,
-foltia_subtitle.subtitle
-FROM foltia_subtitle,foltia_program
-WHERE foltia_subtitle.tid = foltia_program.tid AND foltia_subtitle.pspfilename = ?
-LIMIT 1";
-
-$rs = sql_query($con, $query, "DBクエリに失敗しました",array($fName));
-$rall = $rs->fetch();
-$rowdata = $rall[0];
-
-$title = htmlspecialchars($rall[1]);
-$count = htmlspecialchars($rall[2]);
-$subtitle = htmlspecialchars($rall[3]);
-
-print "
-
-$fName
|
-";
-
-if ($tid > 0 ){
- print "$title";
-}else{
- print "$title";
-}
-
-print " |
-$count
|
-$subtitle
|
-
\n
+SELECT
+foltia_program.tid,foltia_program.title,foltia_subtitle.subtitle
+FROM foltia_subtitle , foltia_program
+WHERE foltia_program.tid = foltia_subtitle.tid
+ AND foltia_subtitle.tid = $filesplit[0]
";
-
-//DBから削除
-if ($demomode){
+$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{
$query = "
-DELETE FROM foltia_mp4files
-WHERE mp4filename = ?
+SELECT
+foltia_program.tid,foltia_program.title,foltia_subtitle.countno,foltia_subtitle.subtitle
+FROM foltia_subtitle , foltia_program
+WHERE foltia_program.tid = foltia_subtitle.tid
+ AND foltia_subtitle.tid = $filesplit[0]
+ AND foltia_subtitle.countno = $filesplit[1]
";
-//$rs = m_query($con, $query, "DBクエリに失敗しました");
-$rs = sql_query($con, $query, "DBクエリに失敗しました",array($fName));
-
-//削除処理
-$oserr = system("$toolpath/perl/deletemovie.pl $fName");
-}//end if demomode
-
-}else{ //拡張子がMP4以外なら 録画一覧(録画順・番組順)の削除(showplaylist.php)
-
-$query = "
-SELECT foltia_program.tid,foltia_program.title,foltia_subtitle.countno,foltia_subtitle.subtitle
-FROM foltia_subtitle , foltia_program
-WHERE foltia_program.tid = foltia_subtitle.tid
-AND foltia_subtitle.m2pfilename = ?
-";
-
-//$rs = m_query($con, $query, "DBクエリに失敗しました");
-//$rs = sql_query($con, $query, "DBクエリに失敗しました",array($filesplit[0] ,$filesplit[1]));
-$rs = sql_query($con, $query, "DBクエリに失敗しました",array($fName));
- $rall = $rs->fetchAll();
- $rowdata = $rall[0];
+$rs = m_query($con, $query, "DBクエリに失敗しました");
+$rowdata = pg_fetch_row($rs, $row);
+//print" $fName./$rowdata[1]/$rowdata[2]/$rowdata[3]
\n";
$title = $rowdata[1];
$count = $rowdata[2];
$subtitle = $rowdata[3];
+
+}//end if 話数がNULL
$tid = htmlspecialchars($rowdata[0]);
@@ -151,16 +101,11 @@
$subtitle = htmlspecialchars($subtitle);
+//--
+
+
print "
$fName
|
-";
-
-if ($tid > 0 ){
- print "$title";
-}else{
- print "$title";
-}
-
-print " |
+$title |
$count
|
$subtitle
|
@@ -174,8 +119,7 @@
$query = "
DELETE FROM foltia_m2pfiles
-WHERE m2pfilename = ?
+WHERE m2pfilename = '$fName'
";
-//$rs = m_query($con, $query, "DBクエリに失敗しました");
-$rs = sql_query($con, $query, "DBクエリに失敗しました",array($fName));
+$rs = m_query($con, $query, "DBクエリに失敗しました");
//削除処理
@@ -183,15 +127,9 @@
}//end if demomode
-}//end if .MP4拡張子分岐
-
}//foreach
-print "
\n";
-
-}else{//権限なし
- print "ファイル削除権限がありません。
";
-}
-}//if $delete == ""
?>
+
+
-
-
録画一覧表示
再生可能番組リストを表示します。
-
";
-//////////////////////////////////////////
-
-
?>
\n