Clickable series with updated results.php.
This commit is contained in:
@ -215,7 +215,7 @@ while ($row = $series->fetchArray()) {
|
|||||||
<?php
|
<?php
|
||||||
if ($row_series) {
|
if ($row_series) {
|
||||||
echo '<hr />';
|
echo '<hr />';
|
||||||
echo '<strong>Number '.$row_seriesindex.' in the '.$row_series.' series</strong><br />';
|
echo '<strong>Number '.$row_seriesindex.' in the <a href="results.php?se='.$row_series.'">'.$row_series.' </a>series</strong><br />';
|
||||||
echo '<hr />';
|
echo '<hr />';
|
||||||
} else {
|
} else {
|
||||||
echo '<hr>';
|
echo '<hr>';
|
||||||
@ -242,7 +242,7 @@ while ($row = $series->fetchArray()) {
|
|||||||
echo '<strong>Title:</strong> '.$row_title.'<br />';
|
echo '<strong>Title:</strong> '.$row_title.'<br />';
|
||||||
echo '<strong>Creator:</strong> <a href="results.php?au='.$row_author_sort.'">'.$row_author_sort.'</a><br />';
|
echo '<strong>Creator:</strong> <a href="results.php?au='.$row_author_sort.'">'.$row_author_sort.'</a><br />';
|
||||||
if ($row_series) {
|
if ($row_series) {
|
||||||
echo '<strong>Series:</strong> '.$row_series.'<br />';
|
echo '<strong>Series:</strong> <a href="results.php?se='.$row_series.'">'.$row_series.'</a><br />';
|
||||||
echo '<strong>Series Index:</strong> '.$row_seriesindex.'<br />';
|
echo '<strong>Series Index:</strong> '.$row_seriesindex.'<br />';
|
||||||
}
|
}
|
||||||
echo '<strong>Publisher:</strong> '.$row_publisher.'<br />';
|
echo '<strong>Publisher:</strong> '.$row_publisher.'<br />';
|
||||||
|
35
results.php
35
results.php
@ -6,17 +6,21 @@ include_once "settings.php";
|
|||||||
$keywordsearch = htmlspecialchars($_GET["kw"]);
|
$keywordsearch = htmlspecialchars($_GET["kw"]);
|
||||||
$authorsearch = htmlspecialchars($_GET["au"]);
|
$authorsearch = htmlspecialchars($_GET["au"]);
|
||||||
$typesearch = htmlspecialchars($_GET["ty"]);
|
$typesearch = htmlspecialchars($_GET["ty"]);
|
||||||
|
$seriessearch = htmlspecialchars($_GET["se"]);
|
||||||
|
|
||||||
$socialkw = mb_convert_case($keywordsearch, MB_CASE_TITLE, "UTF-8");
|
$socialkw = mb_convert_case($keywordsearch, MB_CASE_TITLE, "UTF-8");
|
||||||
$socialau = mb_convert_case($authorsearch, 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");
|
$socialty = mb_convert_case($typesearch, MB_CASE_TITLE, "UTF-8");
|
||||||
|
$socialse = mb_convert_case($seriessearch, MB_CASE_TITLE, "UTF-8");
|
||||||
|
|
||||||
if (!empty($keywordsearch)) {
|
if (!empty($keywordsearch)) {
|
||||||
$searchtopic = 'Keyword: '.$socialkw;
|
$searchtopic = 'Keyword: '.$socialkw;
|
||||||
} elseif (!empty($authorsearch)) {
|
} elseif (!empty($authorsearch)) {
|
||||||
$searchtopic = 'Author: '.$socialau;
|
$searchtopic = 'Author: '.$socialau;
|
||||||
} else {
|
} elseif (!empty($typesearch)) {
|
||||||
$searchtopic = 'Type: '.$socialty;
|
$searchtopic = 'Type: '.$socialty;
|
||||||
|
} else {
|
||||||
|
$searchtopic = 'Series: '.$socialse;
|
||||||
}
|
}
|
||||||
|
|
||||||
// -------------------- BEGIN DATABASE QUERIES --------------------
|
// -------------------- BEGIN DATABASE QUERIES --------------------
|
||||||
@ -68,6 +72,20 @@ WHERE
|
|||||||
custom_column_1.value = '$typesearch'
|
custom_column_1.value = '$typesearch'
|
||||||
ORDER BY books.title ASC");
|
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
|
$types = $db->query("SELECT
|
||||||
value
|
value
|
||||||
FROM custom_column_1
|
FROM custom_column_1
|
||||||
@ -116,9 +134,12 @@ ORDER BY value ASC");
|
|||||||
} elseif (!empty($authorsearch)) {
|
} elseif (!empty($authorsearch)) {
|
||||||
echo '<meta property="og:url" content="'.$SiteURL.'/results.php?au='.$socialau.'" />';
|
echo '<meta property="og:url" content="'.$SiteURL.'/results.php?au='.$socialau.'" />';
|
||||||
echo '<meta name="twitter:url" content="'.$SiteURL.'/results.php?au='.$socialau.'" />';
|
echo '<meta name="twitter:url" content="'.$SiteURL.'/results.php?au='.$socialau.'" />';
|
||||||
} else {
|
} elseif (!empty($typesearch)) {
|
||||||
echo '<meta property="og:url" content="'.$SiteURL.'/results.php?ty='.$socialty.'" />';
|
echo '<meta property="og:url" content="'.$SiteURL.'/results.php?ty='.$socialty.'" />';
|
||||||
echo '<meta name="twitter:url" content="'.$SiteURL.'/results.php?ty='.$socialty.'" />';
|
echo '<meta name="twitter:url" content="'.$SiteURL.'/results.php?ty='.$socialty.'" />';
|
||||||
|
} else {
|
||||||
|
echo '<meta property="og:url" content="'.$SiteURL.'/results.php?ty='.$socialse.'" />';
|
||||||
|
echo '<meta name="twitter:url" content="'.$SiteURL.'/results.php?ty='.$socialse.'" />';
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
@ -250,12 +271,20 @@ ORDER BY value ASC");
|
|||||||
|
|
||||||
echo '<p style="padding:25px 0 35px 0;"><img style="float:left; max-height: 120px; padding: 10px 10px" src="images/'.$row_id.'.jpg"><strong><em><a href="itemrecord.php?itemid='.$row_id.'">'.$row_title.'</em></a> :</strong> '.strip_tags($row_excerpt).'...</p>';
|
echo '<p style="padding:25px 0 35px 0;"><img style="float:left; max-height: 120px; padding: 10px 10px" src="images/'.$row_id.'.jpg"><strong><em><a href="itemrecord.php?itemid='.$row_id.'">'.$row_title.'</em></a> :</strong> '.strip_tags($row_excerpt).'...</p>';
|
||||||
}
|
}
|
||||||
} else {
|
} elseif ($authorsearch != '') {
|
||||||
while ($row = $authorquery->fetchArray()) {
|
while ($row = $authorquery->fetchArray()) {
|
||||||
$row_id = $row['id'];
|
$row_id = $row['id'];
|
||||||
$row_title = $row['title'];
|
$row_title = $row['title'];
|
||||||
$row_excerpt = $row['excerpt'];
|
$row_excerpt = $row['excerpt'];
|
||||||
|
|
||||||
|
echo '<p style="padding:25px 0 35px 0;"><img style="float:left; max-height: 120px; padding: 10px 10px" src="images/'.$row_id.'.jpg"><strong><em><a href="itemrecord.php?itemid='.$row_id.'">'.$row_title.'</em></a> :</strong> '.strip_tags($row_excerpt).'...</p>';
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
while ($row = $seriesquery->fetchArray()) {
|
||||||
|
$row_id = $row['id'];
|
||||||
|
$row_title = $row['title'];
|
||||||
|
$row_excerpt = $row['excerpt'];
|
||||||
|
|
||||||
echo '<p style="padding:25px 0 35px 0;"><img style="float:left; max-height: 120px; padding: 10px 10px" src="images/'.$row_id.'.jpg"><strong><em><a href="itemrecord.php?itemid='.$row_id.'">'.$row_title.'</em></a> :</strong> '.strip_tags($row_excerpt).'...</p>';
|
echo '<p style="padding:25px 0 35px 0;"><img style="float:left; max-height: 120px; padding: 10px 10px" src="images/'.$row_id.'.jpg"><strong><em><a href="itemrecord.php?itemid='.$row_id.'">'.$row_title.'</em></a> :</strong> '.strip_tags($row_excerpt).'...</p>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user