Revision: 4365
http://svn.sourceforge.net/winmerge/?rev=4365&view=rev
Author: gerundt
Date: 2007-07-12 12:10:26 -0700 (Thu, 12 Jul 2007)
Log Message:
-----------
PATCH: [ 1752239 ] Web: "Download Now!" link
Modified Paths:
--------------
trunk/Web/2.6/index.php
trunk/Web/css/screen.css
trunk/Web/downloads/index.php
trunk/Web/index.php
trunk/Web/page.inc
Added Paths:
-----------
trunk/Web/release.inc
Modified: trunk/Web/2.6/index.php
===================================================================
--- trunk/Web/2.6/index.php 2007-07-11 08:14:25 UTC (rev 4364)
+++ trunk/Web/2.6/index.php 2007-07-12 19:10:26 UTC (rev 4365)
@@ -5,6 +5,7 @@
$page->printHead('WinMerge 2.6', WINMERGE_2_6);
?>
<p>WinMerge is an Open Source visual text file differencing and merging tool for Win32 platforms. It is highly useful for determing what has changed between project versions, and then merging changes between versions.</p>
+<?php $page->printDownloadNow(); ?>
<h2>Features</h2>
<ul>
<li>Visual differencing and merging of text files</li>
Modified: trunk/Web/css/screen.css
===================================================================
--- trunk/Web/css/screen.css 2007-07-11 08:14:25 UTC (rev 4364)
+++ trunk/Web/css/screen.css 2007-07-12 19:10:26 UTC (rev 4365)
@@ -101,6 +101,38 @@
margin-top: 0;
}
+/* "Download Now!" link */
+a.downloadnow {
+ display: block;
+ width: 12em;
+ margin: 0;
+ padding: 5px;
+ text-align: center;
+ text-decoration: none;
+ color: black;
+ background: #00B300;
+ border: 1px solid black;
+ -moz-border-radius: 0.5em;
+}
+
+a.downloadnow:hover {
+ color: black;
+ background: #00CC00;
+}
+
+a.downloadnow strong {
+ display: block;
+ text-decoration: underline;
+ font-size: larger;
+ font-weight: bold;
+}
+
+a.downloadnow em {
+ display: block;
+ font-size: smaller;
+ font-style: normal;
+}
+
p.important {
padding: 5px;
background-color: #FFDDDD;
Modified: trunk/Web/downloads/index.php
===================================================================
--- trunk/Web/downloads/index.php 2007-07-11 08:14:25 UTC (rev 4364)
+++ trunk/Web/downloads/index.php 2007-07-12 19:10:26 UTC (rev 4365)
@@ -5,6 +5,7 @@
$page->printHead('WinMerge: Downloads', TAB_DOWNLOADS);
?>
<h2>Downloads</h2>
+<?php $page->printDownloadNow(); ?>
<h3><a href="http://sourceforge.net/project/showfiles.php?group_id=13216&package_id=11248&release_id=517309">WinMerge 2.6.8</a> (<a href="http://sourceforge.net/project/shownotes.php?release_id=517309">Release Notes</a>)</h3>
<dl>
<dt><a href="http://prdownloads.sourceforge.net/winmerge/WinMerge-2.6.8-Setup.exe">Installer</a></dt>
Modified: trunk/Web/index.php
===================================================================
--- trunk/Web/index.php 2007-07-11 08:14:25 UTC (rev 4364)
+++ trunk/Web/index.php 2007-07-12 19:10:26 UTC (rev 4365)
@@ -5,6 +5,7 @@
$page->printHead('WinMerge', TAB_HOME);
?>
<p>WinMerge is an Open Source visual text file differencing and merging tool for Win32 platforms. It is highly useful for determing what has changed between project versions, and then merging changes between versions.</p>
+<?php $page->printDownloadNow(); ?>
<h2>Features</h2>
<ul>
<li>Visual differencing and merging of text files</li>
Modified: trunk/Web/page.inc
===================================================================
--- trunk/Web/page.inc 2007-07-11 08:14:25 UTC (rev 4364)
+++ trunk/Web/page.inc 2007-07-12 19:10:26 UTC (rev 4365)
@@ -18,6 +18,8 @@
define ('TAB_DOWNLOADS', 'downloads');
define ('TAB_SUPPORT', 'support');
+ include 'release.inc';
+
/**
* ...
*/
@@ -25,6 +27,7 @@
var $_title, $_charset;
var $_description, $_keywords;
var $_tab;
+ var $_stablerelease;
/**
* Constructor
@@ -35,6 +38,11 @@
$this->_description = 'WinMerge HomePage: Visual text file comparison and merging (Open Source software).';
$this->_keywords = 'WinMerge, free, download, Beyond Compare, Scooter Software, DLSuperC, DLSubCF, Component Software Diff, Viff, TreeDiff, FileSync, WMatch, Quick Spot, NTDMatch, windiff, WDIFF, FolderMatch, Merge 99, Merge99, PMdiff, PMDiff, PMDIFF, pmdiff, visual, visually, file, folder, directory, synchronization, comparison, graphical, document, text, compare, diff, difference, revision, Araxis, compare folders, compare files, synchronize folders, merge files, merge folders, Y2K, Year 2000, Year 2K, side-by-side, VFC, GFC, gdiff, CSDiff, OS2GFC, vdiff, ediff, fc';
$this->_tab = WINMERGE_2_6;
+ /* _Stable Release */
+ $this->_stablerelease = new Release;
+ $this->_stablerelease->setVersionNumber('2.6.8');
+ $this->_stablerelease->setSetupDownload('http://prdownloads.sourceforge.net/winmerge/WinMerge-2.6.8-Setup.exe');
+ $this->_stablerelease->setSetupSize(3023263);
}
/**
@@ -128,6 +136,17 @@
}
/**
+ * print the "Download Now!" link
+ */
+ function printDownloadNow() {
+ $temp = "<p><a class=\"downloadnow\" href=\"" . $this->_stablerelease->getSetupDownload() . "\">";
+ $temp .= "<strong>Download Now!</strong> ";
+ $temp .= "<em>Version " . $this->_stablerelease->getVersionNumber() . "; " . $this->_stablerelease->getSetupSizeFormatted('mb') . " MB</em>";
+ $temp .= "</a></p>\n";
+ print($temp);
+ }
+
+ /**
* get the tabs menu from the page
*/
function getTabs() {
@@ -273,6 +292,13 @@
}
/**
+ * get the stable release
+ */
+ function getStableRelease() {
+ return $this->_stablerelease;
+ }
+
+ /**
* convert a xml file into an array
*
* @link http://www.devdump.com/phpxml.php
Added: trunk/Web/release.inc
===================================================================
--- trunk/Web/release.inc (rev 0)
+++ trunk/Web/release.inc 2007-07-12 19:10:26 UTC (rev 4365)
@@ -0,0 +1,91 @@
+<?php
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+ /**
+ * ...
+ */
+ class Release {
+ var $_versionnumber;
+ var $_setupdownload, $_setupsize;
+
+ /**
+ * Constructor
+ */
+ function Release() {
+ $this->_versionnumber = '';
+ }
+
+ /**
+ * set the version number from the release
+ */
+ function setVersionNumber($versionnumber) {
+ $this->_versionnumber = $versionnumber;
+ }
+
+ /**
+ * get the version number from the release
+ */
+ function getVersionNumber() {
+ return $this->_versionnumber;
+ }
+
+ /**
+ * set the setup download from the release
+ */
+ function setSetupDownload($setupdownload) {
+ $this->_setupdownload = $setupdownload;
+ }
+
+ /**
+ * get the setup download from the release
+ */
+ function getSetupDownload() {
+ return $this->_setupdownload;
+ }
+
+ /**
+ * set the setup size (in bytes) from the release
+ */
+ function setSetupSize($setupsize) {
+ $this->_setupsize = $setupsize;
+ }
+
+ /**
+ * get the setup size (in bytes) from the release
+ */
+ function getSetupSize() {
+ return $this->_setupsize;
+ }
+
+ /**
+ * get the formatted setup size from the release
+ */
+ function getSetupSizeFormatted($unit = '') {
+ return $this->formatSize($this->_setupsize, $unit);
+ }
+
+ /**
+ * format the size
+ */
+ function formatSize($bytes, $unit = '') {
+ switch (strtolower($unit)) {
+ case 'kb':
+ return number_format($bytes / 1024);
+ break;
+ case 'mb':
+ return number_format($bytes / 1048576, 2);
+ break;
+ default:
+ return number_format($bytes);
+ }
+ }
+ }
+?>
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|