# HG changeset patch # User Yoshiki Yazawa # Date 1268081764 -32400 # Node ID 3450df471c8c5c7951a1c5044f23f38c3eb4eda1 # Parent 29e7a40e6587b2e9583b1bc36bd43698b6aa1935# Parent 4bd07b03c69428523d547943d49974e00b94d288 merged with upstream diff -r 29e7a40e6587 -r 3450df471c8c Keyword.class.php --- a/Keyword.class.php Tue Mar 09 05:42:26 2010 +0900 +++ b/Keyword.class.php Tue Mar 09 05:56:04 2010 +0900 @@ -47,6 +47,10 @@ $options .= " AND WEEKDAY(starttime) = '".$this->weekofday."'"; } + if( $this->prgtime != 24 ) { + $options .= " AND time(starttime) BETWEEN cast('".sprintf( "%02d:00:00", $this->prgtime)."' as time) AND cast('".sprintf("%02d:59:59", $this->prgtime)."' as time)"; + } + $options .= " ORDER BY starttime ASC"; $recs = array(); @@ -56,7 +60,6 @@ catch( Exception $e ) { throw $e; } - return $recs; } diff -r 29e7a40e6587 -r 3450df471c8c keywordTable.php --- a/keywordTable.php Tue Mar 09 05:42:26 2010 +0900 +++ b/keywordTable.php Tue Mar 09 05:56:04 2010 +0900 @@ -9,10 +9,13 @@ $weekofdays = array( "月", "火", "水", "木", "金", "土", "日", "なし" ); +$prgtimes = array(); +for( $i=0 ; $i < 25; $i++ ) { + $prgtimes[$i] = $i == 24 ? "なし" : $i."時~"; +} // 新規キーワードがポストされた - if( isset($_POST["add_keyword"]) ) { if( $_POST["add_keyword"] == 1 ) { try { @@ -23,6 +26,7 @@ $rec->channel_id = $_POST['k_station']; $rec->use_regexp = $_POST['k_use_regexp']; $rec->weekofday = $_POST['k_weekofday']; + $rec->prgtime = $_POST['k_prgtime']; $rec->autorec_mode = $_POST['autorec_mode']; // 録画予約実行 @@ -60,6 +64,8 @@ $arr['weekofday'] = $weekofdays["$rec->weekofday"]; + $arr['prgtime'] = $prgtimes["$rec->prgtime"]; + $arr['autorec_mode'] = $RECORD_MODE[(int)$rec->autorec_mode]['name']; array_push( $keywords, $arr ); diff -r 29e7a40e6587 -r 3450df471c8c programTable.php --- a/programTable.php Tue Mar 09 05:42:26 2010 +0900 +++ b/programTable.php Tue Mar 09 05:56:04 2010 +0900 @@ -20,6 +20,7 @@ array( "name" => "なし", "id" => 7, "selected" => "" ), ); + $autorec_modes = $RECORD_MODE; $autorec_modes[(int)($settings->autorec_mode)]['selected'] = "selected"; @@ -29,6 +30,8 @@ $type = "*"; $category_id = 0; $station = 0; +$prgtime = 24; + // mysql_real_escape_stringより先に接続しておく必要がある $dbh = @mysql_connect($settings->db_host, $settings->db_user, $settings->db_pass ); @@ -71,14 +74,21 @@ $options .= " AND WEEKDAY(starttime) = '".$weekofday."'"; } } + if( isset($_POST['prgtime']) ) { + $prgtime = (int)($_POST['prgtime']); + if( $prgtime != 24 ) { + $options .= " AND time(starttime) BETWEEN cast('".sprintf( "%02d:00:00", $prgtime)."' as time) AND cast('".sprintf("%02d:59:59", $prgtime)."' as time)"; + } + } } $options .= " ORDER BY starttime ASC LIMIT 300"; + + $do_keyword = 0; if( ($search != "") || ($type != "*") || ($category_id != 0) || ($station != 0) ) $do_keyword = 1; try{ - $precs = DBRecord::createRecords(PROGRAM_TBL, $options ); $programs = array(); @@ -157,6 +167,18 @@ array_push( $stations, $arr ); } $weekofdays["$weekofday"]["selected"] = "selected" ; + + // 時間帯 + $prgtimes = array(); + for( $i=0; $i < 25; $i++ ) { + array_push( $prgtimes, + array( "name" => ( $i == 24 ? "なし" : sprintf("%0d時~",$i) ), + "value" => $i, + "selected" => ( $i == $prgtime ? "selected" : "" ) ) + ); + } + + $smarty = new Smarty(); $smarty->assign("sitetitle","番組検索"); @@ -177,6 +199,8 @@ $smarty->assign( "weekofday", $weekofday ); $smarty->assign( "weekofdays", $weekofdays ); $smarty->assign( "autorec_modes", $autorec_modes ); + $smarty->assign( "prgtimes", $prgtimes ); + $smarty->assign( "prgtime", $prgtime ); $smarty->display("programTable.html"); } catch( exception $e ) { diff -r 29e7a40e6587 -r 3450df471c8c recordedTable.php --- a/recordedTable.php Tue Mar 09 05:42:26 2010 +0900 +++ b/recordedTable.php Tue Mar 09 05:56:04 2010 +0900 @@ -60,7 +60,7 @@ $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'] = "install_url.$settings->thumbs."/".$r->path.".jpg\" />"; + $arr['thumb'] = "install_url.$settings->thumbs."/".htmlentities($r->path, ENT_QUOTES,"UTF-8").".jpg\" />"; $arr['cat'] = $cat->name_en; $arr['mode'] = $RECORD_MODE[$r->mode]['name']; diff -r 29e7a40e6587 -r 3450df471c8c templates/keywordTable.html --- a/templates/keywordTable.html Tue Mar 09 05:42:26 2010 +0900 +++ b/templates/keywordTable.html Tue Mar 09 05:56:04 2010 +0900 @@ -87,6 +87,7 @@ 局 カテゴリ 曜日 + 開始時 録画モード 削除 @@ -100,6 +101,7 @@ {$keyword.channel} {$keyword.category} {$keyword.weekofday} + {$keyword.prgtime} {$keyword.autorec_mode} diff -r 29e7a40e6587 -r 3450df471c8c templates/programTable.html --- a/templates/programTable.html Tue Mar 09 05:42:26 2010 +0900 +++ b/templates/programTable.html Tue Mar 09 05:56:04 2010 +0900 @@ -160,7 +160,7 @@ 絞り込み:
-検索語句 +検索語句
正規表現使用 種別 +開始時 + 曜日 @@ -237,6 +244,7 @@ + 録画モード: