# HG changeset patch # User Sushi-k # Date 1248749404 -32400 # Node ID 8965ef108821413658451d4455b72dc04ee8d57e # Parent 2bc96d657ba1c290268f2abbc5d260f9e03c5242 change: modify all scripts for web base setting. diff -r 2bc96d657ba1 -r 8965ef108821 DBRecord.class.php --- a/DBRecord.class.php Tue Jul 28 10:49:55 2009 +0900 +++ b/DBRecord.class.php Tue Jul 28 11:50:04 2009 +0900 @@ -4,19 +4,20 @@ class DBRecord { protected $table; + protected $settings; protected $dbh; public $id; function __construct( $table, $property = null, $value = null ) { - $settings = Settings::factory(); + $this->settings = Settings::factory(); - $this->table = $settings->tbl_prefix.$table; + $this->table = $this->settings->tbl_prefix.$table; - $this->dbh = @mysql_connect( $settings->db_host , $settings->db_user, $settings->db_pass ); + $this->dbh = @mysql_connect( $this->settings->db_host , $this->settings->db_user, $this->settings->db_pass ); if( $this->dbh === FALSE ) throw new exception( "construct:データベースに接続できない" ); - $sqlstr = "use ".$settings->db_name; + $sqlstr = "use ".$this->settings->db_name; $res = $this->__query($sqlstr); if( $res === false ) throw new exception("construct: " . $sqlstr ); $sqlstr = "set NAMES utf8"; @@ -42,9 +43,7 @@ } function createTable( $tblstring ) { - $settings = Settings::factory(); - - $sqlstr = "use ".$settings->db_name; + $sqlstr = "use ".$this->settings->db_name; $res = $this->__query($sqlstr); if( $res === false ) throw new exception("createTable: " . $sqlstr ); $sqlstr = "CREATE TABLE IF NOT EXISTS ".$this->table." (" .$tblstring.") DEFAULT CHARACTER SET 'utf8'"; diff -r 2bc96d657ba1 -r 8965ef108821 Keyword.class.php --- a/Keyword.class.php Tue Jul 28 10:49:55 2009 +0900 +++ b/Keyword.class.php Tue Jul 28 11:50:04 2009 +0900 @@ -7,11 +7,7 @@ class Keyword extends DBRecord { - protected $settings; - public function __construct($property = null, $value = null ) { - $this->settings = Settings::factory(); - try { parent::__construct(KEYWORD_TBL, $property, $value ); } diff -r 2bc96d657ba1 -r 8965ef108821 Reservation.class.php --- a/Reservation.class.php Tue Jul 28 10:49:55 2009 +0900 +++ b/Reservation.class.php Tue Jul 28 11:50:04 2009 +0900 @@ -2,15 +2,18 @@ include_once('config.php'); include_once( INSTALL_PATH . "/DBRecord.class.php" ); include_once( INSTALL_PATH . "/reclib.php" ); +include_once( INSTALL_PATH . "/Settings.class.php" ); + // 予約クラス class Reservation { public static function simple( $program_id , $autorec = 0, $mode = 0) { + $settings = Settings::factory(); $rval = 0; try { - $prec = new DBRecord( TBL_PREFIX.PROGRAM_TBL, "id", $program_id ); + $prec = new DBRecord( PROGRAM_TBL, "id", $program_id ); $rval = self::custom( $prec->starttime, @@ -42,21 +45,22 @@ $mode = 0 // 録画モード ) { global $RECORD_MODE; - + $settings = Settings::factory(); + // 時間を計算 $start_time = toTimestamp( $starttime ); - $end_time = toTimestamp( $endtime ) + EXTRA_TIME; + $end_time = toTimestamp( $endtime ) + $settings->extra_time; if( $start_time < (time() + PADDING_TIME + 10) ) { // 現在時刻より3分先より小さい=すでに開始されている番組 $start_time = time() + PADDING_TIME + 10; // 録画開始時間を3分10秒先に設定する } $at_start = $start_time - PADDING_TIME; - $sleep_time = PADDING_TIME - FORMER_TIME; - $rec_start = $start_time - FORMER_TIME; + $sleep_time = PADDING_TIME - $settings->former_time; + $rec_start = $start_time - $settings->former_time; // durationを計算しておく $duration = $end_time - $rec_start; - if( $duration < (FORMER_TIME + 60) ) { // 60秒以下の番組は弾く + if( $duration < ($settings->former_time + 60) ) { // 60秒以下の番組は弾く throw new Exception( "終わりつつある/終わっている番組です" ); } @@ -64,20 +68,20 @@ try { // 同一番組予約チェック if( $program_id ) { - $num = DBRecord::countRecords( TBL_PREFIX.RESERVE_TBL, "WHERE program_id = '".$program_id."'" ); + $num = DBRecord::countRecords( RESERVE_TBL, "WHERE program_id = '".$program_id."'" ); if( $num ) { throw new Exception("同一の番組が録画予約されています"); } } - $crec = new DBRecord( TBL_PREFIX.CHANNEL_TBL, "id", $channel_id ); + $crec = new DBRecord( CHANNEL_TBL, "id", $channel_id ); // 既存予約数 = TUNER番号 - $tuners = ($crec->type == "GR") ? GR_TUNERS : BS_TUNERS; - $battings = DBRecord::countRecords( TBL_PREFIX.RESERVE_TBL, "WHERE complete = '0' ". - "AND type = '".$crec->type."' ". - "AND starttime < '".toDatetime($end_time) ."' ". - "AND endtime > '".toDatetime($rec_start)."'" + $tuners = ($crec->type == "GR") ? $settings->gr_tuners : $settings->bs_tuners; + $battings = DBRecord::countRecords( RESERVE_TBL, "WHERE complete = '0' ". + "AND type = '".$crec->type."' ". + "AND starttime < '".toDatetime($end_time) ."' ". + "AND endtime > '".toDatetime($rec_start)."'" ); if( $battings >= $tuners ) { @@ -85,13 +89,13 @@ if( FORCE_CONT_REC ) { // 解消可能な重複かどうかを調べる // 前後の予約数 - $nexts = DBRecord::countRecords( TBL_PREFIX.RESERVE_TBL, "WHERE complete = '0' ". - "AND type = '".$crec->type."' ". - "AND starttime = '".toDatetime($end_time - FORMER_TIME)."'"); + $nexts = DBRecord::countRecords( RESERVE_TBL, "WHERE complete = '0' ". + "AND type = '".$crec->type."' ". + "AND starttime = '".toDatetime($end_time - $settings->former_time)."'"); - $prevs = DBRecord::countRecords( TBL_PREFIX.RESERVE_TBL, "WHERE complete = '0' ". - "AND type = '".$crec->type."' ". - "AND endtime = '".$starttime."'" ); + $prevs = DBRecord::countRecords( RESERVE_TBL, "WHERE complete = '0' ". + "AND type = '".$crec->type."' ". + "AND endtime = '".$starttime."'" ); // 前後を引いてもチューナー数と同数以上なら重複の解消は無理 if( ($battings - $nexts - $prevs) >= $tuners ) @@ -100,15 +104,15 @@ // 直後の番組はあるか? if( $nexts ) { // この番組の終わりをちょっとだけ早める - $end_time = $end_time - FORMER_TIME - REC_SWITCH_TIME; + $end_time = $end_time - $settings->former_time - $settings->rec_switch_time; $duration = $end_time - $rec_start; // durationを計算しなおす } $battings -= $nexts; // 直前の録画予約を見付ける - $trecs = DBRecord::createRecords(TBL_PREFIX.RESERVE_TBL, "WHERE complete = '0' ". - "AND type = '".$crec->type."' ". - "AND endtime = '".$starttime."'" ); + $trecs = DBRecord::createRecords(RESERVE_TBL, "WHERE complete = '0' ". + "AND type = '".$crec->type."' ". + "AND endtime = '".$starttime."'" ); // 直前の番組をずらす for( $i = 0; $i < count($trecs) ; $i++ ) { if( $battings < $tuners ) break; // 解消終了のハズ? @@ -126,11 +130,11 @@ $prev_start_time = toTimestamp($prev_starttime); // 始まっていない予約? - if( $prev_start_time > (time() + PADDING_TIME + FORMER_TIME) ) { + if( $prev_start_time > (time() + PADDING_TIME + $settings->former_time) ) { // 開始時刻を元に戻す - $prev_starttime = toDatetime( $prev_start_time + FORMER_TIME ); + $prev_starttime = toDatetime( $prev_start_time + $settings->former_time ); // 終わりをちょっとだけずらす - $prev_endtime = toDatetime( toTimestamp($prev_endtime) - FORMER_TIME - REC_SWITCH_TIME ); + $prev_endtime = toDatetime( toTimestamp($prev_endtime) - $settings->former_time - $settings->rec_switch_time ); // tryのネスト try { @@ -168,7 +172,7 @@ $tuner = $battings; // 改めてdurationをチェックしなおす - if( $duration < (FORMER_TIME + 60) ) { // 60秒以下の番組は弾く + if( $duration < ($settings->former_time + 60) ) { // 60秒以下の番組は弾く throw new Exception( "終わりつつある/終わっている番組です" ); } @@ -192,10 +196,8 @@ */ $day_of_week = array( "日","月","火","水","木","金","土" ); - $filename = "%TYPE%%CH%_%ST%_%ET%"; - if( defined( "FILENAME_FORMAT" ) ) { - $filename = FILENAME_FORMAT; - } + $filename = $settings->filename_format; + // あると面倒くさそうな文字を全部_に $fn_title = mb_ereg_replace("[ \./\*:<>\?\\|()\'\"&]","_", trim($title) ); @@ -237,7 +239,7 @@ // ファイル名生成終了 // 予約レコードを埋める - $rrec = new DBRecord( TBL_PREFIX.RESERVE_TBL ); + $rrec = new DBRecord( RESERVE_TBL ); $rrec->channel_disc = $crec->channel_disc; $rrec->channel_id = $crec->id; $rrec->program_id = $program_id; @@ -254,28 +256,28 @@ $rrec->reserve_disc = md5( $crec->channel_disc . toDatetime( $start_time ). toDatetime( $end_time ) ); // 予約実行 - $cmdline = AT." ".date("H:i m/d/Y", $at_start); + $cmdline = $settings->at." ".date("H:i m/d/Y", $at_start); $descriptor = array( 0 => array( "pipe", "r" ), 1 => array( "pipe", "w" ), 2 => array( "pipe", "w" ), ); $env = array( "CHANNEL" => $crec->channel, "DURATION" => $duration, - "OUTPUT" => INSTALL_PATH.SPOOL."/".$filename, + "OUTPUT" => INSTALL_PATH.$settings->spool."/".$filename, "TYPE" => $crec->type, "TUNER" => $tuner, "MODE" => $mode, ); // ATで予約する - $process = proc_open( $cmdline , $descriptor, $pipes, SPOOL, $env ); + $process = proc_open( $cmdline , $descriptor, $pipes, INSTALL_PATH.$settings->spool, $env ); if( is_resource( $process ) ) { - fwrite($pipes[0], SLEEP." ".$sleep_time."\n" ); + fwrite($pipes[0], $settings->sleep." ".$sleep_time."\n" ); fwrite($pipes[0], DO_RECORD . "\n" ); fwrite($pipes[0], COMPLETE_CMD." ".$rrec->id."\n" ); - if( USE_THUMBS ) { + if( $settings->use_thumbs ) { // サムネール生成 - $ffmpeg_cmd = FFMPEG." -i \${OUTPUT} -r 1 -s 160x90 -ss ".(FORMER_TIME+2)." -vframes 1 -f image2 ".INSTALL_PATH.THUMBS."/".$filename.".jpg\n"; + $ffmpeg_cmd = $settings->ffmpeg." -i \${OUTPUT} -r 1 -s 160x90 -ss ".($settings->former_time + 2)." -vframes 1 -f image2 ".INSTALL_PATH.$settings->thumbs."/".$filename.".jpg\n"; fwrite($pipes[0], $ffmpeg_cmd ); } fclose($pipes[0]); @@ -321,23 +323,24 @@ // 取り消し public static function cancel( $reserve_id = 0, $program_id = 0 ) { + $settings = Settings::factory(); $rec = null; try { if( $reserve_id ) { - $rec = new DBRecord( TBL_PREFIX.RESERVE_TBL, "id" , $reserve_id ); + $rec = new DBRecord( RESERVE_TBL, "id" , $reserve_id ); } else if( $program_id ) { - $rec = new DBRecord( TBL_PREFIX.RESERVE_TBL, "program_id" , $program_id ); + $rec = new DBRecord( RESERVE_TBL, "program_id" , $program_id ); } if( $rec == null ) { throw new Exception("IDの指定が無効です"); } if( ! $rec->complete ) { // 未実行の予約である - if( toTimestamp($rec->starttime) < (time() + PADDING_TIME + FORMER_TIME) ) + if( toTimestamp($rec->starttime) < (time() + PADDING_TIME + $settings->former_time) ) throw new Exception("過去の録画予約です"); - exec( ATRM . " " . $rec->job ); + exec( $settings->atrm . " " . $rec->job ); } $rec->delete(); } diff -r 2bc96d657ba1 -r 8965ef108821 customReservation.php --- a/customReservation.php Tue Jul 28 10:49:55 2009 +0900 +++ b/customReservation.php Tue Jul 28 11:50:04 2009 +0900 @@ -7,7 +7,6 @@ $settings = Settings::factory(); - $program_id = 0; if( isset( $_POST['program_id'] ) ) $program_id = $_POST['program_id']; diff -r 2bc96d657ba1 -r 8965ef108821 getepg.php --- a/getepg.php Tue Jul 28 10:49:55 2009 +0900 +++ b/getepg.php Tue Jul 28 11:50:04 2009 +0900 @@ -88,7 +88,7 @@ $num = DBRecord::countRecords( CHANNEL_TBL , "WHERE channel_disc = '" . $disc ."'" ); if( $num == 0 ) { // チャンネルデータがないなら新規作成 - $rec = new DBRecord( CHANNEL_TBL ); + $rec = new DBRecord( CHANNEL_TBL ); $rec->type = $type; $rec->channel = $map["$disc"]; $rec->channel_disc = $disc; diff -r 2bc96d657ba1 -r 8965ef108821 initdb.php --- a/initdb.php Tue Jul 28 10:49:55 2009 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +0,0 @@ -#!/usr/bin/php -createTable( RESERVE_STRUCT ); - - $rec = new DBRecord( TBL_PREFIX . PROGRAM_TBL ); - $rec->createTable( PROGRAM_STRUCT ); - - $rec = new DBRecord( TBL_PREFIX . CHANNEL_TBL ); - $rec->createTable( CHANNEL_STRUCT ); - - $rec = new DBRecord( TBL_PREFIX . CATEGORY_TBL ); - $rec->createTable( CATEGORY_STRUCT ); - - $rec = new DBRecord( TBL_PREFIX . KEYWORD_TBL ); - $rec->createTable( KEYWORD_STRUCT ); - } - catch( Exception $e ) { - exit( $e->getMessage() ); - } - exit( "Complete!\n"); -?> diff -r 2bc96d657ba1 -r 8965ef108821 keywordTable.php --- a/keywordTable.php Tue Jul 28 10:49:55 2009 +0900 +++ b/keywordTable.php Tue Jul 28 11:50:04 2009 +0900 @@ -5,6 +5,7 @@ include_once( INSTALL_PATH . "/reclib.php" ); include_once( INSTALL_PATH . "/Reservation.class.php" ); include_once( INSTALL_PATH . "/Keyword.class.php" ); +// include_once( INSTALL_PATH . "/Settings.class.php" ); // 新規キーワードがポストされた diff -r 2bc96d657ba1 -r 8965ef108821 programTable.php --- a/programTable.php Tue Jul 28 10:49:55 2009 +0900 +++ b/programTable.php Tue Jul 28 11:50:04 2009 +0900 @@ -97,14 +97,14 @@ $types[0]['name'] = "すべて"; $types[0]['value'] = "*"; $types[0]['selected'] = $type == "*" ? "selected" : ""; - if( GR_TUNERS ) { + if( $settings->gr_tuners ) { $arr = array(); $arr['name'] = "GR"; $arr['value'] = "GR"; $arr['selected'] = $type == "GR" ? "selected" : ""; array_push( $types, $arr ); } - if( BS_TUNERS ) { + if( $settings->bs_tuners ) { $arr = array(); $arr['name'] = "BS"; $arr['value'] = "BS"; diff -r 2bc96d657ba1 -r 8965ef108821 recomplete.php --- a/recomplete.php Tue Jul 28 10:49:55 2009 +0900 +++ b/recomplete.php Tue Jul 28 11:50:04 2009 +0900 @@ -6,7 +6,6 @@ $settings = Settings::factory(); - $reserve_id = $argv[1]; try{ @@ -42,4 +41,4 @@ exit( $e->getMessage() ); } -?> +?> \ No newline at end of file diff -r 2bc96d657ba1 -r 8965ef108821 recordedTable.php --- a/recordedTable.php Tue Jul 28 10:49:55 2009 +0900 +++ b/recordedTable.php Tue Jul 28 11:50:04 2009 +0900 @@ -2,6 +2,10 @@ include_once('config.php'); include_once( INSTALL_PATH . '/DBRecord.class.php' ); include_once( INSTALL_PATH . '/Smarty/Smarty.class.php' ); +include_once( INSTALL_PATH . '/Settings.class.php' ); + +$settings = Settings::factory(); + $order = ""; $search = ""; @@ -9,7 +13,7 @@ $station = 0; // mysql_real_escape_stringより先に接続しておく必要がある -$dbh = @mysql_connect( DB_HOST, DB_USER, DB_PASS ); +$dbh = @mysql_connect( $settings->db_host, $settings->db_user, $settings->db_pass ); #$options = "WHERE complete='1'"; $options = "WHERE starttime < '". date("Y-m-d H:i:s")."'"; // ながら再生は無理っぽい? @@ -39,27 +43,27 @@ $options .= " ORDER BY starttime DESC"; try{ - $rvs = DBRecord::createRecords(TBL_PREFIX.RESERVE_TBL, $options ); + $rvs = DBRecord::createRecords(RESERVE_TBL, $options ); $records = array(); foreach( $rvs as $r ) { - $cat = new DBRecord(TBL_PREFIX.CATEGORY_TBL, "id", $r->category_id ); - $ch = new DBRecord(TBL_PREFIX.CHANNEL_TBL, "id", $r->channel_id ); + $cat = new DBRecord(CATEGORY_TBL, "id", $r->category_id ); + $ch = new DBRecord(CHANNEL_TBL, "id", $r->channel_id ); $arr = array(); $arr['id'] = $r->id; $arr['station_name'] = $ch->name; $arr['starttime'] = $r->starttime; $arr['endtime'] = $r->endtime; - $arr['asf'] = "".INSTALL_URL."/viewer.php?reserve_id=".$r->id; + $arr['asf'] = "".$settings->install_url."/viewer.php?reserve_id=".$r->id; $arr['title'] = htmlspecialchars($r->title,ENT_QUOTES); $arr['description'] = htmlspecialchars($r->description,ENT_QUOTES); - $arr['thumb'] = "path.".jpg\" />"; + $arr['thumb'] = "install_url.$settings->thumbs."/".$r->path.".jpg\" />"; $arr['cat'] = $cat->name_en; $arr['mode'] = $RECORD_MODE[$r->mode]['name']; array_push( $records, $arr ); } - $crecs = DBRecord::createRecords(TBL_PREFIX.CATEGORY_TBL ); + $crecs = DBRecord::createRecords(CATEGORY_TBL ); $cats = array(); $cats[0]['id'] = 0; $cats[0]['name'] = "すべて"; @@ -72,7 +76,7 @@ array_push( $cats, $arr ); } - $crecs = DBRecord::createRecords(TBL_PREFIX.CHANNEL_TBL ); + $crecs = DBRecord::createRecords(CHANNEL_TBL ); $stations = array(); $stations[0]['id'] = 0; $stations[0]['name'] = "すべて"; @@ -92,7 +96,7 @@ $smarty->assign( "search", $search ); $smarty->assign( "stations", $stations ); $smarty->assign( "cats", $cats ); - $smarty->assign( "use_thumbs", USE_THUMBS ); + $smarty->assign( "use_thumbs", $settings->use_thumbs ); $smarty->display("recordedTable.html"); @@ -101,4 +105,4 @@ catch( exception $e ) { exit( $e->getMessage() ); } -?> +?> \ No newline at end of file diff -r 2bc96d657ba1 -r 8965ef108821 reservation.php --- a/reservation.php Tue Jul 28 10:49:55 2009 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,59 +0,0 @@ -starttime, "%4d-%2d-%2d %2d:%2d:%2d", $syear, $smonth, $sday, $shour, $smin, $ssec ); - sscanf( $prec->endtime, "%4d-%2d-%2d %2d:%2d:%2d", $eyear, $emonth, $eday, $ehour, $emin, $esec ); - - $crecs = DBRecord::createRecords( TBL_PREFIX.CATEGORY_TBL ); - $cats = array(); - foreach( $crecs as $crec ) { - $cat = array(); - $cat['id'] = $crec->id; - $cat['name'] = $crec->name_jp; - $cat['selected'] = $prec->category_id == $cat['id'] ? "selected" : ""; - - array_push( $cats , $cat ); - } - - $smarty = new Smarty(); - - $smarty->assign( "syear", $syear ); - $smarty->assign( "smonth", $smonth ); - $smarty->assign( "sday", $sday ); - $smarty->assign( "shour", $shour ); - $smarty->assign( "smin" ,$smin ); - $smarty->assign( "eyear", $eyear ); - $smarty->assign( "emonth", $emonth ); - $smarty->assign( "eday", $eday ); - $smarty->assign( "ehour", $ehour ); - $smarty->assign( "emin" ,$emin ); - - $smarty->assign( "type", $prec->type ); - $smarty->assign( "channel", $prec->channel ); - $smarty->assign( "channel_id", $prec->channel_id ); - $smarty->assign( "record_mode" , $RECORD_MODE ); - - $smarty->assign( "title", $prec->title ); - $smarty->assign( "description", $prec->description ); - - $smarty->assign( "cats" , $cats ); - - $smarty->assign( "program_id", $prec->id ); - - $smarty->assign( "sitetitle" , "詳細予約" ); - - $smarty->display("reservation.html"); -} -catch( exception $e ) { - exit( "Error:". $e->getMessage() ); -} -?> diff -r 2bc96d657ba1 -r 8965ef108821 reservationTable.php --- a/reservationTable.php Tue Jul 28 10:49:55 2009 +0900 +++ b/reservationTable.php Tue Jul 28 11:50:04 2009 +0900 @@ -4,11 +4,11 @@ include_once( INSTALL_PATH . '/Smarty/Smarty.class.php' ); try{ - $rvs = DBRecord::createRecords(TBL_PREFIX.RESERVE_TBL, "WHERE complete='0' ORDER BY starttime ASC" ); + $rvs = DBRecord::createRecords(RESERVE_TBL, "WHERE complete='0' ORDER BY starttime ASC" ); $reservations = array(); foreach( $rvs as $r ) { - $cat = new DBRecord(TBL_PREFIX.CATEGORY_TBL, "id", $r->category_id ); + $cat = new DBRecord(CATEGORY_TBL, "id", $r->category_id ); $arr = array(); $arr['id'] = $r->id; $arr['type'] = $r->type; diff -r 2bc96d657ba1 -r 8965ef108821 reservationform.php --- a/reservationform.php Tue Jul 28 10:49:55 2009 +0900 +++ b/reservationform.php Tue Jul 28 11:50:04 2009 +0900 @@ -8,12 +8,12 @@ $program_id = $_GET['program_id']; try { - $prec = new DBRecord( TBL_PREFIX.PROGRAM_TBL, "id", $program_id ); + $prec = new DBRecord( PROGRAM_TBL, "id", $program_id ); sscanf( $prec->starttime, "%4d-%2d-%2d %2d:%2d:%2d", $syear, $smonth, $sday, $shour, $smin, $ssec ); sscanf( $prec->endtime, "%4d-%2d-%2d %2d:%2d:%2d", $eyear, $emonth, $eday, $ehour, $emin, $esec ); - $crecs = DBRecord::createRecords( TBL_PREFIX.CATEGORY_TBL ); + $crecs = DBRecord::createRecords( CATEGORY_TBL ); $cats = array(); foreach( $crecs as $crec ) { $cat = array(); diff -r 2bc96d657ba1 -r 8965ef108821 sendstream.php --- a/sendstream.php Tue Jul 28 10:49:55 2009 +0900 +++ b/sendstream.php Tue Jul 28 11:50:04 2009 +0900 @@ -9,13 +9,16 @@ include_once("config.php"); include_once(INSTALL_PATH . "/DBRecord.class.php" ); include_once(INSTALL_PATH . "/reclib.php" ); +include_once(INSTALL_PATH . "/Settings.class.php" ); + +$settings = Settings::factory(); if( ! isset( $_GET['reserve_id'] )) jdialog("予約番号が指定されていません", "recordedTable.php"); $reserve_id = $_GET['reserve_id']; try{ - $rrec = new DBRecord( TBL_PREFIX.RESERVE_TBL, "id", $reserve_id ); + $rrec = new DBRecord( RESERVE_TBL, "id", $reserve_id ); $start_time = toTimestamp($rrec->starttime); $end_time = toTimestamp($rrec->endtime ); @@ -30,7 +33,7 @@ ob_clean(); flush(); - $fp = @fopen( INSTALL_PATH.SPOOL."/".$rrec->path, "r" ); + $fp = @fopen( INSTALL_PATH.$settings->spool."/".$rrec->path, "r" ); if( $fp !== false ) { ob_start(null,4096); $status = array(); diff -r 2bc96d657ba1 -r 8965ef108821 templates/reservation.html --- a/templates/reservation.html Tue Jul 28 10:49:55 2009 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,126 +0,0 @@ - - - - - -{$sitetitle} - - -{literal} - - - - -{/literal} - - - - -

{$sitetitle}

-

予約せずに番組表に戻る

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
開始日時年 - 月 - 日 - 時 - 分~ -
終了日時年 - 月 - 日 - 時 - 分 -
種別/ch{$type}:{$channel}ch - -
録画モード -
タイトル
概要
カテゴリ - -
番組ID保持
- -
- - - diff -r 2bc96d657ba1 -r 8965ef108821 viewer.php --- a/viewer.php Tue Jul 28 10:49:55 2009 +0900 +++ b/viewer.php Tue Jul 28 11:50:04 2009 +0900 @@ -9,16 +9,19 @@ include_once("config.php"); include_once(INSTALL_PATH . "/DBRecord.class.php" ); include_once(INSTALL_PATH . "/reclib.php" ); +include_once(INSTALL_PATH . "/Settings.class.php" ); + +$settings = Settings::factory(); if( ! isset( $_GET['reserve_id'] )) jdialog("予約番号が指定されていません", "recordedTable.php"); $reserve_id = $_GET['reserve_id']; try{ - $rrec = new DBRecord( TBL_PREFIX.RESERVE_TBL, "id", $reserve_id ); + $rrec = new DBRecord( RESERVE_TBL, "id", $reserve_id ); $start_time = toTimestamp($rrec->starttime); $end_time = toTimestamp($rrec->endtime ); - $duration = $end_time - $start_time + FORMER_TIME; + $duration = $end_time - $start_time + $settings->former_time; $dh = $duration / 3600; $duration = $duration % 3600; @@ -34,8 +37,8 @@ echo ""; echo ""; echo ""; - echo "id ."\" />"; - echo "path ."\" />"; + echo "install_url."/sendstream.php?reserve_id=".$rrec->id ."\" />"; + echo "install_url.SPOOL."/".$rrec->path ."\" />"; echo "".$title.""; echo "".$abstract.""; echo "