From a12943387da2f5aff2d97629efa9f1b241e27ba7 Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Wed, 8 Dec 2010 18:54:28 +0000 Subject: [PATCH] --- .htaccess | 4 +++- inc/ws/Controlleur/class.ws.url.php | 33 ++++++++++++++++++++++++++--- inc/ws/DAO/class.ws.dao.book.php | 2 +- index.php | 13 +++++++----- 4 files changed, 42 insertions(+), 10 deletions(-) diff --git a/.htaccess b/.htaccess index 094a14aa9..4335daaf9 100644 --- a/.htaccess +++ b/.htaccess @@ -24,4 +24,6 @@ RewriteRule ^docs - [L] RewriteRule ^ajax/supprimeFichier/([0-9]+)/(.*)$ index.php/ajax/supprimeFichier/$1/$2 [L] RewriteRule ^telecharger/([0-9]+)/(.*)$ index.php/telecharger/$1/$2 [L] -RewriteRule ^([-_a-zA-Z0-9/]+)$ index.php/$1 [L] \ No newline at end of file +RewriteRule ^([-_a-zA-Z0-9/]+)$ index.php/$1 [L] + +RewriteRule ^viewer/([0-9]+)_([0-9a-fA-F]+)_([0-9]+)/(.+)$ fluidbook/books/final/$1/$4 [L] \ No newline at end of file diff --git a/inc/ws/Controlleur/class.ws.url.php b/inc/ws/Controlleur/class.ws.url.php index 07fa62919..e78dfb5a9 100644 --- a/inc/ws/Controlleur/class.ws.url.php +++ b/inc/ws/Controlleur/class.ws.url.php @@ -124,12 +124,14 @@ html{height:100%}' . "\n"; global $core; global $css; global $js; + global $standard; + $args = cubePage::getArgs($args); $e = explode('_', $args[0]); - if (count($e) == 2) { - $e[] = TIME; - http::redirect(SITE_PATH . '/viewer/' . implode('_', $e)); + if (count($e) == 2 || $e[2] < TIME-10) { + $e[2] = TIME; + http::redirect(SITE_PATH . 'viewer/' . implode('_', $e) . '/'); exit; } @@ -139,6 +141,31 @@ html{height:100%}' . "\n"; http::head(401); exit; } + + if (!$dao->isUpToDate($e[0])) { + $dao->compile($e[0]); + $dao->touchCompile($e[0]); + } + + $webcompile = WEBROOT . '/fluidbook/compile/'; + + $standard = 'XHTML 1.0 Transitional'; + $css[] = $webcompile . '/style.css'; + cubePage::swfaddress(); + + //$fv = array('base' => WEBROOT . '/fluidbook/books/final/' . $e[0]); + $fv = array(); + + $res = ''; + $res .= ''; + $res .= '' . $book->nom . ''; + $res .= ''; + $res .= ''; + $res .= cubeMedia::flash2('index.swf', '100%', '100%', $fv, 'fluidbook', '', 10, '#ffffff', '', true); + $res .= ''; + $res .= ''; + + echo $res; } public static function statsxls($args) diff --git a/inc/ws/DAO/class.ws.dao.book.php b/inc/ws/DAO/class.ws.dao.book.php index f298cb4b5..dbccf1ff6 100644 --- a/inc/ws/DAO/class.ws.dao.book.php +++ b/inc/ws/DAO/class.ws.dao.book.php @@ -360,7 +360,7 @@ class wsDAOBook extends extranetDAO { public function isUpToDate($book_id) { $r = $this->con->select('SELECT changedate,compiledate FROM books WHERE book_id=\'' . $this->con->escape($book_id) . '\''); - return $r->compiledate > $r->updatedate; + return $r->compiledate > $r->changedate; } public function setComposition($book_id, $pages) diff --git a/index.php b/index.php index 410ff046d..cb2627712 100644 --- a/index.php +++ b/index.php @@ -1,18 +1,21 @@ url->getDocument(); -$buffer = ob_get_contents(); - -ob_clean(); $js[] = JS_PATH . '/common.js'; $js[] = JS_PATH . '/' . MODE . '.js'; $jsvar['IMG'] = IMG; $jsvar['SITE_PATH'] = SITE_PATH; $css[] = CSS_PATH . '/style.css'; +$standard='XHTML 1.0 Strict'; + +echo $core->url->getDocument(); +$buffer = ob_get_contents(); + +ob_clean(); + // $css['IE'] = CSS_PATH . '/ie.css'; -echo cubePage::page($buffer, $js, $jsvar, $css, array(), 6); +echo cubePage::page($buffer, $js, $jsvar, $css, array(), 6,false,array(),array(),$standard); fb($core->debug()); ?> \ No newline at end of file -- 2.39.5