Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r64897 - in website/public_html/beta: . build common/code users/download users/history users/news
From: dnljms_at_[hidden]
Date: 2010-08-18 16:38:48


Author: danieljames
Date: 2010-08-18 16:38:46 EDT (Wed, 18 Aug 2010)
New Revision: 64897
URL: http://svn.boost.org/trac/boost/changeset/64897

Log:
Prebuild feed entries.
Added:
   website/public_html/beta/build/download-entries.php (contents, props changed)
      - copied, changed from r64894, /website/public_html/beta/users/download/entry.php
   website/public_html/beta/build/history-entries.php (contents, props changed)
      - copied, changed from r64894, /website/public_html/beta/users/history/entry.php
   website/public_html/beta/build/news-entries.php (contents, props changed)
      - copied, changed from r64894, /website/public_html/beta/users/news/entry.php
Removed:
   website/public_html/beta/users/download/entry.php
   website/public_html/beta/users/history/entry.php
   website/public_html/beta/users/news/entry.php
Text files modified:
   website/public_html/beta/.htaccess | 6 +++---
   website/public_html/beta/build/build.sh | 5 ++++-
   website/public_html/beta/build/download-entries.php | 28 ++++++++++++++++++++--------
   website/public_html/beta/build/history-entries.php | 28 ++++++++++++++++++++--------
   website/public_html/beta/build/news-entries.php | 28 ++++++++++++++++++++--------
   website/public_html/beta/common/code/boost_feed.php | 2 +-
   6 files changed, 68 insertions(+), 29 deletions(-)

Modified: website/public_html/beta/.htaccess
==============================================================================
--- website/public_html/beta/.htaccess (original)
+++ website/public_html/beta/.htaccess 2010-08-18 16:38:46 EDT (Wed, 18 Aug 2010)
@@ -16,9 +16,9 @@
 
 ########## Rewrites to serve up dynamic RSS feeds.
 
-RewriteRule ^users/news/([-\w]+)$ users/news/entry.php/$1 [L]
-RewriteRule ^users/download/([-\w]+)$ users/download/entry.php/$1 [L]
-RewriteRule ^users/history/([-\w]+)$ users/history/entry.php/$1 [L]
+RewriteRule ^users/news/([-\w]+)$ users/news/$1.html [L]
+RewriteRule ^users/download/([-\w]+)$ users/download/$1.html [L]
+RewriteRule ^users/history/([-\w]+)$ users/history/$1.html [L]
 
 ########## Rewrites to serve up "sub-projects".
 

Modified: website/public_html/beta/build/build.sh
==============================================================================
--- website/public_html/beta/build/build.sh (original)
+++ website/public_html/beta/build/build.sh 2010-08-18 16:38:46 EDT (Wed, 18 Aug 2010)
@@ -1,4 +1,7 @@
 #!/bin/sh
 
 php build.php
-php index-src.php > ../index.html
\ No newline at end of file
+php index-src.php > ../index.html
+php download-entries.php
+php news-entries.php
+php history-entries.php
\ No newline at end of file

Copied: website/public_html/beta/build/download-entries.php (from r64894, /website/public_html/beta/users/download/entry.php)
==============================================================================
--- /website/public_html/beta/users/download/entry.php (original)
+++ website/public_html/beta/build/download-entries.php 2010-08-18 16:38:46 EDT (Wed, 18 Aug 2010)
@@ -1,12 +1,14 @@
 <?php
-require_once(dirname(__FILE__) . '/../../common/code/boost_feed.php');
-$_downloads = new boost_feed(dirname(__FILE__) . '/../../feed/downloads.rss', '/users/download');
-$_guid = basename($_SERVER["PATH_INFO"]);
-if(!isset($_downloads->db[$_guid])) {
- require_once(dirname(__FILE__) . '/../../common/code/boost_error_page.php');
- error_page_404();
- exit(0);
-}
+
+echo "Download entries\n";
+echo "================\n";
+
+require_once(dirname(__FILE__) . '/../common/code/boost_feed.php');
+$_downloads = new boost_feed(dirname(__FILE__) . '/../feed/downloads.rss', '/users/download');
+foreach($_downloads->db as $_guid => $_value) {
+ echo "Building $_guid\n";
+
+ ob_start();
 ?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
@@ -78,3 +80,13 @@
   </div>
 </body>
 </html>
+<?php
+ $_page = ob_get_contents();
+ ob_end_clean();
+
+ file_put_contents(dirname(__FILE__) . "/../users/download/$_guid.html", $_page);
+}
+
+echo "\n";
+
+?>
\ No newline at end of file

Copied: website/public_html/beta/build/history-entries.php (from r64894, /website/public_html/beta/users/history/entry.php)
==============================================================================
--- /website/public_html/beta/users/history/entry.php (original)
+++ website/public_html/beta/build/history-entries.php 2010-08-18 16:38:46 EDT (Wed, 18 Aug 2010)
@@ -1,12 +1,14 @@
 <?php
-require_once(dirname(__FILE__) . '/../../common/code/boost_feed.php');
-$_history = new boost_feed(dirname(__FILE__) . '/../../feed/history.rss', '/users/history');
-$_guid = basename($_SERVER["PATH_INFO"]);
-if(!isset($_history->db[$_guid])) {
- require_once(dirname(__FILE__) . '/../../common/code/boost_error_page.php');
- error_page_404();
- exit(0);
-}
+
+echo "History entries\n";
+echo "===============\n";
+
+require_once(dirname(__FILE__) . '/../common/code/boost_feed.php');
+$_history = new boost_feed(dirname(__FILE__) . '/../feed/history.rss', '/users/history');
+foreach($_history->db as $_guid => $_value) {
+ echo "Building $_guid\n";
+
+ ob_start();
 ?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
@@ -88,3 +90,13 @@
   </div>
 </body>
 </html>
+<?php
+ $_page = ob_get_contents();
+ ob_end_clean();
+
+ file_put_contents(dirname(__FILE__) . "/../users/history/$_guid.html", $_page);
+}
+
+echo "\n";
+
+?>

Copied: website/public_html/beta/build/news-entries.php (from r64894, /website/public_html/beta/users/news/entry.php)
==============================================================================
--- /website/public_html/beta/users/news/entry.php (original)
+++ website/public_html/beta/build/news-entries.php 2010-08-18 16:38:46 EDT (Wed, 18 Aug 2010)
@@ -1,12 +1,14 @@
 <?php
-require_once(dirname(__FILE__) . '/../../common/code/boost_feed.php');
-$_news = new boost_feed(dirname(__FILE__) . '/../../feed/news.rss', '/users/news');
-$_guid = basename($_SERVER["PATH_INFO"]);
-if(!isset($_news->db[$_guid])) {
- require_once(dirname(__FILE__) . '/../../common/code/boost_error_page.php');
- error_page_404();
- exit(0);
-}
+
+echo "News entries\n";
+echo "============\n";
+
+require_once(dirname(__FILE__) . '/../common/code/boost_feed.php');
+$_news = new boost_feed(dirname(__FILE__) . '/../feed/news.rss', '/users/news');
+foreach($_news->db as $_guid => $_value) {
+ echo "Building $_guid\n";
+
+ ob_start();
 ?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
@@ -88,3 +90,13 @@
   </div>
 </body>
 </html>
+<?php
+ $_page = ob_get_contents();
+ ob_end_clean();
+
+ file_put_contents(dirname(__FILE__) . "/../users/news/$_guid.html", $_page);
+}
+
+echo "\n";
+
+?>
\ No newline at end of file

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 2010-08-18 16:38:46 EDT (Wed, 18 Aug 2010)
@@ -104,7 +104,7 @@
     
     function echo_download_table($guid)
     {
- if($this->db[$guid]['boostbook:download']) {
+ if(isset($this->db[$guid]['boostbook:download']) && $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];

Deleted: website/public_html/beta/users/download/entry.php
==============================================================================
--- website/public_html/beta/users/download/entry.php 2010-08-18 16:38:46 EDT (Wed, 18 Aug 2010)
+++ (empty file)
@@ -1,80 +0,0 @@
-<?php
-require_once(dirname(__FILE__) . '/../../common/code/boost_feed.php');
-$_downloads = new boost_feed(dirname(__FILE__) . '/../../feed/downloads.rss', '/users/download');
-$_guid = basename($_SERVER["PATH_INFO"]);
-if(!isset($_downloads->db[$_guid])) {
- require_once(dirname(__FILE__) . '/../../common/code/boost_error_page.php');
- error_page_404();
- exit(0);
-}
-?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-
-<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
-<head>
- <title><?php print $_downloads->db[$_guid]['title']; ?></title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <link rel="icon" href="/favicon.ico" type="image/ico" />
- <link rel="stylesheet" type="text/css" href="/style-v2/section-boost.css" />
- <!--[if IE 7]> <style type="text/css"> body { behavior: url(/style-v2/csshover3.htc); } </style> <![endif]-->
-</head>
-
-<body>
- <div id="heading">
- <?php virtual("/common/heading.html"); ?>
- </div>
-
- <div id="body">
- <div id="body-inner">
- <div id="content">
- <div class="section" id="intro">
- <div class="section-0">
- <div class="section-title">
- <h1><?php print $_downloads->db[$_guid]['title']; ?></h1>
- </div>
-
- <div class="section-body">
- <h2><span class=
- "news-title"><?php print $_downloads->db[$_guid]['title']; ?></span></h2>
-
- <p><span class=
- "news-date"><?php print $_downloads->db[$_guid]['date']; ?></span></p>
-
- <?php $_downloads->echo_download_table($_guid); ?>
-
- <div class="news-description">
- <?php print $_downloads->db[$_guid]['description']; ?>
- </div>
- </div>
- </div>
- </div>
- </div>
-
- <div id="sidebar">
- <?php virtual("/common/sidebar-common.html"); ?><?php virtual("/common/sidebar-boost.html"); ?>
- </div>
-
- <div class="clear"></div>
- </div>
- </div>
-
- <div id="footer">
- <div id="footer-left">
- <div id="revised">
- <p>Revised $Date$</p>
- </div>
-
- <div id="copyright">
- <p>Copyright Rene Rivera 2006-2007.</p>
- </div><?php virtual("/common/footer-license.html"); ?>
- </div>
-
- <div id="footer-right">
- <?php virtual("/common/footer-banners.html"); ?>
- </div>
-
- <div class="clear"></div>
- </div>
-</body>
-</html>

Deleted: website/public_html/beta/users/history/entry.php
==============================================================================
--- website/public_html/beta/users/history/entry.php 2010-08-18 16:38:46 EDT (Wed, 18 Aug 2010)
+++ (empty file)
@@ -1,90 +0,0 @@
-<?php
-require_once(dirname(__FILE__) . '/../../common/code/boost_feed.php');
-$_history = new boost_feed(dirname(__FILE__) . '/../../feed/history.rss', '/users/history');
-$_guid = basename($_SERVER["PATH_INFO"]);
-if(!isset($_history->db[$_guid])) {
- require_once(dirname(__FILE__) . '/../../common/code/boost_error_page.php');
- error_page_404();
- exit(0);
-}
-?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-
-<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
-<head>
- <title><?php print $_history->db[$_guid]['title']; ?></title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <link rel="icon" href="/favicon.ico" type="image/ico" />
- <link rel="stylesheet" type="text/css" href="/style-v2/section-boost.css" />
- <style type="text/css">
-/*<![CDATA[*/
- #content .news-description ul {
- list-style: none;
- }
- #content .news-description ul ul {
- list-style: circle;
- }
- /*]]>*/
- </style>
- <!--[if IE 7]> <style type="text/css"> body { behavior: url(/style-v2/csshover3.htc); } </style> <![endif]-->
-</head>
-
-<body>
- <div id="heading">
- <?php virtual("/common/heading.html"); ?>
- </div>
-
- <div id="body">
- <div id="body-inner">
- <div id="content">
- <div class="section" id="intro">
- <div class="section-0">
- <div class="section-title">
- <h1><?php print $_history->db[$_guid]['title']; ?></h1>
- </div>
-
- <div class="section-body">
- <h2><span class=
- "news-title"><?php print $_history->db[$_guid]['title']; ?></span></h2>
-
- <p><span class=
- "news-date"><?php print $_history->db[$_guid]['date']; ?></span></p>
-
- <?php $_history->echo_download_table($_guid); ?>
-
- <div class="news-description">
- <?php print $_history->db[$_guid]['description']; ?>
- </div>
- </div>
- </div>
- </div>
- </div>
-
- <div id="sidebar">
- <?php virtual("/common/sidebar-common.html"); ?><?php virtual("/common/sidebar-boost.html"); ?>
- </div>
-
- <div class="clear"></div>
- </div>
- </div>
-
- <div id="footer">
- <div id="footer-left">
- <div id="revised">
- <p>Revised $Date$</p>
- </div>
-
- <div id="copyright">
- <p>Copyright Rene Rivera 2006-2007.</p>
- </div><?php virtual("/common/footer-license.html"); ?>
- </div>
-
- <div id="footer-right">
- <?php virtual("/common/footer-banners.html"); ?>
- </div>
-
- <div class="clear"></div>
- </div>
-</body>
-</html>

Deleted: website/public_html/beta/users/news/entry.php
==============================================================================
--- website/public_html/beta/users/news/entry.php 2010-08-18 16:38:46 EDT (Wed, 18 Aug 2010)
+++ (empty file)
@@ -1,90 +0,0 @@
-<?php
-require_once(dirname(__FILE__) . '/../../common/code/boost_feed.php');
-$_news = new boost_feed(dirname(__FILE__) . '/../../feed/news.rss', '/users/news');
-$_guid = basename($_SERVER["PATH_INFO"]);
-if(!isset($_news->db[$_guid])) {
- require_once(dirname(__FILE__) . '/../../common/code/boost_error_page.php');
- error_page_404();
- exit(0);
-}
-?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-
-<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
-<head>
- <title><?php print $_news->db[$_guid]['title']; ?></title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <link rel="icon" href="/favicon.ico" type="image/ico" />
- <link rel="stylesheet" type="text/css" href="/style-v2/section-boost.css" />
- <style type="text/css">
-/*<![CDATA[*/
- #content .news-description ul {
- list-style: none;
- }
- #content .news-description ul ul {
- list-style: circle;
- }
- /*]]>*/
- </style>
- <!--[if IE 7]> <style type="text/css"> body { behavior: url(/style-v2/csshover3.htc); } </style> <![endif]-->
-</head>
-
-<body>
- <div id="heading">
- <?php virtual("/common/heading.html"); ?>
- </div>
-
- <div id="body">
- <div id="body-inner">
- <div id="content">
- <div class="section" id="intro">
- <div class="section-0">
- <div class="section-title">
- <h1><?php print $_news->db[$_guid]['title']; ?></h1>
- </div>
-
- <div class="section-body">
- <h2><span class=
- "news-title"><?php print $_news->db[$_guid]['title']; ?></span></h2>
-
- <p><span class=
- "news-date"><?php print $_news->db[$_guid]['date']; ?></span></p>
-
- <?php $_news->echo_download_table($_guid); ?>
-
- <div class="news-description">
- <?php print $_news->db[$_guid]['description']; ?>
- </div>
- </div>
- </div>
- </div>
- </div>
-
- <div id="sidebar">
- <?php virtual("/common/sidebar-common.html"); ?><?php virtual("/common/sidebar-boost.html"); ?>
- </div>
-
- <div class="clear"></div>
- </div>
- </div>
-
- <div id="footer">
- <div id="footer-left">
- <div id="revised">
- <p>Revised $Date$</p>
- </div>
-
- <div id="copyright">
- <p>Copyright Rene Rivera 2006-2007.</p>
- </div><?php virtual("/common/footer-license.html"); ?>
- </div>
-
- <div id="footer-right">
- <?php virtual("/common/footer-banners.html"); ?>
- </div>
-
- <div class="clear"></div>
- </div>
-</body>
-</html>


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