コード例 #1
0
ファイル: whos_listening.php プロジェクト: Karpec/gizd
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);
                if (@mysqli_num_rows($damn) > 0) {
                    $gimme = mysqli_fetch_array($damn);
                } else {
                    $gimme["id"] = 1;
                    $gimme["username"] = "******";
                }
                if (substr($client, 0, 8) == "NSPlayer") {
                    $client = "<img src='" . $BASEURL . "/radiostats/images/mp.png' width='32' height='32' border='0' alt='Windows.Media.Player' title='Windows.Media.Player'>";