Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   xBTiT (http://www.bvlist.com/forumdisplay.php?f=30)
-   -   xbtitfm 2.1 radio problem (http://www.bvlist.com/showthread.php?t=12133)

steven2007 10th August 2019 09:50

xbtitfm 2.1 radio problem
 
Maybe someone has an xbtitfm source on the run? or knows about it? I have a problem with the radio and need help :ok::wallbash:
Thank you:sos::sos:

shoutcast is installed on server and works
With the stream data I can stream in the radio boss and the connection to the shoutcastserver is no problem

I have three lines in the xbtitfm radio settings.
Radio ip:
port:
password :(here comes admin password)

I enter everything and then get the message in the radio block "Bad login"

So what is wrong?
Perhaps anyone has some advice

Napon 10th August 2019 11:59

now are you using shoutcast v2 if so you need to edit to sid 1

steven2007 10th August 2019 12:37

https://ibb.co/J2nJYyD
Quote:

Originally Posted by Napon (Post 53967)
now are you using shoutcast v2 if so you need to edit to sid 1

ok, I'm honest and do not know now what you mean Napon,but I have no problems connecting to the shoutcast server. Everything is fine.
I can stream, my shoutcast is also running. Only when I enter the data in the source do I get this error.

the connection to the shoutcastserver with streampassword works.
but not the adminpw in the radio block
https://ibb.co/J2nJYyD
https://ibb.co/GFh9yfq
https://ibb.co/7yN2RhT
https://ibb.co/cTysRx2

Napon 10th August 2019 13:06

pm me the files ill have a look

'sid' => '1'
and what is the {fputs} or {url}

thartley55 10th August 2019 15:07

You're using shoutcast version 2.
The xbtit script is not set up to work with that, as there is no current way to put the stream # into the settings in panel.
I've tried requesting xbtitfm be modded to fix it, as have others. But the requests have been ignored.
If Napon can get it fixed and post it up, it would be great.

Napon 10th August 2019 15:56

ill do my best mate i need the files or the full code for this and ill fix it

steven2007 10th August 2019 16:20

i have send Pm to you:cool:

Napon 10th August 2019 16:52

ok im looking now


for a start no v2 shoutcast here
radiostats/shoutcast.class
PHP Code:

<?php

/*******************************************************************
* shoutcast.class.php
* Version: 0.1
* Author: Henrik Malmberg
* Copyright (C) 2002, Henrik Malmberg
* henrik@ih.nut
* http://yoda.ih.nu/
*
*******************************************************************
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.

This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
General Public License for more details.

You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*******************************************************************/


class ShoutCast {
    
// Public
    
var $host;
    var 
$port;
    var 
$passwd;
    
    
//Private
    
var $_xml;
    var 
$_error;
    
    function 
openstats() {
        
$fp = @fsockopen($this->host$this->port$errno$errstr10);
        If (!
$fp) {
            
$this->_error "$errstr ($errno)";
            return(
0);
        } else {
            
fputs($fp"GET /admin.cgi?pass=".$this->passwd."&mode=viewxml HTTP/1.0\r\n");
            
fputs($fp"User-Agent: Mozilla\r\n\r\n");
            while (!
feof($fp)) {
                    
$this->_xml .= fgets($fp512);
            }
            
fclose($fp);

            if (
stristr($this->_xml"HTTP/1.0 200 OK") == true) {
                
// <-H> Thanks to Blaster for this fix.. trim();
                
$this->_xml trim(substr($this->_xml42));
            } else {
                
$this->_error "Bad login";
                return(
0);
            }

            
$xmlparser xml_parser_create();
            if (!
xml_parse_into_struct($xmlparser$this->_xml$this->_values$this->_indexes)) {
                
$this->_error "Unparsable XML";
                return(
0);
            }
    
            
xml_parser_free($xmlparser);

            return(
1);
        }
    }

    function 
GetCurrentListenersCount() {
        return(
$this->_values[$this->_indexes["CURRENTLISTENERS"][0]]["value"]);
    }

    function 
GetPeakListenersCount() {
        return(
$this->_values[$this->_indexes["PEAKLISTENERS"][0]]["value"]);
    }

    function 
GetMaxListenersCount() {
        return(
$this->_values[$this->_indexes["MAXLISTENERS"][0]]["value"]);
    }
    
    function 
GetReportedListenersCount() {
        return(
$this->_values[$this->_indexes["REPORTEDLISTENERS"][0]]["value"]);
    }
    
    function 
GetAverageListenTime() {
        return(
$this->_values[$this->_indexes["AVERAGETIME"][0]]["value"]);
    }

    function 
GetServerGenre() {
        return(
$this->_values[$this->_indexes["SERVERGENRE"][0]]["value"]);
    }
    
    function 
GetServerURL() {
        return(
$this->_values[$this->_indexes["SERVERURL"][0]]["value"]);
    }
    
    function 
GetServerTitle() {
        return(
$this->_values[$this->_indexes["SERVERTITLE"][0]]["value"]);
    }
    
    function 
GetCurrentSongTitle() {
        return(
$this->_values[$this->_indexes["SONGTITLE"][0]]["value"]);
    }
    
    function 
GetIRC() {
        return(
$this->_values[$this->_indexes["IRC"][0]]["value"]);
    }

    function 
GetAIM() {
        return(
$this->_values[$this->_indexes["AIM"][0]]["value"]);
    }
    
    function 
GetICQ() {
        return(
$this->_values[$this->_indexes["ICQ"][0]]["value"]);
    }

    function 
GetWebHitsCount() {
        return(
$this->_values[$this->_indexes["WEBHITS"][0]]["value"]);
    }
    
    function 
GetStreamHitsCount() {
        return(
$this->_values[$this->_indexes["STREAMHITS"][0]]["value"]);
    }
    
    function 
GetStreamStatus() {
        return(
$this->_values[$this->_indexes["STREAMSTATUS"][0]]["value"]);
    }

    function 
GetBitRate() {
        return(
$this->_values[$this->_indexes["BITRATE"][0]]["value"]);
    }
    
    function 
GetSongHistory() {
        for(
$i=1;$i<sizeof($this->_indexes['TITLE']);$i++) {
            
$arrhistory[$i-1] = array(
                                    
"playedat"=>$this->_values[$this->_indexes['PLAYEDAT'][$i]]['value'],
                                    
"title"=>$this->_values[$this->_indexes['TITLE'][$i]]['value']
                                );
        }

        return(
$arrhistory);
    }

    function 
GetListeners() {
        for(
$i=0;$i<sizeof($this->_indexes['USERAGENT']);$i++) {
            
$arrlisteners[$i] = array(
                                    
"hostname"=>$this->_values[$this->_indexes['HOSTNAME'][$i]]['value'],
                                    
"useragent"=>$this->_values[$this->_indexes['USERAGENT'][$i]]['value'],
                                    
"underruns"=>$this->_values[$this->_indexes['UNDERRUNS'][$i]]['value'],
                                    
"connecttime"=>$this->_values[$this->_indexes['CONNECTTIME'][$i]]['value'],
                                    
"pointer"=>$this->_values[$this->_indexes['POINTER'][$i]]['value'],
                                    
"uid"=>$this->_values[$this->_indexes['UID'][$i]]['value'],
                                );
        }

        return(
$arrlisteners);
    }

    function 
geterror() { return($this->_error); }
}

?>

there is quite a few more files to edit

ill post up when done
this is the error your getting in the tools why no shoutcast v2 nor sid
$this->_error = "Bad login";

ill need the DB to add the sid so on

So it looks like this just a test



PHP Code:

<?php

/*******************************************************************
* shoutcast.class.php
* Version: 0.1
* Author: Henrik Malmberg
* Copyright (C) 2002, Henrik Malmberg
* henrik@ih.nut
* http://yoda.ih.nu/
*
*******************************************************************
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.

This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
General Public License for more details.

You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*******************************************************************/


class ShoutCast {
    
// Public
    
var $host;
    var 
$port;
    var 
$passwd;

    
//Private
    
var $_xml;
    var 
$_error;
    
    function 
openstats() {
        
$fp = @fsockopen($this->host$this->port$errno$errstr10);
        If (!
$fp) {
            
$this->_error "$errstr ($errno)";
            return(
0);
        } else {

        
///TEST BY NAPON
        
if ($this->sid==0)
        
fputs($fp"GET /admin.cgi?pass=".$this->passwd."&mode=viewxml HTTP/1.0\r\n");
        else
        
fputs($fp"GET /admin.cgi?sid=".$this->sid."&pass=".$this->passwd."&mode=viewxml HTTP/1.1\r\n");




            
//fputs($fp, "GET /admin.cgi?pass=".$this->passwd."&mode=viewxml HTTP/1.0\r\n");
            //fputs($fp, "User-Agent: Mozilla\r\n\r\n");
            
while (!feof($fp)) {
                    
$this->_xml .= fgets($fp512);
            }
            
fclose($fp);

            if (
stristr($this->_xml"HTTP/1.0 200 OK") == true) {
                
// <-H> Thanks to Blaster for this fix.. trim();
                
$this->_xml trim(substr($this->_xml42));
            } else {
                
$this->_error "Bad login";
                return(
0);
            }

            
$xmlparser xml_parser_create();
            if (!
xml_parse_into_struct($xmlparser$this->_xml$this->_values$this->_indexes)) {
                
$this->_error "Unparsable XML";
                return(
0);
            }
    
            
xml_parser_free($xmlparser);

            return(
1);
        }
    }

    function 
GetCurrentListenersCount() {
        return(
$this->_values[$this->_indexes["CURRENTLISTENERS"][0]]["value"]);
    }

    function 
GetPeakListenersCount() {
        return(
$this->_values[$this->_indexes["PEAKLISTENERS"][0]]["value"]);
    }

    function 
GetMaxListenersCount() {
        return(
$this->_values[$this->_indexes["MAXLISTENERS"][0]]["value"]);
    }
    
    function 
GetReportedListenersCount() {
        return(
$this->_values[$this->_indexes["REPORTEDLISTENERS"][0]]["value"]);
    }
    
    function 
GetAverageListenTime() {
        return(
$this->_values[$this->_indexes["AVERAGETIME"][0]]["value"]);
    }

    function 
GetServerGenre() {
        return(
$this->_values[$this->_indexes["SERVERGENRE"][0]]["value"]);
    }
    
    function 
GetServerURL() {
        return(
$this->_values[$this->_indexes["SERVERURL"][0]]["value"]);
    }

    function 
GetServerTitle() {
        return(
$this->_values[$this->_indexes["SERVERTITLE"][0]]["value"]);
    }
    
    function 
GetCurrentSongTitle() {
        return(
$this->_values[$this->_indexes["SONGTITLE"][0]]["value"]);
    }
    
    function 
GetIRC() {
        return(
$this->_values[$this->_indexes["IRC"][0]]["value"]);
    }

    function 
GetAIM() {
        return(
$this->_values[$this->_indexes["AIM"][0]]["value"]);
    }
    
    function 
GetICQ() {
        return(
$this->_values[$this->_indexes["ICQ"][0]]["value"]);
    }

    function 
GetWebHitsCount() {
        return(
$this->_values[$this->_indexes["WEBHITS"][0]]["value"]);
    }
    
    function 
GetStreamHitsCount() {
        return(
$this->_values[$this->_indexes["STREAMHITS"][0]]["value"]);
    }
    
    function 
GetStreamStatus() {
        return(
$this->_values[$this->_indexes["STREAMSTATUS"][0]]["value"]);
    }

    function 
GetBitRate() {
        return(
$this->_values[$this->_indexes["BITRATE"][0]]["value"]);
    }
    
    function 
GetSongHistory() {
        for(
$i=1;$i<sizeof($this->_indexes['TITLE']);$i++) {
            
$arrhistory[$i-1] = array(
                                    
"playedat"=>$this->_values[$this->_indexes['PLAYEDAT'][$i]]['value'],
                                    
"title"=>$this->_values[$this->_indexes['TITLE'][$i]]['value']
                                );
        }

        return(
$arrhistory);
    }

    function 
GetListeners() {
        for(
$i=0;$i<sizeof($this->_indexes['USERAGENT']);$i++) {
            
$arrlisteners[$i] = array(
                                    
"hostname"=>$this->_values[$this->_indexes['HOSTNAME'][$i]]['value'],
                                    
"useragent"=>$this->_values[$this->_indexes['USERAGENT'][$i]]['value'],
                                    
"underruns"=>$this->_values[$this->_indexes['UNDERRUNS'][$i]]['value'],
                                    
"connecttime"=>$this->_values[$this->_indexes['CONNECTTIME'][$i]]['value'],
                                    
"pointer"=>$this->_values[$this->_indexes['POINTER'][$i]]['value'],
                                    
"uid"=>$this->_values[$this->_indexes['UID'][$i]]['value'],
                                );
        }

        return(
$arrlisteners);
    }

    function 
geterror() { return($this->_error); }
}

?>

or this


PHP Code:

<?php

/*******************************************************************
* shoutcast.class.php
* Version: 0.1
* Author: Henrik Malmberg
* Copyright (C) 2002, Henrik Malmberg
* henrik@ih.nut
* http://yoda.ih.nu/
*
*******************************************************************
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.

This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
General Public License for more details.

You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*******************************************************************/


class ShoutCast {
    
// Public
    
var $host;
    var 
$port;
    var 
$passwd;

    
//Private
    
var $_xml;
    var 
$_error;
    
    function 
openstats() {
        
$fp = @fsockopen($this->host$this->port$errno$errstr10);
        If (!
$fp) {
            
$this->_error "$errstr ($errno)";
            return(
0);
        } else {

        
///TEST BY NAPON
        
if ($this->sid==0)
        
fputs($fp"GET /admin.cgi?pass=".$this->passwd."&mode=viewxml HTTP/1.0\r\n");
        else
        
fputs($fp"GET /admin.cgi?sid=".$this->sid."&pass=".$this->passwd."&mode=viewxml HTTP/1.1\r\n");




            
//fputs($fp, "GET /admin.cgi?pass=".$this->passwd."&mode=viewxml HTTP/1.0\r\n");
            //fputs($fp, "User-Agent: Mozilla\r\n\r\n");
            
while (!feof($fp)) {
                    
$this->_xml .= fgets($fp512);
            }
            
fclose($fp);

            if (
stristr($this->_xml"HTTP/1.0 200 OK") == true) {
                
// <-H> Thanks to Blaster for this fix.. trim();
                
$this->_xml trim(substr($this->_xml42));
            } else {
                
$this->_error "Bad login";
                return(
0);
            }

            
$xmlparser xml_parser_create();
            if (!
xml_parse_into_struct($xmlparser$this->_xml$this->_values$this->_indexes)) {
                
$this->_error "Unparsable XML";
                return(
0);
            }
    
            
xml_parser_free($xmlparser);

            return(
1);
        }
    }

    function 
GetCurrentListenersCount() {
        return(
$this->_values[$this->_indexes["CURRENTLISTENERS"][0]]["value"]);
    }

    function 
GetPeakListenersCount() {
        return(
$this->_values[$this->_indexes["PEAKLISTENERS"][0]]["value"]);
    }

    function 
GetMaxListenersCount() {
        return(
$this->_values[$this->_indexes["MAXLISTENERS"][0]]["value"]);
    }
    
    function 
GetReportedListenersCount() {
        return(
$this->_values[$this->_indexes["REPORTEDLISTENERS"][0]]["value"]);
    }

    function 
GetAverageListenTime() {
        return(
$this->_values[$this->_indexes["AVERAGETIME"][0]]["value"]);
    }

    function 
GetServerGenre() {
        return(
$this->_values[$this->_indexes["SERVERGENRE"][0]]["value"]);
    }
    
    function 
GetServerURL() {
        return(
$this->_values[$this->_indexes["SERVERURL"][0]]["value"]);
    }

    function 
GetServerTitle() {
        return(
$this->_values[$this->_indexes["SERVERTITLE"][0]]["value"]);
    }
    
    function 
GetCurrentSongTitle() {
        return(
$this->_values[$this->_indexes["SONGTITLE"][0]]["value"]);
    }

    function 
GetIRC() {
        return(
$this->_values[$this->_indexes["IRC"][0]]["value"]);
    }

    function 
GetAIM() {
        return(
$this->_values[$this->_indexes["AIM"][0]]["value"]);
    }
    
    function 
GetICQ() {
        return(
$this->_values[$this->_indexes["ICQ"][0]]["value"]);
    }

    function 
GetWebHitsCount() {
        return(
$this->_values[$this->_indexes["WEBHITS"][0]]["value"]);
    }
    
    function 
GetStreamHitsCount() {
        return(
$this->_values[$this->_indexes["STREAMHITS"][0]]["value"]);
    }

    function 
GetStreamStatus() {
        return(
$this->_values[$this->_indexes["STREAMSTATUS"][0]]["value"]);
    }

    function 
GetBitRate() {
        return(
$this->_values[$this->_indexes["BITRATE"][0]]["value"]);
    }
    
    function 
GetSongHistory() {
        for(
$i=1;$i<sizeof($this->_indexes['TITLE']);$i++) {
            
$arrhistory[$i-1] = array(
                                    
"playedat"=>$this->_values[$this->_indexes['PLAYEDAT'][$i]]['value'],
                                    
"title"=>$this->_values[$this->_indexes['TITLE'][$i]]['value']
                                );
        }

        return(
$arrhistory);
    }
if (
$shoutcast->sid>0) {
    
$v2info="?sid=".$shoutcast->sid;
    
$v2xtra=":".$shoutcast->sid;
    } else {
    
$v2info="";
    
$v2xtra="";
}
    function 
GetListeners() {
        for(
$i=0;$i<sizeof($this->_indexes['USERAGENT']);$i++) {
            
$arrlisteners[$i] = array(
                                    
"hostname"=>$this->_values[$this->_indexes['HOSTNAME'][$i]]['value'],
                                    
"useragent"=>$this->_values[$this->_indexes['USERAGENT'][$i]]['value'],
                                    
"underruns"=>$this->_values[$this->_indexes['UNDERRUNS'][$i]]['value'],
                                    
"connecttime"=>$this->_values[$this->_indexes['CONNECTTIME'][$i]]['value'],
                                    
"pointer"=>$this->_values[$this->_indexes['POINTER'][$i]]['value'],
                                    
"uid"=>$this->_values[$this->_indexes['UID'][$i]]['value'],
                                );
        }

        return(
$arrlisteners);
    }

    function 
geterror() { return($this->_error);
    }
}

?>

Also you could add this part to the
fetch.php


PHP Code:

if ($shoutcast->sid>0) {
    
$v2info="?sid=".$shoutcast->sid;
    
$v2xtra=":".$shoutcast->sid;
    } else {
    
$v2info="";
    
$v2xtra="";


So it looks like this test

PHP Code:

<?php
/////////////////////////////////////////////////////////////////////////////////////
// xbtit - Bittorrent tracker/frontend
//
// Copyright (C) 2004 - 2015  Btiteam
//
//    This file is part of xbtitFM.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
//   1. Redistributions of source code must retain the above copyright notice,
//      this list of conditions and the following disclaimer.
//   2. Redistributions in binary form must reproduce the above copyright notice,
//      this list of conditions and the following disclaimer in the documentation
//      and/or other materials provided with the distribution.
//   3. The name of the author may not be used to endorse or promote products
//      derived from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
// TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
////////////////////////////////////////////////////////////////////////////////////
include("shoutcast.class.php");
require(
"../include/functions.php");
dbconn(true);

global 
$btit_settings$BASEURL$TABLE_PREFIX;

$active_seo get_result("SELECT `activated_user`, `str`, `strto` FROM `{$TABLE_PREFIX}seo` WHERE `id`='1'"true$btit_settings["cache_duration"]);
$res_seo=$active_seo[0];

// get user's style
$resheet=do_sqlquery("SELECT * FROM {$TABLE_PREFIX}style where id=".$CURUSER["style"]."");
if (!
$resheet)
   {

   
$STYLEPATH="$THIS_BASEPATH/style/xbtit_default";
   
$STYLEURL="$BASEURL/style/xbtit_default";
}
else
    {
        
$resstyle=mysqli_fetch_array($resheet);
        
$STYLEPATH="$THIS_BASEPATH/".$resstyle["style_url"];
        
$STYLEURL="$BASEURL/".$resstyle["style_url"];
}

$style_css=load_css("main.css");


function 
ConvertSeconds($seconds) {
    
$tmpseconds substr("00".$seconds 60, -2);
    if (
$seconds 59) {
        if (
$seconds 3599) {
            
$tmphours substr("0".intval($seconds 3600), -2);
            
$tmpminutes substr("0".intval($seconds 60 - (60 $tmphours)), -2);
            
            return (
$tmphours.":".$tmpminutes.":".$tmpseconds);
        } else {
            return (
"00:".substr("0".intval($seconds 60), -2).":".$tmpseconds);
        }
    } else {
        return (
"00:00:".$tmpseconds);
    }
}



$shoutcast = new ShoutCast();
$shoutcast->host $btit_settings["radio_ip"];
$shoutcast->port $btit_settings["radio_port"];
$shoutcast->passwd $btit_settings["radio_pass"];
if (
$shoutcast->sid>0) {
    
$v2info="?sid=".$shoutcast->sid;
    
$v2xtra=":".$shoutcast->sid;
    } else {
    
$v2info="";
    
$v2xtra="";
}

if (
$shoutcast->openstats()) {
    
// We got the XML, gogogo!..
    
if ($shoutcast->GetStreamStatus()) {
    
require(
"../".load_language("lang_shoutcast.php"));


echo
"<link rel=\"stylesheet\" type=\"text/css\" href=".$STYLEURL."/main.css\" />";





    
        echo
"<table width=100% cellpadding=3 cellspacing=0><tr><td class=blocklist>";
        
        echo 
"<center><img src='radiostats/images/radio-online.png'></center>";
        echo 
"<table border=0 cellpadding=0 cellspacing=0 align=center class=main>";
        
$todayis date ('D');
        
$timenow date ('G:i');
      
$Query do_sqlquery ('SELECT u.id as realid, sc.uid, sc.activedays, sc.activetime, sc.genre, u.username, g.prefixcolor, g.suffixcolor FROM '.$TABLE_PREFIX.'shoutcastdj sc LEFT JOIN '.$TABLE_PREFIX.'users u ON sc.uid=u.id LEFT JOIN '.$TABLE_PREFIX.'users_level g ON u.id_level=g.id WHERE sc.active = \'1\' ORDER by activetime') OR die ();
      if (
mysqli_num_rows($Query)>0)
      {
          
$found=0;
          while(
$List=mysqli_fetch_assoc($Query))
          {
              if (
preg_match ('@' $todayis '@Ui'$List['activedays']))
              {
                  
$timeslot=explode("-",$List["activetime"]);
                  
$start_time=explode(":",$timeslot[0]);
                  
$end_time=explode(":",$timeslot[1]);

                  
$start_timestamp=mktime($start_time[0],$start_time[1],0);
                  
$end_timestamp=mktime((int)$end_time[0],(int)$end_time[1],0);
                  if(
time()>=$start_timestamp && time()<=$end_timestamp)
                  {
                      
$found=1;
                      echo 
"<tr><td class=header><b>".$language['BL_DJ'].":</b></td><td class=lista>&nbsp;<a href='".(($btit_settings["fmhack_SEO_panel"]=="enabled" && $res_seo["activated_user"]=="true")?$List["realid"]."_".strtr($List["username"], $res_seo["str"], $res_seo["strto"]).".html":"index.php?page=userdetails&id=".$List["realid"])."'><b>".unesc($List["prefixcolor"]).$List["username"].unesc($List["suffixcolor"])."</b></a></td></tr>";
                  }
              }
          }
          if(
$found==0)
          {
              
$djname=mysqli_real_escape_string($GLOBALS['conn'],$shoutcast->GetServerTitle());

              
$petr1=do_sqlquery("SELECT `u`.`id`, `ul`.`prefixcolor`, `ul`.`suffixcolor` FROM `{$TABLE_PREFIX}users` `u` LEFT JOIN `{$TABLE_PREFIX}users_level` `ul` ON `u`.`id_level`=`ul`.`id` WHERE `u`.`username`='".$djname."'");
              if(@
mysqli_num_rows($petr1)>0)
              {
                  
$fied=mysqli_fetch_assoc($petr1);
                  
$djname="<a href='".(($btit_settings["fmhack_SEO_panel"]=="enabled" && $res_seo["activated_user"]=="true")?$fied["id"]."_".strtr($djname$res_seo["str"], $res_seo["strto"]).".html":"index.php?page=userdetails&id=".$fied["id"])."'>".unesc($fied["prefixcolor"] . $djname $fied["suffixcolor"])."</a>";
              }
              else
                  
$djname=unesc($djname);
         
              echo 
"<tr><td class=header><b>".$language['BL_DJ'].":</b></td><td class=lista>&nbsp;<b>".$djname."</b></td></tr>";
          }
      }
      else
      {
          
$djname=mysqli_real_escape_string($GLOBALS['conn'],$shoutcast->GetServerTitle());

          
$petr1=do_sqlquery("SELECT `u`.`id`, `ul`.`prefixcolor`, `ul`.`suffixcolor` FROM `{$TABLE_PREFIX}users` `u` LEFT JOIN `{$TABLE_PREFIX}users_level` `ul` ON `u`.`id_level`=`ul`.`id` WHERE `u`.`username`='".$djname."'");
          if(@
mysqli_num_rows($petr1)>0)
          {
              
$fied=mysqli_fetch_assoc($petr1);
              
$djname="<a href='".(($btit_settings["fmhack_SEO_panel"]=="enabled" && $res_seo["activated_user"]=="true")?$fied["id"]."_".strtr($djname$res_seo["str"], $res_seo["strto"]).".html":"index.php?page=userdetails&id=".$fied["id"])."'>".unesc($fied["prefixcolor"] . $djname $fied["suffixcolor"])."</a>";
          }
          else
              
$djname=unesc($djname);
         
          echo 
"<tr><td class=header><b>".$language['BL_DJ'].":</b></td><td class=lista>&nbsp;<b>".$djname."</b></td></tr>";
      }
        
        echo 
"<tr><td class=header><b>".$language['BL_LISTEN'].":</b></td><td class=lista>&nbsp;<b><a href='index.php?page=listeners'> (".$shoutcast->GetCurrentListenersCount()." of ".$shoutcast->GetMaxListenersCount()." listeners, peak: ".$shoutcast->GetPeakListenersCount().")</a><p></b></td></tr>";
        echo 
"<tr><td class=header><b>".$language['BL_SONG'].":</b></td><td class=lista>&nbsp;<b>".cut_string($shoutcast->GetCurrentSongTitle(),intval(50))."</b></td></tr>\n";
        
echo 
"<tr><td class=header><b>".$language['BL_BRATE'].": </b></td><td class=lista><b>".$shoutcast->GetBitRate()." kbps&nbsp;<iframe src=\"".$BASEURL."/radioon.php\" width=\"0\" height=\"0\"></iframe></b></td></tr><tr><td colspan=2>&nbsp;</td></tr>";


        


        echo 
"</table><table border=0 cellpadding=0 cellspacing=0 align=center class=main><tr><td class=header>";
        
        echo 
"<center><b>".$language['BL_HIST'].":</b></center>\n";
        
$history $shoutcast->GetSongHistory();
        echo
"<textarea rows=3 cols=40 class=frm>";
        if (
is_array($history)) {
            for (
$i=0;$i<sizeof($history);$i++) {
                
                echo 
"[".get_date_time($history[$i]["playedat"])."] - ".$history[$i]["title"]."\n";
                

            }
            echo
"</textarea></td></tr></table>";

echo
'<center><a href="http://'.$btit_settings["radio_ip"].':'.$btit_settings["radio_port"].'/listen.pls" target="_new"><img src='.$BASEURL.'/radiostats/images/winamp.png width="48" height="48" title="Winamp" border="0"></a>&nbsp;<a href="javascript:PopRadio(\'mp\');"><img src='.$BASEURL.'/radiostats/images/mp.png width="48" height="48" title="WMP" border="0"></a>&nbsp;<a href="javascript:PopRadio(\'rp\');"><img src='.$BASEURL.'/radiostats/images/rp.png width="48" height="48" title="RealPlayer" border="0"></a>&nbsp;<a href="javascript:PopRadio(\'qt\');"><img src='.$BASEURL.'/radiostats/images/qt.png width="48" height="48" title="QuickTime" border="0"></a></center>';
echo
'</td></tr></table>';           

        } else {
        require(
"../".load_language("lang_shoutcast.php"));
            echo 
$language['BL_HIST_NO'];
        }
        
//echo "<p>";

        
    
} else {
    require(
"../".load_language("lang_shoutcast.php"));
        echo 
"<table width=100% cellpadding=3 cellspacing=0><tr><td class=blocklist><center><img src=".$BASEURL."/radiostats/images/radio-offline.png><font size=3><b>".$language['BL_NOSOURC']."<iframe src=\"".$BASEURL."/radiooff.php\" width=\"0\" height=\"0\"></iframe>&nbsp;<a href=index.php?page=dj&do=request>".$language['BL_APP']."</a></b></font>
        </td></tr></table>"
;
    }
} else {
    
// Ohhh, damnit..
    
echo $shoutcast->geterror();
}
?>


steven2007 10th August 2019 18:39

first version tries no change.
second version, error message is gone but no other display
third version the same, no error message but no other display

Napon 10th August 2019 20:32

So we getting some where with this one

PHP Code:

 <?php

/*******************************************************************
* shoutcast.class.php
* Version: 0.1
* Author: Henrik Malmberg
* Copyright (C) 2002, Henrik Malmberg
* henrik@ih.nut
* http://yoda.ih.nu/
*
*******************************************************************
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.

This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
General Public License for more details.

You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*******************************************************************/


class ShoutCast {
    
// Public
    
var $host;
    var 
$port;
    var 
$passwd;

    
//Private
    
var $_xml;
    var 
$_error;
    
    function 
openstats() {
        
$fp = @fsockopen($this->host$this->port$errno$errstr10);
        If (!
$fp) {
            
$this->_error "$errstr ($errno)";
            return(
0);
        } else {

        
///TEST BY NAPON
        
if ($this->sid==0)
        
fputs($fp"GET /admin.cgi?pass=".$this->passwd."&mode=viewxml HTTP/1.0\r\n");
        else
        
fputs($fp"GET /admin.cgi?sid=".$this->sid."&pass=".$this->passwd."&mode=viewxml HTTP/1.1\r\n");
            
//fputs($fp, "GET /admin.cgi?pass=".$this->passwd."&mode=viewxml HTTP/1.0\r\n");
            //fputs($fp, "User-Agent: Mozilla\r\n\r\n");
            
while (!feof($fp)) {
                    
$this->_xml .= fgets($fp512);
            }
            
fclose($fp);

            if (
stristr($this->_xml"HTTP/1.0 200 OK") == true) {
                
// <-H> Thanks to Blaster for this fix.. trim();
                
$this->_xml trim(substr($this->_xml42));
            } else {
                
$this->_error "Bad login";
                return(
0);
            }

            
$xmlparser xml_parser_create();
            if (!
xml_parse_into_struct($xmlparser$this->_xml$this->_values$this->_indexes)) {
                
$this->_error "Unparsable XML";
                return(
0);
            }
    
            
xml_parser_free($xmlparser);

            return(
1);
        }
    }

    function 
GetCurrentListenersCount() {
        return(
$this->_values[$this->_indexes["CURRENTLISTENERS"][0]]["value"]);
    }

    function 
GetPeakListenersCount() {
        return(
$this->_values[$this->_indexes["PEAKLISTENERS"][0]]["value"]);
    }

    function 
GetMaxListenersCount() {
        return(
$this->_values[$this->_indexes["MAXLISTENERS"][0]]["value"]);
    }
    
    function 
GetReportedListenersCount() {
        return(
$this->_values[$this->_indexes["REPORTEDLISTENERS"][0]]["value"]);
    }
    
    function 
GetAverageListenTime() {
        return(
$this->_values[$this->_indexes["AVERAGETIME"][0]]["value"]);
    }

    function 
GetServerGenre() {
        return(
$this->_values[$this->_indexes["SERVERGENRE"][0]]["value"]);
    }
    
    function 
GetServerURL() {
        return(
$this->_values[$this->_indexes["SERVERURL"][0]]["value"]);
    }

    function 
GetServerTitle() {
        return(
$this->_values[$this->_indexes["SERVERTITLE"][0]]["value"]);
    }
    
    function 
GetCurrentSongTitle() {
        return(
$this->_values[$this->_indexes["SONGTITLE"][0]]["value"]);
    }
    
    function 
GetIRC() {
        return(
$this->_values[$this->_indexes["IRC"][0]]["value"]);
    }

    function 
GetAIM() {
        return(
$this->_values[$this->_indexes["AIM"][0]]["value"]);
    }
    
    function 
GetICQ() {
        return(
$this->_values[$this->_indexes["ICQ"][0]]["value"]);
    }

    function 
GetWebHitsCount() {
        return(
$this->_values[$this->_indexes["WEBHITS"][0]]["value"]);
    }
    
    function 
GetStreamHitsCount() {
        return(
$this->_values[$this->_indexes["STREAMHITS"][0]]["value"]);
    }
    
    function 
GetStreamStatus() {
        return(
$this->_values[$this->_indexes["STREAMSTATUS"][0]]["value"]);
    }

    function 
GetBitRate() {
        return(
$this->_values[$this->_indexes["BITRATE"][0]]["value"]);
    }
    
    function 
GetSongHistory() {
        for(
$i=1;$i<sizeof($this->_indexes['TITLE']);$i++) {
            
$arrhistory[$i-1] = array(
                                    
"playedat"=>$this->_values[$this->_indexes['PLAYEDAT'][$i]]['value'],
                                    
"title"=>$this->_values[$this->_indexes['TITLE'][$i]]['value']
                                );
        }

        return(
$arrhistory);
    }

    function 
GetListeners() {
        for(
$i=0;$i<sizeof($this->_indexes['USERAGENT']);$i++) {
            
$arrlisteners[$i] = array(
                                    
"hostname"=>$this->_values[$this->_indexes['HOSTNAME'][$i]]['value'],
                                    
"useragent"=>$this->_values[$this->_indexes['USERAGENT'][$i]]['value'],
                                    
"underruns"=>$this->_values[$this->_indexes['UNDERRUNS'][$i]]['value'],
                                    
"connecttime"=>$this->_values[$this->_indexes['CONNECTTIME'][$i]]['value'],
                                    
"pointer"=>$this->_values[$this->_indexes['POINTER'][$i]]['value'],
                                    
"uid"=>$this->_values[$this->_indexes['UID'][$i]]['value'],
                                );
        }

        return(
$arrlisteners);
    }

    function 
geterror() { return($this->_error); }
}

?>

so i need to get this one working with it

so add to the fetch.php

PHP Code:

if ($shoutcast->sid>0) {
    
$v2info="?sid=".$shoutcast->sid;
    
$v2xtra=":".$shoutcast->sid;
    } else {
    
$v2info="";
    
$v2xtra="";




All times are GMT +2. The time now is 12:54.

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