- コミット日時:
- 2010/10/13 21:01:58 (14 年前)
- ファイル:
凡例:
- 変更無し
- 追加
- 削除
- 更新
- コピー
- 移動
trunk/install/perl/db/Pg.pl
r122 r124 28 28 'foltialib.getfilestatus.1' => "SELECT filestatus FROM foltia_subtitle WHERE pid = ?", 29 29 'foltialib.pid2sid.1' => "SELECT stationid FROM foltia_subtitle WHERE pid = ?", 30 'foltialib.mp4filename2tid.1' => "SELECT tid FROM foltia_subtitle WHERE PSPfilename = ?", 30 31 31 32 'getxml2db.1' => "SELECT count(*) FROM foltia_program WHERE tid = ?", trunk/install/perl/deletemovie.pl
r97 r124 14 14 # 15 15 # 16 use DBI; 17 use DBD::Pg; 18 use DBD::SQLite; 16 19 17 20 $path = $0; … … 32 35 33 36 #ファイル名正当性チェック 34 if ($fname =~ /.m2p$|.m2t$|. aac$/){37 if ($fname =~ /.m2p$|.m2t$|.MP4$|.aac$/){ 35 38 36 39 }else{ … … 40 43 } 41 44 45 #DB初期化 46 $dbh = DBI->connect($DSN,$DBUser,$DBPass) ||die $DBI::error;; 47 42 48 #ファイル存在チェック 43 49 my $tid = &mp4filename2tid($fname); 50 my $mp4dirname = &makemp4dir($tid); 44 51 if (-e "$recfolderpath/$fname"){ 45 52 $filemovepath = $recfolderpath; 53 }elsif(-e "$mp4dirname/$fname"){ 54 $filemovepath = $mp4dirname; 46 55 }else{ 47 56 # print "deletemovie file not found.$recfolderpath/$fname\n"; … … 52 61 #既読削除処理 53 62 if ($rapidfiledelete > 0){ #./mita/へ移動 54 system ("mv $ recfolderpath/$fname $recfolderpath/mita/");55 &writelog("deletemovie mv $recfolderpath/$fname $recfolderpath/mita/.");63 system ("mv $filemovepath/$fname $recfolderpath/mita/"); 64 &writelog("deletemovie mv filemovepath/$fname $recfolderpath/mita/."); 56 65 }else{ #即時削除 57 system ("rm $ recfolderpath/$fname ");58 &writelog("deletemovie rm $ recfolderpath/$fname ");66 system ("rm $filemovepath/$fname "); 67 &writelog("deletemovie rm $filemovepath/$fname "); 59 68 60 69 trunk/install/perl/foltialib.pl
r111 r124 399 399 400 400 401 401 sub mp4filename2tid{ 402 #MPEG4ファイル名からTIDを得る 403 my $mp4filename = $_[0]; 404 405 my $sth; 406 $sth = $dbh->prepare($stmt{'foltialib.mp4filename2tid.1'}); 407 $sth->execute($mp4filename); 408 my @statusinfo = $sth->fetchrow_array; 409 my $tid = $statusinfo[0]; 410 411 if ($tid eq ""){ 412 return 0 ; 413 }else{ 414 return $tid; 415 } 416 }#end sub mp4filename2tid 402 417 403 418 trunk/install/php/deletemovie.php
r97 r124 75 75 <tbody>"; 76 76 77 78 79 80 77 foreach ($delete as $fName) { 81 78 82 $filesplit = split("-",$fName); 83 84 /* 85 if ($filesplit[1] == ""){ 79 if( preg_match('/.MP4$/',$fName)){ //拡張子がMP4なら録画ライブラリ番組個別表示での削除 (showlibc.php) 86 80 $query = " 87 SELECT 88 foltia_program.tid,foltia_program.title,foltia_subtitle.subtitle 89 FROM foltia_subtitle , foltia_program 90 WHERE foltia_program.tid = foltia_subtitle.tid 91 AND foltia_subtitle.tid = ? 81 SELECT 82 foltia_subtitle.pspfilename, 83 foltia_program.title, 84 foltia_subtitle.countno, 85 foltia_subtitle.subtitle 86 FROM foltia_subtitle,foltia_program 87 WHERE foltia_subtitle.tid = foltia_program.tid AND foltia_subtitle.pspfilename = ? 88 LIMIT 1"; 89 90 $rs = sql_query($con, $query, "DBクエリに失敗しました",array($fName)); 91 $rall = $rs->fetch(); 92 $rowdata = $rall[0]; 93 94 $title = htmlspecialchars($rall[1]); 95 $count = htmlspecialchars($rall[2]); 96 $subtitle = htmlspecialchars($rall[3]); 97 98 print " 99 <tr> 100 <td>$fName<br></td> 101 <td>"; 102 103 if ($tid > 0 ){ 104 print "<a href=\"http://cal.syoboi.jp/tid/$tid\" target=\"_blank\">$title</a>"; 105 }else{ 106 print "$title"; 107 } 108 109 print "</td> 110 <td>$count<br></td> 111 <td>$subtitle<br></td> 112 </tr>\n 92 113 "; 93 $rs = sql_query($con, $query, "DBクエリに失敗しました",array($filesplit[0])); 94 $rall = $rs->fetchAll(); 95 //$rowdata = $rall[$row]; 96 $rowdata = $rall[0]; 97 $title = $rowdata[1]; 98 $subtitle = ""; 99 $count = ""; 100 */ 101 //}else{ 114 115 //DBから削除 116 if ($demomode){ 117 }else{ 118 119 $query = " 120 DELETE FROM foltia_mp4files 121 WHERE mp4filename = ? 122 "; 123 //$rs = m_query($con, $query, "DBクエリに失敗しました"); 124 $rs = sql_query($con, $query, "DBクエリに失敗しました",array($fName)); 125 126 //削除処理 127 $oserr = system("$toolpath/perl/deletemovie.pl $fName"); 128 }//end if demomode 129 130 }else{ //拡張子がMP4以外なら 録画一覧(録画順・番組順)の削除(showplaylist.php) 102 131 103 132 $query = " … … 112 141 $rs = sql_query($con, $query, "DBクエリに失敗しました",array($fName)); 113 142 $rall = $rs->fetchAll(); 114 //$rowdata = $rall[$row];115 143 $rowdata = $rall[0]; 116 //print" $fName./$rowdata[1]/$rowdata[2]/$rowdata[3]<BR>\n";117 144 $title = $rowdata[1]; 118 145 $count = $rowdata[2]; 119 146 $subtitle = $rowdata[3]; 120 121 //}//end if 話数がNULL122 147 123 148 $tid = htmlspecialchars($rowdata[0]); … … 158 183 }//end if demomode 159 184 185 }//end if .MP4拡張子分岐 186 160 187 }//foreach 161 188 trunk/install/php/showlibc.php
r119 r124 64 64 } 65 65 66 66 ?> 67 68 69 <?php 67 70 ////////////////////////////////////////////////////////// 68 71 //1ページの表示レコード数 69 $lim = 5 2;72 $lim = 53; 70 73 //クエリ取得 71 74 $p = getgetnumform(p); … … 117 120 <p align=\"left\">再生可能ムービーを表示します。<br>"; 118 121 if ($tid == 0){ 119 print "$title 【<A HREF = \"./folcast.php?tid=$tid\">この番組のFolcast</A> [<a href=\"itpc://$serveruri/folcast.php?tid=$tid\">iTunesに登録</a>】 <br>\n";122 print "$title 【<A HREF = \"./folcast.php?tid=$tid\">この番組のFolcast</A> [<a href=\"itpc://$serveruri/folcast.php?tid=$tid\">iTunesに登録</a>]】 <br>\n"; 120 123 }else{ 121 124 print "<a href=\"http://cal.syoboi.jp/tid/" . 122 htmlspecialchars($tid) . "\" target=\"_blank\">$title</a> 【<A HREF = \"./folcast.php?tid=$tid\">この番組のFolcast</A> [<a href=\"itpc://$serveruri/folcast.php?tid=$tid\">iTunesに登録</a>]】 <br>\n"; 125 htmlspecialchars($tid) . "\" target=\"_blank\">$title</a> 126 【<A HREF = \"./folcast.php?tid=$tid\">この番組のFolcast</A> 127 [<a href=\"itpc://$serveruri/folcast.php?tid=$tid\">iTunesに登録</a>]】 <br>\n"; 123 128 } 124 129 }// endif if(ereg("iPhone",$useragent)) … … 139 144 $serverfqdn = getserverfqdn(); 140 145 146 141 147 //Autopager 142 148 echo "<div id=contents class=autopagerize_page_element />"; 149 ?> 150 151 <form name="deletemovie" method="POST" action="./deletemovie.php"> 152 <p align="left"><input type="submit" value="項目削除" ></p> 153 154 155 <?php 143 156 144 157 ///////////////////////////////////////////////////////// … … 199 212 "; 200 213 } 214 201 215 do { 202 216 $title = $rowdata[1]; … … 221 235 $pid = htmlspecialchars($rowdata[6]); 222 236 $fName = htmlspecialchars($rowdata[7]); 237 223 238 if (ereg(".MP4", $fName)){ 224 239 $thumbnail = $fName; … … 271 286 print "\n <td><a href = \"http://cal.syoboi.jp/tid/$tid/time#$pid\" target=\"_blank\">$subtitle</a></td>"; 272 287 }//if 288 289 273 290 print " </tr> 274 291 <tr> … … 276 293 </tr> 277 294 <tr> 278 <td><a href =\"$httpmediamappath/$tid.localized/mp4/$fName\" target=\"_blank\">$fName</A> / <a href=\"./mp4player.php?p=$pid\" target=\"_blank\">Player</a> / <script language=\"JavaScript\" type=\"text/javascript\">QT_WriteOBJECT_XHTML('http://g.hatena.ne.jp/images/podcasting.gif','16','16','','controller','FALSE','href','http://$serverfqdn/$httpmediamappath/$tid.localized/mp4/$fName','target','QuickTimePlayer','type','video/mp4');</script> $caplink</td> 295 <td><INPUT TYPE='checkbox' NAME='delete[]' VALUE='$fName'>削除 / 296 <a href =\"$httpmediamappath/$tid.localized/mp4/$fName\" target=\"_blank\">$fName</A> / 297 <a href=\"./mp4player.php?p=$pid\" target=\"_blank\">Player</a> / 298 <script language=\"JavaScript\" type=\"text/javascript\">QT_WriteOBJECT_XHTML('http://g.hatena.ne.jp/images/podcasting.gif','16','16','','controller','FALSE','href','http://$serverfqdn/$httpmediamappath/$tid.localized/mp4/$fName','target','QuickTimePlayer','type','video/mp4');</script> $caplink</td> 279 299 </tr> 280 300 "; 301 281 302 282 303 }//endif iPhone … … 301 322 ////////////////////////////////////////////// 302 323 ?> 324 303 325 </body> 304 326 </html>