-
Notifications
You must be signed in to change notification settings - Fork 5
/
mediatomb.php
executable file
·35 lines (30 loc) · 1.13 KB
/
mediatomb.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/php
<?php
$script_path = dirname( __FILE__ );
chdir( $script_path );
include_once( $script_path . '/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();
try {
$recs = DBRecord::createRecords(RESERVE_TBL );
// DB接続
$dbh = mysql_connect( $settings->db_host, $settings->db_user, $settings->db_pass );
if( $dbh === false ) exit( "mysql connection fail" );
$sqlstr = "use ".$settings->db_name;
mysql_query( $sqlstr );
$sqlstr = "set NAME utf8";
mysql_query( $sqlstr );
foreach( $recs as $rec ) {
$title = mysql_real_escape_string($rec->title)."(".date("Y/m/d", toTimestamp($rec->starttime)).")";
$sqlstr = "update mt_cds_object set metadata='dc:description=".mysql_real_escape_string($rec->description)."&epgrec:id=".$rec->id."' where dc_title='".$rec->path."'";
mysql_query( $sqlstr );
$sqlstr = "update mt_cds_object set dc_title='".$title."' where dc_title='".$rec->path."'";
mysql_query( $sqlstr );
}
}
catch( Exception $e ) {
exit( $e->getMessage() );
}
?>