Пример #1
0
                    $array[$iTotal]["videoCodec"] = $string_videoCodec;
                    $array[$iTotal]["audioCodec"] = $string_audioCodec;
                    $output = $array;
                }
                $iTotal++;
            }
        }
        return $output;
    }
}
$activity = new activity();
if (isset($_GET['xml'])) {
    if ($_GET['xml'] == "sessions") {
        header('Content-Type: application/xml');
        echo "<sessions>";
        foreach ($activity->sessionProgressView("xml") as $val) {
            echo "<session>\n\t\t\t\t\t<alertBar>";
            if ($plexServer->sessions("count") == 1) {
                echo "<string1>" . $plexServer->lang()->index->userCountPre1User . "</string1>";
                echo "<string2>" . $plexServer->lang()->index->userCount1User . "</string2>";
            } else {
                echo "<string1>" . $plexServer->lang()->index->userCountPreUsers . "</string1>";
                echo "<string2>" . $plexServer->lang()->index->userCountUsers . "</string2>";
            }
            echo "<count>" . $plexServer->sessions("count") . "</count>\n\t\t\t\t\t</alertBar>\n\t\t\t\t\t<colums>" . $val['colums'] . "</colums>\n\t\t\t\t\t<url>" . $val['url'] . "</url>\n\t\t\t\t\t<img>" . $val['img'] . "</img>\n\t\t\t\t\t<title>" . $val['title'] . "</title>\n\t\t\t\t\t<user>" . $val['user'] . "</user>\n\t\t\t\t\t<playStatus>" . $val['playStatus'] . "</playStatus>\n\t\t\t\t\t<platformImage>" . $val['platformImage'] . "</platformImage>\n\t\t\t\t\t<streamID>" . $val['streamID'] . "</streamID>\n\t\t\t\t\t<bar>" . $val['bar'] . "</bar>\n\t\t\t\t\t<percent>" . $val['percent'] . "</percent>\n\t\t\t\t\t<streamType>" . $val['streamType'] . "</streamType>\n\t\t\t\t\t<videoCodec>" . $val['videoCodec'] . "</videoCodec>\n\t\t\t\t\t<audioCodec>" . $val['audioCodec'] . "</audioCodec>\n\t\t\t\t</session>";
        }
        echo "</sessions>";
    }
    if ($_GET['xml'] == "test") {
        echo "<pre>";
        print_r($activity->sessionProgressView("xml"));