www/adium.im 299:f07ac84facdf: Updated our version checking logi...

commits at adium.im commits at adium.im
Sat Oct 30 23:40:49 UTC 2010


details:	http://hg.adium.im/www/adium.im/rev/f07ac84facdf
revision:	299:f07ac84facdf
author:		Evan Schoenberg
date:		Sat Oct 30 18:39:39 2010 -0500

Updated our version checking logic to look for a Mac OS X string in the uesr agent, and added support for 10.5.8 and 10.6 specific versions. Changed default version to 10.6.
Subject: www/adium.im 300:8ef240af69cf: Merged

details:	http://hg.adium.im/www/adium.im/rev/8ef240af69cf
revision:	300:8ef240af69cf
author:		Evan Schoenberg
date:		Sat Oct 30 18:40:43 2010 -0500

Merged

diffs (205 lines):

diff -r 52fd23b0ae77 -r 8ef240af69cf beta/index.php
--- a/beta/index.php	Sat Oct 30 13:58:35 2010 -0500
+++ b/beta/index.php	Sat Oct 30 18:40:43 2010 -0500
@@ -209,7 +209,13 @@
 			<a href="http://www.adium.im/">Adium</a>
 		</div>
 		<div id="navcontainer">
-			<a class="navtab" href="http://adium.im/">Download</a> <a class="navtab" href="http://adium.im/screenshots/">Screenshots</a> <a class="navtab" href="http://adium.im/screencasts/">Videos</a> <a class="navtab" href="http://adium.im/blog/">Blog</a> <a class="navtabcurrent" href="http://trac.adium.im">Support & Development</a> <a class="navtab" href="http://www.adiumxtras.com/">Xtras</a>
+			<a class="navtab" href="http://adium.im/">Download</a> 
+			<a class="navtab" href="http://adium.im/screenshots/">Screenshots</a> 
+			<a class="navtab" href="http://adium.im/screencasts/">Videos</a> 
+			<a class="navtab" href="http://adium.im/blog/">Blog</a> 
+			<a class="navtabcurrent" href="http://trac.adium.im">Support/Development</a> 
+			<a class="navtab" href="http://adium.spreadshirt.com">Merchandise</a>
+			<a class="navtab" href="http://www.adiumxtras.com/">Xtras</a>
 		</div>
 		
 		<div id="content">
diff -r 52fd23b0ae77 -r 8ef240af69cf blog/wp-content/themes/default/header.php
--- a/blog/wp-content/themes/default/header.php	Sat Oct 30 13:58:35 2010 -0500
+++ b/blog/wp-content/themes/default/header.php	Sat Oct 30 18:40:43 2010 -0500
@@ -15,11 +15,12 @@
 			<a href="/">Adium</a>
         </div>
 		<div id="navcontainer">
-			<a class="navtab" href="/">Download</a>
-			<a class="navtab" href="/screenshots/">Screenshots</a>
-			<a class="navtab" href="/screencasts/">Videos</a>
-			<a class="navtabcurrent" href="/blog/">Blog</a>
-			<a class="navtab" href="http://trac.adium.im">Support & Development</a>
+			<a class="navtab" href="http://adium.im/">Download</a> 
+			<a class="navtab" href="http://adium.im/screenshots/">Screenshots</a> 
+			<a class="navtab" href="http://adium.im/screencasts/">Videos</a> 
+			<a class="navtabcurrent" href="http://adium.im/blog/">Blog</a> 
+			<a class="navtab" href="http://trac.adium.im">Support/Development</a> 
+			<a class="navtab" href="http://adium.spreadshirt.com">Merchandise</a>
 			<a class="navtab" href="http://www.adiumxtras.com/">Xtras</a>
 		</div>
         <div id="central">
diff -r 52fd23b0ae77 -r 8ef240af69cf index.php
--- a/index.php	Sat Oct 30 13:58:35 2010 -0500
+++ b/index.php	Sat Oct 30 18:40:43 2010 -0500
@@ -1,4 +1,12 @@
 <?php
+	$downloadText["10.5.8"]   = "1.3.10";
+	$downloadLink["10.5.8"]   = "http://download.adium.im/Adium_1.3.10.dmg";
+	$downloadMD5 ["10.5.8"]   = "16309a78add9dc7695ccc14079baae10 ***";
+
+	$downloadText["10.6"]   = $downloadText["10.5.8"];
+	$downloadLink["10.6"]   = $downloadLink["10.5.8"];
+	$downloadMD5 ["10.6"]   = $downloadMD5 ["10.5.8"];
+
 	$downloadText["10.4"]   = "1.3.10";
 	$downloadLink["10.4"]   = "http://download.adium.im/Adium_1.3.10.dmg";
 	$downloadMD5 ["10.4"] 	= "16309a78add9dc7695ccc14079baae10";
@@ -12,26 +20,53 @@
 	$downloadMD5 ["10.2"] 	= "97814d0e0bad4912570201bb332c5595";
 
 	if ($_GET['download'] && !$downloadLink[$_GET['download']])
-		$_GET['download'] = "10.4";
+		$_GET['download'] = "10.6";
 
 	// OS X check
 	$userAgent = $_SERVER['HTTP_USER_AGENT'];
 
-	// Assuming we're working on 10.4 unless otherwise proven.
-	$operatingSystem = "10.4";
+	// Assuming we're working on 10.6 unless otherwise proven.
+	$operatingSystem = "10.6";
 	
-	// Guess OS by Safari revisions	
-	if (strstr($userAgent, "Safari")) {
-		if (strstr($userAgent, "iPhone")) {
-			$operatingSystem = "iPhone";
-		} else {
-			$safariRev = substr($userAgent, strpos($userAgent, "Safari/")+7);
-			if (intval($safariRev) < 312)
-				$operatingSystem = "10.2"; // 10.3.9 minimum for 1.0
-			else if (intval($safariRev) < 314)
-				$operatingSystem = "10.3.9";
-		}
-	}
+	if (strstr($userAgent, "iPhone") || strstr($userAgent, "iPad") || strstr($userAgent, "iPod")) {
+		$operatingSystem = "iPhone";
+    } else if (strstr($userAgent, "Mac OS X ")) {
+        // e.g. Mac OS X 10_6_4
+        $macOSXMajor = substr($userAgent, strpos($userAgent, "Mac OS X ") + strlen("Mac OS X "));
+        $macOSXMajor = substr($macOSXMajor, 0, strpos($macOSXMajor, "_"));
+        
+        $macOSXMinor = substr($userAgent, strpos($userAgent, "Mac OS X ".$macOSXMajor."_") + strlen("Mac OS X ".$macOSXMajor."_"));
+        $macOSXMinor = substr($macOSXMinor, 0, strpos($macOSXMinor, "_"));
+
+        $macOSXMicro = substr($userAgent, strpos($userAgent, "Mac OS X ".$macOSXMajor."_".$macOSXMinor."_") + strlen("Mac OS X ".$macOSXMajor."_".$macOSXMinor."_"));
+        $macOSXMicro = substr($macOSXMicro, 0, strpos($macOSXMicro, "_"));
+        
+        int major = intval($macOSXMajor);
+        int minor = intval($macOSXMinor);
+        int micro = intval($macOSXMicro);
+        
+        if (major == 10) {
+            if (minor >= 6) {
+                $operatingSystem = "10.6";
+            } else if (minor == 5) {
+                if (micro >= 8) {    
+                    $operatingSystem = "10.5.8";
+                } else {
+                    $operatingSystem = "10.4";                
+                }
+            } else if (minor == 4) {
+                $operatingSystem = "10.4";
+            } else if (minor == 3) {
+                if (micro >= 9) {    
+                    $operatingSystem = "10.3.9";
+                } else {
+                    $operatingSystem = "10.2";                
+                }
+            } else {
+                $operatingSystem = "10.2"; // 10.3.9 minimum for 1.0
+            }
+        } 
+    }
 	
 	if ($_GET['forceOS'])
 		$operatingSystem = $_GET['forceOS'];
@@ -61,11 +96,12 @@
 				<a href="/">Adium</a>
 	        </div>
 			<div id="navcontainer">
-				<a class="navtabcurrent" href="/">Download</a>
-				<a class="navtab" href="/screenshots/">Screenshots</a>
-				<a class="navtab" href="/screencasts/">Videos</a>
-				<a class="navtab" href="/blog/">Blog</a>
-				<a class="navtab" href="http://trac.adium.im">Support & Development</a>
+				<a class="navtabcurrent" href="http://adium.im/">Download</a> 
+				<a class="navtab" href="http://adium.im/screenshots/">Screenshots</a> 
+				<a class="navtab" href="http://adium.im/screencasts/">Videos</a> 
+				<a class="navtab" href="http://adium.im/blog/">Blog</a> 
+				<a class="navtab" href="http://trac.adium.im">Support/Development</a> 
+				<a class="navtab" href="http://adium.spreadshirt.com">Merchandise</a>
 				<a class="navtab" href="http://www.adiumxtras.com/">Xtras</a>
 			</div>
 			<div id="content">
diff -r 52fd23b0ae77 -r 8ef240af69cf screencasts/index.php
--- a/screencasts/index.php	Sat Oct 30 13:58:35 2010 -0500
+++ b/screencasts/index.php	Sat Oct 30 18:40:43 2010 -0500
@@ -142,11 +142,12 @@
 			<a href="/index.php">Adium</a>
         </div>
 		<div id="navcontainer">
-			<a class="navtab" href="/">Download</a>
-			<a class="navtab" href="/screenshots/">Screenshots</a>
-			<a class="navtabcurrent" href="/screencasts/">Videos</a>
-			<a class="navtab" href="/blog/">Blog</a>
-			<a class="navtab" href="http://trac.adium.im">Support & Development</a>
+			<a class="navtab" href="http://adium.im/">Download</a> 
+			<a class="navtab" href="http://adium.im/screenshots/">Screenshots</a> 
+			<a class="navtabcurrent" href="http://adium.im/screencasts/">Videos</a> 
+			<a class="navtab" href="http://adium.im/blog/">Blog</a> 
+			<a class="navtab" href="http://trac.adium.im">Support/Development</a> 
+			<a class="navtab" href="http://adium.spreadshirt.com">Merchandise</a>
 			<a class="navtab" href="http://www.adiumxtras.com/">Xtras</a>
 		</div>
         <div id="central">
diff -r 52fd23b0ae77 -r 8ef240af69cf screenshots/index.html
--- a/screenshots/index.html	Sat Oct 30 13:58:35 2010 -0500
+++ b/screenshots/index.html	Sat Oct 30 18:40:43 2010 -0500
@@ -18,11 +18,12 @@
 			<a href="/">Adium</a>
         </div>
 		<div id="navcontainer">
-			<a class="navtab" href="/">Download</a>
-			<a class="navtabcurrent" href="/screenshots">Screenshots</a>
-			<a class="navtab" href="/screencasts/">Videos</a>
-			<a class="navtab" href="/blog/">Blog</a>
-			<a class="navtab" href="http://trac.adium.im">Support & Development</a>
+			<a class="navtab" href="http://adium.im/">Download</a> 
+			<a class="navtabcurrent" href="http://adium.im/screenshots/">Screenshots</a> 
+			<a class="navtab" href="http://adium.im/screencasts/">Videos</a> 
+			<a class="navtab" href="http://adium.im/blog/">Blog</a> 
+			<a class="navtab" href="http://trac.adium.im">Support/Development</a> 
+			<a class="navtab" href="http://adium.spreadshirt.com">Merchandise</a>
 			<a class="navtab" href="http://www.adiumxtras.com/">Xtras</a>
 		</div>
         <div id="central">
diff -r 52fd23b0ae77 -r 8ef240af69cf sparkle/templates/header.tpl
--- a/sparkle/templates/header.tpl	Sat Oct 30 13:58:35 2010 -0500
+++ b/sparkle/templates/header.tpl	Sat Oct 30 18:40:43 2010 -0500
@@ -13,11 +13,12 @@
 			<a href="/index.php">Adium</a>
         </div>
 		<div id="navcontainer">
-			<a class="navtab" href="http://adium.im/index.php">Download</a>
-			<a class="navtab" href="http://adium.im/screenshots/">Screenshots</a>
-			<a class="navtab" href="http://adium.im/screencasts/">Videos</a>
-			<a class="navtab" href="http://adium.im/blog/">Blog</a>
-			<a class="navtabcurrent" href="http://trac.adium.im">Support & Development</a>
+			<a class="navtab" href="http://adium.im/">Download</a> 
+			<a class="navtab" href="http://adium.im/screenshots/">Screenshots</a> 
+			<a class="navtab" href="http://adium.im/screencasts/">Videos</a> 
+			<a class="navtab" href="http://adium.im/blog/">Blog</a> 
+			<a class="navtabcurrent" href="http://trac.adium.im">Support/Development</a> 
+			<a class="navtab" href="http://adium.spreadshirt.com">Merchandise</a>
 			<a class="navtab" href="http://www.adiumxtras.com/">Xtras</a>
 		</div>
 		<div id="content">




More information about the commits mailing list