annotate mediatomb.php @ 164:254d8a21bf36

fix: ͽÌóºÑ¤ß¤Î̤¼Â¹ÔÏ¿²è¤Ërecomplete.php¤¬É¬ÍפʤΤÇÌᤷ¤¿
author Sushi-k <epgrec@park.mda.or.jp>
date Tue, 06 Apr 2010 11:03:45 +0900
parents 3bed74eca373
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
12
c4cb171f9453 new file: mediatomb.php
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
diff changeset
1 #!/usr/bin/php
c4cb171f9453 new file: mediatomb.php
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
diff changeset
2 <?php
111
3bed74eca373 change: EPG¼èÆÀÊÂÎ󲽤¬²Äǽ¤«¤É¤¦¤«¤òȽÄꤹ¤ë¤è¤¦¤ËÊѹ¹
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents: 65
diff changeset
3 $script_path = dirname( __FILE__ );
3bed74eca373 change: EPG¼èÆÀÊÂÎ󲽤¬²Äǽ¤«¤É¤¦¤«¤òȽÄꤹ¤ë¤è¤¦¤ËÊѹ¹
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents: 65
diff changeset
4 chdir( $script_path );
3bed74eca373 change: EPG¼èÆÀÊÂÎ󲽤¬²Äǽ¤«¤É¤¦¤«¤òȽÄꤹ¤ë¤è¤¦¤ËÊѹ¹
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents: 65
diff changeset
5 include_once( $script_path . '/config.php');
12
c4cb171f9453 new file: mediatomb.php
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
diff changeset
6 include_once(INSTALL_PATH.'/DBRecord.class.php');
13
b0fc647167f5 modified: mediatomb.php
yoneda <yoneda@debian.localnet.mda.or.jp>
parents: 12
diff changeset
7 include_once(INSTALL_PATH.'/reclib.php');
65
f8af9716f021 modified: mediatomb.php
Sushi-k <epgrec@park.mda.or.jp>
parents: 37
diff changeset
8 include_once(INSTALL_PATH.'/Settings.class.php');
37
e5f9aa34d06f change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents: 28
diff changeset
9
e5f9aa34d06f change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents: 28
diff changeset
10 $settings = Settings::factory();
12
c4cb171f9453 new file: mediatomb.php
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
diff changeset
11
c4cb171f9453 new file: mediatomb.php
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
diff changeset
12 try {
c4cb171f9453 new file: mediatomb.php
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
diff changeset
13
37
e5f9aa34d06f change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents: 28
diff changeset
14 $recs = DBRecord::createRecords(RESERVE_TBL );
12
c4cb171f9453 new file: mediatomb.php
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
diff changeset
15
c4cb171f9453 new file: mediatomb.php
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
diff changeset
16 // DB接続
37
e5f9aa34d06f change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents: 28
diff changeset
17 $dbh = mysql_connect( $settings->db_host, $settings->db_user, $settings->db_pass );
12
c4cb171f9453 new file: mediatomb.php
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
diff changeset
18 if( $dbh === false ) exit( "mysql connection fail" );
37
e5f9aa34d06f change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents: 28
diff changeset
19 $sqlstr = "use ".$settings->db_name;
12
c4cb171f9453 new file: mediatomb.php
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
diff changeset
20 mysql_query( $sqlstr );
c4cb171f9453 new file: mediatomb.php
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
diff changeset
21 $sqlstr = "set NAME utf8";
c4cb171f9453 new file: mediatomb.php
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
diff changeset
22 mysql_query( $sqlstr );
c4cb171f9453 new file: mediatomb.php
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
diff changeset
23
c4cb171f9453 new file: mediatomb.php
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
diff changeset
24 foreach( $recs as $rec ) {
16
cf19005e65d1 added: mysql_real_escape_string
Sushi-k <epgrec@park.mda.or.jp>
parents: 13
diff changeset
25 $title = mysql_real_escape_string($rec->title)."(".date("Y/m/d", toTimestamp($rec->starttime)).")";
28
9238c1d9e060 modified: mediatomb.php
yoneda <epgrec@park.mda.or.jp>
parents: 16
diff changeset
26 $sqlstr = "update mt_cds_object set metadata='dc:description=".mysql_real_escape_string($rec->description)."&epgrec:id=".$rec->id."' where dc_title='".$rec->path."'";
12
c4cb171f9453 new file: mediatomb.php
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
diff changeset
27 mysql_query( $sqlstr );
13
b0fc647167f5 modified: mediatomb.php
yoneda <yoneda@debian.localnet.mda.or.jp>
parents: 12
diff changeset
28 $sqlstr = "update mt_cds_object set dc_title='".$title."' where dc_title='".$rec->path."'";
12
c4cb171f9453 new file: mediatomb.php
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
diff changeset
29 mysql_query( $sqlstr );
c4cb171f9453 new file: mediatomb.php
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
diff changeset
30 }
c4cb171f9453 new file: mediatomb.php
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
diff changeset
31 }
c4cb171f9453 new file: mediatomb.php
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
diff changeset
32 catch( Exception $e ) {
c4cb171f9453 new file: mediatomb.php
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
diff changeset
33 exit( $e->getMessage() );
c4cb171f9453 new file: mediatomb.php
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
diff changeset
34 }
c4cb171f9453 new file: mediatomb.php
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
diff changeset
35 ?>