Ignore:
Timestamp:
Apr 14, 2015, 10:20:16 PM (10 years ago)
Author:
chronos
Message:
  • Removed: Spaces on end of line.
  • Modified: Tabs converted to spaces.
Location:
trunk/Modules/SpeedTest
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/SpeedTest/SpeedTest.php

    r615 r738  
    2424    $this->Dependencies = array();
    2525  }
    26  
     26
    2727  function DoStart()
    2828  {
    2929    $this->System->Pages['speedtest'] = 'PageSpeedTest';
    30   } 
     30  }
    3131}
    3232
     
    3636  var $ShortTitle = 'Test rychlosti';
    3737  var $ParentClass = 'PagePortal';
    38  
     38
    3939  function Show()
    4040  {
     
    4646    } else return($this->ShowMain());
    4747  }
    48  
     48
    4949  function ShowDownload()
    5050  {
    5151    global $config;
    5252    require_once(dirname(__FILE__)."/download.php");
    53    
     53
    5454  }
    55  
     55
    5656  function ShowMain()
    57   {   
     57  {
    5858    global $config;
    59    
     59
    6060    require_once(dirname(__FILE__)."/common.php");
    6161    ReadConfig(dirname(__FILE__)."/speedtest.cfg");
    62    
     62
    6363## Redirect immediately to download.php if auto_start = 1
    6464if($config->{'general'}->{'auto_start'}) {
     
    7070<head>
    7171<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" />
    7575<link rel="stylesheet" href="style.css" />
    7676</head>
     
    8989    ## Include "welcome.html" for a custom welcome page, if the file exists
    9090    include("welcome.html");
    91 } else { 
     91} else {
    9292    ## Else print a standard welcome message
    9393
  • trunk/Modules/SpeedTest/download.php

    r560 r738  
    3838        ## Intial test is done.  Set down/upload sizes to the same as
    3939        ## 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
    4141        ## 16 second test
    4242        $down_kbytes = $_GET['downspeed'];
     
    4646        $down_kbytes = $config->{'download'}->{'initial_kbytes'};
    4747        $up_kbytes = $config->{'upload'}->{'initial_kbytes'};
    48    } 
     48   }
    4949} else {
    5050    ## auto_size is off.  Just to the default sizes
     
    8484<head>
    8585<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" />
    8989<link rel="stylesheet" href="style.css" />
    9090</head>
    9191<body>
    9292
    93 <?php 
     93<?php
    9494if(file_exists("header.html")) {
    9595    ## Include "header.html" for a custom header, if the file exists
    9696    include("header.html");
    97 } else { 
     97} else {
    9898    ## Else just print a plain header
    9999    print "<br /><br /><br /><br />\n";
     
    102102<div id="speedtest_contents">
    103103
    104 <?php 
    105 if( ($config_auto_size) && (! isset($_GET['auto_size'])) ) { 
     104<?php
     105if( ($config_auto_size) && (! isset($_GET['auto_size'])) ) {
    106106    ## auto_size is performing the initial, small test
    107107    print "<div>Calculating appropriate file sizes for testing</div>\n";
    108     ob_flush(); 
     108    ob_flush();
    109109} else {
    110110?>
     
    190190    }
    191191}
    192    
     192
    193193
    194194// -->
     
    218218
    219219    ## Read some stuff from our payload file
    220         $data_file = "payload.js";
    221         $fd = fopen ($data_file, "r");
     220  $data_file = "payload.js";
     221  $fd = fopen ($data_file, "r");
    222222    $data = fread ($fd, $each_chunk * 1024);
    223223
     
    281281    CompleteDownloadBar();
    282282
    283         time          = new Date();
    284         endtime       = time.getTime();
    285         if (endtime == starttime)
    286                 {downloadtime = 0
    287         } else {
    288             downloadtime = (endtime - starttime)/1000;
    289         }
     283  time          = new Date();
     284  endtime       = time.getTime();
     285  if (endtime == starttime)
     286    {downloadtime = 0
     287  } else {
     288      downloadtime = (endtime - starttime)/1000;
     289  }
    290290    <?php if(! $config->{'upload'}->{'skip_upload'}){ ?> StartUpload(); <?php } ?>
    291291
    292         down_size = <?php echo $total_kbytes; ?>;
    293         downspeed     = down_size/downloadtime;
    294         downspeed          = (Math.round((downspeed*8)*10*1.024))/10;
     292  down_size = <?php echo $total_kbytes; ?>;
     293  downspeed     = down_size/downloadtime;
     294  downspeed          = (Math.round((downspeed*8)*10*1.024))/10;
    295295
    296296    formElement = document.getElementById('upload_test_form');
    297297
    298 <?php 
     298<?php
    299299if($config_auto_size && (! isset($_GET['auto_size'])) ) {
    300300    $params_auto_size = "&auto_size=1";
  • trunk/Modules/SpeedTest/results.php

    r331 r738  
    4949<head>
    5050<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" />
    5454<link rel="stylesheet" href="style.css" />
    5555</head>
    5656<body>
    5757
    58 <?php 
     58<?php
    5959if(file_exists("header.html")) {
    6060    ## Include "header.html" for a custom header, if the file exists
    6161    include("header.html");
    62 } else { 
     62} else {
    6363    ## Else just print a plain header
    6464    print "<center>\n";
     
    118118        print "</table>\n";
    119119        }
    120        
     120
    121121?>
    122122
Note: See TracChangeset for help on using the changeset viewer.