1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>NOM DE TA RADIO</title>
<!-- Rafraichissement de la page toutes les 5 secondes -->
<meta http-equiv="refresh" content="5" />
<!-- Feuille de style -->
<style type="text/css">
body {
font-family : Arial;
width : 900px;
background-color : #034A79;
margin : 50px auto 0;
}
div {
-moz-border-radius : 8px 8px 8px 8px;
-moz-box-shadow : 0 0 50px black;
background-color : #E0EFF6;
border : 1px solid #599CD4;
padding : 20px;
color : #19B300;
font-weight : bold;
text-align : center;
}
span {
display : block;
color : #005A88;
margin-bottom : 25px;
}
</style>
</head>
<body>
<?php
error_reporting(E_ALL);
ini_set('display_errors','On');
// Définit le fuseau horaire à l'heure française
date_default_timezone_set('Europe/Paris');
// Affiche la date et l'heure qui sera traitée
echo date('l jS \of F Y h:i:s A');
// Selection du fichier
$fichier = file('C:\AudioLog\Histo_OR3_Diffuseurs\Zone_00\Diff_20140930.Log');
// Nombre total de ligne dans le fichier
$total = count($fichier);
// Récupération de la ligne contenant le titre
$ligne = $fichier[$total - 18];
// Récupération uniquement du titre - On supprime les balises a droite et a gauche
$coupeGauche = strpos($ligne, ">" );
$interprete = substr($ligne, $coupeGauche+1);
$coupeDroite = strpos($interprete, "<" );
$interprete = trim(substr($interprete, 0, $coupeDroite));
// Récupération de la ligne contenant l'interprete
$ligne = $fichier[$total - 59];
// Récupération uniquement de interprete - On supprime les balises a droite et a gauche
$coupeGauche = strpos($ligne, ">" );
$titre = substr($ligne, $coupeGauche+1);
$coupeDroite = strpos($titre, "<" );
$titre = trim(substr($titre, 0, $coupeDroite));
// Creation de la ligne contenant 'Interprete - Titre de la chanson'
$chanson = $interprete." - ".$titre;
// Ouverture du fichier en mode écriture
$cheminTitre = 'C:\AudioLog\titrage.txt';
$titre = fopen($cheminTitre, 'w+');
// On ajoute la chanson dans le fichier
fputs($titre, $chanson);
// On ferme et enregistre le fichier
fclose($titre);
?>
<?php
// Affichage de la dernière actualisation pour le titrage
setlocale (LC_TIME, 'fr_FR.utf8','fra');
$heures = strftime("%H" );
$heure = $heures.strftime("h%M et %S secondes" );
$actualisation = ucfirst(strftime("%A %d %B à $heure" ));
echo "
<div>
<h2>Dernière actualisation pour le titre</h2>
<br/>
<span>$actualisation</span>
</div>
";
?>
</body> |
Partager