En el directorio root del sistema crean el archivo radio.php y adentro insertan el siguiente codigo:
radio.php
<?php
/***************************************************************************
* radio.php
* -------------------
* begin : Friday, April 18, 2008
* copyright : (C) 2008 Sein Kraft
* email : seinkraft@hotmail.com
*
* $Id: radio.php,v 2.0.7 2008/04/18 10:16:30 ngoctu Exp $
*
***************************************************************************/
/***************************************************************************
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
***************************************************************************/
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.' . $phpEx);
// Start session management
$userdata = defined('IS_ICYPHOENIX') ? session_pagestart($user_ip) : session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
// End session management
/*
+----------------------------------------------------------
| Start output the page
+----------------------------------------------------------
*/
$page_title = $lang['Radio_Radio'];
$meta_description = $lang['Radio_Radio'];
$meta_keywords = $lang['Radio_Radio'];
include($phpbb_root_path . 'includes/radio_header.' . $phpEx);
include($phpbb_root_path . 'radio_info.' . $phpEx);
$template->set_filenames(array('body' => 'radio.tpl'));
$template->assign_vars(array(
'HISTORY' => $history,
'ENCODERS' => $encoders_started,
'FORMAT' => $relays_format,
'BITRATE' => $relays_bitrate,
'VIEWERS' => $relays_viewers,
'VIEWERS_MAX' => $relays_viewes_max,
'L_RADIO' => $lang['Radio_Radio'],
'L_RADIO_STATUS' => $lang['Radio_Status'],
'L_RADIO_FORMAT' => $lang['Radio_Format'],
'L_RADIO_BITRATE' => $lang['Radio_Bitrate'],
'L_RADIO_FREQUENCY' => $lang['Radio_Frequency'],
'L_RADIO_LISTENERS' => $lang['Radio_Listeners'],
'L_RADIO_LISTEN' => $lang['Radio_Listen'],
'L_RADIO_LATEST' => $lang['Radio_Latest'],
'L_RADIO_LENGHT' => $lang['Radio_Lenght'],
'L_RADIO_SONG' => $lang['Radio_Song'],
'L_RADIO_ARTIST' => $lang['Radio_Artist'],
'L_RADIO_ALBUM' => $lang['Radio_Album'],
'L_RADIO_YEAR' => $lang['Radio_Year'])
);
// Generate the page
$template->pparse('body');
include($phpbb_root_path . 'includes/page_tail.' . $phpEx);
?>
/***************************************************************************
* radio.php
* -------------------
* begin : Friday, April 18, 2008
* copyright : (C) 2008 Sein Kraft
* email : seinkraft@hotmail.com
*
* $Id: radio.php,v 2.0.7 2008/04/18 10:16:30 ngoctu Exp $
*
***************************************************************************/
/***************************************************************************
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
***************************************************************************/
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.' . $phpEx);
// Start session management
$userdata = defined('IS_ICYPHOENIX') ? session_pagestart($user_ip) : session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
// End session management
/*
+----------------------------------------------------------
| Start output the page
+----------------------------------------------------------
*/
$page_title = $lang['Radio_Radio'];
$meta_description = $lang['Radio_Radio'];
$meta_keywords = $lang['Radio_Radio'];
include($phpbb_root_path . 'includes/radio_header.' . $phpEx);
include($phpbb_root_path . 'radio_info.' . $phpEx);
$template->set_filenames(array('body' => 'radio.tpl'));
$template->assign_vars(array(
'HISTORY' => $history,
'ENCODERS' => $encoders_started,
'FORMAT' => $relays_format,
'BITRATE' => $relays_bitrate,
'VIEWERS' => $relays_viewers,
'VIEWERS_MAX' => $relays_viewes_max,
'L_RADIO' => $lang['Radio_Radio'],
'L_RADIO_STATUS' => $lang['Radio_Status'],
'L_RADIO_FORMAT' => $lang['Radio_Format'],
'L_RADIO_BITRATE' => $lang['Radio_Bitrate'],
'L_RADIO_FREQUENCY' => $lang['Radio_Frequency'],
'L_RADIO_LISTENERS' => $lang['Radio_Listeners'],
'L_RADIO_LISTEN' => $lang['Radio_Listen'],
'L_RADIO_LATEST' => $lang['Radio_Latest'],
'L_RADIO_LENGHT' => $lang['Radio_Lenght'],
'L_RADIO_SONG' => $lang['Radio_Song'],
'L_RADIO_ARTIST' => $lang['Radio_Artist'],
'L_RADIO_ALBUM' => $lang['Radio_Album'],
'L_RADIO_YEAR' => $lang['Radio_Year'])
);
// Generate the page
$template->pparse('body');
include($phpbb_root_path . 'includes/page_tail.' . $phpEx);
?>
Luego vamos a la carpeta templates/mg_themes y creamos el archivo radio.tpl y escribimos el siguiente codigo:
radio.tpl
<!-- INCLUDE breadcrumbs.tpl -->
{IMG_THL}{IMG_THC}<span class="forumlink">{L_RADIO}</span>{IMG_THR}
<table class="forumlinenb" width="100%" cellspacing="0" cellpadding="0">
<tr>
<th>{L_RADIO_STATUS}</th>
<th>{L_RADIO_FORMAT}</th>
<th>{L_RADIO_BITRATE}</th>
<th>{L_RADIO_FREQUENCY}</th>
<th>{L_RADIO_LISTENERS}</th>
<th>{L_RADIO_LISTEN}</th>
</tr>
<tr>
<td rowspan="2" class='rowradio'>{ENCODERS}</td>
<td rowspan="2" class='rowradio'>{FORMAT}</td>
<td rowspan="2" class='rowradio'>{BITRATE} Kbps</td>
<td rowspan="2" class='rowradio'>{FREQUENCY} kHz</td>
<td rowspan="2" class='rowradio'>{VIEWERS}/{VIEWERS_MAX}</td>
<td class='rowlisten'><a href="/listen_winamp.zip" target="_blank">Winamp</a></td>
</tr>
<td class='rowlisten'><a href="/listen_windows.zip" target="_blank">Windows Media</a></td>
</tr>
</table>{IMG_TFL}{IMG_TFC}{IMG_TFR}
{IMG_THL}{IMG_THC}<span class="forumlink">{L_RADIO_LATEST}</span>{IMG_THR}
<table class="forumlinenb" width="100%" cellspacing="0" cellpadding="0">
<tr>
<th width='100 px'>{L_RADIO_LENGHT}</th>
<th width='300 px'>{L_RADIO_SONG}</th>
<th width='150 px'>{L_RADIO_ARTIST}</th>
<th>{L_RADIO_ALBUM}</th>
<th width='50 px'>{L_RADIO_YEAR}</th>
</tr>
{HISTORY}
</table>{IMG_TFL}{IMG_TFC}{IMG_TFR}
{IMG_THL}{IMG_THC}<span class="forumlink">{L_RADIO}</span>{IMG_THR}
<table class="forumlinenb" width="100%" cellspacing="0" cellpadding="0">
<tr>
<th>{L_RADIO_STATUS}</th>
<th>{L_RADIO_FORMAT}</th>
<th>{L_RADIO_BITRATE}</th>
<th>{L_RADIO_FREQUENCY}</th>
<th>{L_RADIO_LISTENERS}</th>
<th>{L_RADIO_LISTEN}</th>
</tr>
<tr>
<td rowspan="2" class='rowradio'>{ENCODERS}</td>
<td rowspan="2" class='rowradio'>{FORMAT}</td>
<td rowspan="2" class='rowradio'>{BITRATE} Kbps</td>
<td rowspan="2" class='rowradio'>{FREQUENCY} kHz</td>
<td rowspan="2" class='rowradio'>{VIEWERS}/{VIEWERS_MAX}</td>
<td class='rowlisten'><a href="/listen_winamp.zip" target="_blank">Winamp</a></td>
</tr>
<td class='rowlisten'><a href="/listen_windows.zip" target="_blank">Windows Media</a></td>
</tr>
</table>{IMG_TFL}{IMG_TFC}{IMG_TFR}
{IMG_THL}{IMG_THC}<span class="forumlink">{L_RADIO_LATEST}</span>{IMG_THR}
<table class="forumlinenb" width="100%" cellspacing="0" cellpadding="0">
<tr>
<th width='100 px'>{L_RADIO_LENGHT}</th>
<th width='300 px'>{L_RADIO_SONG}</th>
<th width='150 px'>{L_RADIO_ARTIST}</th>
<th>{L_RADIO_ALBUM}</th>
<th width='50 px'>{L_RADIO_YEAR}</th>
</tr>
{HISTORY}
</table>{IMG_TFL}{IMG_TFC}{IMG_TFR}
Volvemos al directorio root de nuestro sistema y nos dirigimos a language/lang_spanish y editamos el archivo lang_main.php y en la linea 1368 insertamos lo siguiente:
lang_main.php
// Sein Kraft - Radio System - BEGIN
$lang['Radio_Radio'] = 'Radio';
$lang['Radio_Status'] = 'Estado';
$lang['Radio_Format'] = 'Formato';
$lang['Radio_Bitrate'] = 'Bitrate';
$lang['Radio_Frequency'] = 'Frecuencia';
$lang['Radio_Listeners'] = 'Oyentes';
$lang['Radio_Listen'] = 'Escuchar';
$lang['Radio_Latest'] = 'Ultimos Temas';
$lang['Radio_Lenght'] = 'Duración';
$lang['Radio_Song'] = 'Canción';
$lang['Radio_Artist'] = 'Artista';
$lang['Radio_Album'] = 'Album';
$lang['Radio_Year'] = 'Año';
// Sein Kraft - Radio System - END
$lang['Radio_Radio'] = 'Radio';
$lang['Radio_Status'] = 'Estado';
$lang['Radio_Format'] = 'Formato';
$lang['Radio_Bitrate'] = 'Bitrate';
$lang['Radio_Frequency'] = 'Frecuencia';
$lang['Radio_Listeners'] = 'Oyentes';
$lang['Radio_Listen'] = 'Escuchar';
$lang['Radio_Latest'] = 'Ultimos Temas';
$lang['Radio_Lenght'] = 'Duración';
$lang['Radio_Song'] = 'Canción';
$lang['Radio_Artist'] = 'Artista';
$lang['Radio_Album'] = 'Album';
$lang['Radio_Year'] = 'Año';
// Sein Kraft - Radio System - END
Ahora nos dirigimos de vuelta al directorio root y vamos a la carpeta includes, alli copiamos el archivo page_header.php y a la copia la renombramos radio_header.php, luego lo editamos y agregamos lo siguiente en la linea 190:
$phpbb_meta .= '<meta http-equiv="refresh" content="30" />' . "\n";
Esto hara que la pagina refresque los datos cada 30 segundos.
Una vez echo todo esto aun no funciona nuestra radio pero si la pagina donde se mostraran los datos, sin embargo tirara un error al no encontrar el archivo radio_info.php en el directorio root que es el que subieremos a travez del Sam Broadcaster usando FTP.
Creamos el archivo _radio_info.php (no interesa donde, aunque yo lo guarde en la carpeta del Sam) y le insertamos el siguiente codigo:
_radio_info.php
<?
$song_mmss="$song.mmss$";
$song_title="$song.title$";
$song_artist="$song.artist$";
$song_album="$song.album$";
$station_name="$station.name$";
$encoders_started="$encoders.started$";
$relays_viewers="$relays.viewers$";
$relays_viewes_max="$relays.max$";
$relays_viewes_today="$relays.high$";
$relays_format="$relays.format$";
$relays_frequency="$relays.frequency$";
$relays_bitrate="$relays.bitrate$";
$history="<!--LOOP(history,0,10)-->
<!--LOOP_HEADER-->
<!--LOOP_ROW-->
<tr>
<td class='rowradio'>$history.mmss$</td><td class='row1'>$history.title$</td><td class='row1'>$history.artist$</td><td class='row1'>$history.album$</td><td class='rowradio'>$history.albumyear$</td>
</tr>
<!--LOOP_FOOTER-->
<!--LOOP_EMPTY-->
<!--LOOP_END-->";
?>
$song_mmss="$song.mmss$";
$song_title="$song.title$";
$song_artist="$song.artist$";
$song_album="$song.album$";
$station_name="$station.name$";
$encoders_started="$encoders.started$";
$relays_viewers="$relays.viewers$";
$relays_viewes_max="$relays.max$";
$relays_viewes_today="$relays.high$";
$relays_format="$relays.format$";
$relays_frequency="$relays.frequency$";
$relays_bitrate="$relays.bitrate$";
$history="<!--LOOP(history,0,10)-->
<!--LOOP_HEADER-->
<!--LOOP_ROW-->
<tr>
<td class='rowradio'>$history.mmss$</td><td class='row1'>$history.title$</td><td class='row1'>$history.artist$</td><td class='row1'>$history.album$</td><td class='rowradio'>$history.albumyear$</td>
</tr>
<!--LOOP_FOOTER-->
<!--LOOP_EMPTY-->
<!--LOOP_END-->";
?>
Una vez instalado el Sam Broadcaster nos vamos a Config > HTML Output y en Generate HTML output agregamos el archivo que creamos antes y como archivo de salida ponemos radio_info.php; Luego configuramos la seccion de ftp agregando el nombre de usuario, contraeña y puerto para que luego el programa al cambiar de cancion resuba el radio_info.php (debe subirse en el directorio root del sistema)
Y listo! Cada vez que se cambia de canción se resube el archivo radio_info.php que contiene los datos actuales del Sam Broadcaster. Y al refrescarse la pagina cada 30 segundos se acrualizan los daros al releer este archivo.
Pueden verlo en funcionamiento en www.antropomorfos.com/radio.php .
Actualmente estoy trabajando en el sistema de programación (el calendario) y un sistema de pedidos de temas.
Espero que les sirva y cualquier consulta pregunten.
Saludos.-



















































