Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r65095 - website/public_html/beta/common/code
From: dnljms_at_[hidden]
Date: 2010-08-29 04:52:54


Author: danieljames
Date: 2010-08-29 04:52:53 EDT (Sun, 29 Aug 2010)
New Revision: 65095
URL: http://svn.boost.org/trac/boost/changeset/65095

Log:
Less html preparation on most pages.
Text files modified:
   website/public_html/beta/common/code/boost_archive.php | 43 +++++++++++++++++++--------------------
   1 files changed, 21 insertions(+), 22 deletions(-)

Modified: website/public_html/beta/common/code/boost_archive.php
==============================================================================
--- website/public_html/beta/common/code/boost_archive.php (original)
+++ website/public_html/beta/common/code/boost_archive.php 2010-08-29 04:52:53 EDT (Sun, 29 Aug 2010)
@@ -355,7 +355,7 @@
 
 function boost_book_html_filter_content($params)
 {
- $text = prepare_html($params['content']);
+ $text = prepare_html($params['content'], true);
     
     $text = substr($text,strpos($text,'<div class="spirit-nav">'));
     $text = substr($text,0,strpos($text,'</body>'));
@@ -383,7 +383,7 @@
     html_init($params);
     $text = extract_html_body($params['content']);
     if($text) {
- $text = prepare_html($text);
+ $text = prepare_html($text, true);
         $text = remove_html_banner($text);
         $text = prepare_themed_html($text);
         $params['content'] = $text;
@@ -409,7 +409,7 @@
 
 function boost_frame1_filter_content($params)
 {
- $text = prepare_html($params['content']);
+ $text = prepare_html($params['content'], true);
     
     $text = substr($text,strpos($text,'<div class="spirit-nav">'));
     $text = substr($text,0,strpos($text,'</body>'));
@@ -610,28 +610,27 @@
     return $text;
 }
 
-function prepare_html($text) {
- $text = preg_replace(
- '@href="?http://www.boost.org/?([^"\s]*)"?@i',
- 'href="/${1}"',
- $text );
+function prepare_html($text, $full = false) {
     $text = preg_replace(
- '@href="?http://boost.org/?([^"\s]*)"?@i',
+ '@href="?http://(?:www.)?boost.org/?([^"\s]*)"?@i',
         'href="/${1}"',
         $text );
- $text = preg_replace(
- '@href="?(?:\.\./)+people/(.*\.htm)"?@i',
- 'href="/users/people/${1}l"',
- $text );
- $text = preg_replace(
- '@href="?(?:\.\./)+(LICENSE_[^"\s]*\.txt)"?@i',
- 'href="/${1}"',
- $text );
- $text = preg_replace(
- '@<a\s+(class="[^"]+")?\s*href="?(http|mailto)(:[^"\s]*)"?@i',
- '<a class="external" href="${2}${3}"',
- $text );
-
+
+ if($full) {
+ $text = preg_replace(
+ '@href="?(?:\.\./)+people/(.*\.htm)"?@i',
+ 'href="/users/people/${1}l"',
+ $text );
+ $text = preg_replace(
+ '@href="?(?:\.\./)+(LICENSE_[^"\s]*\.txt)"?@i',
+ 'href="/${1}"',
+ $text );
+ $text = preg_replace(
+ '@<a\s+(class="[^"]+")?\s*href="?(http|mailto)(:[^"\s]*)"?@i',
+ '<a class="external" href="${2}${3}"',
+ $text );
+ }
+
     return $text;
 }
 


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