Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   Mods & Themes (http://www.bvlist.com/forumdisplay.php?f=87)
-   -   Shoutcast Radio (http://www.bvlist.com/showthread.php?t=940)

Grom 3rd September 2008 03:28

Shoutcast Radio
 
3 Attachment(s)
This is not all my work!

radio.php
PHP Code:

<?
error_reporting
(0);
require_once(
"backend/functions.php");
dbconn();
if (
$LOGGEDINONLY){
if (!
$CURUSER){
echo 
"<BR><b><CENTER>You Are Not Logged InOnly Members Can Listen to MGA Radio Please Signup.</CENTER><BR><BR>";
}else{
echo 
'
<html>

<head>
<meta http-equiv="Content-Language" content="en-gb">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>MGA Radio</title>
</head>

<body topmargin="0" leftmargin="0" background="images/soundbg.jpg" link="#FFFF00" vlink="#FFFF00" alink="#FFFF00" text="#FFFFFF" bgcolor="#000000">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="350" height="100">
  <tr>
    <td width="100%" valign="top">
   <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
      <tr>
        <td width="100%">
        <p align="center"><font face="Arial"><b>MGA TV Torrents Radio</b></font></td>
      </tr>
    </table>
    <hr>
   <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
      <tr>
        <td width="50%">
        <p align="center"><b><font face="Arial" size="1">
        <a href="radio/radioplayer.php?lang=&z=wmp">Play Using Windows Media 
        Player</a></font></b></td>
        <td width="50%">
        <p align="center"><b><font face="Arial" size="1">
       <a href="radio/radioplayer.php?lang=&z=real">Play Using Real Player</a></font></b></td>
      </tr>
    </table>
    <hr>
   <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
      <tr>
        <td width="100%"><font face="Arial" size="1">Windows 
        Media Player 10 or above is needed to play shoutcast streams</font></td>
      </tr>
    </table>
   <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
      <tr>
        <td width="100%">
        <p align="center"><font size="1" face="Arial">Powered by MGA Radio, 
        Winamp & Shoutcast</font></td>
      </tr>
    </table>
    </td>
  </tr>
</table>

</body>

</html>'
;
}
}
?>

myradio.php


PHP Code:

<?
error_reporting
(0);
require_once(
"backend/functions.php");
dbconn(false);
$showradioinfo="page";
include(
"radio-info.php");
stdhead();
begin_frame("MGA Radio");
?>
<p align="center"><b>

<a href="JavaScript:radio_player()">Click here to tune in and listen now.</a></b></p>
<div align="center">
  <center>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
  <tr>
    <td width="50%">
    <div align="center">
      <center>
      <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111">
        <tr>
          <td width="50%" align="center"><a href="JavaScript:radio_player()">
          <img border="0" src="images/win.gif" width="64" height="64"></a></td>
          <td width="50%" align="center"><a href="JavaScript:radio_player()">
          <img border="0" src="images/real.gif" width="80" height="70"></a></td>
        </tr>
        <tr>
          <td width="50%" align="center">
          <img border="0" src="images/shoutcast.gif" width="160" height="44"></td>
          <td width="50%" align="center">
          <img border="0" src="images/winamp.gif" width="75" height="76"></td>
        </tr>
      </table>
      </center>
    </div>
    </td>
    <td width="50%">
    <table border="0" cellpadding="2" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111">
    <tr>
      <td align="left"><b>Status :</b> </td>
      <td><img border="0" src="<? echo $radioimg?>"></td>
    </tr>
    <tr>
      <td align="left"><b>Currently Playing :&nbsp; </b></td>
      <td><? echo $song[0]; ?></td>
    </tr>
    <tr>
      <td align="left"><b>Members Listening Now :&nbsp; </b></td>
      <td><? echo $currentlisteners?></td>
    </tr>
    <tr>
      <td align="left" valign="top"><b>Last 5 Tracks Played..&nbsp; </b></td>
     <td><? echo $song[1]."<BR>"?><? echo $song[2]."<BR>"?><? echo $song[3]."<BR>"?><? echo $song[4]."<BR>"?><? echo $song[5]."<BR>"?></td>
    </tr>
  </table>
    <p>&nbsp;</td>
  </tr>
</table>
  </center>
</div>
<p>&nbsp;</p>
<div align="center">
  <center>
  
  <p></p>
  
  </center>
</div>

<p align="center">You will need Windows Media Player 10+ or Real Player to to 
listen to the radio stream! </p>
<p align="center">Radio Powered by Shoutcast & Winamp</p>


<?
end_frame
();
stdfoot();
?>

radio-info.php

PHP Code:

<?
error_reporting
(0);
require_once(
"backend/functions.php");
dbconn(false);
?>
<script language="JavaScript">
<!--
function radio_player() {
props=window.open('radio.php', 'poppage', 'toolbars=0, scrollbars=0, location=0, statusbars=0, menubars=0, resizable=0, width=350, height=100 left = 100, top = 100');
}
-->
</script>
<?
error_reporting
(0);
error_reporting(0);
require_once(
"backend/functions.php");
dbconn(false);
$scdef "NAME OF YOUR RADIO"
$scip "HOST OF YOUR RADIO"// IP OR DOMAIN
$scport "8000"// PORT
$scpass "PASSWORD FOR SHOUTCAST SERVER"


$bgcolor "#000000"



$scfp fsockopen("$scip"$scport, &$errno, &$errstr30);
if(!
$scfp) {
$scsuccs=1;
echo
''.$scdef.' is Offline';
}
if(
$scsuccs!=1){
fputs($scfp,"GET /admin.cgi?pass=$scpass&mode=viewxml HTTP/1.1\r\nUser-Agent: SHOUTcast Song Status (Mozilla Compatible)\r\n\r\n");
while(!
feof($scfp)) {
$page .= fgets($scfp1000);
}




$loop = array("STREAMSTATUS""BITRATE""SERVERTITLE""CURRENTLISTENERS");
$y=0;
while(
$loop[$y]!=''){
$pageed ereg_replace(".*<$loop[$y]>"""$page);
$scphp strtolower($loop[$y]);
$
$scphp ereg_replace("</$loop[$y]>.*"""$pageed);
if(
$loop[$y]==SERVERGENRE || $loop[$y]==SERVERTITLE || $loop[$y]==SONGTITLE || $loop[$y]==SERVERTITLE)
$
$scphp urldecode($$scphp);

// uncomment the next line to see all variables
//echo'$'.$scphp.' = '.$$scphp.'';
$y++;
}

$pageed ereg_replace(".*<SONGHISTORY>"""$page);
$pageed ereg_replace("<SONGHISTORY>.*"""$pageed);
$songatime explode("<SONG>"$pageed);
$r=1;
while(
$songatime[$r]!=""){
$t=$r-1;
$playedat[$t] = ereg_replace(".*<PLAYEDAT>"""$songatime[$r]);
$playedat[$t] = ereg_replace("</PLAYEDAT>.*"""$playedat[$t]);
$song[$t] = ereg_replace(".*<TITLE>"""$songatime[$r]);
$song[$t] = ereg_replace("</TITLE>.*"""$song[$t]);
$song[$t] = urldecode($song[$t]);
$dj[$t] = ereg_replace(".*<SERVERTITLE>"""$page);
$dj[$t] = ereg_replace("</SERVERTITLE>.*"""$pageed);
$r++;
}

fclose($scfp);
}
if (
$showradioinfo=="on"){
if (
$streamstatus == "1"){
$rstatus "Playing";}
else { 
$rstatus "Stopped";}

echo 
"<hr>Radio Status : ".$rstatus."";
echo 
"Current Listeners ".$currentlisteners."";
echo 
"Listening to...... ".$song[0];
echo 
"<a href='myradio.php'>Listen Now</a>";}

if (
$showradioinfo=="page") {
if (
$streamstatus == "1"){
$radioimg "images/radioonline.jpg";}
else{
$radioimg "images/radiooffline.jpg";}}

?>

if you want to have the radio stats in the left nav menu
in header.php under the donate block add this

PHP Code:

begin_block("MGA Radio Info");
$showradioinfo="on";
include(
"radio-info.php");
end_block(); 

upload all the images to your images folder
upload the radio folder to your trackers root (same place as index.php)
edit the config.php in the radio folder.
edit the radio-info.php

Egidijuss 13th September 2010 21:29

Help
 
radio-info.php on line 27

PHP Code:

$scfp fsockopen("$scip"$scport, &$errno, &$errstr30); 

:sos:

daffy 13th September 2010 22:04

1 Attachment(s)
replace with attached, edit with server info.

Egidijuss 19th September 2010 09:38

Quote:

Originally Posted by daffy (Post 24488)
replace with attached, edit with server info.



Code:

Warning: Call-time pass-by-reference has been deprecated in ............ ....... radio-info.php on line 25

$scfp = fsockopen("$scip", $scport, &$errno, &$errstr, 01);
 
HELP PLEASE

:unknown:

kickass 19th September 2010 15:19

You can set allow_call_time_pass_reference to true in your INI file

smudger 6th January 2011 00:52

Quote:

begin_block("MGA Radio Info");
$showradioinfo="on";
include(
"radio-info.php");
end_block();



i dnt see were to put this in header tt v2

daffy 6th January 2011 02:03

2 Attachment(s)
place the code where you want it to show, i would put this into index.php and not header.php unless you want this to show on ALL pages ( i would not advice that tho), personally i would put this into index.php

strange as i recall writing most of this on TT some 4 years ago.

Code:

open index.php

to show in index copy below

$showradioinfo="on";
include("myradio.php");

before

stdfoot();
?>


upload all the images to your images folder
upload the radio folder to your trackers root
upload all php files to root
upload shoutcast_block to blocks
edit radio/config.php
edit radio-info.php

Also attached is another radio "Radio_mod" which was written/coded by FOZ so all credit goes to him, i cannot remember what this looks like but i know this works.

smudger 6th January 2011 12:35

after looking into the code in more detail duhhh I had to create a new block.php then add a new block details in phpmyadmin for it to work now it shows in a block

ivo 30th December 2012 03:02

block
 
How to create a block on the index page for the radio, please help me never fails
TBDev 2010

Napon 22nd August 2019 10:47

$scfp = fsockopen("$scip", $scport, $errno, $errstr, 01);

Bump: This is also out of date radio


All times are GMT +2. The time now is 13:56.

Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.