コード例 #1
0
ファイル: whos_listening.php プロジェクト: Karpec/gizd
// 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.
//
////////////////////////////////////////////////////////////////////////////////////
error_reporting(0);
if (!defined("IN_BTIT")) {
    die("non direct access!");
}
global $btit_settings, $BASEURL;
$listennowtpl = new bTemplate();
require load_language("lang_userdetails.php");
include "./radiostats/shoutcast.class.php";
$listen = new ShoutCast();
$listen->host = $btit_settings["radio_ip"];
$listen->port = $btit_settings["radio_port"];
$listen->passwd = $btit_settings["radio_pass"];
if ($listen->openstats()) {
    // We got the XML, gogogo!..
    if ($listen->GetStreamStatus()) {
        require load_language("lang_shoutcast.php");
        $hostname = $listen->GetListeners();
        $j = 0;
        $list = array();
        if (is_array($hostname)) {
            for ($i = 0; $i < sizeof($hostname); $i++) {
                $ip = $hostname[$i]["hostname"];
                $client = $hostname[$i]["useragent"];
                $damn = do_sqlquery("select id,username FROM {$TABLE_PREFIX}users WHERE cip='" . $ip . "' ORDER BY lastconnect ASC LIMIT 1", true);
コード例 #2
0
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;
$shoutcast->port;
$shoutcast->tunein;
$shoutcast->passwd;
// var_dump($shoutcast->openstats());
if ($shoutcast->openstats()) {
    if ($shoutcast->GetStreamStatus()) {
        echo "Status:  " . $shoutcast->GetStreamStatus() . " Open:  " . $shoutcast->openstats();
        echo "<br>";
        ////////////////////////////////////////////////////
        // UMWANDLUNG VON FEHLERHAFT ANGEZEIGTEN UMLAUTEN //
        ////////////////////////////////////////////////////
        $aktuellertitel = $shoutcast->GetCurrentSongTitle();
        echo "was ankommt:  " . $shoutcast->GetCurrentSongTitle();
        echo "<br>";
コード例 #3
0
ファイル: fetch.php プロジェクト: Karpec/gizd
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->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 "<br><center><img src=radiostats/images/radio-online.png></center><br><br>";
        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) {