Changeset 560 for trunk/Modules/SpeedTest/SpeedTest.php
- Timestamp:
- Aug 9, 2013, 10:29:25 PM (11 years ago)
- Location:
- trunk/Modules/SpeedTest
- Files:
-
- 1 copied
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/SpeedTest/SpeedTest.php
r559 r560 1 1 <?php 2 2 3 ############################################################################### 3 4 ## Fancy Speed Test - Easily measure your upload and download speeds … … 7 8 ## Version: 1.1 8 9 ## Date: 2006-02-06 9 ## Purpose: Display a welcome page, or redirect straight to the 10 ## Purpose: Display a welcome page, or redirect straight to the 10 11 ## download test if auto_start is enabled 11 12 ############################################################################### 12 13 13 require("common.php"); 14 ReadConfig("speedtest.cfg"); 14 class ModuleSpeedTest extends AppModule 15 { 16 function __construct($System) 17 { 18 parent::__construct($System); 19 $this->Name = 'SpeedTest'; 20 $this->Version = '1.0'; 21 $this->Creator = 'Chronos'; 22 $this->License = 'GNU/GPL'; 23 $this->Description = 'Testing of download and upload bandwidth'; 24 $this->Dependencies = array(); 25 } 26 27 function Start() 28 { 29 parent::Start(); 30 $this->System->Pages['speedtest'] = 'PageSpeedTest'; 31 32 } 33 } 15 34 35 class PageSpeedTest extends Page 36 { 37 var $FullTitle = 'Test rychlosti připojení'; 38 var $ShortTitle = 'Test rychlosti'; 39 var $ParentClass = 'PagePortal'; 40 41 function Show() 42 { 43 if(count($this->System->PathItems) > 1) 44 { 45 if($this->System->PathItems[1] == 'download.php') return($this->ShowDownload()); 46 //else if($this->System->PathItems[1] == 'rss') return($this->ShowRSS()); 47 else return(PAGE_NOT_FOUND); 48 } else return($this->ShowMain()); 49 } 50 51 function ShowDownload() 52 { 53 global $config; 54 require_once(dirname(__FILE__)."/download.php"); 55 56 } 57 58 function ShowMain() 59 { 60 global $config; 61 62 require_once(dirname(__FILE__)."/common.php"); 63 ReadConfig(dirname(__FILE__)."/speedtest.cfg"); 64 16 65 ## Redirect immediately to download.php if auto_start = 1 17 66 if($config->{'general'}->{'auto_start'}) { 18 Header("Location: ".$config ->{'general'}->{'base_url'}."/download.php");67 Header("Location: ".$config['general']['base_url']."/download.php"); 19 68 exit; 20 69 } 21 70 22 ?> 23 <html> 71 $Output = '<html> 24 72 <head> 25 <title> <?php print $config->{'general'}->{'page_title'}; ?>- Fancy Speed Test</title>73 <title>'.$config->{'general'}->{'page_title'}.' - Fancy Speed Test</title> 26 74 <meta http-equiv="Expires" CONTENT="Fri, Jan 1 1980 00:00:00 GMT" /> 27 75 <meta http-equiv="Pragma" CONTENT="no-cache" /> … … 29 77 <link rel="stylesheet" href="style.css" /> 30 78 </head> 31 <body> 79 <body>'; 32 80 33 <?php34 81 if(file_exists("header.html")) { 35 82 ## Include "header.html" for a custom header, if the file exists … … 39 86 print "<center>\n"; 40 87 } 41 ?> 42 <div id="speedtest_content"> 88 $Output .= '<div id="speedtest_content">'; 43 89 44 45 <?php46 90 if(file_exists("welcome.html")) { 47 91 ## Include "welcome.html" for a custom welcome page, if the file exists … … 49 93 } else { 50 94 ## Else print a standard welcome message 51 ?> 52 <center> 53 <h2>Fancy Speed Test</h2> 95 96 $Output .= '<center> 54 97 <div style="width: 400px;"> 55 98 Welcome to our speedtest. This test will measure your connection speed to and … … 57 100 back to the server. The test should take approximately 30 seconds to complete. 58 101 </div> 59 </center> 60 <?php } ?> 102 </center>'; 103 } 61 104 62 <center><h2><a class="start_test" title="Begin Speed Test" href="<?php echo $config->{'general'}->{'base_url'}; ?>/download.php">Start Test</a></h2></center>105 $Output .= '<center><h2><a class="start_test" title="Begin Speed Test" href="'.$config->{'general'}->{'base_url'}.'/download.php">Start Test</a></h2></center> 63 106 <div id="speedtest_credits"> 64 107 Powered by <a title="Brandon Checketts Fancy Source Speedtest" href="http://www.brandonchecketts.com/speedtest/" target="_new">Fancy Speed Test</a> 65 108 </div> 66 </div> 67 <?php 109 </div>'; 110 68 111 if(file_exists("footer.html")) { 69 112 ## Include "footer.html" for a custom footer, if the file exists … … 73 116 print "</center>\n"; 74 117 } 75 ?> 118 return($Output); 119 } 120 } 76 121 77 78 79 80 81 </body>82 </html>83
Note:
See TracChangeset
for help on using the changeset viewer.