Changeset 848


Ignore:
Timestamp:
1/3/2009 12:42:49 AM (6 years ago)
Author:
lowjoel
Message:

-Implemented supersedance for updates
-Implemented the content-length header for browsers to know how much to download
-

Location:
branches/website
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/website/download.php

    r660 r848  
    55 
    66//Get the download link associated with the download 
    7 $query = mysql_query(sprintf('SELECT Link FROM downloads WHERE DownloadID=%d', intval($_GET['id']))); 
     7$query = mysql_query(sprintf('SELECT Link FROM downloads WHERE DownloadID=%d AND Superseded=0', intval($_GET['id']))); 
    88if (!$query) 
    99    exit; 
     
    1919{ 
    2020    $fileName = substr($row['Link'], 1); 
    21     header("content-type: application/octet-stream"); 
     21    header("Content-Type: application/octet-stream"); 
     22    header('Content-Length: ' . filesize('./downloads/' . $fileName)); 
    2223    if (strpos($_SERVER['HTTP_USER_AGENT'], "MSIE") !== false) 
    2324    { 
    2425        //IE browser 
    25         header('Content-Disposition: inline; filename="'.$fileName.'"'); 
     26        header('Content-Disposition: inline; filename="' . $fileName . '"'); 
    2627        header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); 
    2728        header('Pragma: public'); 
     
    2930    else 
    3031    { 
    31         header('Content-Disposition: attachment; filename="'.$fileName.'"'); 
     32        header('Content-Disposition: attachment; filename="' . $fileName . '"'); 
    3233        header('Pragma: no-cache'); 
    3334    } 
  • branches/website/updates/index.php

    r662 r848  
    2828        downloads.PublisherID=publishers.PublisherID 
    2929    WHERE 
    30         (MinVersion IS NULL AND MaxVersion IS NULL) OR 
    31         (MinVersion IS NULL AND MaxVersion > \'%1$s\') OR 
    32         (MinVersion <= \'%1$s\' AND MaxVersion IS NULL) OR 
    33         (MinVersion <= \'%1$s\' AND MaxVersion > \'%1$s\') 
     30        (Superseded = 0) AND 
     31        ( 
     32            (MinVersion IS NULL AND MaxVersion IS NULL) OR 
     33            (MinVersion IS NULL AND MaxVersion > \'%1$s\') OR 
     34            (MinVersion <= \'%1$s\' AND MaxVersion IS NULL) OR 
     35            (MinVersion <= \'%1$s\' AND MaxVersion > \'%1$s\') 
     36        ) 
    3437    ORDER BY `Type` ASC', $version)); 
    3538 
Note: See TracChangeset for help on using the changeset viewer.