comparison Reservation.class.php @ 117:f5d58cf2842f

merged with upstream
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Sun, 14 Mar 2010 16:31:50 +0900
parents 49145003e6a3 f268d7d10590
children b172a0b1ea48
comparison
equal deleted inserted replaced
113:9b9e22be8407 117:f5d58cf2842f
197 %DURATION% 録画時間(秒) 197 %DURATION% 録画時間(秒)
198 */ 198 */
199 199
200 $day_of_week = array( "日","月","火","水","木","金","土" ); 200 $day_of_week = array( "日","月","火","水","木","金","土" );
201 $filename = $settings->filename_format; 201 $filename = $settings->filename_format;
202 // %TITLE%
203 $filename = mb_str_replace("%TITLE%", $fn_title, $filename);
204 // %ST% 開始日時
205 $filename = mb_str_replace("%ST%",date("YmdHis", $start_time), $filename );
206 // %ET% 終了日時
207 $filename = mb_str_replace("%ET%",date("YmdHis", $end_time), $filename );
208 // %TYPE% GR/BS
209 $filename = mb_str_replace("%TYPE%",$crec->type, $filename );
210 // %CH% チャンネル番号
211 $filename = mb_str_replace("%CH%","".$crec->channel, $filename );
212 // %DOW% 曜日(Sun-Mon)
213 $filename = mb_str_replace("%DOW%",date("D", $start_time), $filename );
214 // %DOWJ% 曜日(日-土)
215 $filename = mb_str_replace("%DOWJ%",$day_of_week[(int)date("w", $start_time)], $filename );
216 // %YEAR% 開始年
217 $filename = mb_str_replace("%YEAR%",date("Y", $start_time), $filename );
218 // %MONTH% 開始月
219 $filename = mb_str_replace("%MONTH%",date("m", $start_time), $filename );
220 // %DAY% 開始日
221 $filename = mb_str_replace("%DAY%",date("d", $start_time), $filename );
222 // %HOUR% 開始時
223 $filename = mb_str_replace("%HOUR%",date("H", $start_time), $filename );
224 // %MIN% 開始分
225 $filename = mb_str_replace("%MIN%",date("i", $start_time), $filename );
226 // %SEC% 開始秒
227 $filename = mb_str_replace("%SEC%",date("s", $start_time), $filename );
228 // %DURATION% 録画時間(秒)
229 $filename = mb_str_replace("%DURATION%","".$duration, $filename );
202 230
203 // あると面倒くさそうな文字を全部_に 231 // あると面倒くさそうな文字を全部_に
204 $fn_title = mb_ereg_replace("[ \./\*:<>\?\\|()\'\"&]","_", trim($title) ); 232 $fn_title = mb_ereg_replace("[ \./\*:<>\?\\|()\'\"&]","_", trim($title) );
205
206 // %TITLE%
207 $filename = str_replace("%TITLE%", $fn_title, $filename);
208 // %ST% 開始日時
209 $filename = str_replace("%ST%",date("YmdHis", $start_time), $filename );
210 // %ET% 終了日時
211 $filename = str_replace("%ET%",date("YmdHis", $end_time), $filename );
212 // %TYPE% GR/BS
213 $filename = str_replace("%TYPE%",$crec->type, $filename );
214 // %CH% チャンネル番号
215 $filename = str_replace("%CH%","".$crec->channel, $filename );
216 // %DOW% 曜日(Sun-Mon)
217 $filename = str_replace("%DOW%",date("D", $start_time), $filename );
218 // %DOWJ% 曜日(日-土)
219 $filename = str_replace("%DOWJ%",$day_of_week[(int)date("w", $start_time)], $filename );
220 // %YEAR% 開始年
221 $filename = str_replace("%YEAR%",date("Y", $start_time), $filename );
222 // %MONTH% 開始月
223 $filename = str_replace("%MONTH%",date("m", $start_time), $filename );
224 // %DAY% 開始日
225 $filename = str_replace("%DAY%",date("d", $start_time), $filename );
226 // %HOUR% 開始時
227 $filename = str_replace("%HOUR%",date("H", $start_time), $filename );
228 // %MIN% 開始分
229 $filename = str_replace("%MIN%",date("i", $start_time), $filename );
230 // %SEC% 開始秒
231 $filename = str_replace("%SEC%",date("s", $start_time), $filename );
232 // %DURATION% 録画時間(秒)
233 $filename = str_replace("%DURATION%","".$duration, $filename );
234 233
235 // 文字コード変換 234 // 文字コード変換
236 if( defined("FILESYSTEM_ENCODING") ) { 235 if( defined("FILESYSTEM_ENCODING") ) {
237 // $filename = mb_convert_encoding( $filename, FILESYSTEM_ENCODING, "UTF-8" ); 236 // $filename = mb_convert_encoding( $filename, FILESYSTEM_ENCODING, "UTF-8" );
238 $filename = mb_convert_encoding( $filename, FILESYSTEM_ENCODING, "auto" ); 237 $filename = mb_convert_encoding( $filename, FILESYSTEM_ENCODING, "auto" );