cvs: phpweb / books.php
| From: | Gabor Hojtsy | Date: | Fri, 25 Jul 2003 17:09:39 +0000 |
| Subject: | cvs: phpweb / books.php | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-19544@lists.php.net to get a copy of this message | ||
goba Fri Jul 25 13:09:39 2003 EDT
Modified files:
/phpweb books.php
Log:
Book page remake:
- employ new vars (_GET, _SERVER), so we are not
dependant on register_globals here anymore
- use simple links instead of a dropdown for navigation
- format the navtable as on the doc download and
lang selection pages
- put misc things into the sidebar
- always display some books, have a fallback for type and
language in case of nothing is specified [display books
in the user's preferred language by default]
- still a not so nice table based aproach for the book
listing, it can be further optimized probably...
Index: phpweb/books.php diff -u phpweb/books.php:1.192 phpweb/books.php:1.193 --- phpweb/books.php:1.192 Sat Jun 14 15:39:58 2003 +++ phpweb/books.php Fri Jul 25 13:09:39 2003 @@ -1,194 +1,219 @@ <?php +// $Id: books.php,v 1.193 2003/07/25 17:09:39 goba Exp $ -include "./include/prepend.inc"; -include "./include/books.inc"; -commonHeader("PHP Books"); +/* + This script provides an interface to our books listing + (includes/books.inc) to the user. The two vars accepted + are 'type' and 'lang', arriving from a GET request. + Fallback to the users language and the PHP type is + supported. +*/ + +// Ensure that our environment is set up +$_SERVER['BASE_PAGE'] = 'books.php'; +include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; +include_once $_SERVER['DOCUMENT_ROOT'] . '/include/books.inc'; + +// Some misc info on books to the sidebar +$SIDEBAR_DATA = <<<SIDEBAR_END +<h3>More Books</h3> +<p> + There may be more books available that we don't know of yet! You can search + <a href="http://www.amazon.com/exec/obidos/redirect-home/wwwphpnet">Amazon.com</a> + for PHP related stuff by using this form (or go directly to + <a href="http://www.amazon.de/exec/obidos/redirect-home/wwwphpnet07">Amazon.de</a> + or <a href="http://www.amazon.fr/exec/obidos/redirect-home/wwwphpnet0f">Amazon.fr</a> + and search there): +</p> -// Show a table row for one book -function showBook($one_book) { +<form method="get" action="http://www.amazon.com/exec/obidos/external-search"> + <input type="hidden" name="tag" value="wwwphpnet" /> + Search Amazon for<br /> + <select name="mode"> + <option value="blended">All Products</option> + <option value="books" selected="selected">Books</option> + <option value="music">Popular Music</option> + <option value="classical-music">Classical Music</option> + <option value="video">Video</option> + <option value="toys">Toys</option> + <option value="electronics">Electronics</option> + </select><br /> + about<br /> + <select name="keyword"> + <option selected="selected">PHP</option> + <option>Apache</option> + <option>Linux</option> + <option>MySQL</option> + <option>PostgreSQL</option> + <option>mSQL</option> + <option>Oracle</option> + <option>IMAP</option> + <option>LDAP</option> + <option>XML</option> + <option>Adabas</option> + <option>Sybase</option> + <option>Microsoft SQL</option> + <option>Microsoft NT</option> + <option>ODBC</option> + </select><br /> + <input type="submit" value="Search" name="Search" /> +</form> - global $book_langs; - list($title, $title_link, $author, $author_link, $image, $info, $info_link, $lang) = $one_book; +<h3>Book Suggestion</h3> +<p> + If you have found a book, which is not listed here, please + email such details presented about books here to the + webmaster. Please also include a link to a suitable image. + See <a href="/support.php">the support page</a> for more + information. +</p> +SIDEBAR_END; - // Default to english - if (!$lang || !isset($book_langs[$lang]) ) { $lang = 'en'; } +commonHeader("Books"); - // Min. one title, max two titles - if (is_array($title)) { - $img_title = $title[0]; - $title = '<h2 class="condensed">' . make_link ($title_link, $title[0]) . '</h2>' . $title[1]; - } else { - $img_title = $title; - $title = '<h2 class="condensed">' . make_link ($title_link, $title) . '</h2>'; - } - - // More than one author for this book - if (is_array($author)) { - // No link for the authors, simple author list - if (!$author_link) { - $temp = $author; - } - // Build links to the authors pages - else { - for ($i=0; $i < count ($author); $i++) { - if ($author_link[$i]) { - $temp[] = make_link ($author_link[$i],$author[$i]); - } else { - $temp[] = $author[$i]; - } - } +// Show a table row for one book +function book_show($one_book) +{ + global $book_langs; + list($title, $title_link, $author, $author_link, + $image, $info, $info_link, $lang) = $one_book; + + // Default to english + if (!$lang || !isset($book_langs[$lang]) ) { $lang = 'en'; } + + // Min. one title, max two titles + if (is_array($title)) { + $img_title = $title[0]; + $title = '<h2 class="condensed">' . + make_link($title_link, $title[0]) . '</h2>' . $title[1]; + } else { + $img_title = $title; + $title = '<h2 class="condensed">' . + make_link($title_link, $title) . '</h2>'; } - $last = array_pop($temp); - $author = join(', ', $temp) . ' & ' . $last; - } else { - if ($author_link) - $author = make_link ($author_link, $author); - } - - echo '<tr><td colspan="2">' . hdelim() . "</td></tr>\n"; - - echo '<tr valign="top">' . "\n"; - echo "<td>\n"; - print_link ($title_link, make_image ("books/$image", $img_title)); - echo "<br>\n</td><td><p>\n"; - echo "$title\nby "; - echo $author; - echo "</p>\n<small>\n"; - - if ($info || $lang != "en") { - echo "<p>\n"; - if ($lang != "en") { - echo "in " . $book_langs[$lang] . "<br>\n"; - } - echo $info . "</p>\n"; - } - echo "<p>" . make_link ($info_link ? $info_link : $title_link, make_image ("caret-rg.gif",">") . "more info" ); - echo "<br>\n</p>\n</small>\n</td>\n</tr>\n\n"; -} // end of showBook() function + // More than one author for this book + if (is_array($author)) { + + // No link for the authors, simple author list + if (!$author_link) { + $temp = $author; + } + + // Build links to the authors' pages + else { + for ($i=0; $i < count ($author); $i++) { + if ($author_link[$i]) { + $temp[] = make_link($author_link[$i], $author[$i]); + } else { + $temp[] = $author[$i]; + } + } + } + $last = array_pop($temp); + $author = join(', ', $temp) . ' & ' . $last; + + } else { + if ($author_link) { + $author = make_link($author_link, $author); + } + } -// Generate book statistics (book numbers by languages) -function bookStats ($books, $btype) { + // Horizontal delimiter row + echo '<tr><td colspan="2">' . hdelim() . "</td></tr>\n"; - $stats = array(); - foreach ($books[$btype] as $number => $book) { - if (isset($stats[$book[7]])) { - $stats[$book[7]]++; - } else { - $stats[$book[7]] = 1; + // Information row for the book + echo "<tr valign=\"top\">\n<td>\n" . + make_link($title_link, make_image("books/$image", $img_title)) . + "<br>\n</td><td><p>\n$title\nby $author</p>\n<small>\n"; + + // Print any book information and more info link + if ($info || $lang != "en") { + echo "<p>\n"; + if ($lang != "en") { + echo "in " . $book_langs[$lang] . "<br>\n"; + } + echo $info . "</p>\n"; } - } - arsort($stats, SORT_NUMERIC); - return $stats; - -} // end of bookStats() function + echo "<p>" . make_link( + $info_link ? $info_link : $title_link, + make_image("caret-rg.gif",">") . "more info" + ); + echo "<br>\n</p>\n</small>\n</td>\n</tr>\n\n"; +} -echo '<h1>PHP Books</h1>'; +// Generate book statistics (book numbers by languages) +function book_stats($books, $btype) +{ + $stats = array(); + foreach ($books[$btype] as $number => $book) { + if (isset($stats[$book[7]])) { + $stats[$book[7]]++; + } else { + $stats[$book[7]] = 1; + } + } + arsort($stats, SORT_NUMERIC); + return $stats; +} -// If invalid type || lang specified, unset it -if (isset($type_lang) && !empty($type_lang)) { - list($type, $lang) = explode("_", $type_lang); - if (!isset($book_types[$type])) { unset($type); } - if (!isset($book_langs[$lang])) { unset($lang); } +// Support for old type of parameters +if (isset($_GET['type_lang']) && !empty($_GET['type_lang'])) { + list($_GET['type'], $_GET['lang']) = explode("_", $_GET['type_lang']); } -// If type is set, we are printing books -if (isset($type)) { ?> -<p> -Click on a book for more information or (in most cases) to purchase it. -If you would like to jump to another category, choose one from the -list below. Remember, if you buy the book using the links on this page, -you are helping to support PHP development! -</p> +// Fallback to default type and language (the users' own language +// preference, if nothing else is specified) +if (!isset($book_types[$_GET['type']])) { $_GET['type'] = "PHP"; } +if (!isset($book_langs[$_GET['lang']])) { + if (!isset($book_langs[$LANG])) { + $_GET['lang'] = 'en'; + } else { + $_GET['lang'] = $LANG; + } +} -<?php } else { ?> +?> +<h1>Books</h1> <p> -Choose one category and/or a language from the ones below to go to -a listing of books about that subject. + Click on a book for more information or (in most cases) to purchase it. + Choose one category and/or a language from the ones below to go to + a listing of books about that subject. If you buy the book using the + links on this page, you are helping to support PHP development! + Note that the list of books is not static, it is always presented + in a random order. </p> -<?php } ?> - -<form method="get" action="<?php echo $PHP_SELF; ?>"> -Browse our listing: -<select name="type_lang"> +<table border="0" cellpadding="3" cellspacing="2" width="100%"> +<tr bgcolor="#cccccc"><th>Types</th><th>Languages</th></tr> <?php + // Jumplist with types and languages foreach ($books as $btype => $book_list) { - echo " <option value=\"${btype}_all\">+ " . $book_types[$btype] . " [" . count($book_list) . " total]" . "</option>\n"; - $book_stat = bookStats($books, $btype); - foreach ($book_stat as $blang => $number) { - if ($number == 1) { $suff = ""; } else { $suff = "s"; } - echo " <option value=\"${btype}_${blang}\">" . " - $number book$suff in " . $book_langs[$blang] . "</option>\n"; - } + echo "<tr>\n <th bgcolor=\"#dddddd\">" . $book_types[$btype] . + "</th>\n <td bgcolor=\"#eeeeee\">\n"; + $book_stat = book_stats($books, $btype); + $first = TRUE; + foreach ($book_stat as $blang => $number) { + if (!$first) { echo ", \n"; } + echo " <a href=\"/books.php?type=${btype}&lang=${blang}\">" . + $book_langs[$blang] . " ($number)</a>"; + $first = FALSE; + } + echo "\n </td>\n</tr>\n"; } -?> - -</select> -<input type="submit" value="Show" /> -</form> - -<p> -There may be more books available that we don't know of yet! You can search -<a href="http://www.amazon.com/exec/obidos/redirect-home/wwwphpnet">Amazon.com</a> -for PHP related stuff by using this form (or go directly to -<a href="http://www.amazon.de/exec/obidos/redirect-home/wwwphpnet07">Amazon.de</a> -or <a href="http://www.amazon.fr/exec/obidos/redirect-home/wwwphpnet0f">Amazon.fr</a> -and search there): -</p> -<form method="get" action="http://www.amazon.com/exec/obidos/external-search"> -<input type="hidden" name="tag" value="wwwphpnet" /> -Search Amazon for -<select name="mode"> -<option value="blended">All Products</option> -<option value="books" selected="selected">Books</option> -<option value="music">Popular Music</option> -<option value="classical-music">Classical Music</option> -<option value="video">Video</option> -<option value="toys">Toys</option> -<option value="electronics">Electronics</option> -</select> -about -<select name="keyword"> -<option selected="selected">PHP</option> -<option>Apache</option> -<option>Linux</option> -<option>MySQL</option> -<option>PostgreSQL</option> -<option>mSQL</option> -<option>Oracle</option> -<option>IMAP</option> -<option>LDAP</option> -<option>XML</option> -<option>Adabas</option> -<option>Sybase</option> -<option>Microsoft SQL</option> -<option>Microsoft NT</option> -<option>ODBC</option> -</select> -<input type="submit" value="Search" name="Search" /> -</form> +echo "</table>\n"; -<?php - -// If the type is set, print out the books -if (isset($type)) { - - if (!isset($lang)) { $suffix = ' in all languages'; } - else { $suffix = ' in ' . $book_langs[$lang]; } - - echo '<h1>' . $book_types[$type] . $suffix . '</h1>'; - echo '<table border="0" cellpadding="5">'; - shuffle($books[$type]); - foreach ($books[$type] as $one_book) { - if (isset($lang) && $lang != $one_book[7]) { continue; } - showBook($one_book); - } - echo '</table>'; +echo '<h1>' . $book_types[$_GET['type']] . ' in ' . + $book_langs[$_GET['lang']] . "</h1>\n"; +echo '<table border="0" cellpadding="5">'; +shuffle($books[$_GET['type']]); +foreach ($books[$_GET['type']] as $one_book) { + if (isset($_GET['lang']) && $_GET['lang'] != $one_book[7]) { continue; } + book_show($one_book); } - -echo "</p>"; +echo "</table>\n"; commonFooter();
Index: phpweb/books.php diff -u phpweb/books.php:1.192 phpweb/books.php:1.193 --- phpweb/books.php:1.192 Sat Jun 14 15:39:58 2003 +++ phpweb/books.php Fri Jul 25 13:09:39 2003 @@ -1,194 +1,219 @@ <?php +// $Id: books.php,v 1.193 2003/07/25 17:09:39 goba Exp $ -include "./include/prepend.inc"; -include "./include/books.inc"; -commonHeader("PHP Books"); +/* + This script provides an interface to our books listing + (includes/books.inc) to the user. The two vars accepted + are 'type' and 'lang', arriving from a GET request. + Fallback to the users language and the PHP type is + supported. +*/ + +// Ensure that our environment is set up +$_SERVER['BASE_PAGE'] = 'books.php'; +include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; +include_once $_SERVER['DOCUMENT_ROOT'] . '/include/books.inc'; + +// Some misc info on books to the sidebar +$SIDEBAR_DATA = <<<SIDEBAR_END +<h3>More Books</h3> +<p> + There may be more books available that we don't know of yet! You can search + <a href="http://www.amazon.com/exec/obidos/redirect-home/wwwphpnet">Amazon.com</a> + for PHP related stuff by using this form (or go directly to + <a href="http://www.amazon.de/exec/obidos/redirect-home/wwwphpnet07">Amazon.de</a> + or <a href="http://www.amazon.fr/exec/obidos/redirect-home/wwwphpnet0f">Amazon.fr</a> + and search there): +</p> -// Show a table row for one book -function showBook($one_book) { +<form method="get" action="http://www.amazon.com/exec/obidos/external-search"> + <input type="hidden" name="tag" value="wwwphpnet" /> + Search Amazon for<br /> + <select name="mode"> + <option value="blended">All Products</option> + <option value="books" selected="selected">Books</option> + <option value="music">Popular Music</option> + <option value="classical-music">Classical Music</option> + <option value="video">Video</option> + <option value="toys">Toys</option> + <option value="electronics">Electronics</option> + </select><br /> + about<br /> + <select name="keyword"> + <option selected="selected">PHP</option> + <option>Apache</option> + <option>Linux</option> + <option>MySQL</option> + <option>PostgreSQL</option> + <option>mSQL</option> + <option>Oracle</option> + <option>IMAP</option> + <option>LDAP</option> + <option>XML</option> + <option>Adabas</option> + <option>Sybase</option> + <option>Microsoft SQL</option> + <option>Microsoft NT</option> + <option>ODBC</option> + </select><br /> + <input type="submit" value="Search" name="Search" /> +</form> - global $book_langs; - list($title, $title_link, $author, $author_link, $image, $info, $info_link, $lang) = $one_book; +<h3>Book Suggestion</h3> +<p> + If you have found a book, which is not listed here, please + email such details presented about books here to the + webmaster. Please also include a link to a suitable image. + See <a href="/support.php">the support page</a> for more + information. +</p> +SIDEBAR_END; - // Default to english - if (!$lang || !isset($book_langs[$lang]) ) { $lang = 'en'; } +commonHeader("Books"); - // Min. one title, max two titles - if (is_array($title)) { - $img_title = $title[0]; - $title = '<h2 class="condensed">' . make_link ($title_link, $title[0]) . '</h2>' . $title[1]; - } else { - $img_title = $title; - $title = '<h2 class="condensed">' . make_link ($title_link, $title) . '</h2>'; - } - - // More than one author for this book - if (is_array($author)) { - // No link for the authors, simple author list - if (!$author_link) { - $temp = $author; - } - // Build links to the authors pages - else { - for ($i=0; $i < count ($author); $i++) { - if ($author_link[$i]) { - $temp[] = make_link ($author_link[$i],$author[$i]); - } else { - $temp[] = $author[$i]; - } - } +// Show a table row for one book +function book_show($one_book) +{ + global $book_langs; + list($title, $title_link, $author, $author_link, + $image, $info, $info_link, $lang) = $one_book; + + // Default to english + if (!$lang || !isset($book_langs[$lang]) ) { $lang = 'en'; } + + // Min. one title, max two titles + if (is_array($title)) { + $img_title = $title[0]; + $title = '<h2 class="condensed">' . + make_link($title_link, $title[0]) . '</h2>' . $title[1]; + } else { + $img_title = $title; + $title = '<h2 class="condensed">' . + make_link($title_link, $title) . '</h2>'; } - $last = array_pop($temp); - $author = join(', ', $temp) . ' & ' . $last; - } else { - if ($author_link) - $author = make_link ($author_link, $author); - } - - echo '<tr><td colspan="2">' . hdelim() . "</td></tr>\n"; - - echo '<tr valign="top">' . "\n"; - echo "<td>\n"; - print_link ($title_link, make_image ("books/$image", $img_title)); - echo "<br>\n</td><td><p>\n"; - echo "$title\nby "; - echo $author; - echo "</p>\n<small>\n"; - - if ($info || $lang != "en") { - echo "<p>\n"; - if ($lang != "en") { - echo "in " . $book_langs[$lang] . "<br>\n"; - } - echo $info . "</p>\n"; - } - echo "<p>" . make_link ($info_link ? $info_link : $title_link, make_image ("caret-rg.gif",">") . "more info" ); - echo "<br>\n</p>\n</small>\n</td>\n</tr>\n\n"; -} // end of showBook() function + // More than one author for this book + if (is_array($author)) { + + // No link for the authors, simple author list + if (!$author_link) { + $temp = $author; + } + + // Build links to the authors' pages + else { + for ($i=0; $i < count ($author); $i++) { + if ($author_link[$i]) { + $temp[] = make_link($author_link[$i], $author[$i]); + } else { + $temp[] = $author[$i]; + } + } + } + $last = array_pop($temp); + $author = join(', ', $temp) . ' & ' . $last; + + } else { + if ($author_link) { + $author = make_link($author_link, $author); + } + } -// Generate book statistics (book numbers by languages) -function bookStats ($books, $btype) { + // Horizontal delimiter row + echo '<tr><td colspan="2">' . hdelim() . "</td></tr>\n"; - $stats = array(); - foreach ($books[$btype] as $number => $book) { - if (isset($stats[$book[7]])) { - $stats[$book[7]]++; - } else { - $stats[$book[7]] = 1; + // Information row for the book + echo "<tr valign=\"top\">\n<td>\n" . + make_link($title_link, make_image("books/$image", $img_title)) . + "<br>\n</td><td><p>\n$title\nby $author</p>\n<small>\n"; + + // Print any book information and more info link + if ($info || $lang != "en") { + echo "<p>\n"; + if ($lang != "en") { + echo "in " . $book_langs[$lang] . "<br>\n"; + } + echo $info . "</p>\n"; } - } - arsort($stats, SORT_NUMERIC); - return $stats; - -} // end of bookStats() function + echo "<p>" . make_link( + $info_link ? $info_link : $title_link, + make_image("caret-rg.gif",">") . "more info" + ); + echo "<br>\n</p>\n</small>\n</td>\n</tr>\n\n"; +} -echo '<h1>PHP Books</h1>'; +// Generate book statistics (book numbers by languages) +function book_stats($books, $btype) +{ + $stats = array(); + foreach ($books[$btype] as $number => $book) { + if (isset($stats[$book[7]])) { + $stats[$book[7]]++; + } else { + $stats[$book[7]] = 1; + } + } + arsort($stats, SORT_NUMERIC); + return $stats; +} -// If invalid type || lang specified, unset it -if (isset($type_lang) && !empty($type_lang)) { - list($type, $lang) = explode("_", $type_lang); - if (!isset($book_types[$type])) { unset($type); } - if (!isset($book_langs[$lang])) { unset($lang); } +// Support for old type of parameters +if (isset($_GET['type_lang']) && !empty($_GET['type_lang'])) { + list($_GET['type'], $_GET['lang']) = explode("_", $_GET['type_lang']); } -// If type is set, we are printing books -if (isset($type)) { ?> -<p> -Click on a book for more information or (in most cases) to purchase it. -If you would like to jump to another category, choose one from the -list below. Remember, if you buy the book using the links on this page, -you are helping to support PHP development! -</p> +// Fallback to default type and language (the users' own language +// preference, if nothing else is specified) +if (!isset($book_types[$_GET['type']])) { $_GET['type'] = "PHP"; } +if (!isset($book_langs[$_GET['lang']])) { + if (!isset($book_langs[$LANG])) { + $_GET['lang'] = 'en'; + } else { + $_GET['lang'] = $LANG; + } +} -<?php } else { ?> +?> +<h1>Books</h1> <p> -Choose one category and/or a language from the ones below to go to -a listing of books about that subject. + Click on a book for more information or (in most cases) to purchase it. + Choose one category and/or a language from the ones below to go to + a listing of books about that subject. If you buy the book using the + links on this page, you are helping to support PHP development! + Note that the list of books is not static, it is always presented + in a random order. </p> -<?php } ?> - -<form method="get" action="<?php echo $PHP_SELF; ?>"> -Browse our listing: -<select name="type_lang"> +<table border="0" cellpadding="3" cellspacing="2" width="100%"> +<tr bgcolor="#cccccc"><th>Types</th><th>Languages</th></tr> <?php + // Jumplist with types and languages foreach ($books as $btype => $book_list) { - echo " <option value=\"${btype}_all\">+ " . $book_types[$btype] . " [" . count($book_list) . " total]" . "</option>\n"; - $book_stat = bookStats($books, $btype); - foreach ($book_stat as $blang => $number) { - if ($number == 1) { $suff = ""; } else { $suff = "s"; } - echo " <option value=\"${btype}_${blang}\">" . " - $number book$suff in " . $book_langs[$blang] . "</option>\n"; - } + echo "<tr>\n <th bgcolor=\"#dddddd\">" . $book_types[$btype] . + "</th>\n <td bgcolor=\"#eeeeee\">\n"; + $book_stat = book_stats($books, $btype); + $first = TRUE; + foreach ($book_stat as $blang => $number) { + if (!$first) { echo ", \n"; } + echo " <a href=\"/books.php?type=${btype}&lang=${blang}\">" . + $book_langs[$blang] . " ($number)</a>"; + $first = FALSE; + } + echo "\n </td>\n</tr>\n"; } -?> - -</select> -<input type="submit" value="Show" /> -</form> - -<p> -There may be more books available that we don't know of yet! You can search -<a href="http://www.amazon.com/exec/obidos/redirect-home/wwwphpnet">Amazon.com</a> -for PHP related stuff by using this form (or go directly to -<a href="http://www.amazon.de/exec/obidos/redirect-home/wwwphpnet07">Amazon.de</a> -or <a href="http://www.amazon.fr/exec/obidos/redirect-home/wwwphpnet0f">Amazon.fr</a> -and search there): -</p> -<form method="get" action="http://www.amazon.com/exec/obidos/external-search"> -<input type="hidden" name="tag" value="wwwphpnet" /> -Search Amazon for -<select name="mode"> -<option value="blended">All Products</option> -<option value="books" selected="selected">Books</option> -<option value="music">Popular Music</option> -<option value="classical-music">Classical Music</option> -<option value="video">Video</option> -<option value="toys">Toys</option> -<option value="electronics">Electronics</option> -</select> -about -<select name="keyword"> -<option selected="selected">PHP</option> -<option>Apache</option> -<option>Linux</option> -<option>MySQL</option> -<option>PostgreSQL</option> -<option>mSQL</option> -<option>Oracle</option> -<option>IMAP</option> -<option>LDAP</option> -<option>XML</option> -<option>Adabas</option> -<option>Sybase</option> -<option>Microsoft SQL</option> -<option>Microsoft NT</option> -<option>ODBC</option> -</select> -<input type="submit" value="Search" name="Search" /> -</form> +echo "</table>\n"; -<?php - -// If the type is set, print out the books -if (isset($type)) { - - if (!isset($lang)) { $suffix = ' in all languages'; } - else { $suffix = ' in ' . $book_langs[$lang]; } - - echo '<h1>' . $book_types[$type] . $suffix . '</h1>'; - echo '<table border="0" cellpadding="5">'; - shuffle($books[$type]); - foreach ($books[$type] as $one_book) { - if (isset($lang) && $lang != $one_book[7]) { continue; } - showBook($one_book); - } - echo '</table>'; +echo '<h1>' . $book_types[$_GET['type']] . ' in ' . + $book_langs[$_GET['lang']] . "</h1>\n"; +echo '<table border="0" cellpadding="5">'; +shuffle($books[$_GET['type']]); +foreach ($books[$_GET['type']] as $one_book) { + if (isset($_GET['lang']) && $_GET['lang'] != $one_book[7]) { continue; } + book_show($one_book); } - -echo "</p>"; +echo "</table>\n"; commonFooter();