diff --git a/itemrecord.php b/itemrecord.php index 9b60c24..7252b67 100644 --- a/itemrecord.php +++ b/itemrecord.php @@ -215,7 +215,7 @@ while ($row = $series->fetchArray()) { '; - echo 'Number '.$row_seriesindex.' in the '.$row_series.' series
'; + echo 'Number '.$row_seriesindex.' in the '.$row_series.' series
'; echo '
'; } else { echo '
'; @@ -242,7 +242,7 @@ while ($row = $series->fetchArray()) { echo 'Title: '.$row_title.'
'; echo 'Creator: '.$row_author_sort.'
'; if ($row_series) { - echo 'Series: '.$row_series.'
'; + echo 'Series: '.$row_series.'
'; echo 'Series Index: '.$row_seriesindex.'
'; } echo 'Publisher: '.$row_publisher.'
'; diff --git a/results.php b/results.php index 0c743ea..cb3fe11 100644 --- a/results.php +++ b/results.php @@ -6,17 +6,21 @@ include_once "settings.php"; $keywordsearch = htmlspecialchars($_GET["kw"]); $authorsearch = htmlspecialchars($_GET["au"]); $typesearch = htmlspecialchars($_GET["ty"]); +$seriessearch = htmlspecialchars($_GET["se"]); $socialkw = mb_convert_case($keywordsearch, MB_CASE_TITLE, "UTF-8"); $socialau = mb_convert_case($authorsearch, MB_CASE_TITLE, "UTF-8"); $socialty = mb_convert_case($typesearch, MB_CASE_TITLE, "UTF-8"); +$socialse = mb_convert_case($seriessearch, MB_CASE_TITLE, "UTF-8"); if (!empty($keywordsearch)) { $searchtopic = 'Keyword: '.$socialkw; } elseif (!empty($authorsearch)) { $searchtopic = 'Author: '.$socialau; -} else { +} elseif (!empty($typesearch)) { $searchtopic = 'Type: '.$socialty; +} else { + $searchtopic = 'Series: '.$socialse; } // -------------------- BEGIN DATABASE QUERIES -------------------- @@ -68,6 +72,20 @@ WHERE custom_column_1.value = '$typesearch' ORDER BY books.title ASC"); +$seriesquery = $db->query("SELECT +DISTINCT books.id AS id, +books.title AS title, +SUBSTR(comments.text,0,120) AS excerpt +FROM books +INNER JOIN +comments ON comments.book = books.id +INNER JOIN +books_series_link ON books_series_link.book = books.id +INNER JOIN +series ON series.id = books_series_link.series +WHERE series.name = '$seriessearch' +ORDER BY books.series_index ASC"); + $types = $db->query("SELECT value FROM custom_column_1 @@ -116,9 +134,12 @@ ORDER BY value ASC"); } elseif (!empty($authorsearch)) { echo ''; echo ''; - } else { + } elseif (!empty($typesearch)) { echo ''; echo ''; + } else { + echo ''; + echo ''; } ?> @@ -250,12 +271,20 @@ ORDER BY value ASC"); echo '

'.$row_title.' : '.strip_tags($row_excerpt).'...

'; } - } else { + } elseif ($authorsearch != '') { while ($row = $authorquery->fetchArray()) { $row_id = $row['id']; $row_title = $row['title']; $row_excerpt = $row['excerpt']; + echo '

'.$row_title.' : '.strip_tags($row_excerpt).'...

'; + } + } else { + while ($row = $seriesquery->fetchArray()) { + $row_id = $row['id']; + $row_title = $row['title']; + $row_excerpt = $row['excerpt']; + echo '

'.$row_title.' : '.strip_tags($row_excerpt).'...

'; } }