pidgin/old.pidgin.im

Parents 64dd2e7033f4
Children 078937bcc1cc
Add the metadata about each type of download to a php array and just
reference the array. This kind of separates model from view... but
more importantly it will allow /download/ to
show identical content to what's on /download//
--- a/htdocs/download/linux/index.php Thu May 03 04:52:36 2012 +0000
+++ b/htdocs/download/linux/index.php Thu May 03 05:56:07 2012 +0000
@@ -1,9 +1,13 @@
<?php
- // Update these to match the current page.
- $page['title'] = "Download Pidgin for Linux";
+ include($_SERVER['DOCUMENT_ROOT'] . "/../inc/downloads.inc");
+
+ $exploded_uri = explode('/', $_SERVER['DOCUMENT_URI']);
+ $me = $exploded_uri[2];
+
+ $page['title'] = $download_types[$me]['title'];
$page['section'] = "Download";
- $page['subsect'] = "Linux";
- $page['description'] = "Download the free Pidgin universal chat client for Linux";
+ $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");
@@ -20,9 +24,7 @@
<div class="box_download">
-<p>We do not provide pre-built packages for most Linux and Unix distributions. We recommend installing Pidgin using your operating system's standard package management tool.</p>
-
-<p>If your operating system doesn't provide a pre-built package, or if their pre-built package is out of date and you want to upgrade, then you can try <a href="/download/source/">building from source</a>.</p>
+<?php echo $download_types[$me]['body'] ?>
</div>
--- a/htdocs/download/mac/index.php Thu May 03 04:52:36 2012 +0000
+++ b/htdocs/download/mac/index.php Thu May 03 05:56:07 2012 +0000
@@ -1,9 +1,13 @@
<?php
- // Update these to match the current page.
- $page['title'] = "Download Pidgin for Mac OS X";
+ include($_SERVER['DOCUMENT_ROOT'] . "/../inc/downloads.inc");
+
+ $exploded_uri = explode('/', $_SERVER['DOCUMENT_URI']);
+ $me = $exploded_uri[2];
+
+ $page['title'] = $download_types[$me]['title'];
$page['section'] = "Download";
- $page['subsect'] = "Mac OS X";
- $page['description'] = "Download the free Pidgin universal chat client for Mac OS X";
+ $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");
@@ -20,9 +24,7 @@
<div class="box_download">
-<p>For a native Mac OS X experience we recommend <a href="http://adium.im" onClick="javascript:pageTracker._trackPageview('/external/adium.im');">Adium</a>, which uses libpurple (the core of Pidgin) for much of its protocol support.</p>
-<p>If you're sure you want to use Pidgin on OS X, you may find the packages provided through <a href="http://finkproject.org/download/" onClick="javascript:pageTracker._trackPageview('/external/finkproject.org');">Fink</a> or <a href="http://www.macports.org/install.php" onClick="javascript:pageTracker._trackPageview('/external/macports.org');">Macports</a> more convenient than compiling from source. Please note, <i>we do not provide support for issues related to installing Fink, Macports, or their packages of Pidgin</i>. Contact those projects directly with questions or concerns.</p>
-<p>If you're sure you want to use Pidgin on OS X and you don't want to use Fink or Macports, you can <a href="/download/source/">download the Pidgin source</a> and compile.</p>
+<?php echo $download_types[$me]['body'] ?>
</div>
--- a/htdocs/download/source/index.php Thu May 03 04:52:36 2012 +0000
+++ b/htdocs/download/source/index.php Thu May 03 05:56:07 2012 +0000
@@ -1,9 +1,13 @@
<?php
- // Update these to match the current page.
- $page['title'] = "Download Pidgin Source";
+ include($_SERVER['DOCUMENT_ROOT'] . "/../inc/downloads.inc");
+
+ $exploded_uri = explode('/', $_SERVER['DOCUMENT_URI']);
+ $me = $exploded_uri[2];
+
+ $page['title'] = $download_types[$me]['title'];
$page['section'] = "Download";
- $page['subsect'] = "Source";
- $page['description'] = "Download the source code for the free Pidgin universal chat client";
+ $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");
@@ -20,22 +24,7 @@
<div class="box_download">
-<p class="download_button">
-<a class="sourceforge_accelerator_link" href="http://sourceforge.net/projects/pidgin/files/Pidgin/<?php echo $pidgin_version; ?>/pidgin-<?php echo $pidgin_version; ?>.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>
-</p>
-
-<p>This download is for the source code of Pidgin <?php echo $pidgin_version; ?>.</p>
-<p>If you want to <b>use</b> Pidgin, you should first look for pre-built packages from us (see the links on the left) or your operating system distribution.</p>
-<p>If you are looking to <b>modify</b> Pidgin, you may want to look at our <a href="http://developer.pidgin.im/wiki/UsingPidginMonotone">instructions for checking out the code from our repository</a>.</p>
+<?php echo $download_types[$me]['body'] ?>
</div>
--- a/htdocs/download/ubuntu/index.php Thu May 03 04:52:36 2012 +0000
+++ b/htdocs/download/ubuntu/index.php Thu May 03 05:56:07 2012 +0000
@@ -1,9 +1,13 @@
<?php
- // Update these to match the current page.
- $page['title'] = "Download Pidgin for Ubuntu";
+ include($_SERVER['DOCUMENT_ROOT'] . "/../inc/downloads.inc");
+
+ $exploded_uri = explode('/', $_SERVER['DOCUMENT_URI']);
+ $me = $exploded_uri[2];
+
+ $page['title'] = $download_types[$me]['title'];
$page['section'] = "Download";
- $page['subsect'] = "Ubuntu";
- $page['description'] = "Download the free Pidgin universal chat client for Ubuntu";
+ $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");
@@ -20,25 +24,8 @@
<div class="box_download">
-<p>Ubuntu ships Pidgin but does not update it after a release (except for security issues and high-severity bugs). For those users who desire new releases of Pidgin, we have packaged Pidgin in <a href="https://launchpad.net/~pidgin-developers/+archive/ppa/">a PPA</a>. If you encounter problems with these packages, try <a href="../source">building from source</a> and <a href="/support">report the bug</a>.</p>
-<p>To setup <a href="https://launchpad.net/~pidgin-developers/+archive/ppa/">the PPA</a>, follow these steps: <br />
-&nbsp;&nbsp;1. Click to download the <a href="https://launchpad.net/~pidgin-developers/+archive/ppa/+files/pidgin-ppa_0.0.7_all.deb">Pidgin PPA package</a>.<br />
-&nbsp;&nbsp;2. Select <em>Open with:</em> and <em>GDebi Package Installer</em>. Click <em>OK</em>.<br />
-&nbsp;&nbsp;3. Click <em>Install Package</em>.<br />
-&nbsp;&nbsp;4. Click <em>Close</em>. Then close GDebi.
-</p>
+<?php echo $download_types[$me]['body'] ?>
-<p>After doing this, check for and apply updates: <br />
-&nbsp;&nbsp;1. Click <em>System</em>, point to <em>Administration</em>, and click <em>Update Manager</em>.<br />
-&nbsp;&nbsp;2. Click <em>Check</em>.<br />
-&nbsp;&nbsp;3. Click <em>Install Updates</em>.<br />
-</p>
-
-<p>Future Pidgin updates will show up in Update Manager along with the usual Ubuntu updates.</p>
-
-<p>This PPA often lags behind the source releases a couple of days, so please be patient.</p>
-
-<p><b>This PPA supports Ubuntu Lucid (10.04) and newer.</b></p>
</div>
</div>
--- a/htdocs/download/windows/index.php Thu May 03 04:52:36 2012 +0000
+++ b/htdocs/download/windows/index.php Thu May 03 05:56:07 2012 +0000
@@ -1,9 +1,13 @@
<?php
- // Update these to match the current page.
- $page['title'] = "Download Pidgin for Windows";
+ include($_SERVER['DOCUMENT_ROOT'] . "/../inc/downloads.inc");
+
+ $exploded_uri = explode('/', $_SERVER['DOCUMENT_URI']);
+ $me = $exploded_uri[2];
+
+ $page['title'] = $download_types[$me]['title'];
$page['section'] = "Download";
- $page['subsect'] = "Windows";
- $page['description'] = "Download the free Pidgin universal chat client for Windows";
+ $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");
@@ -20,25 +24,10 @@
<div class="box_download">
-<p class="download_button">
-<a class="sourceforge_accelerator_link" href="http://sourceforge.net/projects/pidgin/files/Pidgin/<?php echo $pidgin_win32_version; ?>/pidgin-<?php echo $pidgin_win32_version; ?>.exe/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>
-</p>
-
-<p>This version of Pidgin downloads an appropriate version of GTK+. GTK+ is now installed locally for Pidgin, and not system-wide, thus Pidgin will not interfere with other GTK+ apps on your system.</p>
-<p>If you would like to have GTK+ included in the installer, we have an <a href="http://sourceforge.net/projects/pidgin/files/Pidgin/<?php echo $pidgin_win32_version; ?>/pidgin-<?php echo $pidgin_win32_version; ?>-offline.exe/download">offline installer</a> that bundles everything except spell-checking dictionaries. </p>
+<?php echo $download_types[$me]['body'] ?>
</div>
-
</div>
</div>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/inc/downloads.inc Thu May 03 05:56:07 2012 +0000
@@ -0,0 +1,97 @@
+<?php
+
+// The keys in this array are available download types. They should
+// match the piece of the URL following "/download/" For example,
+// "source" or "windows"
+// The values in this array are arrays containing info about the
+// download type. The keys in these arrays are things like "name"
+// and "description."
+$download_types = array(
+ 'windows' => array(
+ 'title' => 'Download Pidgin for Windows',
+ 'subsect' => 'Windows',
+ 'description' => 'Download the free Pidgin universal chat client for Windows',
+ 'body' => '<p class="download_button">
+<a class="sourceforge_accelerator_link" href="http://sourceforge.net/projects/pidgin/files/Pidgin/<?php echo $pidgin_win32_version; ?>/pidgin-<?php echo $pidgin_win32_version; ?>.exe/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>
+</p>
+
+<p>This version of Pidgin downloads an appropriate version of GTK+. GTK+ is now installed locally for Pidgin, and not system-wide, thus Pidgin will not interfere with other GTK+ apps on your system.</p>
+<p>If you would like to have GTK+ included in the installer, we have an <a href="http://sourceforge.net/projects/pidgin/files/Pidgin/<?php echo $pidgin_win32_version; ?>/pidgin-<?php echo $pidgin_win32_version; ?>-offline.exe/download">offline installer</a> that bundles everything except spell-checking dictionaries. </p>',
+ ),
+
+ 'ubuntu' => array(
+ 'title' => 'Download Pidgin for Ubuntu Linux',
+ 'subsect' => 'Ubuntu',
+ 'description' => 'Download the free Pidgin universal chat client for Ubuntu Linux',
+ 'body' => '<p>Ubuntu ships Pidgin but does not update it after a release (except for security issues and high-severity bugs). For those users who desire new releases of Pidgin, we have packaged Pidgin in <a href="https://launchpad.net/~pidgin-developers/+archive/ppa/">a PPA</a>. If you encounter problems with these packages, try <a href="../source">building from source</a> and <a href="/support">report the bug</a>.</p>
+<p>To setup <a href="https://launchpad.net/~pidgin-developers/+archive/ppa/">the PPA</a>, follow these steps: <br />
+&nbsp;&nbsp;1. Click to download the <a href="https://launchpad.net/~pidgin-developers/+archive/ppa/+files/pidgin-ppa_0.0.7_all.deb">Pidgin PPA package</a>.<br />
+&nbsp;&nbsp;2. Select <em>Open with:</em> and <em>GDebi Package Installer</em>. Click <em>OK</em>.<br />
+&nbsp;&nbsp;3. Click <em>Install Package</em>.<br />
+&nbsp;&nbsp;4. Click <em>Close</em>. Then close GDebi.
+</p>
+
+<p>After doing this, check for and apply updates: <br />
+&nbsp;&nbsp;1. Click <em>System</em>, point to <em>Administration</em>, and click <em>Update Manager</em>.<br />
+&nbsp;&nbsp;2. Click <em>Check</em>.<br />
+&nbsp;&nbsp;3. Click <em>Install Updates</em>.<br />
+</p>
+
+<p>Future Pidgin updates will show up in Update Manager along with the usual Ubuntu updates.</p>
+
+<p>This PPA often lags behind the source releases a couple of days, so please be patient.</p>
+
+<p><b>This PPA supports Ubuntu Lucid (10.04) and newer.</b></p>',
+ ),
+
+ 'linux' => array(
+ 'title' => 'Download Pidgin for Linux',
+ 'subsect' => 'Linux',
+ 'description' => 'Download the free Pidgin universal chat client for Linux',
+ 'body' => '<p>We do not provide pre-built packages for most Linux and Unix distributions. We recommend installing Pidgin using your operating system\'s standard package management tool.</p>
+
+<p>If your operating system doesn\'t provide a pre-built package, or if their pre-built package is out of date and you want to upgrade, then you can try <a href="/download/source/">building from source</a>.</p>',
+ ),
+
+ 'mac' => array(
+ 'title' => 'Download Pidgin for Mac OS X',
+ 'subsect' => 'Mac OS X',
+ 'description' => 'Download the free Pidgin universal chat client for Mac OS X',
+ 'body' => '<p>For a native Mac OS X experience we recommend <a href="http://adium.im" onClick="javascript:pageTracker._trackPageview("/external/adium.im");">Adium</a>, which uses libpurple (the core of Pidgin) for much of its protocol support.</p>
+<p>If you\'re sure you want to use Pidgin on OS X, you may find the packages provided through <a href="http://finkproject.org/download/" onClick="javascript:pageTracker._trackPageview("/external/finkproject.org");">Fink</a> or <a href="http://www.macports.org/install.php" onClick="javascript:pageTracker._trackPageview("/external/macports.org");">Macports</a> more convenient than compiling from source. Please note, <i>we do not provide support for issues related to installing Fink, Macports, or their packages of Pidgin</i>. Contact those projects directly with questions or concerns.</p>
+<p>If you\'re sure you want to use Pidgin on OS X and you don\'t want to use Fink or Macports, you can <a href="/download/source/">download the Pidgin source</a> and compile.</p>',
+ ),
+
+ 'source' => array(
+ 'title' => 'Download Pidgin Source',
+ 'subsect' => 'Source',
+ 'description' => 'Download the source code for the free Pidgin universal chat client',
+ 'body' => '<p class="download_button">
+<a class="sourceforge_accelerator_link" href="http://sourceforge.net/projects/pidgin/files/Pidgin/<?php echo $pidgin_version; ?>/pidgin-<?php echo $pidgin_version; ?>.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>
+</p>
+
+<p>This download is for the source code of Pidgin <?php echo $pidgin_version; ?>.</p>
+<p>If you want to <b>use</b> Pidgin, you should first look for pre-built packages from us (see the links on the left) or your operating system distribution.</p>
+<p>If you are looking to <b>modify</b> Pidgin, you may want to look at our <a href="http://developer.pidgin.im/wiki/UsingPidginMonotone">instructions for checking out the code from our repository</a>.</p>',
+ ),
+);
+
+?>