Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r75679 - website/public_html/beta/doc
From: dnljms_at_[hidden]
Date: 2011-11-26 14:29:14


Author: danieljames
Date: 2011-11-26 14:29:13 EST (Sat, 26 Nov 2011)
New Revision: 75679
URL: http://svn.boost.org/trac/boost/changeset/75679

Log:
Website: Shorter expiry date for current docs + beta.

Text files modified:
   website/public_html/beta/doc/display_libs.php | 44 ++++++++++++++++++++-------------------
   1 files changed, 23 insertions(+), 21 deletions(-)

Modified: website/public_html/beta/doc/display_libs.php
==============================================================================
--- website/public_html/beta/doc/display_libs.php (original)
+++ website/public_html/beta/doc/display_libs.php 2011-11-26 14:29:13 EST (Sat, 26 Nov 2011)
@@ -18,27 +18,25 @@
 
 require_once(dirname(__FILE__) . '/../common/code/boost_archive.php');
 
-function boost_future_version($version)
+function boost_compare_version($version)
 {
- if ($version)
+ if ($version && preg_match('@([0-9]+)_([0-9]+)_([0-9]+)@',$version,$vinfo))
     {
- $vinfo = array();
- preg_match('@([0-9]+)_([0-9]+)_([0-9]+)@',$version,$vinfo);
- if (isset($vinfo[0]))
- {
- global $boost_current_version;
- $v = $boost_current_version[0];
- $r = $boost_current_version[1];
- $p = $boost_current_version[2];
- return
- ($v < $vinfo[1]) ||
- ($v == $vinfo[1] && $r < $vinfo[2]) ||
- ($v == $vinfo[1] && $r == $vinfo[2] && $p < $vinfo[3]);
- }
- else
- {
- return FALSE;
- }
+ array_shift($vinfo);
+
+ global $boost_current_version;
+ $v = $boost_current_version[0];
+ $r = $boost_current_version[1];
+ $p = $boost_current_version[2];
+
+ return
+ $v < $vinfo[0] ? 1 :
+ ($v > $vinfo[0] ? -1 :
+ ($r < $vinfo[1] ? 1 :
+ ($r > $vinfo[1] ? -1 :
+ ($p < $vinfo[2] ? 1 :
+ ($p > $vinfo[2] ? -1
+ : 0)))));
     }
     else
     {
@@ -88,7 +86,9 @@
 $beta_docs = strpos($location['version'], 'beta') !== FALSE ||
     strpos($location['version'], 'snapshot') !== FALSE;
 
-if (!$beta_docs && boost_future_version($location['version'])) {
+$compare_version = boost_compare_version($location['version']);
+
+if (!$beta_docs && $compare_version === 1) {
     file_not_found($location['file'],
         "Documentation for this version has not been uploaded yet. ".
         "Documentation is only uploaded when it's fully released, ".
@@ -128,5 +128,7 @@
   //~ the headers are text files displayed in an embeded page
   array('@.*@','@^boost/.*$@i','cpp','text/plain')
   ),
- null, "+1 year"
+ null,
+ $compare_version === -1 ? "+1 year" :
+ ($compare_version === 0 ? "+1 week" : "+1 day")
 );


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