www: caf75e78: Change the download links on the frontpa...

markdoliner at pidgin.im markdoliner at pidgin.im
Thu May 3 04:01:08 EDT 2012


----------------------------------------------------------------------
Revision: caf75e7882c512b2daf1cff041a2758640eb05e0
Parent:   2e1a6cf58bfbe044b307f47d4b7a9da7699002a2
Author:   markdoliner at pidgin.im
Date:     05/03/12 03:56:29
Branch:   im.pidgin.www
URL: http://d.pidgin.im/viewmtn/revision/info/caf75e7882c512b2daf1cff041a2758640eb05e0

Changelog: 

Change the download links on the frontpage to use the sourceforge download
button when linking directly to sourceforge.  This currently only happens
for Windows and source downloads (and source doesn't happen very often and
probably should never happen, because we should also link to a page that
tells users to get Pidgin from their OS  vendor or distribution, or compile
as a last resort).

Changes against parent 2e1a6cf58bfbe044b307f47d4b7a9da7699002a2

  patched  htdocs/index.php
  patched  htdocs/shared/css/main.css
  patched  inc/blurb.downloaddetect.inc

-------------- next part --------------
============================================================
--- htdocs/index.php	017533a3c69e6964d146ed40fb92baede86bf60f
+++ htdocs/index.php	d6886878e5b29267f88eaec73ce3194ec2008122
@@ -13,34 +13,68 @@
 <div class="box_home">
 <div id="left">
 
-<div id="version">
-<img src="/shared/img/logo.text-big.gif" alt="Pidgin" />
-<span class="number"><?php echo $pidgin_version; ?></span>
-</div>
+<?php include($_SERVER['DOCUMENT_ROOT'] . "/../inc/blurb.downloaddetect.inc"); ?>
 
-<div id="download">
-<img src="/shared/img/logo.pidgin.png" alt="[Pidgin Logo]" id="logo" width="107" height="185" />
+<span id="frontpage_download_common">
+<?php if ($download_have_direct_link) { ?>
 
+	<span id="frontpage_download_direct">
 
-<?php include($_SERVER['DOCUMENT_ROOT'] . "/../inc/blurb.downloaddetect.inc"); ?>
+	<div id="version">
+	<img src="/shared/img/logo.text-big.gif" alt="Pidgin" />
+	<span class="number"><?php echo $pidgin_version; ?></span>
+	</div>
 
-<a id="download_link" href="<?php echo $download_link; ?>">
-<img src="/shared/img/button.download.png" alt="[Down Arrow]" id="downbutton" width="48" height="48" />
-Download Pidgin<br />
-<span class="number"><?php echo $download_version, ' ', $download_os; ?></span></a>
-<?php include($_SERVER['DOCUMENT_ROOT'] . "/../inc/langdetect.inc");
-if (strlen($language) > 0 && $language != "English") {
-?>
-<span class="number"><?php echo $language ?></span>
-<?php } ?>
+	<div id="download">
+	<img src="/shared/img/logo.pidgin.png" alt="[Pidgin Logo]" id="logo" width="107" height="185" />
+	<a class="sourceforge_accelerator_link" href="<?php echo $download_link; ?>.tar.bz2/download">Download Now</a>
+	<script>
+	(function() {
+		var script = document.createElement('script');
+		script.src = '//sourceforge.net/accelerator/js?partner_id=62&button_size=large';
+		script.defer = true;
+		var s = document.getElementsByTagName('script')[0];
+		s.parentNode.insertBefore(script, s);
+	})();
+	</script>
+	</div>
 
+	<p class="linkbar">
+	<span class="number"><?php echo $download_version, ' ', $download_os; ?></span><br/>
+	<a href="http://developer.pidgin.im/wiki/ChangeLog">ChangeLog</a>
+	</p>
 
-</div>
+	</span>
 
-<p class="linkbar">
-  <a href="http://developer.pidgin.im/wiki/ChangeLog">ChangeLog</a>
-</p>
+<?php } else { ?>
 
+	<span id="frontpage_download_indirect">
+
+	<div id="version">
+	<img src="/shared/img/logo.text-big.gif" alt="Pidgin" />
+	<span class="number"><?php echo $pidgin_version; ?></span>
+	</div>
+
+	<div id="download">
+	<img src="/shared/img/logo.pidgin.png" alt="[Pidgin Logo]" id="logo" width="107" height="185" />
+	<a id="download_link" href="<?php echo $download_link; ?>">
+	<img src="/shared/img/button.download.png" alt="[Down Arrow]" id="downbutton" width="48" height="48" />
+	Get Pidgin<br />
+	<span class="number"><?php echo $download_version, ' ', $download_os; ?></span></a>
+	<?php include($_SERVER['DOCUMENT_ROOT'] . "/../inc/langdetect.inc");
+	if (strlen($language) > 0 && $language != "English") {
+	?>
+	<span class="number"><?php echo $language ?></span>
+	<?php } ?>
+	</div>
+
+	<p class="linkbar"><a href="http://developer.pidgin.im/wiki/ChangeLog">ChangeLog</a></p>
+
+	</span>
+
+<?php } ?>
+</span>
+
 </div>
 
 </div>
============================================================
--- htdocs/shared/css/main.css	f23152f36154f5aacbbccc16884a1b6fac819313
+++ htdocs/shared/css/main.css	fbb61efdb44215200551b6241adf396acce57dcd
@@ -246,7 +246,6 @@ a:hover, a:active {
   content: url('/shared/img/frame.right.bottom.png');
 }
 
-
 .box_download:before {
   content: url('/shared/img/frame.download.top.gif');
   display: block;
@@ -261,15 +260,20 @@ a:hover, a:active {
   overflow: hidden;
 }
 
-#version {
+#frontpage_download_common #version {
   text-align: left;
   padding: 20px 0 28px 0;
-  height: 216px;
   left: 36px;
   position: relative;
 }
+#frontpage_download_direct #version {
+  height: 236px;
+}
+#frontpage_download_indirect #version {
+  height: 216px;
+}
 
-#version .number {
+#frontpage_download_common #version .number {
   display: block;
   z-index: 10;
   top: -29px;
@@ -277,21 +281,27 @@ a:hover, a:active {
   position: relative;
 }
 
-#download #logo {
+#frontpage_download_common #download #logo {
   display: block;
   position: absolute;
+}
+#frontpage_download_direct #download #logo {
+  top: 18px;
+  left: -28px;
+}
+#frontpage_download_indirect #download #logo {
   top: -6px;
   left: -86px;
 }
 
-#download:before {
+#frontpage_download_indirect #download:before {
   content: url('/shared/img/balloon.top.gif');
   display: block;
   height: 17px;
   overflow: hidden;
 }
 
-#download:after {
+#frontpage_download_indirect #download:after {
   content: url('/shared/img/balloon.bottom.png');
   display: block;
   height: 16px;
@@ -299,39 +309,53 @@ a:hover, a:active {
   clear: both;
 }
 
-#download {
+#frontpage_download_common #download {
   width: 268px;
   position: absolute;
-  left: 101px;
   top: 157px;
-  background: url('/shared/img/balloon.middle.gif') no-repeat left 17px;
-}
-
-#download {
   font-size: 1.2em;
   font-weight: bold;
 }
+#frontpage_download_direct #download {
+  left: 32px;
+}
+#frontpage_download_indirect #download {
+  left: 101px;
+  background: url('/shared/img/balloon.middle.gif') no-repeat left 17px;
+}
 
-#download .number, .box_download .number {
+#frontpage_download_common #download .number {
   font-size: 0.85em;
   font-weight: normal;
 }
 
-#download a img, .box_download a img {
+#frontpage_download_common #download a img {
   float: left;
   margin-right: 6px;
 }
 
-#download a img {
+#frontpage_download_common #download a img {
   padding-bottom: 11px;
 }
 
-#download a {
+#frontpage_download_common #download a {
   display: block;
   padding-left: 35px;
   padding-top: 8px;
 }
 
+#frontpage_download_common .linkbar {
+  position: relative;
+  text-align: right;
+  margin: -6px 26px 0 0;
+}
+#frontpage_download_direct .linkbar {
+  top: -66px;
+}
+#frontpage_download_indirect .linkbar {
+  top: -6px;
+}
+
 #main {
   padding: 22px 13px 13px;
 }
@@ -391,13 +415,6 @@ h3 {
   color: #444;
 }
 
-#left .linkbar {
-  position: relative;
-  top: -6px;
-  text-align: right;
-  margin: -6px 26px 0 0;
-}
-
 #main img {
   max-width: 530px;
 }
============================================================
--- inc/blurb.downloaddetect.inc	bd25be3cdc25b5ecdc156c154645530934760378
+++ inc/blurb.downloaddetect.inc	1e9833a5f5c41a481dd9fccea06281763241ccea
@@ -2,14 +2,17 @@
 
   // Figure out what browser we're working with
   $useragent = $_SERVER['HTTP_USER_AGENT'];
+$useragent = 'Win';//TODO MARK test code--remove this!
 
-  // Default val
+  // Default value
+  $download_have_direct_link = false;
   $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_have_direct_link = true;
     $download_version = $pidgin_win32_version;
   } else if (strstr($useragent, "Ubuntu")) {
     $download_type = "ubuntu";


More information about the Commits mailing list