Name = 'SpeedTest'; $this->Version = '1.0'; $this->Creator = 'Chronos'; $this->License = 'GNU/GPLv3'; $this->Description = 'Testing of download and upload bandwidth'; } function DoStart(): void { $this->System->Pages['speedtest'] = 'PageSpeedTest'; } } class PageSpeedTest extends Page { function __construct(System $System) { parent::__construct($System); $this->Title = 'Test rychlosti'; $this->Description = 'Test rychlosti připojení'; $this->ParentClass = 'PagePortal'; } function Show(): string { if (count($this->System->PathItems) > 1) { if ($this->System->PathItems[1] == 'download.php') return $this->ShowDownload(); //else if ($this->System->PathItems[1] == 'rss') return $this->ShowRSS(); else return PAGE_NOT_FOUND; } else return $this->ShowMain(); } function ShowDownload(): void { global $config; require_once(dirname(__FILE__)."/download.php"); } function ShowMain(): string { global $config; require_once(dirname(__FILE__)."/common.php"); ReadConfig(dirname(__FILE__)."/speedtest.cfg"); ## Redirect immediately to download.php if auto_start = 1 if ($config->{'general'}->{'auto_start'}) { Header("Location: ".$config['general']['base_url']."/download.php"); exit; } $Output = ' '.$config->{'general'}->{'page_title'}.' - Fancy Speed Test '; if (file_exists("header.html")) { ## Include "header.html" for a custom header, if the file exists include("header.html"); } else { ## Else just print a plain header print "
\n"; } $Output .= '
'; if (file_exists("welcome.html")) { ## Include "welcome.html" for a custom welcome page, if the file exists include("welcome.html"); } else { ## Else print a standard welcome message $Output .= '
Welcome to our speedtest. This test will measure your connection speed to and from our server by downloading some data from our server, and then uploading it back to the server. The test should take approximately 30 seconds to complete.
'; } $Output .= '

Start Test

Powered by Fancy Speed Test
'; if (file_exists("footer.html")) { ## Include "footer.html" for a custom footer, if the file exists include("footer.html"); } else { ## Else just print a plain footer print "
\n"; } return $Output; } }