www: c08d7e91: Change /download/ to display the exact s.

markdoliner at pidgin.im markdoliner at pidgin.im
Thu May 3 02:10:26 EDT 2012


----------------------------------------------------------------------
Revision: c08d7e919d8e6c6298639d320cbff957b0c916f0
Parent:   d8610e32232fdee521d9ea51c60fa1bfd1dac3db
Author:   markdoliner at pidgin.im
Date:     05/03/12 02:05:28
Branch:   im.pidgin.www
URL: http://d.pidgin.im/viewmtn/revision/info/c08d7e919d8e6c6298639d320cbff957b0c916f0

Changelog: 

Change /download/ to display the exact same info for your auto-detected
download type as when you're viewing the details for that download type
at /download/linux/ or /download/whatever/

Changes against parent d8610e32232fdee521d9ea51c60fa1bfd1dac3db

  patched  htdocs/download/index.php
  patched  inc/blurb.downloaddetect.inc

-------------- next part --------------
============================================================
--- htdocs/download/index.php	419dec30bd305931371022771f67440066c2285c
+++ htdocs/download/index.php	437a21c31c93ba37fc9b945997ba449f95b73aee
@@ -1,9 +1,13 @@
 <?php
-  // Update these to match the current page.
-  $page['title'] =   "Download Pidgin, the universal chat client";
+  include($_SERVER['DOCUMENT_ROOT'] . "/../inc/downloads.inc");
+  include($_SERVER['DOCUMENT_ROOT'] . "/../inc/blurb.downloaddetect.inc");
+
+  $me = $download_type;
+
+  $page['title'] = $download_types[$me]['title'];
   $page['section'] = "Download";
-  $page['description'] = "Download the free Pidgin chat client.  Pidgin runs on Windows and Linux/UNIX.";
-  $page['subsect'] = "";
+  $page['subsect'] = $download_types[$me]['subsect'];
+  $page['description'] = $download_types[$me]['description'];
 
   include($_SERVER['DOCUMENT_ROOT'] . "/../inc/header.inc");
   include($_SERVER['DOCUMENT_ROOT'] . "/../inc/version.inc");
@@ -14,21 +18,16 @@
 <?php include($_SERVER['DOCUMENT_ROOT'] . "/../inc/section.download.inc"); ?>
 
 <div class="box_right">
-<div id="main" style="position:relative;">
+<div id="main">
 
-<h1>Download Pidgin</h1>
+<h1><?php echo $page['subsect']; ?></h1>
 
-<p>Download the free Pidgin chat client.  Pidgin runs on Windows and Linux/UNIX.</p>
+<div class="box_download">
 
-<div id="download">
-<?php
-include($_SERVER['DOCUMENT_ROOT'] . "/../inc/blurb.download.inc");
-?>
-</div>
+<?php echo $download_types[$me]['body'] ?>
 
-<a href="http://developer.pidgin.im/wiki/ChangeLog">ChangeLog</a>
+</div>
 
-
 </div>
 </div>
 
============================================================
--- inc/blurb.downloaddetect.inc	c026271fcd12c563ff244058bf1786810db98a27
+++ inc/blurb.downloaddetect.inc	9310592332e514298be07df99863c02fee91bac1
@@ -4,23 +4,28 @@
   $useragent = $_SERVER['HTTP_USER_AGENT'];
 
   // Default vals
+  $download_type = "source";
   $download_link = "/download/";
   $download_os = "";
   $download_version = $pidgin_version;
 
   if (strstr($useragent, 'Win')) {
+    $download_type = "windows";
     $download_os = "for Windows";
     $download_link = "http://sourceforge.net/projects/pidgin/files/Pidgin/$pidgin_win32_version/pidgin-$pidgin_win32_version.exe/download";
     $download_version = $pidgin_win32_version;
   } else if (strstr($useragent, "Ubuntu")) {
+    $download_type = "ubuntu";
     $download_os = "for Ubuntu";
     $download_link = "/download/ubuntu/";
     $download_version = $pidgin_ubuntu_version;
   } else if (strstr($useragent, "Mac")) {
+    $download_type = "mac";
     $download_os = "for Mac OS X";
     $download_link = "/download/mac/";
   } else if (strstr($useragent, 'X11') ||
              strstr($useragent, 'Linux')) {
+    $download_type = "source";
     $download_os = "Source";
     $download_link = "/download/source/";
   }


More information about the Commits mailing list