cvs: php-gtk-web / manual2-lookup.php search.php /include layout.php make-manual2-index.php
| From: | Christian Weiske | Date: | Tue, 11 Apr 2006 09:33:20 +0000 |
| Subject: | cvs: php-gtk-web / manual2-lookup.php search.php /include layout.php make-manual2-index.php | ||
| Groups: | php.gtk.webmaster | ||
| Request: | Send a blank email to php-gtk-webmaster+get-2997@lists.php.net to get a copy of this message | ||
cweiske Tue Apr 11 09:33:20 2006 UTC
Added files:
/php-gtk-web manual2-lookup.php
/php-gtk-web/include make-manual2-index.php
Modified files:
/php-gtk-web search.php
/php-gtk-web/include layout.php
Log:
Search for php-gtk2 manual
http://cvs.php.net/viewcvs.cgi/php-gtk-web/search.php?r1=1.11&r2=1.12&diff_format=u Index: php-gtk-web/search.php diff -u php-gtk-web/search.php:1.11 php-gtk-web/search.php:1.12 --- php-gtk-web/search.php:1.11 Mon Mar 27 13:08:09 2006 +++ php-gtk-web/search.php Tue Apr 11 09:33:20 2006 @@ -7,7 +7,14 @@ } $show = $_POST['show']; -if(isset($pattern) && ($pattern) && isset($show) && ($show == "manual")) { +if(isset($pattern) && ($pattern) && isset($show) && ($show == "manual2")) { + $location = "/manual2-lookup.php"; + $query = "q=".urlencode($pattern); + Header("Location: ".$location."?".$query); + exit; +} + +if(isset($pattern) && ($pattern) && isset($show) && ($show == "manual1")) { /* ALTER FOR LOCAL $location = "manual1-lookup.php"; */ $location = "/manual1-lookup.php"; $query = "function=".urlencode($pattern); http://cvs.php.net/viewcvs.cgi/php-gtk-web/include/layout.php?r1=1.43&r2=1.44&diff_format=u Index: php-gtk-web/include/layout.php diff -u php-gtk-web/include/layout.php:1.43 php-gtk-web/include/layout.php:1.44 --- php-gtk-web/include/layout.php:1.43 Mon Mar 27 16:50:44 2006 +++ php-gtk-web/include/layout.php Tue Apr 11 09:33:20 2006 @@ -1,11 +1,11 @@ <?php -/* $Id: layout.php,v 1.43 2006/03/27 16:50:44 sfox Exp $ */ +/* $Id: layout.php,v 1.44 2006/04/11 09:33:20 cweiske Exp $ */ # spacer() # print a IMG tag for a sized spacer GIF # function spacer($width=1, $height=1, $align=false, $extras=false) { - printf('<img src="/gifs/spacer.gif" width="%d" height="%d" border="0" alt="" %s%s>', + printf('<img src="/gifs/spacer.gif" width="%d" height="%d" border="0" alt="" %s%s/>', $width, $height, ($align ? 'align="'.$align.'" ' : ''), @@ -33,7 +33,7 @@ } if ($size = @getimagesize($_SERVER['DOCUMENT_ROOT'].$dir.'/'.$file)) { - $image = sprintf('<img src="%s/%s" border="%d" %s alt="%s" %s%s>', + $image = sprintf('<img src="%s/%s" border="%d" %s alt="%s" %s%s/>', $dir, $file, $border, @@ -43,12 +43,12 @@ ($extras ? ' '.$extras : '') ); } else { - $image = sprintf('<img src="%s/%s" border="%d" alt="%s" %s%s>', + $image = sprintf('<img src="%s/%s" border="%d" alt="%s"%s%s/>', $dir, $file, $border, ($alt ? $alt : ''), - ($align ? ' ALIGN="'.$align.'"' : ''), + ($align ? ' align="'.$align.'"' : ''), ($extras ? ' '.$extras : '') ); } @@ -73,10 +73,10 @@ $return = make_image($file, $alt, $align, $extras, $dir, $border); - if ($return != "<img>") { + if ($return != "<img/>") { $return = '<input type="image"' . substr($return,4); } else { - $return = '<input type="submit">'; + $return = '<input type="submit"/>'; } return $return; } @@ -88,7 +88,7 @@ if (!$color) { return ' | '; } - return sprintf('<font color="%s"> | </font>', $color); + return sprintf('<span style="color:%s"> | </span>', $color); } # hdelim() @@ -121,7 +121,7 @@ # make an e-mail hyperlink # function make_email($email, $linktext=false) { - return sprintf("<a href=\"mailto:%s\">%s</a>", + return sprintf('<a href="mailto:%s">%s</a>', $email, ($linktext ? $linktext : $email) ); @@ -141,7 +141,7 @@ global $SIDEBAR_DATA; ?><html> <head> - <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"> + <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/> <title>PHP-GTK<?php if ($title) { echo ' : '.$title; } ?></title> <link rel="stylesheet" href="/style.css" /> <link rel="stylesheet" href="/style-highlight.css" /> @@ -155,14 +155,12 @@ <td align="left" rowspan="2"> <?php print_link('/', make_image('php-gtk.gif', 'PHP-GTK', false, 'vspace="2" hspace="2"')); ?><br /> </td> - <td align="right" valign="top" nowrap> - <font color="#FFFFFF"> - <b><?php echo strftime("%A, %B %d, %Y"); ?></b> <br /> - </font> + <td align="right" valign="top" nowrap="nowrap" style="color:#FFF; font-weight:bold"> + <?php echo strftime("%A, %B %d, %Y"); ?> <br /> </td> </tr> <tr bgcolor="#0099CC"> - <td align="right" valign="bottom" nowrap> + <td align="right" valign="bottom" nowrap="nowrap"> <?php print_link('/download.php', 'download', false, 'class="menuBlack"'); echo delim(); @@ -187,22 +185,21 @@ </tr> <tr bgcolor="#000033"><td colspan="2"><?php spacer(1,1); ?><br /></td></tr> <tr bgcolor="#006699"> - <form method="POST" action="/search.php"> - <td align="right" valign="top" colspan="2" nowrap> - <font color="#FFFFFF"> - <small>search for</small> - <input class="small" type="text" name="pattern" value="<?php echo htmlentities($prevsearch); ?>" size="30" /> - <small>in the</small> - <select name="show" class="small"> - <option value="manual">manual</option> - <option value="whole-site">whole site</option> - <option value="wiki">wiki</option> - <option value="php-gtk-general-list">general mailing list</option> - <option value="php-gtk-dev-list">development mailing list</option> - <option value="php-gtk-doc-list">documentation mailing list</option> - </select> - <?php echo make_submit('small_submit_white.gif', 'search', 'bottom'); ?> <br /> - </font> + <form method="post" action="/search.php"> + <td align="right" valign="top" colspan="2" nowrap="nowrap" style="color:#FFF"> + <small>search for</small> + <input class="small" type="text" name="pattern" value="<?php echo htmlentities($prevsearch); ?>" size="30" /> + <small>in the</small> + <select name="show" class="small"> + <option value="manual1"<?php echo $_SERVER['SCRIPT_NAME'] == '/manual1-lookup.php' ? ' selected="selected"':'' ?>>manual v1</option> + <option value="manual2"<?php echo $_SERVER['SCRIPT_NAME'] == '/manual2-lookup.php' ? ' selected="selected"':'' ?>>manual v2</option> + <option value="whole-site">whole site</option> + <option value="wiki">wiki</option> + <option value="php-gtk-general-list">general mailing list</option> + <option value="php-gtk-dev-list">development mailing list</option> + <option value="php-gtk-doc-list">documentation mailing list</option> + </select> + <?php echo make_submit('small_submit_white.gif', 'search', 'bottom'); ?> <br /> </td> </form> </tr> http://cvs.php.net/viewcvs.cgi/php-gtk-web/manual2-lookup.php?view=markup&rev=1.1 Index: php-gtk-web/manual2-lookup.php +++ php-gtk-web/manual2-lookup.php <?php //we are in php-gtk-web/ and need php-gtk-web/include/ as include path set_include_path(get_include_path() . PATH_SEPARATOR . dirname(__FILE__) . '/include/'); $strResult = null; $strError = null; $strSearch = null; $strSelectedType = ''; if (isset($_REQUEST['q']) && $_REQUEST['q'] != '') { require_once 'PhpGtkDoc/Search2.php'; require_once 'PhpGtkDoc/Search2/Result/Html.php'; $strIndexFile = dirname(__FILE__) . '/include/PhpGtkDoc/index.dat'; $strDocumentationDir = 'manual/en/'; if (isset($_REQUEST['type']) && isset($arTypes[$_REQUEST['type']])) { $strSelectedType = $_REQUEST['type']; } $strSearch = preg_replace('/[^a-zA-Z0-9_ ]/', '', $_REQUEST['q']); try { $arResults = PhpGtkDoc_Search2::find($strSearch, $strIndexFile); $strResult = PhpGtkDoc_Search2_Result_Html::format($arResults, $strDocumentationDir, $strSelectedType); if ($strResult == '') { $strResult = '<p>Your search for "' . $strSearch . '" didn\'t return any results.</p>'; } } catch (Exception $e) { $strError = $e->getMessage(); } } commonHeader('Search results'); if ($strError !== null) { echo '<h2>Error</h2>'; echo $strError; } if ($strResult !== null) { echo '<h2>PHP-Gtk2 manual search results for "' . $strSearch . '"</h2>'; echo $strResult; } commonFooter(); ?> http://cvs.php.net/viewcvs.cgi/php-gtk-web/include/make-manual2-index.php?view=markup&rev=1.1 Index: php-gtk-web/include/make-manual2-index.php +++ php-gtk-web/include/make-manual2-index.php <?php if (isset($_SERVER['HTTP_HOST']) && $_SERVER['HTTP_HOST'] !== '') { die("This script may be run from cmdline only\r\n"); } require_once 'PhpGtkDoc/Search2/Index.php'; $strDocDir = dirname(__FILE__) . '/../manual/en/'; $strIndexFile = dirname(__FILE__) . '/PhpGtkDoc/index.dat'; PhpGtkDoc_Search2_Index::createIndex($strDocDir, $strIndexFile); ?>
http://cvs.php.net/viewcvs.cgi/php-gtk-web/search.php?r1=1.11&r2=1.12&diff_format=u Index: php-gtk-web/search.php diff -u php-gtk-web/search.php:1.11 php-gtk-web/search.php:1.12 --- php-gtk-web/search.php:1.11 Mon Mar 27 13:08:09 2006 +++ php-gtk-web/search.php Tue Apr 11 09:33:20 2006 @@ -7,7 +7,14 @@ } $show = $_POST['show']; -if(isset($pattern) && ($pattern) && isset($show) && ($show == "manual")) { +if(isset($pattern) && ($pattern) && isset($show) && ($show == "manual2")) { + $location = "/manual2-lookup.php"; + $query = "q=".urlencode($pattern); + Header("Location: ".$location."?".$query); + exit; +} + +if(isset($pattern) && ($pattern) && isset($show) && ($show == "manual1")) { /* ALTER FOR LOCAL $location = "manual1-lookup.php"; */ $location = "/manual1-lookup.php"; $query = "function=".urlencode($pattern); http://cvs.php.net/viewcvs.cgi/php-gtk-web/include/layout.php?r1=1.43&r2=1.44&diff_format=u Index: php-gtk-web/include/layout.php diff -u php-gtk-web/include/layout.php:1.43 php-gtk-web/include/layout.php:1.44 --- php-gtk-web/include/layout.php:1.43 Mon Mar 27 16:50:44 2006 +++ php-gtk-web/include/layout.php Tue Apr 11 09:33:20 2006 @@ -1,11 +1,11 @@ <?php -/* $Id: layout.php,v 1.43 2006/03/27 16:50:44 sfox Exp $ */ +/* $Id: layout.php,v 1.44 2006/04/11 09:33:20 cweiske Exp $ */ # spacer() # print a IMG tag for a sized spacer GIF # function spacer($width=1, $height=1, $align=false, $extras=false) { - printf('<img src="/gifs/spacer.gif" width="%d" height="%d" border="0" alt="" %s%s>', + printf('<img src="/gifs/spacer.gif" width="%d" height="%d" border="0" alt="" %s%s/>', $width, $height, ($align ? 'align="'.$align.'" ' : ''), @@ -33,7 +33,7 @@ } if ($size = @getimagesize($_SERVER['DOCUMENT_ROOT'].$dir.'/'.$file)) { - $image = sprintf('<img src="%s/%s" border="%d" %s alt="%s" %s%s>', + $image = sprintf('<img src="%s/%s" border="%d" %s alt="%s" %s%s/>', $dir, $file, $border, @@ -43,12 +43,12 @@ ($extras ? ' '.$extras : '') ); } else { - $image = sprintf('<img src="%s/%s" border="%d" alt="%s" %s%s>', + $image = sprintf('<img src="%s/%s" border="%d" alt="%s"%s%s/>', $dir, $file, $border, ($alt ? $alt : ''), - ($align ? ' ALIGN="'.$align.'"' : ''), + ($align ? ' align="'.$align.'"' : ''), ($extras ? ' '.$extras : '') ); } @@ -73,10 +73,10 @@ $return = make_image($file, $alt, $align, $extras, $dir, $border); - if ($return != "<img>") { + if ($return != "<img/>") { $return = '<input type="image"' . substr($return,4); } else { - $return = '<input type="submit">'; + $return = '<input type="submit"/>'; } return $return; } @@ -88,7 +88,7 @@ if (!$color) { return ' | '; } - return sprintf('<font color="%s"> | </font>', $color); + return sprintf('<span style="color:%s"> | </span>', $color); } # hdelim() @@ -121,7 +121,7 @@ # make an e-mail hyperlink # function make_email($email, $linktext=false) { - return sprintf("<a href=\"mailto:%s\">%s</a>", + return sprintf('<a href="mailto:%s">%s</a>', $email, ($linktext ? $linktext : $email) ); @@ -141,7 +141,7 @@ global $SIDEBAR_DATA; ?><html> <head> - <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"> + <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/> <title>PHP-GTK<?php if ($title) { echo ' : '.$title; } ?></title> <link rel="stylesheet" href="/style.css" /> <link rel="stylesheet" href="/style-highlight.css" /> @@ -155,14 +155,12 @@ <td align="left" rowspan="2"> <?php print_link('/', make_image('php-gtk.gif', 'PHP-GTK', false, 'vspace="2" hspace="2"')); ?><br /> </td> - <td align="right" valign="top" nowrap> - <font color="#FFFFFF"> - <b><?php echo strftime("%A, %B %d, %Y"); ?></b> <br /> - </font> + <td align="right" valign="top" nowrap="nowrap" style="color:#FFF; font-weight:bold"> + <?php echo strftime("%A, %B %d, %Y"); ?> <br /> </td> </tr> <tr bgcolor="#0099CC"> - <td align="right" valign="bottom" nowrap> + <td align="right" valign="bottom" nowrap="nowrap"> <?php print_link('/download.php', 'download', false, 'class="menuBlack"'); echo delim(); @@ -187,22 +185,21 @@ </tr> <tr bgcolor="#000033"><td colspan="2"><?php spacer(1,1); ?><br /></td></tr> <tr bgcolor="#006699"> - <form method="POST" action="/search.php"> - <td align="right" valign="top" colspan="2" nowrap> - <font color="#FFFFFF"> - <small>search for</small> - <input class="small" type="text" name="pattern" value="<?php echo htmlentities($prevsearch); ?>" size="30" /> - <small>in the</small> - <select name="show" class="small"> - <option value="manual">manual</option> - <option value="whole-site">whole site</option> - <option value="wiki">wiki</option> - <option value="php-gtk-general-list">general mailing list</option> - <option value="php-gtk-dev-list">development mailing list</option> - <option value="php-gtk-doc-list">documentation mailing list</option> - </select> - <?php echo make_submit('small_submit_white.gif', 'search', 'bottom'); ?> <br /> - </font> + <form method="post" action="/search.php"> + <td align="right" valign="top" colspan="2" nowrap="nowrap" style="color:#FFF"> + <small>search for</small> + <input class="small" type="text" name="pattern" value="<?php echo htmlentities($prevsearch); ?>" size="30" /> + <small>in the</small> + <select name="show" class="small"> + <option value="manual1"<?php echo $_SERVER['SCRIPT_NAME'] == '/manual1-lookup.php' ? ' selected="selected"':'' ?>>manual v1</option> + <option value="manual2"<?php echo $_SERVER['SCRIPT_NAME'] == '/manual2-lookup.php' ? ' selected="selected"':'' ?>>manual v2</option> + <option value="whole-site">whole site</option> + <option value="wiki">wiki</option> + <option value="php-gtk-general-list">general mailing list</option> + <option value="php-gtk-dev-list">development mailing list</option> + <option value="php-gtk-doc-list">documentation mailing list</option> + </select> + <?php echo make_submit('small_submit_white.gif', 'search', 'bottom'); ?> <br /> </td> </form> </tr> http://cvs.php.net/viewcvs.cgi/php-gtk-web/manual2-lookup.php?view=markup&rev=1.1 Index: php-gtk-web/manual2-lookup.php +++ php-gtk-web/manual2-lookup.php <?php //we are in php-gtk-web/ and need php-gtk-web/include/ as include path set_include_path(get_include_path() . PATH_SEPARATOR . dirname(__FILE__) . '/include/'); $strResult = null; $strError = null; $strSearch = null; $strSelectedType = ''; if (isset($_REQUEST['q']) && $_REQUEST['q'] != '') { require_once 'PhpGtkDoc/Search2.php'; require_once 'PhpGtkDoc/Search2/Result/Html.php'; $strIndexFile = dirname(__FILE__) . '/include/PhpGtkDoc/index.dat'; $strDocumentationDir = 'manual/en/'; if (isset($_REQUEST['type']) && isset($arTypes[$_REQUEST['type']])) { $strSelectedType = $_REQUEST['type']; } $strSearch = preg_replace('/[^a-zA-Z0-9_ ]/', '', $_REQUEST['q']); try { $arResults = PhpGtkDoc_Search2::find($strSearch, $strIndexFile); $strResult = PhpGtkDoc_Search2_Result_Html::format($arResults, $strDocumentationDir, $strSelectedType); if ($strResult == '') { $strResult = '<p>Your search for "' . $strSearch . '" didn\'t return any results.</p>'; } } catch (Exception $e) { $strError = $e->getMessage(); } } commonHeader('Search results'); if ($strError !== null) { echo '<h2>Error</h2>'; echo $strError; } if ($strResult !== null) { echo '<h2>PHP-Gtk2 manual search results for "' . $strSearch . '"</h2>'; echo $strResult; } commonFooter(); ?> http://cvs.php.net/viewcvs.cgi/php-gtk-web/include/make-manual2-index.php?view=markup&rev=1.1 Index: php-gtk-web/include/make-manual2-index.php +++ php-gtk-web/include/make-manual2-index.php <?php if (isset($_SERVER['HTTP_HOST']) && $_SERVER['HTTP_HOST'] !== '') { die("This script may be run from cmdline only\r\n"); } require_once 'PhpGtkDoc/Search2/Index.php'; $strDocDir = dirname(__FILE__) . '/../manual/en/'; $strIndexFile = dirname(__FILE__) . '/PhpGtkDoc/index.dat'; PhpGtkDoc_Search2_Index::createIndex($strDocDir, $strIndexFile); ?>