チェンジセット 122

差分発生行の前後
無視リスト:
コミット日時:
2010/10/07 10:43:38 (14 年前)
コミッタ:
sorshi
ログメッセージ:

EPGのDB格納形式を全角英数から半角英数に変更。
EPGタイトルが消えてしまう不具合修正。
DBへ重複登録されてしまう不具合を修正。

ファイル:

凡例:

変更無し
追加
削除
更新
コピー
移動
  • trunk/install/perl/db/Pg.pl

    r121 r122  
    7474 
    7575'xmltv2foltia.replaceepg.1' => "SELECT * FROM foltia_epg WHERE enddatetime > ? AND startdatetime < ? AND ontvchannel = ? AND startdatetime > ?", 
     76'xmltv2foltia.replaceepg.2' => "SELECT * FROM foltia_epg WHERE startdatetime = ? AND enddatetime = ? AND ontvchannel = ? ", 
    7677'xmltv2foltia.commitdb.1' => "DELETE FROM foltia_epg WHERE epgid = ?", 
    7778'xmltv2foltia.commitdb.2' => "INSERT INTO foltia_epg VALUES ( nextval('foltia_epg_epgid_seq'), ?, ?, ?, ?, ?, ?, ?)" , 
  • trunk/install/perl/xmltv2foltia.pl

    r121 r122  
    127127        chomp(); 
    128128        $item{title}  = &removetag($_); 
    129         $item{title} =~ s/【.*】//g;#【解】とか 
    130         $item{title} =~ s/\[.*\]//g;#[二]とか  
     129        $item{title} =~ s/【.*?】//g;#【解】とか 
     130        $item{title} =~ s/\[.*?\]//g;#[二]とか  
    131131        #print Dumper($_) ; 
    132132        #print "$result  \n"; 
     
    232232        #&writelog("xmltv2foltia DEBUG push(\@deleteepgid,$data[0]);"); 
    233233}#end while  
     234 
     235#上書きを消す 
     236$sth = $dbh->prepare($stmt{'xmltv2foltia.replaceepg.2'}); 
     237$sth->execute($foltiastarttime , $foltiaendtime , $ontvepgchannel); 
     238while (@data = $sth->fetchrow_array()) { 
     239        push(@deleteepgid,$data[0]); 
     240        #&writelog("xmltv2foltia DEBUG push(\@deleteepgid,$data[0]);"); 
     241}#end while  
     242 
    234243}#endsub replaceepg 
    235244 
     
    241250my $desc = $_[4]; 
    242251my $category = $_[5]; 
     252 
     253#Encode::JP::H2Z::z2h(\$string); 
     254$title = jcode($title)->tr('A-Za-z0-9!#$%&()*+,−./:;<=>?@[\]^_`{|}','A-Za-z0-9!#$%&()*+,-./:;<=>?@[\]^_`{|}'); 
     255$desc = jcode($desc)->tr('A-Za-z0-9!#$%&()*+,−./:;<=>?@[\]^_`{|}','A-Za-z0-9!#$%&()*+,-./:;<=>?@[\]^_`{|}'); 
    243256 
    244257#&writelog("xmltv2foltia DEBUG $foltiastarttime:$foltiaendtime"); 
     
    288301        $sth = $dbh->prepare($stmt{'xmltv2foltia.commitdb.1'}); 
    289302        $sth->execute( $delid ) || warn "$delid\n"; 
    290 #      &writelog("xmltv2foltia DEBUG : DELETE FROM foltia_epg WHERE epgid = $delid"); 
     303       #&writelog("xmltv2foltia DEBUG $stmt{'xmltv2foltia.commitdb.1'}/$delid"); 
    291304} 
    292305#追加 
     
    294307        $sth = $dbh->prepare($stmt{'xmltv2foltia.commitdb.2'}); 
    295308        $sth->execute( $foltiastarttime[$i],$foltiaendtime[$i], $lengthmin[$i], $channel[$i], $title[$i], $desc[$i], $category[$i]) || warn "error: $foltiastarttime, $foltiaendtime, $lengthmin, $channel, $title, $desc, $category\n"; 
    296 #&writelog("xmltv2foltia DEBUG : INSERT INTO foltia_epg VALUES ( NULL , $foltiastarttime[$i],$foltiaendtime[$i], $lengthmin[$i], $channel[$i], $title[$i], $desc[$i], $category[$i])"); 
     309       #&writelog("xmltv2foltia DEBUG $stmt{'xmltv2foltia.commitdb.2'}/$foltiastarttime[$i],$foltiaendtime[$i], $lengthmin[$i], $channel[$i], $title[$i], $desc[$i], $category[$i]"); 
    297310}# end for 
    298311$dbh->commit; 
  • trunk/install/php/reserveepg.php

    r94 r122  
    201201</table> 
    202202 
     203<input type=\"hidden\" name=\"epgid\" value=\"$epgid\" /> 
    203204<input type=\"hidden\" name=\"stationid\" value=\"$stationid\" /> 
    204205<input type=\"hidden\" name=\"subtitle\" value=\"$progname $progdesc\" /> 
  • trunk/install/php/reserveepgcomp.php

    r94 r122  
    5252<?php 
    5353 
    54 $stationid = getnumform(stationid); 
     54/* $stationid = getnumform(stationid); 
    5555$subtitle = getform(subtitle); 
    5656$startdatetime = getnumform(startdatetime); 
    5757$enddatetime = getnumform(enddatetime); 
    58 $lengthmin = getnumform(lengthmin); 
     58$lengthmin = getnumform(lengthmin); */ 
     59$epgid = getnumform(epgid); 
    5960 
    60                 if ($stationid == "" || $startdatetime < 0 ||  $enddatetime < 0 || $lengthmin < 0) { 
     61                if ($epgid == "" ) { 
    6162                print " <title>foltia:EPG予約:Error</title></head>\n"; 
    6263                die_exit("登録番組がありません<BR>"); 
     
    6566</head>\n"; 
    6667$now = date("YmdHi");    
     68//タイトル取得 
     69        $query = " 
     70        SELECT epgid,startdatetime,enddatetime,lengthmin, ontvchannel,epgtitle,epgdesc,epgcategory ,  
     71        stationname , stationrecch ,stationid  
     72        FROM foltia_epg , foltia_station  
     73        WHERE epgid = ? AND foltia_station.ontvcode = foltia_epg.ontvchannel 
     74        "; 
     75        $rs = sql_query($con, $query, "DBクエリに失敗しました",array($epgid)); 
     76$rowdata = $rs->fetch(); 
     77if (! $rowdata) { 
     78                die_exit("登録番組がありません。もう一度EPGに戻り操作して下さい。<BR>"); 
     79}else{ 
     80$stationid = $rowdata[10]; 
     81$subtitle = $rowdata[5] . $rowdata[6]; 
     82$startdatetime = $rowdata[1]; 
     83$enddatetime = $rowdata[2]; 
     84$lengthmin = $rowdata[3]; 
     85} 
     86 
     87 
     88 
    6789// - DB登録作業 
    6890 
     
    147169 
    148170 
    149 print "<table width=\"100%\" border=\"0\"> 
    150     <tr><td>放送開始</td><td>$startdatetime</td></tr> 
    151     <tr><td>放送終了</td><td>$enddatetime</td></tr> 
    152     <tr><td>局コード</td><td>$stationid</td></tr> 
    153     <tr><td>尺(分)</td><td>$lengthmin</td></tr> 
    154     <tr><td>番組名</td><td>$subtitle</td></tr> 
    155          
    156 </tbody> 
    157 </table>"; 
     171print "<table width=\"100%\" border=\"0\">\n"; 
     172print "<tr><td>放送開始</td><td>".htmlspecialchars($startdatetime)."</td></tr>"; 
     173print "<tr><td>放送終了</td><td>".htmlspecialchars($enddatetime)."</td></tr>\n"; 
     174print "<tr><td>局コード</td><td>".htmlspecialchars($stationid)."</td></tr>\n"; 
     175print "<tr><td>尺(分)</td><td>".htmlspecialchars($lengthmin)."</td></tr>\n"; 
     176print "<tr><td>番組名</td><td>".htmlspecialchars($subtitle)."</td></tr>\n"; 
     177print "</tbody>\n</table>"; 
    158178 
    159179?> 
track feed