51 lines
1.8 KiB
PHP
51 lines
1.8 KiB
PHP
<?php
|
||
|
||
//script icecast
|
||
require_once __DIR__ . '/conf/streaminfo.conf.php';
|
||
require_once __DIR__ .'/icecast.php';
|
||
require_once __DIR__ .'/deezer-api.php';
|
||
|
||
//parse
|
||
$server = $icecastUrl.":".$icecastPort;
|
||
$etat = getStreamStatus($server, $icecastMountPoint);
|
||
$streamInfo = getStreamInfo($server, $icecastMountPoint, $icecastIndexNbListeners, $icecastIndexCurrentPlaying);
|
||
$interpTitre = $streamInfo['currently_playing'];
|
||
$titre = $streamInfo['titre'];
|
||
$interp = $streamInfo['artiste'];
|
||
$auditeurs = $streamInfo['auditeurs'];
|
||
//$lienInfo="https://www.deezer.com/search/".$interpTitre;
|
||
$lienInfo="https://www.last.fm/search?q=".$interp."+".$titre;
|
||
$cover = getCoverOf($interp." ".$titre);
|
||
|
||
// Si zcover non référencée
|
||
if ($cover=="1" or $interp=="Radio Mercure") {
|
||
$cover = "img/subcover/".$subCover;
|
||
}
|
||
|
||
// Si aucune info
|
||
if ($interp=="" and $titre=="") {
|
||
$interp = "Aucune information";
|
||
$titre = "disponible";
|
||
$labelAuditeurs = "Indisponible";
|
||
}
|
||
//Si nb auditeurs > 1
|
||
if($auditeurs>1){
|
||
$labelAuditeurs = "auditeurs écoutent :";
|
||
} else {
|
||
$labelAuditeurs = "auditeur écoute :";
|
||
}
|
||
?>
|
||
<table>
|
||
<tr>
|
||
<td style="width: 150px;">
|
||
<a title="Plus d'infos sur ce titre" target="_blank" href="<?php echo $lienInfo; ?>">
|
||
<img style="width: 120px; border-radius: 10px;" src="<?php echo $cover; ?>"></a>
|
||
</td><td style="width: 10px;"></td>
|
||
<td style="vertical-align: middle; font-size: 22px; width: 350px;"><i><span style="color: green; font-size: 20px;"><?php echo $auditeurs." ".$labelAuditeurs; ?></span></i><br />
|
||
<b><?php echo $interp; ?></b><br />
|
||
<?php echo $titre; ?>
|
||
</td>
|
||
<td style="vertical-align: middle; font-size: 25px; width: 10px;"><a style="text-decoration: none;" title="Plus d'infos sur ce titre" target="_blank" href="<?php echo $lienInfo; ?>">ℹ</a></td>
|
||
</tr>
|
||
</table>
|