cvs: presentations /slides/intro exif.xml header.xml image2a.xml image_colors4.xml image_colors6.xml mysql_connect.xml mysql_insert.xml mysql_time.xml
numbers.xml pdf.xml phpstats.png pres2 css.php objects.php show.php
| From: | Rasmus Lerdorf | Date: | Sun, 15 Dec 2002 18:38:52 +0000 |
| Subject: | cvs: presentations /slides/intro exif.xml header.xml image2a.xml image_colors4.xml image_colors6.xml mysql_connect.xml mysql_insert.xml mysql_time.xml numbers.xml pdf.xml phpstats.png pres2 css.php objects.php show.php |
||
| Groups: | php.pres | ||
| Request: | Send a blank email to pres+get-573@lists.php.net to get a copy of this message | ||
rasmus Sun Dec 15 13:38:52 2002 EDT
Modified files:
/pres2 css.php objects.php show.php
/presentations/slides/intro exif.xml header.xml image2a.xml
image_colors4.xml image_colors6.xml
mysql_connect.xml mysql_insert.xml
mysql_time.xml numbers.xml pdf.xml
phpstats.png
Log:
Add new "php2" template
Index: pres2/css.php diff -u pres2/css.php:1.10 pres2/css.php:1.11 --- pres2/css.php:1.10 Tue Aug 6 00:34:29 2002 +++ pres2/css.php Sun Dec 15 13:38:51 2002 @@ -25,6 +25,19 @@ bottom: auto; width: auto; } +div.bsticky { + margin: 0; +<?if(strstr($_SERVER['HTTP_USER_AGENT'],'MSIE')): // Need a much smarter check here ?> + position: absolute; +<?else:?> + position: fixed; +<?endif?> + top: auto; + left: 0em; + right: auto; + bottom: 0em; + width: 100%; +} div.shadow { background: <?php echo $pres[1]->shadowbackground; ?>; padding: 0.5em; @@ -91,6 +104,13 @@ width : 46%; float : right; } +.c2rightnb { + margin : 1em 1em 0 0; + padding-left : 1%; + padding-right : 1%; + width : 46%; + float : right; +} .c2left { margin : 1em 1em 0 0; padding-left : 1%; @@ -105,6 +125,14 @@ width : 46%; float : left; } +.c2leftnb { + margin : 1em 1em 0 0; + padding-left : 1%; + padding-right : 1%; + border-style : none; + width : 46%; + float : left; +} .box { margin : 0 0 0 0; padding-left : 1%; @@ -118,4 +146,12 @@ border-left-color : inherit; float : left; } + +A.linka { text-decoration: none; color: 000000; } +td.foo {color: ffffff; font-family: arial,verdana,helvetica; font-size: 70%} +span.c4 {position: fixed; bottom: 0.5em; right: 4em; top: auto; left: auto; color: ffffff; font-family: arial,verdana,helvetica; font-size: 70%} +td.c3 {color: CC6600; font-family: arial, helvetica, verdana} +span.c2 {color: ffffff; font-family: arial,hevetica,verdana} +td.c1 {font-family: arial,helvetica,verdana; font-size: 80%} + </style> Index: pres2/objects.php diff -u pres2/objects.php:1.129 pres2/objects.php:1.130 --- pres2/objects.php:1.129 Wed Dec 11 08:46:33 2002 +++ pres2/objects.php Sun Dec 15 13:38:51 2002 @@ -107,46 +107,80 @@ } // }}} +function format_tt($arg) { + return("<tt>".str_replace(' ', ' ', $arg[1])."</tt>"); +} + /* {{{ string markup_text($str) *word* Bold _word_ underline %word% monospaced word (ie. %function()%) + ~word~ italics |rrggbb|word| Colour a word ^N^ Superscript @N@ Subscript */ function markup_text($str) { - $ret = preg_replace('/\*([\S ]+?)\*/','<strong>\1</strong>',$str); + $ret = $str; +# $ret = preg_replace('/\*([\S ]+?)([^\\\])\*/','<strong>\1\2</strong>',$str); $ret = preg_replace('/#([[:alnum:]]+?)#/','&\1;',$ret); $ret = preg_replace('/\b_([\S ]+?)_\b/','<u>\1</u>',$ret); - $ret = preg_replace('/%([\S ]+?)%/','<tt>\1</tt>',$ret); - $ret = preg_replace('/\|([0-9a-fA-F]+?)\|(\S+?)\|/','<font color="\1">\2</font>',$ret); + + //bold + $ret = str_replace('\*',chr(1),$ret); + $ret = preg_replace('/\*([\S ]+?)\*/','<strong>\1</strong>',$ret); + $ret = str_replace(chr(1),'\*',$ret); + + // italics + $ret = str_replace('\~',chr(1),$ret); + $ret = preg_replace('/~([\S ]+?)~/','<i>\1</i>',$ret); + $ret = str_replace(chr(1),'\~',$ret); + + // monospace font + $ret = str_replace('\%',chr(1),$ret); + $ret = preg_replace_callback('/%([\S ]+?)%/', 'format_tt', $ret); + $ret = str_replace(chr(1),'%',$ret); + + // Hack by arjen: allow more than one word to be coloured + $ret = preg_replace('/\|([0-9a-fA-F]+?)\|([\S ]+?)\|/','<font color="\1">\2</font>',$ret); $ret = preg_replace('/\^([[:alnum:]]+?)\^/','<sup>\1</sup>',$ret); $ret = preg_replace('/\@([[:alnum:]]+?)\@/','<sub>\1</sub>',$ret); + // Quick hack by arjen: BR/ and TAB/ pseudotags from conversion + $ret = preg_replace('/BR\//','<BR/>',$ret); + $ret = preg_replace('/TAB\//',' ',$ret); + + $ret = preg_replace('/([\\\])([*#_|^@%])/', '\2', $ret); + return $ret; } // }}} function add_line_numbers($text) { - $lines = preg_split ('!$\n!m', $text); - $lnwidth = strlen(count($lines)); - $format = '%'.$lnwidth."d: %s\n"; - $lined_text = ''; - while (list ($num, $line) = each ($lines)) { - $lined_text .= sprintf($format, $num + 1, $line); - } - return $lined_text; + $lines = preg_split ('!$\n!m', $text); + $lnwidth = strlen(count($lines)); + $format = '%'.$lnwidth."d: %s\n"; + $lined_text = ''; + while (list ($num, $line) = each ($lines)) { + $lined_text .= sprintf($format, $num + 1, $line); + } + return $lined_text; } + // {{{ strip_markups function strip_markups($str) { $ret = preg_replace('/\*([\S ]+?)\*/','\1',$str); $ret = preg_replace('/\b_([\S ]+?)_\b/','\1',$ret); $ret = preg_replace('/%([\S ]+?)%/','\1',$ret); - $ret = preg_replace('/\|([0-9a-fA-F]+?)\|(\S+?)\|/','\2',$ret); + // Hack by arjen: allow more than one word to be coloured + $ret = preg_replace('/\|([0-9a-fA-F]+?)\|([\S ]+?)\|/','\2',$ret); $ret = preg_replace('/\^([[:alnum:]]+?)\^/','^\1',$ret); $ret = preg_replace('/\@([[:alnum:]]+?)\@/','_\1',$ret); + $ret = preg_replace('/~([\S ]+?)~/','<i>\1</i>',$ret); + // Quick hack by arjen: BR/ and TAB/ pseudotags from conversion + $ret = preg_replace('/BR\//','<BR/>',$ret); + $ret = preg_replace('/TAB\//','',$ret); return $ret; } // }}} @@ -222,6 +256,12 @@ $navsize = $this->navSize; if ($pres[1]->navsize) $navsize = $pres[1]->navsize; + + $titlesize = $this->titleSize; + if ($pres[1]->titlesize) $titlesize = $pres[1]->titlesize; + + $titlecolor = $this->titleColor; + if ($pres[1]->titlecolor) $titlecolor = $pres[1]->titlecolor; $prev = $next = 0; if($slideNum < $maxSlideNum) { @@ -236,7 +276,101 @@ case 'simple': $this->titleColor = '#000000'; - echo "<div align=\"$this->titleAlign\" style=\"font-size: $this->titleSize; margin: 0 ".$offset."em 0 0;\"><a href=\"http://$_SERVER[HTTP_HOST]$baseDir$showScript/$currentPres/$slideNum\" style=\"text-decoration: none; color: $this->titleColor;\">$this->title</a></div>"; + echo "<div align=\"$this->titleAlign\" style=\"font-size: $titlesize; margin: 0 ".$offset."em 0 0;\"><a href=\"http://$_SERVER[HTTP_HOST]$baseDir$showScript/$currentPres/$slideNum\" style=\"text-decoration: none; color: $titlecolor;\">".markup_text($this->title)."</a></div>"; + break; + + case 'php2': + echo "<div class=\"sticky\" align=\"$this->titleAlign\" style=\"width: 100%\"><div class=\"navbar\">"; + echo "<table style=\"float: left;\" width=\"60%\" border=\"0\" cellpadding=0 cellspacing=0><tr>\n"; + if(!empty($this->logo1)) $logo1 = $this->logo1; + else $logo1 = $pres[1]->logo1; + if(!empty($this->logoimage1url)) $logo1url = $this->logoimage1url; + else $logo1url = $pres[1]->logoimage1url; + if(!empty($logo1)) { + $size = getimagesize($logo1); + echo "<td align=\"left\" $size[3]><a href=\"$logo1url\"><img src=\"$logo1\" border=\"0\" align=\"left\" style=\"float: left; margin-bottom: 0.5em; margin-left: 1em;\" alt=\"".$pres[1]->slides[$slideNum]->filename."\"></a></td>"; + $offset+=2; + } + ?> + <td align="center"> + <?echo "<div align=\"center\" style=\"font-size: $titlesize; margin: 0 ".$offset."em 0 0;\"><a href=\"http://$_SERVER[HTTP_HOST]$baseDir$showScript/$currentPres/$slideNum\" style=\"text-decoration: none; color: $titlecolor;\">".markup_text($this->title)."</a></div>";?> + </td> + </tr></table> + <br /> + <table style="float: right"> + <tr> + <td class="c1"><b><?= $pres[1]->title ?></b></td> + <td><img src="images/vline.gif" hspace="5" /></td> + <td class="c1"><?= date('Y-m-d') ?></td> + <td><img src="images/blank.gif" width="5" /></td> + <td><? if( $slideNum > 0){ + $prevSlide = $slideNum - 1; + echo "<a href=\"http://$_SERVER[HTTP_HOST]$baseDir$showScript/$currentPres/$prevSlide\">" + . '<img src="images/back.gif" border="0" hspace="2" /></a>'; + } + if($slideNum < $maxSlideNum) $nextSlideNum = $slideNum + 1; + ?></td> + <td bgcolor="999999"><img src="images/blank.gif" width="25" height="1" /><br /> + <span class="c2"><b><i> + <a href="<?= "http://$_SERVER[HTTP_HOST]{$baseDir}slidelist.php" ?>" onClick="window.open('<?= "http://$_SERVER[HTTP_HOST]{$baseDir}slidelist.php" ?>','slidelist','toolbar=no,directories=no,location=no,status=no,menubar=no,resizable=no,scrollbars=yes,width=300,height=500,left=<?= $winW-300 ?>,top=0'); return false" class="linka"><?= $slideNum ?></a> </i></b></span></td> + <td><? if( !empty($nextSlideNum) ) + echo "<a href=\"http://$_SERVER[HTTP_HOST]$baseDir$showScript/$currentPres/$nextSlideNum\">" + . '<img src="images/next.gif" border="0" hspace="2" /></a>'; + ?></td> + <td><img src="images/blank.gif" height="10" width="15" /></td> + </tr> + </table> + <br clear="left" /> + <hr style="border: 0; color: <?=$titlecolor?>; background-color: <?=$titlecolor?>; height: 2px"> + </div></div> + <? + break; + + case 'mysql': + echo "<div class=\"sticky\" align=\"$this->titleAlign\" style=\"width: 100%\"><div class=\"navbar\">"; + echo "<table style=\"float: left;\" width=\"60%\" border=\"0\"><tr>\n"; + if(!empty($this->logo1)) $logo1 = $this->logo1; + else $logo1 = $pres[1]->logo1; + if(!empty($this->logoimage1url)) $logo1url = $this->logoimage1url; + else $logo1url = $pres[1]->logoimage1url; + if(!empty($logo1)) { + $size = getimagesize($logo1); + echo "<td align=\"left\" $size[3]><a href=\"$logo1url\"><img src=\"$logo1\" border=\"0\" align=\"left\" style=\"float: left; margin-bottom: 0.5em; margin-left: 1em;\" alt=\"".$pres[1]->slides[$slideNum]->filename."\"></a></td>"; + $offset+=2; + } + ?> + <td align="center"> + <b style="color: CC6600; font-size: 1.5em; font-family: arial, helvetica, verdana"><?= markup_text($this->title) ?></b> + </td> + </tr></table> + <br /> + <table style="float: right"> + <tr> + <td class="c1"><b><?= $pres[1]->title ?></b></td> + <td><img src="images/vline.gif" hspace="5" /></td> + <td class="c1"><?= date('Y-m-d') ?></td> + <td><img src="images/blank.gif" width="5" /></td> + <td><? if( $slideNum > 0){ + $prevSlide = $slideNum - 1; + echo "<a href=\"http://$_SERVER[HTTP_HOST]$baseDir$showScript/$currentPres/$prevSlide\">" + . '<img src="images/back.gif" border="0" hspace="2" /></a>'; + } + if($slideNum < $maxSlideNum) $nextSlideNum = $slideNum + 1; + ?></td> + <td bgcolor="999999"><img src="images/blank.gif" width="25" height="1" /><br /> + <span class="c2"><b><i> + <a href="<?= "http://$_SERVER[HTTP_HOST]{$baseDir}slidelist.php" ?>" onClick="window.open('<?= "http://$_SERVER[HTTP_HOST]{$baseDir}slidelist.php" ?>','slidelist','toolbar=no,directories=no,location=no,status=no,menubar=no,resizable=no,scrollbars=yes,width=300,height=500,left=<?= $winW-300 ?>,top=0'); return false" class="linka"><?= $slideNum ?></a> </i></b></span></td> + <td><? if( !empty($nextSlideNum) ) + echo "<a href=\"http://$_SERVER[HTTP_HOST]$baseDir$showScript/$currentPres/$nextSlideNum\">" + . '<img src="images/next.gif" border="0" hspace="2" /></a>'; + ?></td> + <td><img src="images/blank.gif" height="10" width="15" /></td> + </tr> + </table> + <br clear="left" /> + <hr style="border: 0; color: #CC6600; background-color: #CC6600; height: 2px"> + </div></div> + <? break; case 'php': @@ -250,18 +384,18 @@ echo "<a href=\"$logo1url\"><img src=\"$logo1\" border=\"0\" align=\"left\" style=\"float: left;\" alt=\"".$pres[1]->slides[$slideNum]->filename."\"></a>"; $offset+=2; } - echo "<div align=\"center\" style=\"font-size: $this->titleSize; margin: 0 ".$offset."em 0 0;\"><a href=\"http://$_SERVER[HTTP_HOST]$baseDir$showScript/$currentPres/$slideNum\" style=\"text-decoration: none; color: $this->titleColor;\">$this->title</a></div>"; + echo "<div align=\"center\" style=\"font-size: $titlesize; margin: 0 ".$offset."em 0 0;\"><a href=\"http://$_SERVER[HTTP_HOST]$baseDir$showScript/$currentPres/$slideNum\" style=\"text-decoration: none; color: $titlecolor;\">".markup_text($this->title)."</a></div>"; echo "<div style=\"font-size: $navsize; float: right; margin: -2em 0 0 0;\">"; if(!empty($this->logo2)) $logo2 = $this->logo2; else $logo2 = $pres[1]->logo2; if (!empty($logo2)) { - echo "<img src=\"$logo2\" border=\"0\"><br />"; + echo "<img src=\"$logo2\" border=\"0\"><br/>"; $offset-=2; } - echo "<a href=\"http://$_SERVER[HTTP_HOST]{$baseDir}slidelist.php\" style=\"text-decoration: none; color: $this->titleColor;\" onClick=\"window.open('slidelist.php','slidelist','toolbar=no,directories=no,location=no,status=no,menubar=no,resizable=no,scrollbars=yes,width=300,height=$slidelistH,left=".($winW-300).",top=0'); return false\">".($slideNum)."/".($maxSlideNum)."</a></div>"; + echo "<a href=\"http://$_SERVER[HTTP_HOST]{$baseDir}slidelist.php\" style=\"text-decoration: none; color: $this->titleColor;\" onClick=\"window.open('http://$_SERVER[HTTP_HOST]{$baseDir}slidelist.php','slidelist','toolbar=no,directories=no,location=no,status=no,menubar=no,resizable=no,scrollbars=yes,width=300,height=$slidelistH,left=".($winW-300).",top=0'); return false\">".($slideNum)."/".($maxSlideNum)."</a></div>"; if ($pres[1]->navbartopiclinks) { - echo "<div style=\"float: left; margin: -0.2em 2em 0 0; font-size: $navsize;\"><a href=\"http://$_SERVER[HTTP_HOST]$baseDir$showScript/$currentPres/$prev\" style=\"text-decoration: none; color: $this->navColor;\">$prevTitle</a></div>"; - echo "<div style=\"float: right; margin: -0.2em 2em 0 0; color: $this->navColor; font-size: $navsize;\"><a href=\"http://$_SERVER[HTTP_HOST]$baseDir$showScript/$currentPres/$next\" style=\"text-decoration: none; color: $this->navColor;\">$nextTitle</a></div>"; + echo "<div style=\"float: left; margin: -0.2em 2em 0 0; font-size: $navsize;\"><a href=\"http://$_SERVER[HTTP_HOST]$baseDir$showScript/$currentPres/$prev\" style=\"text-decoration: none; color: $this->navColor;\">".markup_text($prevTitle)."</a></div>"; + echo "<div style=\"float: right; margin: -0.2em 2em 0 0; color: $this->navColor; font-size: $navsize;\"><a href=\"http://$_SERVER[HTTP_HOST]$baseDir$showScript/$currentPres/$next\" style=\"text-decoration: none; color: $this->navColor;\">".markup_text($nextTitle)."</a></div>"; } echo '</div></div>'; break; @@ -272,6 +406,9 @@ case '2columns': echo "<div class=\"c2left\">\n"; break; + case '2columns-noborder': + echo "<div class=\"c2leftnb\">\n"; + break; case 'box': echo "<div class=\"box\">\n"; break; @@ -343,8 +480,8 @@ echo "</td>\n"; if ($pres[1]->navbartopiclinks) { echo "<td align=\"left\">"; - if($prevTitle) echo "<a href=\"http://$_SERVER[HTTP_HOST]$baseDir$showScript/$currentPres/$prev\" style=\"text-decoration: none;\"><font size=+2>Previous: $prevTitle</font></a></td>\n"; - if($nextTitle) echo "<td align=\"right\"><a href=\"http://$_SERVER[HTTP_HOST]$baseDir$showScript/$currentPres/$next\" style=\"text-decoration: none;\"><font size=+2>Next: $nextTitle</font></a></td>"; + if($prevTitle) echo "<a href=\"http://$_SERVER[HTTP_HOST]$baseDir$showScript/$currentPres/$prev\" style=\"text-decoration: none;\"><font size=+2>Previous: ".markup_text($prevTitle)."</font></a></td>\n"; + if($nextTitle) echo "<td align=\"right\"><a href=\"http://$_SERVER[HTTP_HOST]$baseDir$showScript/$currentPres/$next\" style=\"text-decoration: none;\"><font size=+2>Next: ".markup_text($nextTitle)."</font></a></td>"; } echo "<td rowspan=2 width=1>"; if(!empty($this->logo2)) $logo2 = $this->logo2; @@ -353,7 +490,7 @@ echo "<img src=\"$logo2\" align=\"right\">\n"; } echo "</td>\n"; - echo "<tr><th colspan=3 align=\"center\"><font size=+4>$this->title</font></th></table>\n"; + echo "<tr><th colspan=3 align=\"center\"><font size=+4>".markup_text($this->title)."</font></th></table>\n"; break; } @@ -363,6 +500,9 @@ case '2columns': echo "<table width=\"100%\"><tr><td valign=\"top\">\n"; break; + case '2columns-noborder': + echo "<table width=\"100%\" border=\"0\"><tr><td valign=\"top\">\n"; + break; case 'box': echo "<table><tr><td>\n"; break; @@ -426,6 +566,9 @@ case '2columns': echo "<div class=\"c2left\">\n"; break; + case '2columns-noborder': + echo "<div class=\"c2leftnb\">\n"; + break; case 'box': echo "<div class=\"box\">\n"; break; @@ -555,9 +698,9 @@ $w = pdf_stringwidth($pdf, $d); pdf_show_boxed($pdf, $d, 40, $pdf_cy, $pdf_x-2*$pdf_cx, 1, 'right'); pdf_set_font($pdf, $pdf_font , -24, 'winansi'); - pdf_show_boxed($pdf, $this->title, 40, $pdf_cy, $pdf_x-2*$pdf_cx, 1, 'center'); + pdf_show_boxed($pdf, strip_markups($this->title), 40, $pdf_cy, $pdf_x-2*$pdf_cx, 1, 'center'); - $page_index[$page_number] = $this->title; + $page_index[$page_number] = strip_markups($this->title); } $pdf_cy += 30; @@ -952,7 +1095,7 @@ } break; case 'shell': - echo '<pre>'.htmlspecialchars($this->text)."</pre>\n"; + echo '<pre>'.markup_text(htmlspecialchars($this->text))."</pre>\n"; break; case 'html': echo $this->text."\n"; @@ -1375,7 +1518,7 @@ class _bullet { function _bullet() { - $this->text = ''; + $this->text = ' '; $this->effect = ''; $this->id = ''; $this->type = ''; @@ -1487,6 +1630,9 @@ case 'lozenge': $bullet = '◊'; break; + case 'hyphen': + $bullet = '-'; + break; default: $bullet = '•'; break; @@ -1494,7 +1640,7 @@ $style .= 'list-style-type: none;'; - echo "<div $eff_str style=\"position: relative;\"><li style=\"$style\">".'<tt>'.$bullet.'</tt> '.markup_text($this->text)."</li></div>\n"; + echo "<div $eff_str><li style=\"$style\">".'<tt>'.$bullet.'</tt> '.markup_text($this->text)."</li></div>\n"; } function plainhtml() { @@ -1874,6 +2020,9 @@ case '2columns': echo "</div>\n<div class=\"c2right\">\n"; break; + case '2columns-noborder': + echo "</div>\n<div class=\"c2rightnb\">\n"; + break; } } @@ -1885,6 +2034,9 @@ case '2columns': echo "</td>\n<td valign=\"top\">\n"; break; + case '2columns-noborder': + echo "</td>\n<td valign=\"top\">\n"; + break; } } @@ -1912,12 +2064,25 @@ } function html() { - global $objs; + global $objs, $pres; // Slide layout templates if(!empty($objs[1]->layout)) switch($objs[1]->layout) { default: echo "</div>\n"; + break; + } + // Navbar layout templates + switch($pres[1]->template) { + case 'mysql': + if(!strstr($_SERVER['HTTP_USER_AGENT'],'MSIE')) { + ?> + <div class="bsticky"> + <img style="margin-bottom: -0.3em" src="images/bottomswoop.gif" width="100%" height="50" /> + <span class="c4">© Copyright 2002 MySQL AB</span> + </div> + <? + } break; } } Index: pres2/show.php diff -u pres2/show.php:1.42 pres2/show.php:1.43 --- pres2/show.php:1.42 Sat Nov 30 22:25:17 2002 +++ pres2/show.php Sun Dec 15 13:38:51 2002 @@ -25,8 +25,7 @@ $presFile = trim($_SERVER['PATH_INFO']); $presFile = trim($presFile,'/'); - $lastPres = -1; - if(isset($currentPres)) { + if(isset($currentPres)) { $lastPres = $currentPres; } @list($currentPres,$slideNum) = explode('/',$presFile); @@ -104,8 +103,11 @@ case 'simple': $body_style = "margin-top: 1em;"; break; + case 'php2': + $body_style = "margin-top: 6em;"; + break; default: - $body_style = "margin-top: 7em;"; + $body_style = "margin-top: 8em;"; break; } include 'getwidth.php'; @@ -176,6 +178,7 @@ pdf_set_info($pdf, "Subject", isset($pres[1]->topic)?$pres[1]->topic:""); while(list($slideNum,$slide) = each($pres[1]->slides)) { + $slideDir = dirname($presentationDir.'/'.$pres[1]->slides[$slideNum]->filename).'/'; $r =& new XML_Slide($presentationDir.'/'.$pres[1]->slides[$slideNum]->filename); $r->setErrorHandling(PEAR_ERROR_DIE,"%s\n"); $r->parse(); Index: presentations/slides/intro/exif.xml diff -u presentations/slides/intro/exif.xml:1.4 presentations/slides/intro/exif.xml:1.5 --- presentations/slides/intro/exif.xml:1.4 Tue Oct 15 19:55:58 2002 +++ presentations/slides/intro/exif.xml Sun Dec 15 13:38:52 2002 @@ -2,6 +2,7 @@ <example title="Reading EXIF Headers from a JPEG" result="1" + fontsize="1.7em" ><![CDATA[<?php $data = exif_read_data('presentations/slides/intro/img_resize.jpg'); foreach($data as $key=>$val) { Index: presentations/slides/intro/header.xml diff -u presentations/slides/intro/header.xml:1.2 presentations/slides/intro/header.xml:1.3 --- presentations/slides/intro/header.xml:1.2 Fri Jul 5 19:09:15 2002 +++ presentations/slides/intro/header.xml Sun Dec 15 13:38:52 2002 @@ -1,5 +1,5 @@ <slide title="HTTP Headers"> -<blurb title="Sending HTTP Headers"> +<blurb> You can add headers to the HTTP response in PHP using the Header() function. Since the response headers are sent before any of the actual response data, you have to send these @@ -10,7 +10,7 @@ <h3>Setting a Last-Modified Header</h3> <example title="Setting a Last-Modified Header"><![CDATA[<?header('Last-Modified: '. - gmdate('D, d M Y H:i:s',getlastmod()).' GMT')?>]]></example> + gmdate('D, d M Y H:i:s',getlastmod()).' GMT')?>]]></example> <example title="Avoid all Caching"><![CDATA[<?php Header('Cache-Control: no-cache, must-revalidate'); Index: presentations/slides/intro/image2a.xml diff -u presentations/slides/intro/image2a.xml:1.2 presentations/slides/intro/image2a.xml:1.3 --- presentations/slides/intro/image2a.xml:1.2 Sun Aug 18 17:11:45 2002 +++ presentations/slides/intro/image2a.xml Sun Dec 15 13:38:52 2002 @@ -2,7 +2,7 @@ <example title="Scaling and the Alpha Channel" filename="img_resize.php" - fontsize="1.5em" + fontsize="1.4em" result="1" rwidth="910" type="genimage" Index: presentations/slides/intro/image_colors4.xml diff -u presentations/slides/intro/image_colors4.xml:1.2 presentations/slides/intro/image_colors4.xml:1.3 --- presentations/slides/intro/image_colors4.xml:1.2 Sun Aug 18 17:11:45 2002 +++ presentations/slides/intro/image_colors4.xml Sun Dec 15 13:38:52 2002 @@ -16,7 +16,7 @@ <example title="For example:" type="genimage" result="1" filename="image_colors_ex3.php" rwidth="455"/> -<example title="This example could also be written like this:"><![CDATA[<?php +<example fontsize="1.7em" title="This example could also be written like this:"><![CDATA[<?php $im = ImageCreateTruecolor(400,300); $white = ImageColorAllocate($im,255,255,255); ImageFilledRectangle($im,0,0,399,299,$white); Index: presentations/slides/intro/image_colors6.xml diff -u presentations/slides/intro/image_colors6.xml:1.3 presentations/slides/intro/image_colors6.xml:1.4 --- presentations/slides/intro/image_colors6.xml:1.3 Tue Oct 15 19:55:58 2002 +++ presentations/slides/intro/image_colors6.xml Sun Dec 15 13:38:52 2002 @@ -1,5 +1,5 @@ <slide title="ImageColorAt" outputbackground="#222222"> -<example title="Using ImageColorAt()" result="1" rfontsize="1.7em" ><![CDATA[ +<example title="Using ImageColorAt()" result="1" fontsize="1.6em" rfontsize="1.6em" ><![CDATA[ <? $image = "presentations/slides/intro/php-tiny.jpg"; ?> <img src="<?=$image?>"><br /> <? @@ -10,7 +10,7 @@ for($x=0; $x < $dx; $x++) { $col = imagecolorat($im, $x, $y); $rgb = imagecolorsforindex($im,$col); - printf('<font color=#%02x%02x%02x>#</font>', + printf("<font color=#%02x%02x%02x>#</font>", $rgb['red'],$rgb['green'],$rgb['blue']); } echo "<br />\n"; Index: presentations/slides/intro/mysql_connect.xml diff -u presentations/slides/intro/mysql_connect.xml:1.1 presentations/slides/intro/mysql_connect.xml:1.2 --- presentations/slides/intro/mysql_connect.xml:1.1 Thu Jul 25 15:34:49 2002 +++ presentations/slides/intro/mysql_connect.xml Sun Dec 15 13:38:52 2002 @@ -5,7 +5,7 @@ echo $conn; ?>]]></example> -<example title="Other variations"><![CDATA[<? +<example title="Other variations" fontsize="1.8em"><![CDATA[<? mysql_connect('db.domain.com:33306','rasmus','foobar'); mysql_connect('localhost:/tmp/mysql.sock'); mysql_connect('localhost','rasmus','foobar', Index: presentations/slides/intro/mysql_insert.xml diff -u presentations/slides/intro/mysql_insert.xml:1.1 presentations/slides/intro/mysql_insert.xml:1.2 --- presentations/slides/intro/mysql_insert.xml:1.1 Thu Jul 25 15:34:49 2002 +++ presentations/slides/intro/mysql_insert.xml Sun Dec 15 13:38:52 2002 @@ -1,20 +1,20 @@ <slide title="Inserting Data"> -<example result="1" title="INSERT Query" fontsize="1.5em"><![CDATA[<? - function add_user($id, $pass, $name, $email) { - $result = mysql_query( - "insert into users values ('$id',ENCRYPT('$pass'),'$name','$email',NULL)"); - if($result) { - echo "Row inserted<br />"; - } else { - echo mysql_error()."<br />"; - } +<example result="1" title="INSERT Query" fontsize="1.5em"><![CDATA[<?php +function add_user($id, $pass, $name, $email) { + $result=mysql_query("insert into users values + ('$id',ENCRYPT('$pass'),'$name','$email',NULL)"); + if($result) { + echo "Row inserted<br />"; + } else { + echo mysql_error()."<br />"; } +} - mysql_connect('localhost'); - mysql_select_db('foo'); +mysql_connect('localhost'); +mysql_select_db('foo'); - add_user('rasmus','foobar','Rasmus Lerdorf','rasmus@php.net'); - add_user('carl','carlspass','Carl AlexandeR Lerdorf','carl@lerdorf.com'); +add_user('rasmus','foobar','Rasmus Lerdorf','rasmus@php.net'); +add_user('carl','carlspass','Carl AlexandeR Lerdorf','carl@lerdorf.com'); ?>]]></example> </slide> Index: presentations/slides/intro/mysql_time.xml diff -u presentations/slides/intro/mysql_time.xml:1.1 presentations/slides/intro/mysql_time.xml:1.2 --- presentations/slides/intro/mysql_time.xml:1.1 Thu Jul 25 15:34:49 2002 +++ presentations/slides/intro/mysql_time.xml Sun Dec 15 13:38:52 2002 @@ -1,18 +1,18 @@ <slide title="Dealing with timestamps"> -<example title="Using DATE_FORMAT" result="1"><![CDATA[<? - mysql_connect('localhost'); - mysql_select_db('foo'); - $result = mysql_query( - "select id, email, - date_format(ts,'%W %M %D, %Y %r') as d - from users order by ts"); - if($result) { - while($row = mysql_fetch_assoc($result)) { - echo "$row[id] - $row[email] - $row[d]<br />\n"; - } - } else { - echo mysql_error(); +<example title="Using DATE_FORMAT" result="1" marginleft="1em" marginright="1em"><![CDATA[<? +mysql_connect('localhost'); +mysql_select_db('foo'); +$result = mysql_query( + "select id, email, + date_format(ts,'%W %M %D, %Y %r') as d + from users order by ts"); +if($result) { + while($row = mysql_fetch_assoc($result)) { + echo "$row[id] - $row[email] - $row[d]<br />\n"; } +} else { + echo mysql_error(); +} ?>]]></example> </slide> Index: presentations/slides/intro/numbers.xml diff -u presentations/slides/intro/numbers.xml:1.7 presentations/slides/intro/numbers.xml:1.8 --- presentations/slides/intro/numbers.xml:1.7 Wed Oct 16 17:03:57 2002 +++ presentations/slides/intro/numbers.xml Sun Dec 15 13:38:52 2002 @@ -1,25 +1,25 @@ <slide title="PHP Usage Growth"> <list> -<title>September 2002 Netcraft Report</title> -<bullet>35,756,436 Domains queried</bullet> -<bullet> 9,458,364 Domains. 1,191,872 IP addresses</bullet> -<bullet>PHP installed on 26% of all domains</bullet> +<title>November 2002 Netcraft Report</title> +<bullet>35,686,907 Domains queried</bullet> +<bullet> 9,866,075 Domains. 1,232,818 IP addresses</bullet> +<bullet>PHP installed on 27.65% of all domains</bullet> </list> <image filename="phpstats.png" align="center"/> <link href="http://www.netcraft.com" leader="Source: " align="right" marginright="6em">Netcraft</link> <list> -<title>September 2002 Apache Module Report</title> -<bullet>5,758,921 Apache Servers surveyed</bullet> -<bullet>2,381,307 (39.44%) PHP</bullet> -<bullet>2,198,834 (36.42%) mod_perl</bullet> -<bullet>1,459,613 (24.18%) OpenSSL</bullet> -<bullet>1,406,702 (23.30%) mod_ssl</bullet> -<bullet>1,096,914 (18.17%) Frontpage</bullet> -<bullet> 248,374 (4.11%) DAV</bullet> -<bullet> 201,401 (3.34%) mod_throttle</bullet> -<bullet> 155,147 (2.57%) AuthMySQL</bullet> -<bullet> 141,285 (2.34%) ApacheJServ</bullet> +<title>November 2002 Apache Module Report</title> +<bullet>%5,125,626 Apache Servers surveyed%</bullet> +<bullet>%2,560,988 (45.54\%) PHP%</bullet> +<bullet>%1,519,770 (27.81\%) OpenSSL%</bullet> +<bullet>%1,463,087 (26.77\%) mod_ssl%</bullet> +<bullet>%1,149,763 (22.43\%) Frontpage%</bullet> +<bullet>%1,071,022 (20.90\%) mod_perl%</bullet> +<bullet>% 266,347 (5.20\%) DAV%</bullet> +<bullet>% 215,534 (4.21\%) mod_throttle%</bullet> +<bullet>% 166,054 (3.24\%) AuthMySQL%</bullet> +<bullet>% 139,067 (2.71\%) ApacheJServ%</bullet> </list> <link href="http://www.securityspace.com/s_survey/data/index.html" leader="Source: ">SecuritySpace.com</link> Index: presentations/slides/intro/pdf.xml diff -u presentations/slides/intro/pdf.xml:1.2 presentations/slides/intro/pdf.xml:1.3 --- presentations/slides/intro/pdf.xml:1.2 Sun Aug 18 17:11:45 2002 +++ presentations/slides/intro/pdf.xml Sun Dec 15 13:38:52 2002 @@ -5,6 +5,6 @@ filename="invoice.php" fontsize="1.5em" result="1" - type="iframe" + type="link" /> </slide> Index: presentations/slides/intro/phpstats.png
Index: pres2/css.php diff -u pres2/css.php:1.10 pres2/css.php:1.11 --- pres2/css.php:1.10 Tue Aug 6 00:34:29 2002 +++ pres2/css.php Sun Dec 15 13:38:51 2002 @@ -25,6 +25,19 @@ bottom: auto; width: auto; } +div.bsticky { + margin: 0; +<?if(strstr($_SERVER['HTTP_USER_AGENT'],'MSIE')): // Need a much smarter check here ?> + position: absolute; +<?else:?> + position: fixed; +<?endif?> + top: auto; + left: 0em; + right: auto; + bottom: 0em; + width: 100%; +} div.shadow { background: <?php echo $pres[1]->shadowbackground; ?>; padding: 0.5em; @@ -91,6 +104,13 @@ width : 46%; float : right; } +.c2rightnb { + margin : 1em 1em 0 0; + padding-left : 1%; + padding-right : 1%; + width : 46%; + float : right; +} .c2left { margin : 1em 1em 0 0; padding-left : 1%; @@ -105,6 +125,14 @@ width : 46%; float : left; } +.c2leftnb { + margin : 1em 1em 0 0; + padding-left : 1%; + padding-right : 1%; + border-style : none; + width : 46%; + float : left; +} .box { margin : 0 0 0 0; padding-left : 1%; @@ -118,4 +146,12 @@ border-left-color : inherit; float : left; } + +A.linka { text-decoration: none; color: 000000; } +td.foo {color: ffffff; font-family: arial,verdana,helvetica; font-size: 70%} +span.c4 {position: fixed; bottom: 0.5em; right: 4em; top: auto; left: auto; color: ffffff; font-family: arial,verdana,helvetica; font-size: 70%} +td.c3 {color: CC6600; font-family: arial, helvetica, verdana} +span.c2 {color: ffffff; font-family: arial,hevetica,verdana} +td.c1 {font-family: arial,helvetica,verdana; font-size: 80%} + </style> Index: pres2/objects.php diff -u pres2/objects.php:1.129 pres2/objects.php:1.130 --- pres2/objects.php:1.129 Wed Dec 11 08:46:33 2002 +++ pres2/objects.php Sun Dec 15 13:38:51 2002 @@ -107,46 +107,80 @@ } // }}} +function format_tt($arg) { + return("<tt>".str_replace(' ', ' ', $arg[1])."</tt>"); +} + /* {{{ string markup_text($str) *word* Bold _word_ underline %word% monospaced word (ie. %function()%) + ~word~ italics |rrggbb|word| Colour a word ^N^ Superscript @N@ Subscript */ function markup_text($str) { - $ret = preg_replace('/\*([\S ]+?)\*/','<strong>\1</strong>',$str); + $ret = $str; +# $ret = preg_replace('/\*([\S ]+?)([^\\\])\*/','<strong>\1\2</strong>',$str); $ret = preg_replace('/#([[:alnum:]]+?)#/','&\1;',$ret); $ret = preg_replace('/\b_([\S ]+?)_\b/','<u>\1</u>',$ret); - $ret = preg_replace('/%([\S ]+?)%/','<tt>\1</tt>',$ret); - $ret = preg_replace('/\|([0-9a-fA-F]+?)\|(\S+?)\|/','<font color="\1">\2</font>',$ret); + + //bold + $ret = str_replace('\*',chr(1),$ret); + $ret = preg_replace('/\*([\S ]+?)\*/','<strong>\1</strong>',$ret); + $ret = str_replace(chr(1),'\*',$ret); + + // italics + $ret = str_replace('\~',chr(1),$ret); + $ret = preg_replace('/~([\S ]+?)~/','<i>\1</i>',$ret); + $ret = str_replace(chr(1),'\~',$ret); + + // monospace font + $ret = str_replace('\%',chr(1),$ret); + $ret = preg_replace_callback('/%([\S ]+?)%/', 'format_tt', $ret); + $ret = str_replace(chr(1),'%',$ret); + + // Hack by arjen: allow more than one word to be coloured + $ret = preg_replace('/\|([0-9a-fA-F]+?)\|([\S ]+?)\|/','<font color="\1">\2</font>',$ret); $ret = preg_replace('/\^([[:alnum:]]+?)\^/','<sup>\1</sup>',$ret); $ret = preg_replace('/\@([[:alnum:]]+?)\@/','<sub>\1</sub>',$ret); + // Quick hack by arjen: BR/ and TAB/ pseudotags from conversion + $ret = preg_replace('/BR\//','<BR/>',$ret); + $ret = preg_replace('/TAB\//',' ',$ret); + + $ret = preg_replace('/([\\\])([*#_|^@%])/', '\2', $ret); + return $ret; } // }}} function add_line_numbers($text) { - $lines = preg_split ('!$\n!m', $text); - $lnwidth = strlen(count($lines)); - $format = '%'.$lnwidth."d: %s\n"; - $lined_text = ''; - while (list ($num, $line) = each ($lines)) { - $lined_text .= sprintf($format, $num + 1, $line); - } - return $lined_text; + $lines = preg_split ('!$\n!m', $text); + $lnwidth = strlen(count($lines)); + $format = '%'.$lnwidth."d: %s\n"; + $lined_text = ''; + while (list ($num, $line) = each ($lines)) { + $lined_text .= sprintf($format, $num + 1, $line); + } + return $lined_text; } + // {{{ strip_markups function strip_markups($str) { $ret = preg_replace('/\*([\S ]+?)\*/','\1',$str); $ret = preg_replace('/\b_([\S ]+?)_\b/','\1',$ret); $ret = preg_replace('/%([\S ]+?)%/','\1',$ret); - $ret = preg_replace('/\|([0-9a-fA-F]+?)\|(\S+?)\|/','\2',$ret); + // Hack by arjen: allow more than one word to be coloured + $ret = preg_replace('/\|([0-9a-fA-F]+?)\|([\S ]+?)\|/','\2',$ret); $ret = preg_replace('/\^([[:alnum:]]+?)\^/','^\1',$ret); $ret = preg_replace('/\@([[:alnum:]]+?)\@/','_\1',$ret); + $ret = preg_replace('/~([\S ]+?)~/','<i>\1</i>',$ret); + // Quick hack by arjen: BR/ and TAB/ pseudotags from conversion + $ret = preg_replace('/BR\//','<BR/>',$ret); + $ret = preg_replace('/TAB\//','',$ret); return $ret; } // }}} @@ -222,6 +256,12 @@ $navsize = $this->navSize; if ($pres[1]->navsize) $navsize = $pres[1]->navsize; + + $titlesize = $this->titleSize; + if ($pres[1]->titlesize) $titlesize = $pres[1]->titlesize; + + $titlecolor = $this->titleColor; + if ($pres[1]->titlecolor) $titlecolor = $pres[1]->titlecolor; $prev = $next = 0; if($slideNum < $maxSlideNum) { @@ -236,7 +276,101 @@ case 'simple': $this->titleColor = '#000000'; - echo "<div align=\"$this->titleAlign\" style=\"font-size: $this->titleSize; margin: 0 ".$offset."em 0 0;\"><a href=\"http://$_SERVER[HTTP_HOST]$baseDir$showScript/$currentPres/$slideNum\" style=\"text-decoration: none; color: $this->titleColor;\">$this->title</a></div>"; + echo "<div align=\"$this->titleAlign\" style=\"font-size: $titlesize; margin: 0 ".$offset."em 0 0;\"><a href=\"http://$_SERVER[HTTP_HOST]$baseDir$showScript/$currentPres/$slideNum\" style=\"text-decoration: none; color: $titlecolor;\">".markup_text($this->title)."</a></div>"; + break; + + case 'php2': + echo "<div class=\"sticky\" align=\"$this->titleAlign\" style=\"width: 100%\"><div class=\"navbar\">"; + echo "<table style=\"float: left;\" width=\"60%\" border=\"0\" cellpadding=0 cellspacing=0><tr>\n"; + if(!empty($this->logo1)) $logo1 = $this->logo1; + else $logo1 = $pres[1]->logo1; + if(!empty($this->logoimage1url)) $logo1url = $this->logoimage1url; + else $logo1url = $pres[1]->logoimage1url; + if(!empty($logo1)) { + $size = getimagesize($logo1); + echo "<td align=\"left\" $size[3]><a href=\"$logo1url\"><img src=\"$logo1\" border=\"0\" align=\"left\" style=\"float: left; margin-bottom: 0.5em; margin-left: 1em;\" alt=\"".$pres[1]->slides[$slideNum]->filename."\"></a></td>"; + $offset+=2; + } + ?> + <td align="center"> + <?echo "<div align=\"center\" style=\"font-size: $titlesize; margin: 0 ".$offset."em 0 0;\"><a href=\"http://$_SERVER[HTTP_HOST]$baseDir$showScript/$currentPres/$slideNum\" style=\"text-decoration: none; color: $titlecolor;\">".markup_text($this->title)."</a></div>";?> + </td> + </tr></table> + <br /> + <table style="float: right"> + <tr> + <td class="c1"><b><?= $pres[1]->title ?></b></td> + <td><img src="images/vline.gif" hspace="5" /></td> + <td class="c1"><?= date('Y-m-d') ?></td> + <td><img src="images/blank.gif" width="5" /></td> + <td><? if( $slideNum > 0){ + $prevSlide = $slideNum - 1; + echo "<a href=\"http://$_SERVER[HTTP_HOST]$baseDir$showScript/$currentPres/$prevSlide\">" + . '<img src="images/back.gif" border="0" hspace="2" /></a>'; + } + if($slideNum < $maxSlideNum) $nextSlideNum = $slideNum + 1; + ?></td> + <td bgcolor="999999"><img src="images/blank.gif" width="25" height="1" /><br /> + <span class="c2"><b><i> + <a href="<?= "http://$_SERVER[HTTP_HOST]{$baseDir}slidelist.php" ?>" onClick="window.open('<?= "http://$_SERVER[HTTP_HOST]{$baseDir}slidelist.php" ?>','slidelist','toolbar=no,directories=no,location=no,status=no,menubar=no,resizable=no,scrollbars=yes,width=300,height=500,left=<?= $winW-300 ?>,top=0'); return false" class="linka"><?= $slideNum ?></a> </i></b></span></td> + <td><? if( !empty($nextSlideNum) ) + echo "<a href=\"http://$_SERVER[HTTP_HOST]$baseDir$showScript/$currentPres/$nextSlideNum\">" + . '<img src="images/next.gif" border="0" hspace="2" /></a>'; + ?></td> + <td><img src="images/blank.gif" height="10" width="15" /></td> + </tr> + </table> + <br clear="left" /> + <hr style="border: 0; color: <?=$titlecolor?>; background-color: <?=$titlecolor?>; height: 2px"> + </div></div> + <? + break; + + case 'mysql': + echo "<div class=\"sticky\" align=\"$this->titleAlign\" style=\"width: 100%\"><div class=\"navbar\">"; + echo "<table style=\"float: left;\" width=\"60%\" border=\"0\"><tr>\n"; + if(!empty($this->logo1)) $logo1 = $this->logo1; + else $logo1 = $pres[1]->logo1; + if(!empty($this->logoimage1url)) $logo1url = $this->logoimage1url; + else $logo1url = $pres[1]->logoimage1url; + if(!empty($logo1)) { + $size = getimagesize($logo1); + echo "<td align=\"left\" $size[3]><a href=\"$logo1url\"><img src=\"$logo1\" border=\"0\" align=\"left\" style=\"float: left; margin-bottom: 0.5em; margin-left: 1em;\" alt=\"".$pres[1]->slides[$slideNum]->filename."\"></a></td>"; + $offset+=2; + } + ?> + <td align="center"> + <b style="color: CC6600; font-size: 1.5em; font-family: arial, helvetica, verdana"><?= markup_text($this->title) ?></b> + </td> + </tr></table> + <br /> + <table style="float: right"> + <tr> + <td class="c1"><b><?= $pres[1]->title ?></b></td> + <td><img src="images/vline.gif" hspace="5" /></td> + <td class="c1"><?= date('Y-m-d') ?></td> + <td><img src="images/blank.gif" width="5" /></td> + <td><? if( $slideNum > 0){ + $prevSlide = $slideNum - 1; + echo "<a href=\"http://$_SERVER[HTTP_HOST]$baseDir$showScript/$currentPres/$prevSlide\">" + . '<img src="images/back.gif" border="0" hspace="2" /></a>'; + } + if($slideNum < $maxSlideNum) $nextSlideNum = $slideNum + 1; + ?></td> + <td bgcolor="999999"><img src="images/blank.gif" width="25" height="1" /><br /> + <span class="c2"><b><i> + <a href="<?= "http://$_SERVER[HTTP_HOST]{$baseDir}slidelist.php" ?>" onClick="window.open('<?= "http://$_SERVER[HTTP_HOST]{$baseDir}slidelist.php" ?>','slidelist','toolbar=no,directories=no,location=no,status=no,menubar=no,resizable=no,scrollbars=yes,width=300,height=500,left=<?= $winW-300 ?>,top=0'); return false" class="linka"><?= $slideNum ?></a> </i></b></span></td> + <td><? if( !empty($nextSlideNum) ) + echo "<a href=\"http://$_SERVER[HTTP_HOST]$baseDir$showScript/$currentPres/$nextSlideNum\">" + . '<img src="images/next.gif" border="0" hspace="2" /></a>'; + ?></td> + <td><img src="images/blank.gif" height="10" width="15" /></td> + </tr> + </table> + <br clear="left" /> + <hr style="border: 0; color: #CC6600; background-color: #CC6600; height: 2px"> + </div></div> + <? break; case 'php': @@ -250,18 +384,18 @@ echo "<a href=\"$logo1url\"><img src=\"$logo1\" border=\"0\" align=\"left\" style=\"float: left;\" alt=\"".$pres[1]->slides[$slideNum]->filename."\"></a>"; $offset+=2; } - echo "<div align=\"center\" style=\"font-size: $this->titleSize; margin: 0 ".$offset."em 0 0;\"><a href=\"http://$_SERVER[HTTP_HOST]$baseDir$showScript/$currentPres/$slideNum\" style=\"text-decoration: none; color: $this->titleColor;\">$this->title</a></div>"; + echo "<div align=\"center\" style=\"font-size: $titlesize; margin: 0 ".$offset."em 0 0;\"><a href=\"http://$_SERVER[HTTP_HOST]$baseDir$showScript/$currentPres/$slideNum\" style=\"text-decoration: none; color: $titlecolor;\">".markup_text($this->title)."</a></div>"; echo "<div style=\"font-size: $navsize; float: right; margin: -2em 0 0 0;\">"; if(!empty($this->logo2)) $logo2 = $this->logo2; else $logo2 = $pres[1]->logo2; if (!empty($logo2)) { - echo "<img src=\"$logo2\" border=\"0\"><br />"; + echo "<img src=\"$logo2\" border=\"0\"><br/>"; $offset-=2; } - echo "<a href=\"http://$_SERVER[HTTP_HOST]{$baseDir}slidelist.php\" style=\"text-decoration: none; color: $this->titleColor;\" onClick=\"window.open('slidelist.php','slidelist','toolbar=no,directories=no,location=no,status=no,menubar=no,resizable=no,scrollbars=yes,width=300,height=$slidelistH,left=".($winW-300).",top=0'); return false\">".($slideNum)."/".($maxSlideNum)."</a></div>"; + echo "<a href=\"http://$_SERVER[HTTP_HOST]{$baseDir}slidelist.php\" style=\"text-decoration: none; color: $this->titleColor;\" onClick=\"window.open('http://$_SERVER[HTTP_HOST]{$baseDir}slidelist.php','slidelist','toolbar=no,directories=no,location=no,status=no,menubar=no,resizable=no,scrollbars=yes,width=300,height=$slidelistH,left=".($winW-300).",top=0'); return false\">".($slideNum)."/".($maxSlideNum)."</a></div>"; if ($pres[1]->navbartopiclinks) { - echo "<div style=\"float: left; margin: -0.2em 2em 0 0; font-size: $navsize;\"><a href=\"http://$_SERVER[HTTP_HOST]$baseDir$showScript/$currentPres/$prev\" style=\"text-decoration: none; color: $this->navColor;\">$prevTitle</a></div>"; - echo "<div style=\"float: right; margin: -0.2em 2em 0 0; color: $this->navColor; font-size: $navsize;\"><a href=\"http://$_SERVER[HTTP_HOST]$baseDir$showScript/$currentPres/$next\" style=\"text-decoration: none; color: $this->navColor;\">$nextTitle</a></div>"; + echo "<div style=\"float: left; margin: -0.2em 2em 0 0; font-size: $navsize;\"><a href=\"http://$_SERVER[HTTP_HOST]$baseDir$showScript/$currentPres/$prev\" style=\"text-decoration: none; color: $this->navColor;\">".markup_text($prevTitle)."</a></div>"; + echo "<div style=\"float: right; margin: -0.2em 2em 0 0; color: $this->navColor; font-size: $navsize;\"><a href=\"http://$_SERVER[HTTP_HOST]$baseDir$showScript/$currentPres/$next\" style=\"text-decoration: none; color: $this->navColor;\">".markup_text($nextTitle)."</a></div>"; } echo '</div></div>'; break; @@ -272,6 +406,9 @@ case '2columns': echo "<div class=\"c2left\">\n"; break; + case '2columns-noborder': + echo "<div class=\"c2leftnb\">\n"; + break; case 'box': echo "<div class=\"box\">\n"; break; @@ -343,8 +480,8 @@ echo "</td>\n"; if ($pres[1]->navbartopiclinks) { echo "<td align=\"left\">"; - if($prevTitle) echo "<a href=\"http://$_SERVER[HTTP_HOST]$baseDir$showScript/$currentPres/$prev\" style=\"text-decoration: none;\"><font size=+2>Previous: $prevTitle</font></a></td>\n"; - if($nextTitle) echo "<td align=\"right\"><a href=\"http://$_SERVER[HTTP_HOST]$baseDir$showScript/$currentPres/$next\" style=\"text-decoration: none;\"><font size=+2>Next: $nextTitle</font></a></td>"; + if($prevTitle) echo "<a href=\"http://$_SERVER[HTTP_HOST]$baseDir$showScript/$currentPres/$prev\" style=\"text-decoration: none;\"><font size=+2>Previous: ".markup_text($prevTitle)."</font></a></td>\n"; + if($nextTitle) echo "<td align=\"right\"><a href=\"http://$_SERVER[HTTP_HOST]$baseDir$showScript/$currentPres/$next\" style=\"text-decoration: none;\"><font size=+2>Next: ".markup_text($nextTitle)."</font></a></td>"; } echo "<td rowspan=2 width=1>"; if(!empty($this->logo2)) $logo2 = $this->logo2; @@ -353,7 +490,7 @@ echo "<img src=\"$logo2\" align=\"right\">\n"; } echo "</td>\n"; - echo "<tr><th colspan=3 align=\"center\"><font size=+4>$this->title</font></th></table>\n"; + echo "<tr><th colspan=3 align=\"center\"><font size=+4>".markup_text($this->title)."</font></th></table>\n"; break; } @@ -363,6 +500,9 @@ case '2columns': echo "<table width=\"100%\"><tr><td valign=\"top\">\n"; break; + case '2columns-noborder': + echo "<table width=\"100%\" border=\"0\"><tr><td valign=\"top\">\n"; + break; case 'box': echo "<table><tr><td>\n"; break; @@ -426,6 +566,9 @@ case '2columns': echo "<div class=\"c2left\">\n"; break; + case '2columns-noborder': + echo "<div class=\"c2leftnb\">\n"; + break; case 'box': echo "<div class=\"box\">\n"; break; @@ -555,9 +698,9 @@ $w = pdf_stringwidth($pdf, $d); pdf_show_boxed($pdf, $d, 40, $pdf_cy, $pdf_x-2*$pdf_cx, 1, 'right'); pdf_set_font($pdf, $pdf_font , -24, 'winansi'); - pdf_show_boxed($pdf, $this->title, 40, $pdf_cy, $pdf_x-2*$pdf_cx, 1, 'center'); + pdf_show_boxed($pdf, strip_markups($this->title), 40, $pdf_cy, $pdf_x-2*$pdf_cx, 1, 'center'); - $page_index[$page_number] = $this->title; + $page_index[$page_number] = strip_markups($this->title); } $pdf_cy += 30; @@ -952,7 +1095,7 @@ } break; case 'shell': - echo '<pre>'.htmlspecialchars($this->text)."</pre>\n"; + echo '<pre>'.markup_text(htmlspecialchars($this->text))."</pre>\n"; break; case 'html': echo $this->text."\n"; @@ -1375,7 +1518,7 @@ class _bullet { function _bullet() { - $this->text = ''; + $this->text = ' '; $this->effect = ''; $this->id = ''; $this->type = ''; @@ -1487,6 +1630,9 @@ case 'lozenge': $bullet = '◊'; break; + case 'hyphen': + $bullet = '-'; + break; default: $bullet = '•'; break; @@ -1494,7 +1640,7 @@ $style .= 'list-style-type: none;'; - echo "<div $eff_str style=\"position: relative;\"><li style=\"$style\">".'<tt>'.$bullet.'</tt> '.markup_text($this->text)."</li></div>\n"; + echo "<div $eff_str><li style=\"$style\">".'<tt>'.$bullet.'</tt> '.markup_text($this->text)."</li></div>\n"; } function plainhtml() { @@ -1874,6 +2020,9 @@ case '2columns': echo "</div>\n<div class=\"c2right\">\n"; break; + case '2columns-noborder': + echo "</div>\n<div class=\"c2rightnb\">\n"; + break; } } @@ -1885,6 +2034,9 @@ case '2columns': echo "</td>\n<td valign=\"top\">\n"; break; + case '2columns-noborder': + echo "</td>\n<td valign=\"top\">\n"; + break; } } @@ -1912,12 +2064,25 @@ } function html() { - global $objs; + global $objs, $pres; // Slide layout templates if(!empty($objs[1]->layout)) switch($objs[1]->layout) { default: echo "</div>\n"; + break; + } + // Navbar layout templates + switch($pres[1]->template) { + case 'mysql': + if(!strstr($_SERVER['HTTP_USER_AGENT'],'MSIE')) { + ?> + <div class="bsticky"> + <img style="margin-bottom: -0.3em" src="images/bottomswoop.gif" width="100%" height="50" /> + <span class="c4">© Copyright 2002 MySQL AB</span> + </div> + <? + } break; } } Index: pres2/show.php diff -u pres2/show.php:1.42 pres2/show.php:1.43 --- pres2/show.php:1.42 Sat Nov 30 22:25:17 2002 +++ pres2/show.php Sun Dec 15 13:38:51 2002 @@ -25,8 +25,7 @@ $presFile = trim($_SERVER['PATH_INFO']); $presFile = trim($presFile,'/'); - $lastPres = -1; - if(isset($currentPres)) { + if(isset($currentPres)) { $lastPres = $currentPres; } @list($currentPres,$slideNum) = explode('/',$presFile); @@ -104,8 +103,11 @@ case 'simple': $body_style = "margin-top: 1em;"; break; + case 'php2': + $body_style = "margin-top: 6em;"; + break; default: - $body_style = "margin-top: 7em;"; + $body_style = "margin-top: 8em;"; break; } include 'getwidth.php'; @@ -176,6 +178,7 @@ pdf_set_info($pdf, "Subject", isset($pres[1]->topic)?$pres[1]->topic:""); while(list($slideNum,$slide) = each($pres[1]->slides)) { + $slideDir = dirname($presentationDir.'/'.$pres[1]->slides[$slideNum]->filename).'/'; $r =& new XML_Slide($presentationDir.'/'.$pres[1]->slides[$slideNum]->filename); $r->setErrorHandling(PEAR_ERROR_DIE,"%s\n"); $r->parse(); Index: presentations/slides/intro/exif.xml diff -u presentations/slides/intro/exif.xml:1.4 presentations/slides/intro/exif.xml:1.5 --- presentations/slides/intro/exif.xml:1.4 Tue Oct 15 19:55:58 2002 +++ presentations/slides/intro/exif.xml Sun Dec 15 13:38:52 2002 @@ -2,6 +2,7 @@ <example title="Reading EXIF Headers from a JPEG" result="1" + fontsize="1.7em" ><![CDATA[<?php $data = exif_read_data('presentations/slides/intro/img_resize.jpg'); foreach($data as $key=>$val) { Index: presentations/slides/intro/header.xml diff -u presentations/slides/intro/header.xml:1.2 presentations/slides/intro/header.xml:1.3 --- presentations/slides/intro/header.xml:1.2 Fri Jul 5 19:09:15 2002 +++ presentations/slides/intro/header.xml Sun Dec 15 13:38:52 2002 @@ -1,5 +1,5 @@ <slide title="HTTP Headers"> -<blurb title="Sending HTTP Headers"> +<blurb> You can add headers to the HTTP response in PHP using the Header() function. Since the response headers are sent before any of the actual response data, you have to send these @@ -10,7 +10,7 @@ <h3>Setting a Last-Modified Header</h3> <example title="Setting a Last-Modified Header"><![CDATA[<?header('Last-Modified: '. - gmdate('D, d M Y H:i:s',getlastmod()).' GMT')?>]]></example> + gmdate('D, d M Y H:i:s',getlastmod()).' GMT')?>]]></example> <example title="Avoid all Caching"><![CDATA[<?php Header('Cache-Control: no-cache, must-revalidate'); Index: presentations/slides/intro/image2a.xml diff -u presentations/slides/intro/image2a.xml:1.2 presentations/slides/intro/image2a.xml:1.3 --- presentations/slides/intro/image2a.xml:1.2 Sun Aug 18 17:11:45 2002 +++ presentations/slides/intro/image2a.xml Sun Dec 15 13:38:52 2002 @@ -2,7 +2,7 @@ <example title="Scaling and the Alpha Channel" filename="img_resize.php" - fontsize="1.5em" + fontsize="1.4em" result="1" rwidth="910" type="genimage" Index: presentations/slides/intro/image_colors4.xml diff -u presentations/slides/intro/image_colors4.xml:1.2 presentations/slides/intro/image_colors4.xml:1.3 --- presentations/slides/intro/image_colors4.xml:1.2 Sun Aug 18 17:11:45 2002 +++ presentations/slides/intro/image_colors4.xml Sun Dec 15 13:38:52 2002 @@ -16,7 +16,7 @@ <example title="For example:" type="genimage" result="1" filename="image_colors_ex3.php" rwidth="455"/> -<example title="This example could also be written like this:"><![CDATA[<?php +<example fontsize="1.7em" title="This example could also be written like this:"><![CDATA[<?php $im = ImageCreateTruecolor(400,300); $white = ImageColorAllocate($im,255,255,255); ImageFilledRectangle($im,0,0,399,299,$white); Index: presentations/slides/intro/image_colors6.xml diff -u presentations/slides/intro/image_colors6.xml:1.3 presentations/slides/intro/image_colors6.xml:1.4 --- presentations/slides/intro/image_colors6.xml:1.3 Tue Oct 15 19:55:58 2002 +++ presentations/slides/intro/image_colors6.xml Sun Dec 15 13:38:52 2002 @@ -1,5 +1,5 @@ <slide title="ImageColorAt" outputbackground="#222222"> -<example title="Using ImageColorAt()" result="1" rfontsize="1.7em" ><![CDATA[ +<example title="Using ImageColorAt()" result="1" fontsize="1.6em" rfontsize="1.6em" ><![CDATA[ <? $image = "presentations/slides/intro/php-tiny.jpg"; ?> <img src="<?=$image?>"><br /> <? @@ -10,7 +10,7 @@ for($x=0; $x < $dx; $x++) { $col = imagecolorat($im, $x, $y); $rgb = imagecolorsforindex($im,$col); - printf('<font color=#%02x%02x%02x>#</font>', + printf("<font color=#%02x%02x%02x>#</font>", $rgb['red'],$rgb['green'],$rgb['blue']); } echo "<br />\n"; Index: presentations/slides/intro/mysql_connect.xml diff -u presentations/slides/intro/mysql_connect.xml:1.1 presentations/slides/intro/mysql_connect.xml:1.2 --- presentations/slides/intro/mysql_connect.xml:1.1 Thu Jul 25 15:34:49 2002 +++ presentations/slides/intro/mysql_connect.xml Sun Dec 15 13:38:52 2002 @@ -5,7 +5,7 @@ echo $conn; ?>]]></example> -<example title="Other variations"><![CDATA[<? +<example title="Other variations" fontsize="1.8em"><![CDATA[<? mysql_connect('db.domain.com:33306','rasmus','foobar'); mysql_connect('localhost:/tmp/mysql.sock'); mysql_connect('localhost','rasmus','foobar', Index: presentations/slides/intro/mysql_insert.xml diff -u presentations/slides/intro/mysql_insert.xml:1.1 presentations/slides/intro/mysql_insert.xml:1.2 --- presentations/slides/intro/mysql_insert.xml:1.1 Thu Jul 25 15:34:49 2002 +++ presentations/slides/intro/mysql_insert.xml Sun Dec 15 13:38:52 2002 @@ -1,20 +1,20 @@ <slide title="Inserting Data"> -<example result="1" title="INSERT Query" fontsize="1.5em"><![CDATA[<? - function add_user($id, $pass, $name, $email) { - $result = mysql_query( - "insert into users values ('$id',ENCRYPT('$pass'),'$name','$email',NULL)"); - if($result) { - echo "Row inserted<br />"; - } else { - echo mysql_error()."<br />"; - } +<example result="1" title="INSERT Query" fontsize="1.5em"><![CDATA[<?php +function add_user($id, $pass, $name, $email) { + $result=mysql_query("insert into users values + ('$id',ENCRYPT('$pass'),'$name','$email',NULL)"); + if($result) { + echo "Row inserted<br />"; + } else { + echo mysql_error()."<br />"; } +} - mysql_connect('localhost'); - mysql_select_db('foo'); +mysql_connect('localhost'); +mysql_select_db('foo'); - add_user('rasmus','foobar','Rasmus Lerdorf','rasmus@php.net'); - add_user('carl','carlspass','Carl AlexandeR Lerdorf','carl@lerdorf.com'); +add_user('rasmus','foobar','Rasmus Lerdorf','rasmus@php.net'); +add_user('carl','carlspass','Carl AlexandeR Lerdorf','carl@lerdorf.com'); ?>]]></example> </slide> Index: presentations/slides/intro/mysql_time.xml diff -u presentations/slides/intro/mysql_time.xml:1.1 presentations/slides/intro/mysql_time.xml:1.2 --- presentations/slides/intro/mysql_time.xml:1.1 Thu Jul 25 15:34:49 2002 +++ presentations/slides/intro/mysql_time.xml Sun Dec 15 13:38:52 2002 @@ -1,18 +1,18 @@ <slide title="Dealing with timestamps"> -<example title="Using DATE_FORMAT" result="1"><![CDATA[<? - mysql_connect('localhost'); - mysql_select_db('foo'); - $result = mysql_query( - "select id, email, - date_format(ts,'%W %M %D, %Y %r') as d - from users order by ts"); - if($result) { - while($row = mysql_fetch_assoc($result)) { - echo "$row[id] - $row[email] - $row[d]<br />\n"; - } - } else { - echo mysql_error(); +<example title="Using DATE_FORMAT" result="1" marginleft="1em" marginright="1em"><![CDATA[<? +mysql_connect('localhost'); +mysql_select_db('foo'); +$result = mysql_query( + "select id, email, + date_format(ts,'%W %M %D, %Y %r') as d + from users order by ts"); +if($result) { + while($row = mysql_fetch_assoc($result)) { + echo "$row[id] - $row[email] - $row[d]<br />\n"; } +} else { + echo mysql_error(); +} ?>]]></example> </slide> Index: presentations/slides/intro/numbers.xml diff -u presentations/slides/intro/numbers.xml:1.7 presentations/slides/intro/numbers.xml:1.8 --- presentations/slides/intro/numbers.xml:1.7 Wed Oct 16 17:03:57 2002 +++ presentations/slides/intro/numbers.xml Sun Dec 15 13:38:52 2002 @@ -1,25 +1,25 @@ <slide title="PHP Usage Growth"> <list> -<title>September 2002 Netcraft Report</title> -<bullet>35,756,436 Domains queried</bullet> -<bullet> 9,458,364 Domains. 1,191,872 IP addresses</bullet> -<bullet>PHP installed on 26% of all domains</bullet> +<title>November 2002 Netcraft Report</title> +<bullet>35,686,907 Domains queried</bullet> +<bullet> 9,866,075 Domains. 1,232,818 IP addresses</bullet> +<bullet>PHP installed on 27.65% of all domains</bullet> </list> <image filename="phpstats.png" align="center"/> <link href="http://www.netcraft.com" leader="Source: " align="right" marginright="6em">Netcraft</link> <list> -<title>September 2002 Apache Module Report</title> -<bullet>5,758,921 Apache Servers surveyed</bullet> -<bullet>2,381,307 (39.44%) PHP</bullet> -<bullet>2,198,834 (36.42%) mod_perl</bullet> -<bullet>1,459,613 (24.18%) OpenSSL</bullet> -<bullet>1,406,702 (23.30%) mod_ssl</bullet> -<bullet>1,096,914 (18.17%) Frontpage</bullet> -<bullet> 248,374 (4.11%) DAV</bullet> -<bullet> 201,401 (3.34%) mod_throttle</bullet> -<bullet> 155,147 (2.57%) AuthMySQL</bullet> -<bullet> 141,285 (2.34%) ApacheJServ</bullet> +<title>November 2002 Apache Module Report</title> +<bullet>%5,125,626 Apache Servers surveyed%</bullet> +<bullet>%2,560,988 (45.54\%) PHP%</bullet> +<bullet>%1,519,770 (27.81\%) OpenSSL%</bullet> +<bullet>%1,463,087 (26.77\%) mod_ssl%</bullet> +<bullet>%1,149,763 (22.43\%) Frontpage%</bullet> +<bullet>%1,071,022 (20.90\%) mod_perl%</bullet> +<bullet>% 266,347 (5.20\%) DAV%</bullet> +<bullet>% 215,534 (4.21\%) mod_throttle%</bullet> +<bullet>% 166,054 (3.24\%) AuthMySQL%</bullet> +<bullet>% 139,067 (2.71\%) ApacheJServ%</bullet> </list> <link href="http://www.securityspace.com/s_survey/data/index.html" leader="Source: ">SecuritySpace.com</link> Index: presentations/slides/intro/pdf.xml diff -u presentations/slides/intro/pdf.xml:1.2 presentations/slides/intro/pdf.xml:1.3 --- presentations/slides/intro/pdf.xml:1.2 Sun Aug 18 17:11:45 2002 +++ presentations/slides/intro/pdf.xml Sun Dec 15 13:38:52 2002 @@ -5,6 +5,6 @@ filename="invoice.php" fontsize="1.5em" result="1" - type="iframe" + type="link" /> </slide> Index: presentations/slides/intro/phpstats.png