コード例 #1
0
ファイル: index.php プロジェクト: skaligotla/kplaylist
 function xml_link($sid, $encode = false)
 {
     $f2 = new file2($sid, true);
     if ($f2->ifexists()) {
         $fd = new filedesc($f2->fname);
         if ($fd->found && $fd->m3u) {
             $url = httpstreamheader3($fd->fid, $sid, $f2, UTF8MODE);
             if (strlen($url) > 0) {
                 $id3 = $f2->getid3();
                 $title = '';
                 if (is_numeric($id3['track']) && $id3['track'] > 0) {
                     $title .= lzero($id3['track']) . '. ';
                 }
                 $title .= $f2->gentitle(array('title'));
                 $imgurl = '';
                 $ci = new coverinterface();
                 $ci->setartist($f2->id3['artist'], $f2->id3['album']);
                 $ci->setlocation($f2->drive, $f2->relativepath);
                 if ($ci->coverexists()) {
                     $ci->geturl($imgurl, true, true);
                 }
                 $this->items[] = array($imgurl, $url, $title, $fd->extension, $id3['length']);
             }
         }
     }
 }
コード例 #2
0
ファイル: index.php プロジェクト: Git-Host/AMPPS
 function xml_link($sid, $encode = false)
 {
     $f2 = new file2($sid, true);
     if ($f2->ifexists()) {
         $fd = new filedesc($f2->fname);
         if ($fd->found && $fd->m3u) {
             $url = httpstreamheader3($fd->fid, $sid, $f2);
             if (strlen($url) > 0) {
                 $title = $f2->gentitle(array('title'));
                 $creator = $f2->id3['artist'];
                 $kpi = new kpimage(false, $f2->drive, $f2->relativepath);
                 if ($kpi->find()) {
                     $kpi->resize();
                     $imgurl = $kpi->geturl(true);
                 } else {
                     $imgurl = '';
                 }
                 if ($encode) {
                     $imgurl = urlencode($imgurl);
                     $url = urlencode($url);
                 }
                 $this->data .= '<track>' . $this->crlf;
                 $this->data .= '<title>' . $title . '</title>' . $this->crlf;
                 $this->data .= '<creator>' . $creator . '</creator>' . $this->crlf;
                 $this->data .= '<image>' . $imgurl . '</image>' . $this->crlf;
                 $this->data .= '<location>' . $url . '</location>' . $this->crlf;
                 $this->data .= '</track>' . $this->crlf;
             }
         }
     }
 }