Mercurial > epgrec.yaz
changeset 109:3450df471c8c
merged with upstream
author | Yoshiki Yazawa <yaz@honeyplanet.jp> |
---|---|
date | Tue, 09 Mar 2010 05:56:04 +0900 |
parents | 29e7a40e6587 (current diff) 4bd07b03c694 (diff) |
children | 74a174a245d2 |
files | upgrade_to_201002.php |
diffstat | 8 files changed, 246 insertions(+), 144 deletions(-) [+] |
line wrap: on
line diff
--- 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; }
--- 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 );
--- 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 ) {
--- 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'] = "<img src=\"".$settings->install_url.$settings->thumbs."/".$r->path.".jpg\" />"; + $arr['thumb'] = "<img src=\"".$settings->install_url.$settings->thumbs."/".htmlentities($r->path, ENT_QUOTES,"UTF-8").".jpg\" />"; $arr['cat'] = $cat->name_en; $arr['mode'] = $RECORD_MODE[$r->mode]['name'];
--- 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 @@ <th>局</th> <th>カテゴリ</th> <th>曜日</th> + <th>開始時</ht> <th>録画モード</th> <th>削除</th> </tr> @@ -100,6 +101,7 @@ <td>{$keyword.channel}</td> <td>{$keyword.category}</td> <td>{$keyword.weekofday}</td> + <td>{$keyword.prgtime}</td> <td>{$keyword.autorec_mode}</td> <td><input type="button" value="削除" onClick="javascript:PRG.delkey('{$keyword.id}')" /></td> </tr>
--- 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 @@ 絞り込み: <form method="post" action="programTable.php"> <input type="hidden" name="do_search" value="1" /> -検索語句<input type="text" size="20" name="search" value="{$search}" /> +検索語句<input type="text" size="20" name="search" value="{$search}" /><br /> 正規表現使用<input type="checkbox" name="use_regexp" value="1" {if $use_regexp}checked{/if} /> 種別<select name="type"> {foreach from=$types item=type} @@ -177,6 +177,12 @@ <option value="{$cat.id}" {$cat.selected}>{$cat.name}</option> {/foreach} </select> +開始時<select name="prgtime"> + {foreach from=$prgtimes item=prgt} + <option value="{$prgt.value}" {$prgt.selected}>{$prgt.name}</option> + {/foreach} + </select> + 曜日<select name='weekofday'> {foreach from=$weekofdays item=day} <option value="{$day.id}" {$day.selected}>{$day.name}</option> @@ -228,7 +234,8 @@ <b>種別:</b>{if $k_type == "*"}すべて{else}{$k_type}{/if} <b>局:</b>{if $k_station == 0}すべて{else}{$k_station_name}{/if} <b>カテゴリ:</b>{if $k_category == 0}すべて{else}{$k_category_name}{/if} - <b>曜日:</b>{if $weekofday == 7}なし{else}{$k_weekofday}{/if}曜 + <b>曜日:</b>{if $weekofday == 7}なし{else}{$k_weekofday}曜{/if} + <b>時間:</b>{if $prgtime == 24}なし{else}{$prgtime}時~{/if} <b>件数:</b>{$programs|@count} <input type="hidden" name="add_keyword" value="{$do_keyword}" /> <input type="hidden" name="k_use_regexp" value="{$use_regexp}" /> @@ -237,6 +244,7 @@ <input type="hidden" name="k_category" value="{$k_category}" /> <input type="hidden" name="k_station" value="{$k_station}" /> <input type="hidden" name="k_weekofday" value={$weekofday} /> + <input type="hidden" name="k_prgtime" value={$prgtime} /> <b>録画モード:</b><select name="autorec_mode" > {foreach from=$autorec_modes item=mode name=recmode } <option value="{$smarty.foreach.recmode.index}" {$mode.selected} >{$mode.name}</option>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/upgrade_db.php Tue Mar 09 05:56:04 2010 +0900 @@ -0,0 +1,197 @@ +#!/usr/bin/php +<?php +include_once('config.php'); +include_once(INSTALL_PATH . '/Settings.class.php' ); + + +// mysqli::multi_queryは動作がいまいちなので使わない + +function multi_query( $sqlstrs, $dbh ) { + $error = false; + + foreach( $sqlstrs as $sqlstr ) { + $res = mysql_query( $sqlstr ); + if( $res === FALSE ) { + echo "failed: ". $sqlstr . "\n"; + $error = true; + } + } + return $error; +} + +function column_exists( $tbl, $col, $dbh ) { + $sqlstr = "show fields from ".$tbl." where Field='".$col."'"; + $res = mysql_query( $sqlstr, $dbh ); + return mysql_num_rows($res); +} + +function index_exists( $tbl, $idx, $dbh ) { + $sqlstr = "show index from ".$tbl." where Key_name='".$idx."'"; + $res = mysql_query( $sqlstr, $dbh ); + return mysql_num_rows($res); +} + + +$settings = Settings::factory(); +$dbh = mysql_connect( $settings->db_host, $settings->db_user, $settings->db_pass ); +if( $dbh !== FALSE ) { + + $sqlstr = "use ".$settings->db_name; + mysql_query( $sqlstr ); + + $sqlstr = "set NAMES 'utf8'"; + mysql_query( $sqlstr ); + + // RESERVE_TBL + + $sqlstrs = array ( + "alter table ".$settings->tbl_prefix.RESERVE_TBL." modify channel_disc varchar(128) not null default 'none';", // channel disc + "alter table ".$settings->tbl_prefix.RESERVE_TBL." modify channel_id integer not null default '0';", // channel ID + "alter table ".$settings->tbl_prefix.RESERVE_TBL." modify program_id integer not null default '0';", // Program ID + "alter table ".$settings->tbl_prefix.RESERVE_TBL." modify type varchar(8) not null default 'GR';", // 種別(GR/BS/CS) + "alter table ".$settings->tbl_prefix.RESERVE_TBL." modify channel varchar(10) not null default '0';", // チャンネル + "alter table ".$settings->tbl_prefix.RESERVE_TBL." modify title varchar(512) not null default 'none';", // タイトル + "alter table ".$settings->tbl_prefix.RESERVE_TBL." modify description varchar(512) not null default 'none';", // 説明 text->varchar + "alter table ".$settings->tbl_prefix.RESERVE_TBL." modify category_id integer not null default '0';", // カテゴリID + "alter table ".$settings->tbl_prefix.RESERVE_TBL." modify starttime datetime not null default '1970-01-01 00:00:00';", // 開始時刻 + "alter table ".$settings->tbl_prefix.RESERVE_TBL." modify endtime datetime not null default '1970-01-01 00:00:00';", // 終了時刻 + "alter table ".$settings->tbl_prefix.RESERVE_TBL." modify job integer not null default '0';", // job番号 + "alter table ".$settings->tbl_prefix.RESERVE_TBL." modify path blob default null;", // 録画ファイルパス + "alter table ".$settings->tbl_prefix.RESERVE_TBL." modify complete boolean not null default '0';", // 完了フラグ + "alter table ".$settings->tbl_prefix.RESERVE_TBL." modify reserve_disc varchar(128) not null default 'none';", // 識別用hash + "alter table ".$settings->tbl_prefix.RESERVE_TBL." modify autorec integer not null default '0';", // キーワードID + "alter table ".$settings->tbl_prefix.RESERVE_TBL." modify mode integer not null default '0';", //録画モード + ); + + if( multi_query( $sqlstrs, $dbh ) ) { + echo "予約テーブルのアップデートに失敗\n"; + } + + // インデックス追加 + $sqlstrs = array(); + if( index_exists( $settings->tbl_prefix.RESERVE_TBL, "reserve_ch_idx", $dbh ) ) { + echo "reserve_ch_idxはすでに存在しているため作成しません\n"; + } + else { + array_push( $sqlstrs, "create index reserve_ch_idx on ".$settings->tbl_prefix.RESERVE_TBL." (channel_disc);" ); + } + if( index_exists( $settings->tbl_prefix.RESERVE_TBL, "reserve_st_idx", $dbh ) ) { + echo "reserve_st_idxはすでに存在しているため作成しません\n"; + } + else { + array_push( $sqlstrs, "create index reserve_st_idx on ".$settings->tbl_prefix.RESERVE_TBL." (starttime);" ); + } + if( multi_query( $sqlstrs, $dbh ) ) { + echo "予約テーブルにインデックスが作成できません\n"; + } + + // PROGRAM_TBL + + $sqlstrs = array ( + "alter table ".$settings->tbl_prefix.PROGRAM_TBL." modify channel_disc varchar(128) not null default 'none';", // channel disc + "alter table ".$settings->tbl_prefix.PROGRAM_TBL." modify channel_id integer not null default '0';", // channel ID + "alter table ".$settings->tbl_prefix.PROGRAM_TBL." modify type varchar(8) not null default 'GR';", // 種別(GR/BS/CS) + "alter table ".$settings->tbl_prefix.PROGRAM_TBL." modify channel varchar(10) not null default '0';", // チャンネル + "alter table ".$settings->tbl_prefix.PROGRAM_TBL." modify title varchar(512) not null default 'none';", // タイトル + "alter table ".$settings->tbl_prefix.PROGRAM_TBL." modify description varchar(512) not null default 'none';", // 説明 text->varchar + "alter table ".$settings->tbl_prefix.PROGRAM_TBL." modify category_id integer not null default '0';", // カテゴリID + "alter table ".$settings->tbl_prefix.PROGRAM_TBL." modify starttime datetime not null default '1970-01-01 00:00:00';", // 開始時刻 + "alter table ".$settings->tbl_prefix.PROGRAM_TBL." modify endtime datetime not null default '1970-01-01 00:00:00';", // 終了時刻 + "alter table ".$settings->tbl_prefix.PROGRAM_TBL." modify program_disc varchar(128) not null default 'none';", // 識別用hash + "alter table ".$settings->tbl_prefix.PROGRAM_TBL." modify autorec boolean not null default '1';", // 自動録画有効無効 + ); + + if( multi_query( $sqlstrs, $dbh ) ) { + echo "番組テーブルのアップデートに失敗\n"; + } + + // インデックス追加 + $sqlstrs = array(); + if( index_exists( $settings->tbl_prefix.PROGRAM_TBL , "program_ch_idx", $dbh ) ) { + echo "program_ch_idxはすでに存在しているため作成しません\n"; + } + else { + array_push( $sqlstrs, "create index program_ch_idx on ".$settings->tbl_prefix.PROGRAM_TBL." (channel_disc);" ); + } + if( index_exists( $settings->tbl_prefix.PROGRAM_TBL , "program_st_idx", $dbh ) ) { + echo "program_st_idxはすでに存在しているため作成しません\n"; + } + else { + array_push( $sqlstrs, "create index program_st_idx on ".$settings->tbl_prefix.PROGRAM_TBL." (starttime);" ); + } + if( multi_query( $sqlstrs, $dbh ) ) { + echo "番組テーブルにインデックスが作成できません\n"; + } + + // CHANNEL_TBL + + $sqlstrs = array( + "alter table ".$settings->tbl_prefix.CHANNEL_TBL." modify type varchar(8) not null default 'GR';", // 種別 + "alter table ".$settings->tbl_prefix.CHANNEL_TBL." modify channel varchar(10) not null default '0';", // channel + "alter table ".$settings->tbl_prefix.CHANNEL_TBL." modify name varchar(512) not null default 'none';", // 表示名 + "alter table ".$settings->tbl_prefix.CHANNEL_TBL." modify channel_disc varchar(128) not null default 'none';", // 識別用hash + ); + if( column_exists( $settings->tbl_prefix.CHANNEL_TBL, "sid", $dbh ) ) { + echo "sidフィールドは存在しているので作成しません\n"; + } + else { + array_push( $sqlstrs , "alter table ".$settings->tbl_prefix.CHANNEL_TBL." add sid varchar(64) not null default 'hd'" ); + } + if( column_exists( $settings->tbl_prefix.CHANNEL_TBL, "skip", $dbh ) ) { + echo "skipフィールドは存在しているので作成しません\n"; + } + else { + array_push( $sqlstrs , "alter table ".$settings->tbl_prefix.CHANNEL_TBL." add skip boolean not null default '0'" ); + } + if( multi_query( $sqlstrs, $dbh ) ) { + echo "チャンネルテーブルのアップデートに失敗\n"; + } + + // CATEGORY_TBL + + $sqlstrs = array( + "alter table ".$settings->tbl_prefix.CATEGORY_TBL." modify name_jp varchar(512) not null default 'none';", // 表示名 + "alter table ".$settings->tbl_prefix.CATEGORY_TBL." modify name_en varchar(512) not null default 'none';", // 同上 + "alter table ".$settings->tbl_prefix.CATEGORY_TBL." modify category_disc varchar(128) not null default 'none'", // 識別用hash + ); + if( multi_query( $sqlstrs, $dbh ) ) { + echo "カテゴリテーブルのアップデートに失敗\n"; + } + + // KEYWORD_TBL + + $sqlstrs = array( + "alter table ".$settings->tbl_prefix.KEYWORD_TBL." modify keyword varchar(512) not null default '*';", // 表示名 + "alter table ".$settings->tbl_prefix.KEYWORD_TBL." modify type varchar(8) not null default '*';", // 種別 + "alter table ".$settings->tbl_prefix.KEYWORD_TBL." modify channel_id integer not null default '0';", // channel ID + "alter table ".$settings->tbl_prefix.KEYWORD_TBL." modify category_id integer not null default '0';", // カテゴリID + "alter table ".$settings->tbl_prefix.KEYWORD_TBL." modify use_regexp boolean not null default '0';", // 正規表現を使用するなら1 + ); + if( column_exists( $settings->tbl_prefix.KEYWORD_TBL, "autorec_mode", $dbh ) ) { + echo "autorec_modeは存在しているので作成しません\n"; + } + else { + array_push( $sqlstrs, "alter table ".$settings->tbl_prefix.KEYWORD_TBL." add autorec_mode integer not null default '0';"); + } + if( column_exists( $settings->tbl_prefix.KEYWORD_TBL, "weekofday", $dbh ) ) { + echo "weekofdayは存在しているので作成しません\n"; + } + else { + array_push( $sqlstrs, "alter table ".$settings->tbl_prefix.KEYWORD_TBL." add weekofday enum ('0','1','2','3','4','5','6','7' ) default '7'" ); + } + if( column_exists( $settings->tbl_prefix.KEYWORD_TBL, "prgtime", $dbh ) ) { + echo "prgtimeは存在しているので作成しません\n"; + } + else { + array_push( $sqlstrs, + "alter table ".$settings->tbl_prefix.KEYWORD_TBL." add prgtime enum ('0','1','2','3','4','5','6','7','8','9','10','11','12',". + "'13','14','15','16','17','18','19','20','21','22','23','24') default '24'" ); + } + + if( multi_query( $sqlstrs, $dbh ) ) { + echo "キーワードテーブルのアップデートに失敗\n"; + } +} +else + exit( "DBの接続に失敗\n" ); +?> \ No newline at end of file
--- a/upgrade_to_201002.php Tue Mar 09 05:42:26 2010 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,138 +0,0 @@ -#!/usr/bin/php -<?php -include_once('config.php'); -include_once(INSTALL_PATH . '/Settings.class.php' ); - - -// mysqli::multi_queryは動作がいまいちなので使わない - -function multi_query( $sqlstrs, $dbh ) { - $error = false; - - foreach( $sqlstrs as $sqlstr ) { - $res = mysql_query( $sqlstr ); - if( $res === FALSE ) { - echo "failed: ". $sqlstr . "\n"; - $error = true; - } - } - return $error; -} - - -$settings = Settings::factory(); -$dbh = mysql_connect( $settings->db_host, $settings->db_user, $settings->db_pass ); -if( $dbh !== FALSE ) { - - $sqlstr = "use ".$settings->db_name; - mysql_query( $sqlstr ); - - $sqlstr = "set NAMES 'utf8'"; - mysql_query( $sqlstr ); - - // RESERVE_TBL - - $sqlstrs = array ( - "alter table ".$settings->tbl_prefix.RESERVE_TBL." modify channel_disc varchar(128) not null default 'none';", // channel disc - "alter table ".$settings->tbl_prefix.RESERVE_TBL." modify channel_id integer not null default '0';", // channel ID - "alter table ".$settings->tbl_prefix.RESERVE_TBL." modify program_id integer not null default '0';", // Program ID - "alter table ".$settings->tbl_prefix.RESERVE_TBL." modify type varchar(8) not null default 'GR';", // 種別(GR/BS/CS) - "alter table ".$settings->tbl_prefix.RESERVE_TBL." modify channel varchar(10) not null default '0';", // チャンネル - "alter table ".$settings->tbl_prefix.RESERVE_TBL." modify title varchar(512) not null default 'none';", // タイトル - "alter table ".$settings->tbl_prefix.RESERVE_TBL." modify description varchar(512) not null default 'none';", // 説明 text->varchar - "alter table ".$settings->tbl_prefix.RESERVE_TBL." modify category_id integer not null default '0';", // カテゴリID - "alter table ".$settings->tbl_prefix.RESERVE_TBL." modify starttime datetime not null default '1970-01-01 00:00:00';", // 開始時刻 - "alter table ".$settings->tbl_prefix.RESERVE_TBL." modify endtime datetime not null default '1970-01-01 00:00:00';", // 終了時刻 - "alter table ".$settings->tbl_prefix.RESERVE_TBL." modify job integer not null default '0';", // job番号 - "alter table ".$settings->tbl_prefix.RESERVE_TBL." modify path blob default null;", // 録画ファイルパス - "alter table ".$settings->tbl_prefix.RESERVE_TBL." modify complete boolean not null default '0';", // 完了フラグ - "alter table ".$settings->tbl_prefix.RESERVE_TBL." modify reserve_disc varchar(128) not null default 'none';", // 識別用hash - "alter table ".$settings->tbl_prefix.RESERVE_TBL." modify autorec integer not null default '0';", // キーワードID - "alter table ".$settings->tbl_prefix.RESERVE_TBL." modify mode integer not null default '0';", //録画モード - ); - - if( multi_query( $sqlstrs, $dbh ) ) { - echo "予約テーブルのアップデートに失敗\n"; - } - - $sqlstrs = array( - "create index reserve_ch_idx on ".$settings->tbl_prefix.RESERVE_TBL." (channel_disc);", - "create index reserve_st_idx on ".$settings->tbl_prefix.RESERVE_TBL." (starttime);", - ); - - if( multi_query( $sqlstrs, $dbh ) ) { - echo "予約テーブルにインデックスが作成できません\n"; - } - - // PROGRAM_TBL - - $sqlstrs = array ( - "alter table ".$settings->tbl_prefix.PROGRAM_TBL." modify channel_disc varchar(128) not null default 'none';", // channel disc - "alter table ".$settings->tbl_prefix.PROGRAM_TBL." modify channel_id integer not null default '0';", // channel ID - "alter table ".$settings->tbl_prefix.PROGRAM_TBL." modify type varchar(8) not null default 'GR';", // 種別(GR/BS/CS) - "alter table ".$settings->tbl_prefix.PROGRAM_TBL." modify channel varchar(10) not null default '0';", // チャンネル - "alter table ".$settings->tbl_prefix.PROGRAM_TBL." modify title varchar(512) not null default 'none';", // タイトル - "alter table ".$settings->tbl_prefix.PROGRAM_TBL." modify description varchar(512) not null default 'none';", // 説明 text->varchar - "alter table ".$settings->tbl_prefix.PROGRAM_TBL." modify category_id integer not null default '0';", // カテゴリID - "alter table ".$settings->tbl_prefix.PROGRAM_TBL." modify starttime datetime not null default '1970-01-01 00:00:00';", // 開始時刻 - "alter table ".$settings->tbl_prefix.PROGRAM_TBL." modify endtime datetime not null default '1970-01-01 00:00:00';", // 終了時刻 - "alter table ".$settings->tbl_prefix.PROGRAM_TBL." modify program_disc varchar(128) not null default 'none';", // 識別用hash - "alter table ".$settings->tbl_prefix.PROGRAM_TBL." modify autorec boolean not null default '1';", // 自動録画有効無効 - ); - - if( multi_query( $sqlstrs, $dbh ) ) { - echo "番組テーブルのアップデートに失敗\n"; - } - - $sqlstrs = array( - "create index program_ch_idx on ".$settings->tbl_prefix.PROGRAM_TBL." (channel_disc);", // インデックス - "create index program_st_idx on ".$settings->tbl_prefix.PROGRAM_TBL." (starttime);", // インデックス - ); - - if( multi_query( $sqlstrs, $dbh ) ) { - echo "番組テーブルにインデックスが作成できません\n"; - } - - // CHANNEL_TBL - - $sqlstrs = array( - "alter table ".$settings->tbl_prefix.CHANNEL_TBL." modify type varchar(8) not null default 'GR';", // 種別 - "alter table ".$settings->tbl_prefix.CHANNEL_TBL." modify channel varchar(10) not null default '0';", // channel - "alter table ".$settings->tbl_prefix.CHANNEL_TBL." modify name varchar(512) not null default 'none';", // 表示名 - "alter table ".$settings->tbl_prefix.CHANNEL_TBL." modify channel_disc varchar(128) not null default 'none';", // 識別用hash - "alter table ".$settings->tbl_prefix.CHANNEL_TBL." add sid varchar(64) not null default 'hd'", // サービスID用02/23/2010追加 - ); - - if( multi_query( $sqlstrs, $dbh ) ) { - echo "チャンネルテーブルのアップデートに失敗\n"; - } - - // CATEGORY_TBL - - $sqlstrs = array( - "alter table ".$settings->tbl_prefix.CATEGORY_TBL." modify name_jp varchar(512) not null default 'none';", // 表示名 - "alter table ".$settings->tbl_prefix.CATEGORY_TBL." modify name_en varchar(512) not null default 'none';", // 同上 - "alter table ".$settings->tbl_prefix.CATEGORY_TBL." modify category_disc varchar(128) not null default 'none'", // 識別用hash - ); - if( multi_query( $sqlstrs, $dbh ) ) { - echo "カテゴリテーブルのアップデートに失敗\n"; - } - - // KEYWORD_TBL - - $sqlstrs = array( - "alter table ".$settings->tbl_prefix.KEYWORD_TBL." modify keyword varchar(512) not null default '*';", // 表示名 - "alter table ".$settings->tbl_prefix.KEYWORD_TBL." modify type varchar(8) not null default '*';", // 種別 - "alter table ".$settings->tbl_prefix.KEYWORD_TBL." modify channel_id integer not null default '0';", // channel ID - "alter table ".$settings->tbl_prefix.KEYWORD_TBL." modify category_id integer not null default '0';", // カテゴリID - "alter table ".$settings->tbl_prefix.KEYWORD_TBL." modify use_regexp boolean not null default '0';", // 正規表現を使用するなら1 - "alter table ".$settings->tbl_prefix.KEYWORD_TBL." add autorec_mode integer not null default '0';", // 自動録画のモード02/23/2010追加 - "alter table ".$settings->tbl_prefix.KEYWORD_TBL." add weekofday enum ('0','1','2','3','4','5','6','7' ) default '7'", // 曜日、同追加 - ); - if( multi_query( $sqlstrs, $dbh ) ) { - echo "キーワードテーブルのアップデートに失敗\n"; - } -} -else - exit( "DBの接続に失敗\n" ); -?> \ No newline at end of file