Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r55425 - in website/public_html/beta: common/code feed feed/history style/css_0 users/download users/history users/news
From: daniel_james_at_[hidden]
Date: 2009-08-05 17:34:27


Author: danieljames
Date: 2009-08-05 17:34:25 EDT (Wed, 05 Aug 2009)
New Revision: 55425
URL: http://svn.boost.org/trac/boost/changeset/55425

Log:
Try replacing download links on the release notes with links to individual files.
Text files modified:
   website/public_html/beta/common/code/boost_feed.php | 54 ++++++++++++++++++++++++++++++++++++++++
   website/public_html/beta/feed/history.rss | 4 +-
   website/public_html/beta/feed/history/boost_1_40_0.qbk | 4 +-
   website/public_html/beta/feed/news.rss | 4 +-
   website/public_html/beta/style/css_0/content.css | 14 ++++++++++
   website/public_html/beta/users/download/entry.php | 4 --
   website/public_html/beta/users/history/entry.php | 4 --
   website/public_html/beta/users/news/entry.php | 4 --
   8 files changed, 77 insertions(+), 15 deletions(-)

Modified: website/public_html/beta/common/code/boost_feed.php
==============================================================================
--- website/public_html/beta/common/code/boost_feed.php (original)
+++ website/public_html/beta/common/code/boost_feed.php 2009-08-05 17:34:25 EDT (Wed, 05 Aug 2009)
@@ -110,5 +110,59 @@
         $f = '_field_cmp_'.strtolower(str_replace('-','_',$field)).'_';
         uasort($this->db,$f);
     }
+
+ function echo_download_table($guid)
+ {
+ if($this->db[$guid]['boostbook:download']) {
+ $link = $this->db[$guid]['boostbook:download'];
+ if(preg_match('@/boost/(\d+)\.(\d+)\.(\d+)/$@', $link, $matches)) {
+ $base_name = 'boost_'.$matches[1].'_'.$matches[2].'_'.$matches[3];
+
+ /* Pick which files are available by examining the version number.
+ This could possibly be meta-data in the rss feed instead of being
+ hardcoded here. */
+
+ $downloads['unix'][] = $base_name.'.tar.bz2';
+ $downloads['unix'][] = $base_name.'.tar.gz';
+
+ if($matches[1] == 1 && $matches[2] >= 32 && $matches[2] <= 33) {
+ $downloads['windows'][] = $base_name.'.exe';
+ }
+ else if($matches[1] > 1 || $matches[2] > 34 || ($matches[2] == 34 && $matches[3] == 1)) {
+ $downloads['windows'][] = $base_name.'.7z';
+ }
+ $downloads['windows'][] = $base_name.'.zip';
+
+ /* Print the download table. */
+
+ echo '<table class="download-table">';
+ echo '<caption>Downloads</caption>';
+ echo '<tr><th scope="col">Platform</th><th scope="col">File</th></tr>';
+ foreach($downloads as $platform => $files) {
+ echo "\n";
+ echo '<tr><th scope="row"';
+ if(count($files) > 1) {
+ echo ' rowspan="'.count($files).'"';
+ }
+ echo '>'.htmlentities($platform).'</th>';
+ foreach($files as $index => $file) {
+ if($index > 0) echo '</tr><tr>';
+ echo '<td><a href="'.htmlentities($link.$file.'/download').'">'.
+ htmlentities($file).'</a></td>';
+ }
+ echo '</tr>';
+ }
+ echo '</table>';
+ }
+ else {
+ /* If the link didn't match the normal version number pattern
+ then just use the old fashioned link to sourceforge. */
+
+ echo '<p><span class="news-download"><a href="'.
+ htmlentities($link).
+ '">Download this release.</a></span></p>';
+ }
+ }
+ }
 }
 ?>

Modified: website/public_html/beta/feed/history.rss
==============================================================================
--- website/public_html/beta/feed/history.rss (original)
+++ website/public_html/beta/feed/history.rss 2009-08-05 17:34:25 EDT (Wed, 05 Aug 2009)
@@ -6,10 +6,10 @@
     <description/>
     <language>en-us</language>
     <copyright>Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)</copyright>
- <item><title>Version 1.40.0</title><pubDate>$Date$</pubDate><boostbook:purpose>&lt;span class=&quot;brief&quot;&gt;&lt;span class=&quot;purpose&quot;&gt;
+ <item><title>Version 1.40.0</title><pubDate>$Date: 2009/08/05 21:25:53 $</pubDate><boostbook:purpose>&lt;span class=&quot;brief&quot;&gt;&lt;span class=&quot;purpose&quot;&gt;
       Build System improvements. Updated Libraries: Foreach, Function, Hash, Program.Options,
       Serialization, Unordered, Wave.
- &lt;/span&gt;&lt;/span&gt;</boostbook:purpose><boostbook:download>http://sourceforge.net/projects/boost/files/boost/1.40.0/><description>&lt;div class=&quot;description&quot;&gt;
+ &lt;/span&gt;&lt;/span&gt;</boostbook:purpose><boostbook:download>
http://sourceforge.net/projects/boost/files/boost/1.40.0 beta/</boostbook:download><description>&lt;div class=&quot;description&quot;&gt;
   
   
   

Modified: website/public_html/beta/feed/history/boost_1_40_0.qbk
==============================================================================
--- website/public_html/beta/feed/history/boost_1_40_0.qbk (original)
+++ website/public_html/beta/feed/history/boost_1_40_0.qbk 2009-08-05 17:34:25 EDT (Wed, 05 Aug 2009)
@@ -9,8 +9,8 @@
 
 [include ext.qbk]
 
-[/ TODO: Check download link on release.]
-[download http://sourceforge.net/projects/boost/files/boost/1.40.0/]
+[/ TODO: Remove beta from link on release.]
+[download http://sourceforge.net/projects/boost/files/boost/1.40.0 beta/]
 
 [/
     When adding libraries:

Modified: website/public_html/beta/feed/news.rss
==============================================================================
--- website/public_html/beta/feed/news.rss (original)
+++ website/public_html/beta/feed/news.rss 2009-08-05 17:34:25 EDT (Wed, 05 Aug 2009)
@@ -6,10 +6,10 @@
     <description/>
     <language>en-us</language>
     <copyright>Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)</copyright>
- <item><title>Version 1.40.0</title><pubDate>$Date$</pubDate><boostbook:purpose>&lt;span class=&quot;brief&quot;&gt;&lt;span class=&quot;purpose&quot;&gt;
+ <item><title>Version 1.40.0</title><pubDate>$Date: 2009/08/05 21:25:53 $</pubDate><boostbook:purpose>&lt;span class=&quot;brief&quot;&gt;&lt;span class=&quot;purpose&quot;&gt;
       Build System improvements. Updated Libraries: Foreach, Function, Hash, Program.Options,
       Serialization, Unordered, Wave.
- &lt;/span&gt;&lt;/span&gt;</boostbook:purpose><boostbook:download>http://sourceforge.net/projects/boost/files/boost/1.40.0/><description>&lt;div class=&quot;description&quot;&gt;
+ &lt;/span&gt;&lt;/span&gt;</boostbook:purpose><boostbook:download>
http://sourceforge.net/projects/boost/files/boost/1.40.0 beta/</boostbook:download><description>&lt;div class=&quot;description&quot;&gt;
   
   
   

Modified: website/public_html/beta/style/css_0/content.css
==============================================================================
--- website/public_html/beta/style/css_0/content.css (original)
+++ website/public_html/beta/style/css_0/content.css 2009-08-05 17:34:25 EDT (Wed, 05 Aug 2009)
@@ -531,3 +531,17 @@
   color: #777;
   font-size: 90%;
 }
+/* Download table */
+#content .section table.download-table {
+ text-align: left;
+ margin: 1.5em 0;
+}
+
+#content .section table.download-table caption {
+ caption-side: top;
+ text-align: left;
+ margin: 0.5em 0;
+ font-family: 'Times New Roman', serif;
+ font-variant: small-caps;
+ font-size: 115%;
+}
\ No newline at end of file

Modified: website/public_html/beta/users/download/entry.php
==============================================================================
--- website/public_html/beta/users/download/entry.php (original)
+++ website/public_html/beta/users/download/entry.php 2009-08-05 17:34:25 EDT (Wed, 05 Aug 2009)
@@ -41,9 +41,7 @@
               <p><span class=
               "news-date"><?php print $_downloads->db[$_guid]['date']; ?></span></p>
 
- <?php if($_downloads->db[$_guid]['boostbook:download']) : ?>
- <p><span class="news-download">Download this release.</span></p>
- <? endif; ?>
+ <?php $_downloads->echo_download_table($_guid); ?>
 
               <div class="news-description">
                 <?php print $_downloads->db[$_guid]['description']; ?>

Modified: website/public_html/beta/users/history/entry.php
==============================================================================
--- website/public_html/beta/users/history/entry.php (original)
+++ website/public_html/beta/users/history/entry.php 2009-08-05 17:34:25 EDT (Wed, 05 Aug 2009)
@@ -51,9 +51,7 @@
               <p><span class=
               "news-date"><?php print $_history->db[$_guid]['date']; ?></span></p>
 
- <?php if($_history->db[$_guid]['boostbook:download']) : ?>
- <p><span class="news-download">Download this release.</span></p>
- <?php endif; ?>
+ <?php $_history->echo_download_table($_guid); ?>
 
               <div class="news-description">
                 <?php print $_history->db[$_guid]['description']; ?>

Modified: website/public_html/beta/users/news/entry.php
==============================================================================
--- website/public_html/beta/users/news/entry.php (original)
+++ website/public_html/beta/users/news/entry.php 2009-08-05 17:34:25 EDT (Wed, 05 Aug 2009)
@@ -51,9 +51,7 @@
               <p><span class=
               "news-date"><?php print $_news->db[$_guid]['date']; ?></span></p>
 
- <?php if($_news->db[$_guid]['boostbook:download']) : ?>
- <p><span class="news-download">Download this release.</span></p>
- <?php endif; ?>
+ <?php $_news->echo_download_table($_guid); ?>
 
               <div class="news-description">
                 <?php print $_news->db[$_guid]['description']; ?>


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk