annotate mediatomb.php @ 45:a48ea70993a3

fix: bug
author Sushi-k <epgrec@park.mda.or.jp>
date Tue, 28 Jul 2009 17:07:46 +0900
parents e5f9aa34d06f
children f8af9716f021
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
c4cb171f9453 new file: mediatomb.php
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
diff changeset
3
c4cb171f9453 new file: mediatomb.php
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
diff changeset
4 include_once('config.php');
c4cb171f9453 new file: mediatomb.php
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
diff changeset
5 include_once(INSTALL_PATH.'/DBRecord.class.php');
13
b0fc647167f5 modified: mediatomb.php
yoneda <yoneda@debian.localnet.mda.or.jp>
parents: 12
diff changeset
6 include_once(INSTALL_PATH.'/reclib.php');
37
e5f9aa34d06f change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents: 28
diff changeset
7 include_once(INSTALL_PATH.'Settings.class.php');
e5f9aa34d06f change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents: 28
diff changeset
8
e5f9aa34d06f change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents: 28
diff changeset
9 $settings = Settings::factory();
12
c4cb171f9453 new file: mediatomb.php
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
diff changeset
10
c4cb171f9453 new file: mediatomb.php
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
diff changeset
11 try {
c4cb171f9453 new file: mediatomb.php
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
diff changeset
12
37
e5f9aa34d06f change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents: 28
diff changeset
13 $recs = DBRecord::createRecords(RESERVE_TBL );
12
c4cb171f9453 new file: mediatomb.php
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
diff changeset
14
c4cb171f9453 new file: mediatomb.php
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
diff changeset
15 // DB接続
37
e5f9aa34d06f change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents: 28
diff changeset
16 $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
17 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
18 $sqlstr = "use ".$settings->db_name;
12
c4cb171f9453 new file: mediatomb.php
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
diff changeset
19 mysql_query( $sqlstr );
c4cb171f9453 new file: mediatomb.php
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
diff changeset
20 $sqlstr = "set NAME utf8";
c4cb171f9453 new file: mediatomb.php
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
diff changeset
21 mysql_query( $sqlstr );
c4cb171f9453 new file: mediatomb.php
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
diff changeset
22
c4cb171f9453 new file: mediatomb.php
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
diff changeset
23 foreach( $recs as $rec ) {
16
cf19005e65d1 added: mysql_real_escape_string
Sushi-k <epgrec@park.mda.or.jp>
parents: 13
diff changeset
24 $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
25 $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
26 mysql_query( $sqlstr );
13
b0fc647167f5 modified: mediatomb.php
yoneda <yoneda@debian.localnet.mda.or.jp>
parents: 12
diff changeset
27 $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
28 mysql_query( $sqlstr );
c4cb171f9453 new file: mediatomb.php
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
diff changeset
29 }
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 catch( Exception $e ) {
c4cb171f9453 new file: mediatomb.php
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
diff changeset
32 exit( $e->getMessage() );
c4cb171f9453 new file: mediatomb.php
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
diff changeset
33 }
c4cb171f9453 new file: mediatomb.php
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
diff changeset
34 ?>