cvs: pres2 / show.php

From: Date: Thu, 29 Jul 2004 00:14:14 +0000
Subject: cvs: pres2 / show.php
Groups: php.pres 
Request: Send a blank email to pres+get-1015@lists.php.net to get a copy of this message
shiflett Wed Jul 28 20:14:14 2004 EDT Modified files: /pres2 show.php Log: I wanted to have more complex URLs, such as http://shiflett.org/talks/oscon2004/php-security, so I made some slight modifications that makes this read oscon2004-php-security.xml. This URL gets translated to http://shiflett.org/talks/oscon2004-php-security when going through the slides, because our navigation uses absolute URLs (or at least absolute paths), so this is something else I'll fix later. http://cvs.php.net/diff.php/pres2/show.php?r1=1.56&r2=1.57&ty=u Index: pres2/show.php diff -u pres2/show.php:1.56 pres2/show.php:1.57 --- pres2/show.php:1.56 Thu Jul 1 09:27:20 2004 +++ pres2/show.php Wed Jul 28 20:14:14 2004 @@ -28,7 +28,27 @@ if(isset($_SESSION['currentPres'])) { $lastPres = $_SESSION['currentPres']; } + + /* + Adding support for URLs such as + http://shiflett.org/talks/oscon2004/php-security + */ + $urlArray = explode('/', $presFile); + $slideNumIndex = sizeof($urlArray) - 1; + if ($urlArray[$slideNumIndex] == strval(intval($urlArray[$slideNumIndex]))) { + $slideNum = $urlArray[$slideNumIndex]; + unset($urlArray[$slideNumIndex]); + } + else { + $slideNum = ''; + } + $_SESSION['currentPres'] = trim(implode('-', $urlArray), '-'); + + /* + Old way: @list($_SESSION['currentPres'],$slideNum) = explode('/',$presFile); + */ + if(!isset($_SESSION['titlesLoaded'])) $_SESSION['titlesLoaded'] = 0; $presFile = str_replace('..','',$_SESSION['currentPres']); // anti-hack $presFile = "$presentationDir/$presFile".'.xml';

« previous php.pres (#1015) next »