2016-06-28 21:18:59 +00:00
|
|
|
<?php
|
|
|
|
require_once __DIR__ . "/include/header.php";
|
|
|
|
require_once __DIR__ . "/include/tsutils.php";
|
2017-01-29 21:56:17 +00:00
|
|
|
require_once __DIR__ . "/include/cacheutils.class.php";
|
2016-06-28 21:18:59 +00:00
|
|
|
|
2017-01-29 21:56:17 +00:00
|
|
|
$cacheutils = new CacheUtils('tsviewer');
|
2016-06-28 21:18:59 +00:00
|
|
|
|
2017-01-29 21:56:17 +00:00
|
|
|
if($cacheutils->isExpired()) {
|
|
|
|
$cacheutils->setValue([getViewer(), date('d-m-Y H:i:s')], 300);
|
2016-06-28 21:18:59 +00:00
|
|
|
}
|
|
|
|
|
2017-01-29 21:56:17 +00:00
|
|
|
$tsviewer = $cacheutils->getValue();
|
|
|
|
|
2016-06-28 21:18:59 +00:00
|
|
|
// print_r ($tsviewer);
|
|
|
|
|
|
|
|
function getViewer() {
|
2016-07-25 14:14:04 +00:00
|
|
|
global $lang;
|
|
|
|
|
2016-06-28 21:18:59 +00:00
|
|
|
try {
|
2017-02-01 15:31:32 +00:00
|
|
|
$tsAdmin = getTeamspeakConnection("#no_query_clients");
|
|
|
|
$base = "lib/ts3phpframework/images";
|
|
|
|
return $tsAdmin->getViewer(new TeamSpeak3_Viewer_Html("$base/viewer/", "$base/flags/", "data:image"));
|
2016-10-31 02:18:46 +00:00
|
|
|
} catch (TeamSpeak3_Exception $e) {
|
2016-07-25 14:14:04 +00:00
|
|
|
return '<div class="alert alert-danger"><p class="text-center">' . translate($lang["general"]["scripterror"], [$e->getCode(), $e->getMessage()]) . '</p></div>';
|
2016-06-28 21:18:59 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|
|
|
|
|
|
|
|
<div class="panel panel-default">
|
|
|
|
<div class="panel-heading">
|
2016-07-25 14:14:04 +00:00
|
|
|
<h3 class="panel-title"><i class="fa fa-eye" aria-hidden="true"></i> <?php tl($lang["viewer"]["title"]); ?></h3>
|
2016-06-28 21:18:59 +00:00
|
|
|
</div>
|
|
|
|
<div class="panel-body">
|
|
|
|
<?php echo $tsviewer[0]; ?>
|
|
|
|
</div>
|
|
|
|
<div class="panel-footer">
|
2016-10-12 19:57:49 +00:00
|
|
|
<?php tl($lang["viewer"]["lastupdate"], [$tsviewer[1]]); ?><!-- <span style="float: right">Podgląd odświeża się co 30 sekund</span> -->
|
2016-06-28 21:18:59 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<?php
|
|
|
|
require_once __DIR__ . "/include/footer.php";
|
|
|
|
?>
|