Changeset 738 for trunk/Modules/SpeedTest/download.php
- Timestamp:
- Apr 14, 2015, 10:20:16 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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";
Note:
See TracChangeset
for help on using the changeset viewer.