Changeset 738 for trunk/Modules/SpeedTest
- Timestamp:
- Apr 14, 2015, 10:20:16 PM (10 years ago)
- Location:
- trunk/Modules/SpeedTest
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/SpeedTest/SpeedTest.php
r615 r738 24 24 $this->Dependencies = array(); 25 25 } 26 26 27 27 function DoStart() 28 28 { 29 29 $this->System->Pages['speedtest'] = 'PageSpeedTest'; 30 } 30 } 31 31 } 32 32 … … 36 36 var $ShortTitle = 'Test rychlosti'; 37 37 var $ParentClass = 'PagePortal'; 38 38 39 39 function Show() 40 40 { … … 46 46 } else return($this->ShowMain()); 47 47 } 48 48 49 49 function ShowDownload() 50 50 { 51 51 global $config; 52 52 require_once(dirname(__FILE__)."/download.php"); 53 53 54 54 } 55 55 56 56 function ShowMain() 57 { 57 { 58 58 global $config; 59 59 60 60 require_once(dirname(__FILE__)."/common.php"); 61 61 ReadConfig(dirname(__FILE__)."/speedtest.cfg"); 62 62 63 63 ## Redirect immediately to download.php if auto_start = 1 64 64 if($config->{'general'}->{'auto_start'}) { … … 70 70 <head> 71 71 <title>'.$config->{'general'}->{'page_title'}.' - Fancy Speed Test</title> 72 <meta http-equiv="Expires" CONTENT="Fri, Jan 1 1980 00:00:00 GMT" /> 73 <meta http-equiv="Pragma" CONTENT="no-cache" /> 74 <meta http-equiv="Cache-Control" CONTENT="no-cache" /> 72 <meta http-equiv="Expires" CONTENT="Fri, Jan 1 1980 00:00:00 GMT" /> 73 <meta http-equiv="Pragma" CONTENT="no-cache" /> 74 <meta http-equiv="Cache-Control" CONTENT="no-cache" /> 75 75 <link rel="stylesheet" href="style.css" /> 76 76 </head> … … 89 89 ## Include "welcome.html" for a custom welcome page, if the file exists 90 90 include("welcome.html"); 91 } else { 91 } else { 92 92 ## Else print a standard welcome message 93 93 -
trunk/Modules/SpeedTest/download.php
r560 r738 38 38 ## Intial test is done. Set down/upload sizes to the same as 39 39 ## our initial measured speeds. That way the test should take 40 ## about 8 seconds for each test (up/down) making it about a 40 ## about 8 seconds for each test (up/down) making it about a 41 41 ## 16 second test 42 42 $down_kbytes = $_GET['downspeed']; … … 46 46 $down_kbytes = $config->{'download'}->{'initial_kbytes'}; 47 47 $up_kbytes = $config->{'upload'}->{'initial_kbytes'}; 48 } 48 } 49 49 } else { 50 50 ## auto_size is off. Just to the default sizes … … 84 84 <head> 85 85 <title><?php print $config->{'general'}->{'page_title'}; ?> - Fancy Speed Test</title> 86 <meta http-equiv="Expires" CONTENT="Fri, Jan 1 1980 00:00:00 GMT" /> 87 <meta http-equiv="Pragma" CONTENT="no-cache" /> 88 <meta http-equiv="Cache-Control" CONTENT="no-cache" /> 86 <meta http-equiv="Expires" CONTENT="Fri, Jan 1 1980 00:00:00 GMT" /> 87 <meta http-equiv="Pragma" CONTENT="no-cache" /> 88 <meta http-equiv="Cache-Control" CONTENT="no-cache" /> 89 89 <link rel="stylesheet" href="style.css" /> 90 90 </head> 91 91 <body> 92 92 93 <?php 93 <?php 94 94 if(file_exists("header.html")) { 95 95 ## Include "header.html" for a custom header, if the file exists 96 96 include("header.html"); 97 } else { 97 } else { 98 98 ## Else just print a plain header 99 99 print "<br /><br /><br /><br />\n"; … … 102 102 <div id="speedtest_contents"> 103 103 104 <?php 105 if( ($config_auto_size) && (! isset($_GET['auto_size'])) ) { 104 <?php 105 if( ($config_auto_size) && (! isset($_GET['auto_size'])) ) { 106 106 ## auto_size is performing the initial, small test 107 107 print "<div>Calculating appropriate file sizes for testing</div>\n"; 108 ob_flush(); 108 ob_flush(); 109 109 } else { 110 110 ?> … … 190 190 } 191 191 } 192 192 193 193 194 194 // --> … … 218 218 219 219 ## Read some stuff from our payload file 220 221 220 $data_file = "payload.js"; 221 $fd = fopen ($data_file, "r"); 222 222 $data = fread ($fd, $each_chunk * 1024); 223 223 … … 281 281 CompleteDownloadBar(); 282 282 283 284 285 286 287 288 289 283 time = new Date(); 284 endtime = time.getTime(); 285 if (endtime == starttime) 286 {downloadtime = 0 287 } else { 288 downloadtime = (endtime - starttime)/1000; 289 } 290 290 <?php if(! $config->{'upload'}->{'skip_upload'}){ ?> StartUpload(); <?php } ?> 291 291 292 293 294 292 down_size = <?php echo $total_kbytes; ?>; 293 downspeed = down_size/downloadtime; 294 downspeed = (Math.round((downspeed*8)*10*1.024))/10; 295 295 296 296 formElement = document.getElementById('upload_test_form'); 297 297 298 <?php 298 <?php 299 299 if($config_auto_size && (! isset($_GET['auto_size'])) ) { 300 300 $params_auto_size = "&auto_size=1"; -
trunk/Modules/SpeedTest/results.php
r331 r738 49 49 <head> 50 50 <title><?php print $config->{'general'}->{'page_title'}; ?> - Fancy Speed Test</title> 51 <meta http-equiv="Expires" CONTENT="Fri, Jan 1 1980 00:00:00 GMT" /> 52 <meta http-equiv="Pragma" CONTENT="no-cache" /> 53 <meta http-equiv="Cache-Control" CONTENT="no-cache" /> 51 <meta http-equiv="Expires" CONTENT="Fri, Jan 1 1980 00:00:00 GMT" /> 52 <meta http-equiv="Pragma" CONTENT="no-cache" /> 53 <meta http-equiv="Cache-Control" CONTENT="no-cache" /> 54 54 <link rel="stylesheet" href="style.css" /> 55 55 </head> 56 56 <body> 57 57 58 <?php 58 <?php 59 59 if(file_exists("header.html")) { 60 60 ## Include "header.html" for a custom header, if the file exists 61 61 include("header.html"); 62 } else { 62 } else { 63 63 ## Else just print a plain header 64 64 print "<center>\n"; … … 118 118 print "</table>\n"; 119 119 } 120 120 121 121 ?> 122 122
Note:
See TracChangeset
for help on using the changeset viewer.