Clickable authors and new results.php.

This commit is contained in:
2023-08-03 11:36:48 -05:00
parent 73f1003d13
commit 1ae30b499f
4 changed files with 53 additions and 11 deletions

View File

@ -7,7 +7,7 @@ In no particular order, here is a semi-current list of things to be done in Info
[ ] Add an About page
[ ] Item pages - Add clickable links on Creator
[ ] Add a citation generator (Chicago, APA, MLA)
[ ] Item pages - Add clickable links on Series
@ -21,6 +21,8 @@ In no particular order, here is a semi-current list of things to be done in Info
[ ] Add image (mostly Pixabay) credits
[x] Item pages - Add clickable links on Creator
[x] Item pages - Add clickable links on Identifiers
[x] Add link to project repo

View File

@ -127,7 +127,7 @@ LIMIT 4');
</div>
<div class="fh5co-box">
<h3 class="heading">Search</h3>
<form action="keywordresults.php" method="get">
<form action="results.php" method="get">
<div class="form-group">
<input type="text" class="form-control" name="kw" placeholder="Keyword search">
</div>

View File

@ -240,7 +240,7 @@ while ($row = $series->fetchArray()) {
<?php
echo '<strong>Item Control Number: </strong>'.$ItemID.'<br />';
echo '<strong>Title:</strong> '.$row_title.'<br />';
echo '<strong>Creator:</strong> '.$row_author_sort.'<br />';
echo '<strong>Creator:</strong> <a href="results.php?au='.$row_author_sort.'">'.$row_author_sort.'</a><br />';
if ($row_series) {
echo '<strong>Series:</strong> '.$row_series.'<br />';
echo '<strong>Series Index:</strong> '.$row_seriesindex.'<br />';

View File

@ -4,8 +4,16 @@ include_once "settings.php";
// Get and use a basic title search for pulling records.
$keywordsearch = htmlspecialchars($_GET["kw"]);
$authorsearch = htmlspecialchars($_GET["au"]);
$socialkw = mb_convert_case($keywordsearch, MB_CASE_TITLE, "UTF-8");
$socialau = mb_convert_case($authorsearch, MB_CASE_TITLE, "UTF-8");
if (empty($keywordsearch)) {
$searchtopic = $socialau;
} else {
$searchtopic = $socialkw;
}
// -------------------- BEGIN DATABASE QUERIES --------------------
@ -29,6 +37,20 @@ OR comments.text LIKE '%$keywordsearch%'
OR tags.name LIKE '%$keywordsearch%'
ORDER BY books.title ASC");
$authorquery = $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_tags_link ON books_tags_link.book = books.id
INNER JOIN
tags ON tags.id = books_tags_link.tag
WHERE books.author_sort LIKE '%$authorsearch%'
ORDER BY books.title ASC");
?>
@ -40,7 +62,7 @@ ORDER BY books.title ASC");
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Infopump - Basic title search</title>
<title>Infopump - Search results - <?php echo $searchtopic; ?></title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="Free HTML5 Template by FREEHTML5.CO" />
<meta name="keywords" content="free html5, free template, free bootstrap, html5, css3, mobile first, responsive" />
@ -61,21 +83,29 @@ ORDER BY books.title ASC");
-->
<!-- Facebook and Twitter integration -->
<meta property="og:title" content=<?php echo '"'.$SiteName.' - Keyword Search - '.$socialkw.'" />';?>
<meta property="og:title" content=<?php echo '"'.$SiteName.' - Search - '.$searchtopic.'" />';?>
<meta property="og:image" content=<?php echo '"'.$SiteURL.'/images/og-site-avatar.jpg" />';?>
<meta property="og:url" content=<?php echo '"'.$SiteURL.'/keywordresults.php?kw='.$keywordsearch.'" />';?>
<?php
if (empty($keywordsearch)) {
echo '<meta property="og:url" content="'.$SiteURL.'/results.php?au='.$searchtopic.'" />';
echo '<meta name="twitter:url" content="'.$SiteURL.'/results.php?au='.$searchtopic.'" />';
} else {
echo '<meta property="og:url" content="'.$SiteURL.'/results.php?kw='.$searchtopic.'" />';
echo '<meta name="twitter:url" content="'.$SiteURL.'/results.php?au='.$searchtopic.'" />';
}
?>
<meta property="og:site_name" content=<?php echo '"'.$SiteName.' - Keyword Search" />';?>
<meta property="og:site_name" content=<?php echo '"'.$SiteName.' - Search" />';?>
<meta property="og:description" content=<?php echo '"'.$SubName.'" />';?>
<meta name="twitter:title" content=<?php echo '"'.$SiteName.' - Keyword Search - '.$socialkw.'" />';?>
<meta name="twitter:title" content=<?php echo '"'.$SiteName.' - Search - '.$searchtopic.'" />';?>
<meta name="twitter:image" content=<?php echo '"'.$SiteURL.'/images/og-site-avatar.jpg" />';?>
<meta name="twitter:url" content=<?php echo '"'.$SiteURL.'/keywordresults.php?kw='.$keywordsearch.'" />';?>
<meta name="twitter:card" content="summary" />
@ -137,7 +167,7 @@ ORDER BY books.title ASC");
</div>
<div class="fh5co-box">
<h3 class="heading">Search</h3>
<form action="keywordresults.php" method="get">
<form action="results.php" method="get">
<div class="form-group">
<input type="text" class="form-control" name="kw" placeholder="Keyword search">
</div>
@ -159,7 +189,7 @@ ORDER BY books.title ASC");
<li><a href="#"><i class="icon-instagram"></i></a></li>
</ul> -->
<div class="col-lg-12 col-md-12 text-center">
<h1 id="fh5co-logo"><a href="index.html">Search Results: <?php echo $titlesearch; ?></a></h1>
<h1 id="fh5co-logo"><a href="index.html">Search Results: <?php echo $searchtopic; ?></a></h1>
</div>
</div>
@ -175,6 +205,7 @@ ORDER BY books.title ASC");
<div class="row rp-b">
<div class="col-md-12 animate-box">
<?php
if ($keywordsearch != '') {
while ($row = $titlequery->fetchArray()) {
$row_id = $row['id'];
$row_title = $row['title'];
@ -182,6 +213,15 @@ ORDER BY books.title 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>';
}
} else {
while ($row = $authorquery->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>';
}
}
?>
</div>
</div>