annotate mediatomb.php @ 18:19cd7816b2c1

change: draw main program table too fast.
author Sushi-k <epgrec@park.mda.or.jp>
date Thu, 16 Jul 2009 11:54:24 +0900
parents cf19005e65d1
children 9238c1d9e060
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');
12
c4cb171f9453 new file: mediatomb.php
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
diff changeset
7
c4cb171f9453 new file: mediatomb.php
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
diff changeset
8 try {
c4cb171f9453 new file: mediatomb.php
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
diff changeset
9
c4cb171f9453 new file: mediatomb.php
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
diff changeset
10 $recs = DBRecord::createRecords(TBL_PREFIX.RESERVE_TBL );
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 // DB接続
c4cb171f9453 new file: mediatomb.php
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
diff changeset
13 $dbh = mysql_connect( DB_HOST, DB_USER, DB_PASS );
c4cb171f9453 new file: mediatomb.php
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
diff changeset
14 if( $dbh === false ) exit( "mysql connection fail" );
c4cb171f9453 new file: mediatomb.php
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
diff changeset
15 $sqlstr = "use ".DB_NAME;
c4cb171f9453 new file: mediatomb.php
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
diff changeset
16 mysql_query( $sqlstr );
c4cb171f9453 new file: mediatomb.php
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
diff changeset
17 $sqlstr = "set NAME utf8";
c4cb171f9453 new file: mediatomb.php
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
diff changeset
18 mysql_query( $sqlstr );
c4cb171f9453 new file: mediatomb.php
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
diff changeset
19
c4cb171f9453 new file: mediatomb.php
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
diff changeset
20 foreach( $recs as $rec ) {
16
cf19005e65d1 added: mysql_real_escape_string
Sushi-k <epgrec@park.mda.or.jp>
parents: 13
diff changeset
21 $title = mysql_real_escape_string($rec->title)."(".date("Y/m/d", toTimestamp($rec->starttime)).")";
cf19005e65d1 added: mysql_real_escape_string
Sushi-k <epgrec@park.mda.or.jp>
parents: 13
diff changeset
22 $sqlstr = "update mt_cds_object set metadata='dc:description=".mysql_real_escape_string($rec->description)."' where dc_title='".$rec->path."'";
12
c4cb171f9453 new file: mediatomb.php
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
diff changeset
23 mysql_query( $sqlstr );
13
b0fc647167f5 modified: mediatomb.php
yoneda <yoneda@debian.localnet.mda.or.jp>
parents: 12
diff changeset
24 $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
25 mysql_query( $sqlstr );
c4cb171f9453 new file: mediatomb.php
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
diff changeset
26 }
c4cb171f9453 new file: mediatomb.php
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
diff changeset
27 }
c4cb171f9453 new file: mediatomb.php
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
diff changeset
28 catch( Exception $e ) {
c4cb171f9453 new file: mediatomb.php
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
diff changeset
29 exit( $e->getMessage() );
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 ?>