View previous topic :: View next topic |
Author |
Message |
jcr Modérateur français
Joined: 14 Apr 2006 Posts: 544 Location: France, Auvergne
|
Posted: Sat May 03, 2008 3:46 pm Post subject: |
|
|
Le script donné, en PHP, en première page d ece topic est capable de liste tous les points de montage d'un serveur, sur un port donné. Ensuite, à toi de comprendre la boucle de traitement du tableau de résultats pour savoir ce que tu veux afficher dans la liste _________________ Epsilon Friends Radio Icecast Radio on CentovaCast admin panel. Icecast hosting |
|
Back to top |
|
|
Anonymous Guest
|
Posted: Sat May 03, 2008 4:36 pm Post subject: |
|
|
ok
mais cela fait 3 semaines que je test sur plusieurs script
et celui j'ai pas compris ce qu il fallait mettre ici
Quote: |
radioname = getParam( 'RadioStation' ) ;
$host = getParam( 'RadioHost' ) ;
$port = getParam( 'RadioPort' ) ;
$pic = getParam( 'RadioInfo' ) ;
$radioConnect = getParam( 'RadioStreamURI' ) ; |
pour moi il faut mettre ceci
radioname = getParam( 'RadioStation' ) ; ici le nom de la radio
$host = getParam( 'RadioHost' ) ; ici le l'adresse ip de la radio
$port = getParam( 'RadioPort' ) ; ici le port de la radio
$pic = getParam( 'RadioInfo' ) ; mais ici je met quoi ?
$radioConnect = getParam( 'RadioStreamURI' ) ; et la quoi ?
merci
[/quote] |
|
Back to top |
|
|
jcr Modérateur français
Joined: 14 Apr 2006 Posts: 544 Location: France, Auvergne
|
|
Back to top |
|
|
Anonymous Guest
|
Posted: Sat May 03, 2008 7:09 pm Post subject: |
|
|
ok merci et celui c i
$pic = getParam( 'RadioInfo' ) ; mais ici je met quoi ? |
|
Back to top |
|
|
jcr Modérateur français
Joined: 14 Apr 2006 Posts: 544 Location: France, Auvergne
|
Posted: Sat May 03, 2008 7:14 pm Post subject: |
|
|
Les getParam(), c'est parce que l'exemple donné est un module pour Mambo/Joomla/Enfin
RadioInfo, c'est la ligne d'info sur la radio, genre: "Ma Super Radio" _________________ Epsilon Friends Radio Icecast Radio on CentovaCast admin panel. Icecast hosting |
|
Back to top |
|
|
Anonymous Guest
|
Posted: Sat May 03, 2008 7:30 pm Post subject: |
|
|
chez moi cela ne fonctionne pas
pourquoi ai je ce message voici le lien Direct Access to this location is not allowed.
http://modem.radio.free.fr//script%20radio/titresicecastseb.php
Quote: |
<div>
<center><br>
<?php
# Don't allow direct acces to the file
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
$radioname = getParam( 'Modem-Radio-flux-Souvenir' ) ;
$host = getParam( 'http://streaming.radionomy.com' ) ;
$port = getParam( '8000' ) ;
$pic = getParam( 'Modem-Radio-flux-Souvenir' ) ;
$radioConnect = getParam( 'http://streaming.radionomy.com:8000/Modem-Radio-flux-Souvenir.m3u' ) ;
/**
* Lab Radio
*/
$msg = http_get( "http://$host:$port/getradiostatus.xsl" ) ;
$spl = explode( '<pre>', $msg ) ;
$spl = str_replace( '</pre>', '', $spl[1] ) ;
$spl = explode( "<br/>", $spl ) ;
$flds = $spl[0] ;
$spl = explode( "\n", $flds ) ;
array_shift( $spl ) ;
$stations = array() ;
foreach ( $spl as $e ) {
if ( ( $e !== '_END_' ) && !empty( $e ) ) {
$p = explode( '|', $e ) ;
$stations[$p[0]]['Name'] = $p[1] ;
$stations[$p[0]]['Description'] = $p[2] ;
$stations[$p[0]]['Listeners'] = $p[9] ;
$stations[$p[0]]['Peak'] = $p[10] ;
$stations[$p[0]]['Artist'] = $p[14] ;
$stations[$p[0]]['Title'] = $p[13] ;
}
}
$curtitle = $stations['/jrplay']['Title'] ;
$curartist = $stations['/jrplay']['Artist'] ;
$listeners = $stations['/jrplay']['Listeners'] ;
$peak = $stations['/jrplay']['Peak'] ;
$stream = 'DJ Robot' ;
echo '<a href="' . $radioConnect .'">' . $pic . '</a><br />' . "\n" ;
if ( !empty( $stations['/jrlive']['Name'] ) ) {
$curtitle = $stations['/jrlive']['Title'] ;
$curartist = $stations['/jrlive']['Artist'] ;
$listeners = $stations['/jrlive']['Listeners'] ;
$peak = $stations['/jrlive']['Peak'] ;
$stream = str_replace( 'on FlyDance', '', $stations['/jrlive']['Name'] ) ;
}
$curtitle = str_replace( '_', '', $curtitle ) ;
$curartist = str_replace( '_', '', $curartist ) ;
echo '<font size="+1"><strong>' . $listeners .'</strong></font> (' . $peak . ') auditeurs écoutent<br />' ;
echo "DJ: <strong>$stream</strong><br />" ;
echo "$curartist<br />" ;
?>
</center> <br/>
</div> |
merci |
|
Back to top |
|
|
jcr Modérateur français
Joined: 14 Apr 2006 Posts: 544 Location: France, Auvergne
|
Posted: Sat May 03, 2008 8:43 pm Post subject: |
|
|
Si tu n'as pas Mambo/Joomla/Enfin comme soft CMS, commentes la ligne:
Code: |
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' ); |
L'exemple a été donné avec le code d'un module pour un site Enfin fonctionnel. Pour les autres scripts PHP il faut adapter un peu
Idem avec les fonctions getParam() qui, si elles n'existent pas dans ton CMS, doivent être remplacées par les valeurs que tu attends _________________ Epsilon Friends Radio Icecast Radio on CentovaCast admin panel. Icecast hosting |
|
Back to top |
|
|
Anonymous Guest
|
Posted: Sat May 03, 2008 8:53 pm Post subject: |
|
|
je n'est pas mambo
je comprend pas ce que tu veux dire par commente cette ligne
je met quoi ? et sinon ma config est elle bonne
merci |
|
Back to top |
|
|
jcr Modérateur français
Joined: 14 Apr 2006 Posts: 544 Location: France, Auvergne
|
Posted: Sun May 04, 2008 8:17 am Post subject: |
|
|
Effectivement, si tu n'utilises pas un CMS et ne connais rien à PHP, ce n'est pas gagné.
Pour commenter une ligne en PHP, on met un # devant.
Chez toi, les fonctions getParam() ne risquent pas de fonctionner non plus tu devras remplacer tous les appels par la valeur attendue. _________________ Epsilon Friends Radio Icecast Radio on CentovaCast admin panel. Icecast hosting |
|
Back to top |
|
|
Anonymous Guest
|
Posted: Sun May 04, 2008 8:45 am Post subject: |
|
|
donne moi un exemple s t p pour que le script fonctionne sans cms
merci davance je suis tres nul en php |
|
Back to top |
|
|
jcr Modérateur français
Joined: 14 Apr 2006 Posts: 544 Location: France, Auvergne
|
Posted: Sun May 04, 2008 12:44 pm Post subject: |
|
|
Code: |
<div>
<center><br>
<?php
$radioname = 'Modem-Radio-flux-Souvenir' ;
$host = 'streaming.radionomy.com' ;
$port = 8000 ;
$pic = 'Modem-Radio-flux-Souvenir.gif' ; // Icone pour écouter la radio
$radioConnect = 'http://streaming.radionomy.com:8000/Modem-Radio-flux-Souvenir.m3u' ;
// Voir le script radiostatus.xsl plus bas.
// Attention, vérifier que PHP ait bien l'extension HTTP compilée
// sinon cet appel va échouer
$msg = http_get( "http://$host:$port/getradiostatus.xsl" ) ;
$spl = explode( '<pre>', $msg ) ;
$spl = str_replace( '</pre>', '', $spl[1] ) ;
$spl = explode( "<br/>", $spl ) ;
$flds = $spl[0] ;
$spl = explode( "\n", $flds ) ;
array_shift( $spl ) ;
$stations = array() ;
foreach ( $spl as $e ) {
if ( ( $e !== '_END_' ) && !empty( $e ) ) {
$p = explode( '|', $e ) ;
$stations[$p[0]]['Name'] = $p[1] ;
$stations[$p[0]]['Description'] = $p[2] ;
$stations[$p[0]]['Listeners'] = $p[9] ;
$stations[$p[0]]['Peak'] = $p[10] ;
$stations[$p[0]]['Artist'] = $p[14] ;
$stations[$p[0]]['Title'] = $p[13] ;
}
}
// Remplcaer les /jrplay et /jrlive par les noms des flux
$curtitle = $stations['/jrplay']['Title'] ;
$curartist = $stations['/jrplay']['Artist'] ;
$listeners = $stations['/jrplay']['Listeners'] ;
$peak = $stations['/jrplay']['Peak'] ;
$stream = 'DJ Robot' ;
echo '<a href="' . $radioConnect .'">' . $pic . '</a><br />' . "\n" ;
if ( !empty( $stations['/jrlive']['Name'] ) ) {
$curtitle = $stations['/jrlive']['Title'] ;
$curartist = $stations['/jrlive']['Artist'] ;
$listeners = $stations['/jrlive']['Listeners'] ;
$peak = $stations['/jrlive']['Peak'] ;
$stream = str_replace( 'on FlyDance', '', $stations['/jrlive']['Name'] ) ;
}
$curtitle = str_replace( '_', '', $curtitle ) ;
$curartist = str_replace( '_', '', $curartist ) ;
echo '<font size="+1"><strong>' . $listeners .'</strong></font> (' . $peak . ') auditeurs écoutent<br />' ;
echo "DJ: <strong>$stream</strong><br />" ;
echo "$curartist<br />" ;
?>
|
_________________ Epsilon Friends Radio Icecast Radio on CentovaCast admin panel. Icecast hosting |
|
Back to top |
|
|
jcr Modérateur français
Joined: 14 Apr 2006 Posts: 544 Location: France, Auvergne
|
Posted: Sun May 04, 2008 12:49 pm Post subject: |
|
|
Le getradiostatus.xsl, à mettre dans le dossier web de icecast. Sous linux, ce dossier est en général dans /usr/share/icecast. Sous Windows, dans le dossier d'installation de icecast
Code: |
<xsl:stylesheet xmlns:xsl = "http://www.w3.org/1999/XSL/Transform" version = "1.0" >
<xsl:output omit-xml-declaration="no" method="xml" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" indent="yes" encoding="UTF-8" />
<xsl:template match = "/icestats" >
<pre>
MountPoint,Server Name,Description,Data Type,Bitrate,Quality,Video Quality,Frame Size,Frame Rate,Listeners,Peak Listeners,Genre,Server URL,Artist,Title
<xsl:for-each select="source">
<xsl:value-of select="@mount" />|<xsl:value-of select="server_name" />|<xsl:value-of select="server_description" />|<xsl:value-of select="server_type" />|<xsl:value-of select="bitrate" />|<xsl:value-of select="quality" />|<xsl:value-of select="video_quality" />|<xsl:value-of select="frame_size" />|<xsl:value-of select="frame_rate" />|<xsl:value-of select="listeners" />|<xsl:value-of select="listener_peak" />|<xsl:value-of select="genre" />|<xsl:value-of select="server_url" />|<xsl:value-of select="artist" />|<xsl:value-of select="title" />
_END_
</xsl:for-each>
</pre>
</xsl:template>
</xsl:stylesheet>
|
_________________ Epsilon Friends Radio Icecast Radio on CentovaCast admin panel. Icecast hosting |
|
Back to top |
|
|
Anonymous Guest
|
Posted: Sun May 04, 2008 1:44 pm Post subject: |
|
|
merci |
|
Back to top |
|
|
Anonymous Guest
|
Posted: Tue May 06, 2008 9:55 pm Post subject: |
|
|
Bonjour,
Je viens de tester votre scripte et j'ai une erreur :
Code: |
Fatal error: Call to undefined function http_get() in /var/www/web16/web/test/test.php on line 12 |
Cela doit venir de l'annotation que vous avez mis a propos de l'extension http.
Comment l'activer dans le php.ini?
Et il pas possible de faire autrement que ceci ?
Je vous remercie. |
|
Back to top |
|
|
jcr Modérateur français
Joined: 14 Apr 2006 Posts: 544 Location: France, Auvergne
|
Posted: Tue May 06, 2008 10:04 pm Post subject: |
|
|
l'extension PHP http est disponible ici http://pecl.php.net/package/pecl_http
Pour les serveurs Linux, Unix ou MacOS, elle s'installe par le très classique:
Code: |
phpize
./configure
make
sudo make install
|
Pour windows, il doit exister une dll préparée quelque part je pense.
Sans cette extension, il est possible d'utiliser l'extension Curl, mais qui est moins immédiate d'accès _________________ Epsilon Friends Radio Icecast Radio on CentovaCast admin panel. Icecast hosting |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2002 phpBB Group subRebel style by ktauber
|