Mercurial > epgrec.yaz
diff recomplete.php @ 37:e5f9aa34d06f
change: modify all script for web base setting
author | yoneda <epgrec@park.mda.or.jp> |
---|---|
date | Tue, 28 Jul 2009 00:00:04 +0900 |
parents | a34f2ff49097 |
children | 8965ef108821 |
line wrap: on
line diff
--- a/recomplete.php Mon Jul 27 22:27:54 2009 +0900 +++ b/recomplete.php Tue Jul 28 00:00:04 2009 +0900 @@ -2,32 +2,34 @@ <?php include_once( "config.php" ); include_once( INSTALL_PATH . "/DBRecord.class.php" ); +include_once( INSTALL_PATH . "/Settings.class.php" ); + +$settings = Settings::factory(); + $reserve_id = $argv[1]; try{ - $rrec = new DBRecord( TBL_PREFIX.RESERVE_TBL, "id" , $reserve_id ); + $rrec = new DBRecord( RESERVE_TBL, "id" , $reserve_id ); - if( file_exists( INSTALL_PATH . SPOOL . "/". $rrec->path ) ) { + if( file_exists( INSTALL_PATH .$settings->spool . "/". $rrec->path ) ) { // 予約完了 $rrec->complete = '1'; - if( defined("MEDIATOMB_UPDATE") ) { - if( MEDIATOMB_UPDATE ) { - // ちょっと待った方が確実っぽい - @exec("sync"); - sleep(15); - $dbh = mysql_connect( DB_HOST, DB_USER, DB_PASS ); - if( $dbh !== false ) { - $sqlstr = "use ".DB_NAME; - mysql_query( $sqlstr ); - // 別にやらなくてもいいが - $sqlstr = "set NAME utf8"; - mysql_query( $sqlstr ); - $sqlstr = "update mt_cds_object set metadata='dc:description=".mysql_real_escape_string($rrec->description)."&epgrec:id=".$reserve_id."' where dc_title='".$rrec->path."'"; - mysql_query( $sqlstr ); - $sqlstr = "update mt_cds_object set dc_title='".mysql_real_escape_string($rrec->title)."(".date("Y/m/d").")' where dc_title='".$rrec->path."'"; - mysql_query( $sqlstr ); - } + if( $settings->mediatomb_update ) { + // ちょっと待った方が確実っぽい + @exec("sync"); + sleep(15); + $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 NAME utf8"; + @mysql_query( $sqlstr ); + $sqlstr = "update mt_cds_object set metadata='dc:description=".mysql_real_escape_string($rrec->description)."&epgrec:id=".$reserve_id."' where dc_title='".$rrec->path."'"; + @mysql_query( $sqlstr ); + $sqlstr = "update mt_cds_object set dc_title='".mysql_real_escape_string($rrec->title)."(".date("Y/m/d").")' where dc_title='".$rrec->path."'"; + @mysql_query( $sqlstr ); } } }