* @see http://tsstatus.sebastien.me/ * @version 2013-08-31 **/ $enableGenerator = false; $absoluteDir = dirname(__FILE__) . "/"; $wwwDir = substr($_SERVER["SCRIPT_NAME"], 0, strrpos($_SERVER["SCRIPT_NAME"], "/") + 1); $host = isset($_POST["host"]) ? $_POST["host"] : ""; $qport = isset($_POST["qport"]) ? intval($_POST["qport"]) : 10011; $portOrId = isset($_POST["portOrId"]) ? intval($_POST["portOrId"]) : 1; $port = isset($_POST["port"]) ? intval($_POST["port"]) : 9987; $sid = isset($_POST["sid"]) ? intval($_POST["sid"]) : 1; $showNicknameBox = !isset($_POST["showNicknameBox"]); $timeout = isset($_POST["timeout"]) ? intval($_POST["timeout"]) : 2; $showPasswordBox = !isset($_POST["showPasswordBox"]); $serverQueryLogin = isset($_POST["serverQueryLogin"]) ? $_POST["serverQueryLogin"] : ""; $serverQueryPassword = isset($_POST["serverQueryPassword"]) ? $_POST["serverQueryPassword"] : ""; $cacheTime = isset($_POST["cacheTime"]) ? intval($_POST["cacheTime"]) : 0; $cacheFile = isset($_POST["cacheFile"]) ? $_POST["cacheFile"] : ""; $limitToChannels = isset($_POST["limitToChannels"]) ? $_POST["limitToChannels"] : ""; $hideEmptyChannels = !isset($_POST["hideEmptyChannels"]); $hideParentChannels = !isset($_POST["hideParentChannels"]); if($timeout < 1) $timeout = 0; else if($timeout > 10) $timeout = 10; $htmlCode = ' '; echo $htmlCode; $phpCode = "useServerPort(' . $port . ');' . "\n"; if($portOrId == 2) $phpCode .= '$tsstatus->useServerId(' . $sid . ');' . "\n"; $phpCode .= '$tsstatus->imagePath = "' . $wwwDir . 'img/";' . "\n"; $phpCode .= '$tsstatus->timeout = ' . $timeout . ";\n"; if($serverQueryLogin != "") $phpCode .= '$tsstatus->setLoginPassword("'.$serverQueryLogin.'", "'.$serverQueryPassword.'");' . "\n"; if($cacheTime > 0 && $cacheFile == "") $phpCode .= '$tsstatus->setCache('.$cacheTime.');' . "\n"; if($cacheTime > 0 && $cacheFile != "") $phpCode .= '$tsstatus->setCache('.$cacheTime.', "'.$cacheFile.'");' . "\n"; if($limitToChannels != "") $phpCode .= '$tsstatus->limitToChannels('.$limitToChannels.');' . "\n"; $phpCode .= '$tsstatus->hideEmptyChannels = ' . (!$hideEmptyChannels ? "true" : "false") . ";\n"; $phpCode .= '$tsstatus->hideParentChannels = ' . (!$hideParentChannels ? "true" : "false") . ";\n"; $phpCode .= '$tsstatus->showNicknameBox = ' . ($showNicknameBox ? "true" : "false") . ";\n"; $phpCode .= '$tsstatus->showPasswordBox = ' . ($showPasswordBox ? "false" : "true") . ";\n"; $phpCode .= 'echo $tsstatus->render();' . "\n?>"; ?>