OSDN Git Service

PATCH: [ 1752239 ] Web: "Download Now!" link
authorTim Gerundt <tim@gerundt.de>
Thu, 12 Jul 2007 19:10:26 +0000 (19:10 +0000)
committerTim Gerundt <tim@gerundt.de>
Thu, 12 Jul 2007 19:10:26 +0000 (19:10 +0000)
Web/2.6/index.php
Web/css/screen.css
Web/downloads/index.php
Web/index.php
Web/page.inc
Web/release.inc [new file with mode: 0644]

index b5dfd2d..bad66e8 100644 (file)
@@ -5,6 +5,7 @@
   $page->printHead('WinMerge 2.6', WINMERGE_2_6);\r
 ?>\r
 <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>\r
+<?php $page->printDownloadNow(); ?>\r
 <h2>Features</h2>\r
 <ul>\r
   <li>Visual differencing and merging of text files</li>\r
index f69938e..9f91085 100644 (file)
@@ -101,6 +101,38 @@ code,pre {
        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;
index b2e6b86..15cb027 100644 (file)
@@ -5,6 +5,7 @@
   $page->printHead('WinMerge: Downloads', TAB_DOWNLOADS);\r
 ?>\r
 <h2>Downloads</h2>\r
+<?php $page->printDownloadNow(); ?>\r
 <h3><a href="http://sourceforge.net/project/showfiles.php?group_id=13216&amp;package_id=11248&amp;release_id=517309">WinMerge 2.6.8</a> (<a href="http://sourceforge.net/project/shownotes.php?release_id=517309">Release Notes</a>)</h3>\r
 <dl>\r
   <dt><a href="http://prdownloads.sourceforge.net/winmerge/WinMerge-2.6.8-Setup.exe">Installer</a></dt>\r
index 5eff24f..b811828 100644 (file)
@@ -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>
index 27ae504..69b3bd8 100644 (file)
@@ -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
       $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);
     }
 
     /**
     }
 
     /**
+     * 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() {
     }
 
     /**
+     * get the stable release
+     */
+    function getStableRelease() {
+      return $this->_stablerelease;
+    }
+
+    /**
      * convert a xml file into an array
      *
      * @link http://www.devdump.com/phpxml.php
diff --git a/Web/release.inc b/Web/release.inc
new file mode 100644 (file)
index 0000000..110ae83
--- /dev/null
@@ -0,0 +1,91 @@
+<?php\r
+// This program is free software; you can redistribute it and/or modify\r
+// it under the terms of the GNU General Public License as published by\r
+// the Free Software Foundation; either version 2 of the License, or\r
+// (at your option) any later version.\r
+// \r
+// This program is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+// GNU General Public License for more details.\r
+\r
+  /**\r
+   * ...\r
+   */\r
+  class Release {\r
+    var $_versionnumber;\r
+    var $_setupdownload, $_setupsize;\r
+\r
+    /**\r
+     * Constructor\r
+     */\r
+    function Release() {\r
+      $this->_versionnumber = '';\r
+    }\r
+\r
+    /**\r
+     * set the version number from the release\r
+     */\r
+    function setVersionNumber($versionnumber) {\r
+      $this->_versionnumber = $versionnumber;\r
+    }\r
+\r
+    /**\r
+     * get the version number from the release\r
+     */\r
+    function getVersionNumber() {\r
+      return $this->_versionnumber;\r
+    }\r
+\r
+    /**\r
+     * set the setup download from the release\r
+     */\r
+    function setSetupDownload($setupdownload) {\r
+      $this->_setupdownload = $setupdownload;\r
+    }\r
+\r
+    /**\r
+     * get the setup download from the release\r
+     */\r
+    function getSetupDownload() {\r
+      return $this->_setupdownload;\r
+    }\r
+\r
+    /**\r
+     * set the setup size (in bytes) from the release\r
+     */\r
+    function setSetupSize($setupsize) {\r
+      $this->_setupsize = $setupsize;\r
+    }\r
+\r
+    /**\r
+     * get the setup size (in bytes) from the release\r
+     */\r
+    function getSetupSize() {\r
+      return $this->_setupsize;\r
+    }\r
+\r
+    /**\r
+     * get the formatted setup size from the release\r
+     */\r
+    function getSetupSizeFormatted($unit = '') {\r
+      return $this->formatSize($this->_setupsize, $unit);\r
+    }\r
+\r
+    /**\r
+     * format the size\r
+     */\r
+    function formatSize($bytes, $unit = '') {\r
+      switch (strtolower($unit)) {\r
+        case 'kb':\r
+          return number_format($bytes / 1024);\r
+          break;\r
+        case 'mb':\r
+          return number_format($bytes / 1048576, 2);\r
+          break;\r
+        default:\r
+          return number_format($bytes);\r
+      }\r
+    }\r
+  }\r
+?>
\ No newline at end of file