cvs: pres2 / show.php

From: Date: Thu, 07 Nov 2002 05:08:09 +0000
Subject: cvs: pres2 / show.php
Groups: php.pres 
Request: Send a blank email to pres+get-496@lists.php.net to get a copy of this message
lhl Thu Nov 7 00:08:09 2002 EDT Modified files: /pres2 show.php Log: Adds Last-Modified header to slide if it doesn't execute php example code. Also adds <link> tags for navigation and Mozilla pre-fetching Index: pres2/show.php diff -u pres2/show.php:1.38 pres2/show.php:1.39 --- pres2/show.php:1.38 Fri Nov 1 19:15:32 2002 +++ pres2/show.php Thu Nov 7 00:08:08 2002 @@ -85,9 +85,19 @@ switch($navmode) { case 'html': case 'flash': - // facilitate caching - header("Last-Modified: " . date("r", filemtime($presentationDir.'/'.$pres[1]->slides[$slideNum]->filename))); + // Determine if we should cache + $cache_ok = 1; + foreach($objs as $obj) { + if(is_a($obj, '_example')) { + if(strtolower($obj->type) == 'php') { + $cache_ok = 0; + } + } + } + reset($objs); // shouldn't be necessary, but is + // allow caching + if($cache_ok) header("Last-Modified: " . date("r", filemtime($presentationDir.'/'.$pres[1]->slides[$slideNum]->filename))); echo <<<HEADER <html> <head> @@ -105,6 +115,9 @@ include $pres[1]->stylesheet; /* the following includes scripts necessary for various animations */ if($pres[1]->animate || $pres[1]->jskeyboard) include 'keyboard.js.php'; + // Link Navigation (and next slide pre-fetching)) + if($slideNum) echo '<link rel="prev" href="'.$presentationDir.'/'.$pres[1]->slides[$prevSlideNum]->filename."\" />\n"; + if($nextSlideNum) echo '<link rel="next" href="'.$presentationDir.'/'.$pres[1]->slides[$nextSlideNum]->filename."\" />\n"; echo '</head>'; echo "<body onResize=\"get_dims();\" style=\"".$body_style."\">\n"; while(list($coid,$obj) = each($objs)) {

« previous php.pres (#496) next »