Compare commits
9 Commits
3f5febb1f7
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 359729efc2 | |||
| cf92b68164 | |||
| 770812e364 | |||
| ae1a7f2c77 | |||
| 586e59d306 | |||
| 441e61fb50 | |||
| 0830311340 | |||
| e85c7fd578 | |||
| e83fb53d02 |
32
.gitignore
vendored
Executable file
32
.gitignore
vendored
Executable file
@@ -0,0 +1,32 @@
|
|||||||
|
# ---> macOS
|
||||||
|
.DS_Store
|
||||||
|
.AppleDouble
|
||||||
|
.LSOverride
|
||||||
|
|
||||||
|
# Icon must end with two \r
|
||||||
|
Icon
|
||||||
|
|
||||||
|
|
||||||
|
# Thumbnails
|
||||||
|
._*
|
||||||
|
|
||||||
|
# Files that might appear in the root of a volume
|
||||||
|
.DocumentRevisions-V100
|
||||||
|
.fseventsd
|
||||||
|
.Spotlight-V100
|
||||||
|
.TemporaryItems
|
||||||
|
.Trashes
|
||||||
|
.VolumeIcon.icns
|
||||||
|
|
||||||
|
# Directories potentially created on remote AFP share
|
||||||
|
.AppleDB
|
||||||
|
.AppleDesktop
|
||||||
|
Network Trash Folder
|
||||||
|
Temporary Items
|
||||||
|
.apdisk
|
||||||
|
|
||||||
|
# Let's not share the working database creds
|
||||||
|
creds.php
|
||||||
|
|
||||||
|
# Maybe we don't upload all the test images either
|
||||||
|
uploads/*
|
||||||
35
TODO.md
Normal file → Executable file
35
TODO.md
Normal file → Executable file
@@ -3,38 +3,39 @@
|
|||||||
## To Do
|
## To Do
|
||||||
|
|
||||||
In no particular order, here is a semi-current list of things to be done in Infopump.
|
In no particular order, here is a semi-current list of things to be done in Infopump.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
[ ] Add share button/link on item page
|
- [ ] Add RSS feed for new items
|
||||||
|
|
||||||
[x] Add metadata to item records for Zotero and RDF connections
|
- [x] Add metadata to item records for Zotero and RDF connections
|
||||||
|
|
||||||
[x] Add a citation generator (Chicago, APA, MLA)
|
- [x] Add a citation generator (Chicago, APA, MLA)
|
||||||
|
|
||||||
[x] Add an About page
|
- [x] Add an About page
|
||||||
|
|
||||||
[x] Item pages - Add clickable links on Subjects
|
- [x] Item pages - Add clickable links on Subjects
|
||||||
|
|
||||||
[x] Item pages - Add clickable links on Series
|
- [x] Item pages - Add clickable links on Series
|
||||||
|
|
||||||
[x] Menu - change categories to media types and hook to latest list
|
- [x] Menu - change categories to media types and hook to latest list
|
||||||
|
|
||||||
[x] Item pages - Add clickable links on Type
|
- [x] Item pages - Add clickable links on Type
|
||||||
|
|
||||||
[x] Item pages - Add clickable links on Creator
|
- [x] Item pages - Add clickable links on Creator
|
||||||
|
|
||||||
[x] Item pages - Add clickable links on Identifiers
|
- [x] Item pages - Add clickable links on Identifiers
|
||||||
|
|
||||||
[x] Add link to project repo
|
- [x] Add link to project repo
|
||||||
|
|
||||||
[x] Hook up social graphs and metadata on basic title search
|
- [x] Hook up social graphs and metadata on basic title search
|
||||||
|
|
||||||
[x] Add links to Neon Distopia, Cyberpunk Librarian, and The L0WL1F3 Podcast
|
- [x] Add links to Neon Distopia, Cyberpunk Librarian, and The L0WL1F3 Podcast
|
||||||
|
|
||||||
[x] Social image on home page should be switched to a local image
|
- [x] Social image on home page should be switched to a local image
|
||||||
|
|
||||||
[x] Hook up social graphs and metadata on the item record page
|
- [x] Hook up social graphs and metadata on the item record page
|
||||||
|
|
||||||
[x] Hook up social graphs and metadata on the home page
|
- [x] Hook up social graphs and metadata on the home page
|
||||||
|
|
||||||
[x] Add more search features - added basic keyword search
|
- [x] Add more search features - added basic keyword search
|
||||||
99
about.php
99
about.php
@@ -1,14 +1,30 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* About Page
|
||||||
|
* Displays information about the Infopump project
|
||||||
|
*/
|
||||||
|
|
||||||
include_once "settings.php";
|
include_once "settings.php";
|
||||||
|
|
||||||
// Set up Calibre database connection
|
// -------------------- BEGIN DATABASE QUERIES --------------------
|
||||||
$db = new SQLite3('metadata.sqlite');
|
|
||||||
|
|
||||||
$types = $db->query("SELECT
|
// Initialize variables
|
||||||
value
|
$types = null;
|
||||||
FROM custom_column_1
|
|
||||||
ORDER BY value ASC");
|
try {
|
||||||
|
// Set up Calibre database connection
|
||||||
|
$db = new SQLite3('metadata.sqlite', SQLITE3_OPEN_READONLY);
|
||||||
|
$db->enableExceptions(true);
|
||||||
|
|
||||||
|
// Fetch types for menu - using prepared statement for consistency
|
||||||
|
$stmt = $db->prepare("SELECT value FROM custom_column_1 ORDER BY value ASC");
|
||||||
|
$types = $stmt->execute();
|
||||||
|
|
||||||
|
} catch (Exception $e) {
|
||||||
|
error_log("Database error in about.php: " . $e->getMessage());
|
||||||
|
// Continue without types menu if database fails
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
@@ -21,9 +37,9 @@ ORDER BY value ASC");
|
|||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<title>About Infopump</title>
|
<title>About Infopump</title>
|
||||||
<title><?php echo $SiteName.': '.$SubName;?></title>
|
<title><?php echo htmlspecialchars($SiteName . ': ' . $SubName, ENT_QUOTES, 'UTF-8'); ?></title>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<meta name="description" content=<?php echo '"About '.$SiteName.' - '.$SubName.'" />';?>
|
<meta name="description" content="About <?php echo htmlspecialchars($SiteName . ' - ' . $SubName, ENT_QUOTES, 'UTF-8'); ?>" />
|
||||||
<meta name="keywords" content="free software, open source, bibliography, cyberpunk, books, media, movies, video games" />
|
<meta name="keywords" content="free software, open source, bibliography, cyberpunk, books, media, movies, video games" />
|
||||||
<meta name="author" content="Daniel Messer" />
|
<meta name="author" content="Daniel Messer" />
|
||||||
|
|
||||||
@@ -42,38 +58,28 @@ ORDER BY value ASC");
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
<!-- Facebook and Twitter integration -->
|
<!-- Facebook and Twitter integration -->
|
||||||
<meta property="og:title" content=<?php echo '"About '.$SiteName.'" />';?>
|
<meta property="og:title" content="About <?php echo htmlspecialchars($SiteName, ENT_QUOTES, 'UTF-8'); ?>" />
|
||||||
|
<meta property="og:image" content="<?php echo htmlspecialchars($SiteURL, ENT_QUOTES, 'UTF-8'); ?>/images/og-site-avatar.jpg" />
|
||||||
<meta property="og:image" content=<?php echo '"'.$SiteURL.'/images/og-site-avatar.jpg" />';?>
|
<meta property="og:url" content="<?php echo htmlspecialchars($SiteURL, ENT_QUOTES, 'UTF-8'); ?>" />
|
||||||
|
<meta property="og:site_name" content="<?php echo htmlspecialchars($SiteName . ' - ' . $SubName, ENT_QUOTES, 'UTF-8'); ?>" />
|
||||||
<meta property="og:url" content=<?php echo '"'.$SiteURL.'" />';?>
|
<meta property="og:description" content="<?php echo htmlspecialchars($SubName, ENT_QUOTES, 'UTF-8'); ?>" />
|
||||||
|
<meta name="twitter:title" content="About <?php echo htmlspecialchars($SiteName . ' - ' . $SubName, ENT_QUOTES, 'UTF-8'); ?>" />
|
||||||
<meta property="og:site_name" content=<?php echo '"'.$SiteName.' - '.$SubName.'" />';?>
|
<meta name="twitter:image" content="<?php echo htmlspecialchars($SiteURL, ENT_QUOTES, 'UTF-8'); ?>/images/og-site-avatar.jpg" />
|
||||||
|
<meta name="twitter:url" content="<?php echo htmlspecialchars($SiteURL, ENT_QUOTES, 'UTF-8'); ?>" />
|
||||||
<meta property="og:description" content=<?php echo '"'.$SubName.'" />';?>
|
|
||||||
|
|
||||||
<meta name="twitter:title" content=<?php echo '"About '.$SiteName.' - '.$SubName.'" />';?>
|
|
||||||
|
|
||||||
<meta name="twitter:image" content=<?php echo '"'.$SiteURL.'/images/og-site-avatar.jpg" />';?>
|
|
||||||
|
|
||||||
<meta name="twitter:url" content=<?php echo '"'.$SiteURL.'" />';?>
|
|
||||||
|
|
||||||
<meta name="twitter:card" content="summary" />
|
<meta name="twitter:card" content="summary" />
|
||||||
|
|
||||||
<!-- Place favicon.ico and apple-touch-icon.png in the root directory -->
|
<!-- Place favicon.ico and apple-touch-icon.png in the root directory -->
|
||||||
<link rel="shortcut icon" href="favicon.ico">
|
<link rel="shortcut icon" href="favicon.ico">
|
||||||
<!-- Google Fonts -->
|
<!-- Google Fonts -->
|
||||||
<link href='http://fonts.googleapis.com/css?family=Playfair+Display:400,700,400italic|Roboto:400,300,700' rel='stylesheet' type='text/css'>
|
<link href='https://fonts.googleapis.com/css?family=Playfair+Display:400,700,400italic|Roboto:400,300,700' rel='stylesheet' type='text/css'>
|
||||||
<!-- Animate -->
|
<!-- Animate -->
|
||||||
<link rel="stylesheet" href="css/animate.css">
|
<link rel="stylesheet" href="css/animate.css">
|
||||||
<!-- Icomoon -->
|
<!-- Icomoon -->
|
||||||
<link rel="stylesheet" href="css/icomoon.css">
|
<link rel="stylesheet" href="css/icomoon.css">
|
||||||
<!-- Bootstrap -->
|
<!-- Bootstrap -->
|
||||||
<link rel="stylesheet" href="css/bootstrap.css">
|
<link rel="stylesheet" href="css/bootstrap.css">
|
||||||
|
|
||||||
<link rel="stylesheet" href="css/style.css">
|
<link rel="stylesheet" href="css/style.css">
|
||||||
|
|
||||||
|
|
||||||
<!-- Modernizr JS -->
|
<!-- Modernizr JS -->
|
||||||
<script src="js/modernizr-2.6.2.min.js"></script>
|
<script src="js/modernizr-2.6.2.min.js"></script>
|
||||||
<!-- FOR IE9 below -->
|
<!-- FOR IE9 below -->
|
||||||
@@ -95,13 +101,13 @@ ORDER BY value ASC");
|
|||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
<p>A free, open source project from:<br />
|
<p>A free, open source project from:<br />
|
||||||
<a href="https://rss.com/podcasts/l0wl1f3podcast/">The L0WL1F3 Podcast</a><br />
|
<a href="https://rss.com/podcasts/l0wl1f3podcast/" rel="noopener noreferrer" target="_blank">The L0WL1F3 Podcast</a><br />
|
||||||
<a href="https://www.neondystopia.com/">Neon Dystopia</a><br />
|
<a href="https://www.neondystopia.com/" rel="noopener noreferrer" target="_blank">Neon Dystopia</a><br />
|
||||||
<a href="https://cyberpunklibrarian.com">Cyberpunk Librarian</a>
|
<a href="https://cyberpunklibrarian.com" rel="noopener noreferrer" target="_blank">Cyberpunk Librarian</a>
|
||||||
</p>
|
</p>
|
||||||
<hr>
|
<hr>
|
||||||
<p>
|
<p>
|
||||||
<a href="https://cyberpunklibrarian.nohost.me/gitlab/code/infopump">GitLab</a>
|
<a href="https://cyberpunklibrarian.nohost.me/gitea/Public/infopump" rel="noopener noreferrer" target="_blank">Repo</a>
|
||||||
</p>
|
</p>
|
||||||
<ul class="fh5co-social">
|
<ul class="fh5co-social">
|
||||||
<!--<li><a href="#"><i class="icon-twitter"></i></a></li>
|
<!--<li><a href="#"><i class="icon-twitter"></i></a></li>
|
||||||
@@ -115,14 +121,15 @@ ORDER BY value ASC");
|
|||||||
<h3 class="heading">Recent Additions</h3>
|
<h3 class="heading">Recent Additions</h3>
|
||||||
<ul>
|
<ul>
|
||||||
<?php
|
<?php
|
||||||
while ($row = $types->fetchArray()) {
|
if ($types) {
|
||||||
$row_value = $row['value'];
|
while ($row = $types->fetchArray(SQLITE3_ASSOC)) {
|
||||||
$row_titlecase = mb_convert_case($row_value, MB_CASE_TITLE, "UTF-8");
|
$row_value = htmlspecialchars($row['value'], ENT_QUOTES, 'UTF-8');
|
||||||
echo '<li><a href="recent.php?ty='.$row_value.'">'.$row_titlecase.'</a></li>';
|
$row_titlecase = htmlspecialchars(mb_convert_case($row['value'], MB_CASE_TITLE, "UTF-8"), ENT_QUOTES, 'UTF-8');
|
||||||
//echo '<li>'.$row_value.'</li>';
|
echo '<li><a href="recent.php?ty=' . urlencode($row['value']) . '">' . $row_titlecase . '</a></li>';
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
echo '<li>Unable to load menu</li>';
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
@@ -131,7 +138,7 @@ ORDER BY value ASC");
|
|||||||
<h3 class="heading">Search</h3>
|
<h3 class="heading">Search</h3>
|
||||||
<form action="results.php" method="get">
|
<form action="results.php" method="get">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<input type="text" class="form-control" name="kw" placeholder="Keyword search">
|
<input type="text" class="form-control" name="kw" placeholder="Keyword search" maxlength="100" required>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
@@ -176,9 +183,9 @@ ORDER BY value ASC");
|
|||||||
<div class="col-lg-8 cp-r animate-box">
|
<div class="col-lg-8 cp-r animate-box">
|
||||||
<p>There are two things behind the creation of Infopump, the thought directly above and an almost obsessively compiled spreadsheet of cyberpunk media. Shadowlink, from Neon Dystopia and the L0WL1F3 Podcast, created something amazing. It's a gigantic Google Sheet of cyberpunk related books, movies, games, music, and more. When I first saw it, the librarian in me went wild. Because what I saw wasn't a spreadsheet, I saw a bibliography.</p>
|
<p>There are two things behind the creation of Infopump, the thought directly above and an almost obsessively compiled spreadsheet of cyberpunk media. Shadowlink, from Neon Dystopia and the L0WL1F3 Podcast, created something amazing. It's a gigantic Google Sheet of cyberpunk related books, movies, games, music, and more. When I first saw it, the librarian in me went wild. Because what I saw wasn't a spreadsheet, I saw a bibliography.</p>
|
||||||
|
|
||||||
<p>After a couple conversations, I got to work on something that would take that data and display it in an attractive manner, and maybe even make it fun. We needed more than just titles and authors though, especially if this was going to be a useful bibliography. After some attempts to build a cataloguing interface, I had an epiphany while working on some eBook collections for my everyday job. (Hello, <a href="https://cyberpunklibrarian.com/about/">I'm Dan</a>. I'm a <a href="https://www.linkedin.com/in/danielmesser/">Systems Librarian</a>, library technologist, and researcher.) It dawned on me that there is already a piece of software that could handle the cataloguing, the metadata, the collection, and all the rest. And it's free, open source, and cross platform. It has an excellent, well designed database powered by SQLite which I could query using PHP and display the results in a web browser.</p>
|
<p>After a couple conversations, I got to work on something that would take that data and display it in an attractive manner, and maybe even make it fun. We needed more than just titles and authors though, especially if this was going to be a useful bibliography. After some attempts to build a cataloguing interface, I had an epiphany while working on some eBook collections for my everyday job. (Hello, <a href="https://cyberpunklibrarian.com/about/" rel="noopener noreferrer" target="_blank">I'm Dan</a>. I'm a <a href="https://www.linkedin.com/in/danielmesser/" rel="noopener noreferrer" target="_blank">Systems Librarian</a>, library technologist, and researcher.) It dawned on me that there is already a piece of software that could handle the cataloguing, the metadata, the collection, and all the rest. And it's free, open source, and cross platform. It has an excellent, well designed database powered by SQLite which I could query using PHP and display the results in a web browser.</p>
|
||||||
|
|
||||||
<p><a href="https://calibre-ebook.com/">Calibre</a>.</p>
|
<p><a href="https://calibre-ebook.com/" rel="noopener noreferrer" target="_blank">Calibre</a>.</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-lg-4 animate-box">
|
<div class="col-lg-4 animate-box">
|
||||||
<div class="fh5co-highlight right">
|
<div class="fh5co-highlight right">
|
||||||
@@ -224,7 +231,7 @@ ORDER BY value ASC");
|
|||||||
|
|
||||||
<p>Thank you from your little free Cyberpunk Librarian, and the L0WL1F3 lads at Neon Dystopia.</p>
|
<p>Thank you from your little free Cyberpunk Librarian, and the L0WL1F3 lads at Neon Dystopia.</p>
|
||||||
|
|
||||||
<p>Contact: cyberpunklibrarian [at] protonmail [dot] com<br />Code: <a href="https://cyberpunklibrarian.nohost.me/gitlab/code/infopump">GitLab</a></p>
|
<p>Contact: cyberpunklibrarian [at] protonmail [dot] com<br />Code: <a href="https://cyberpunklibrarian.nohost.me/gitea/Public/infopump" rel="noopener noreferrer" target="_blank">Repo</a></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -234,7 +241,7 @@ ORDER BY value ASC");
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<footer id="fh5co-footer">
|
<footer id="fh5co-footer">
|
||||||
<p><small>© Creative Commons By-NC-SA<br> Design by <a href="http://freehtml5.co" target="_blank">FREEHTML5.co</a></small></p>
|
<p><small>© Creative Commons By-NC-SA<br> Design by <a href="http://freehtml5.co" target="_blank" rel="noopener noreferrer">FREEHTML5.co</a></small></p>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<!-- jQuery -->
|
<!-- jQuery -->
|
||||||
@@ -251,3 +258,9 @@ ORDER BY value ASC");
|
|||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
// Close database connection
|
||||||
|
if (isset($db)) {
|
||||||
|
$db->close();
|
||||||
|
}
|
||||||
|
?>
|
||||||
253
archive/about-old.php
Normal file
253
archive/about-old.php
Normal file
@@ -0,0 +1,253 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
include_once "settings.php";
|
||||||
|
|
||||||
|
// Set up Calibre database connection
|
||||||
|
$db = new SQLite3('metadata.sqlite');
|
||||||
|
|
||||||
|
$types = $db->query("SELECT
|
||||||
|
value
|
||||||
|
FROM custom_column_1
|
||||||
|
ORDER BY value ASC");
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
|
||||||
|
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
|
||||||
|
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
|
||||||
|
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
|
<title>About Infopump</title>
|
||||||
|
<title><?php echo $SiteName.': '.$SubName;?></title>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<meta name="description" content=<?php echo '"About '.$SiteName.' - '.$SubName.'" />';?>
|
||||||
|
<meta name="keywords" content="free software, open source, bibliography, cyberpunk, books, media, movies, video games" />
|
||||||
|
<meta name="author" content="Daniel Messer" />
|
||||||
|
|
||||||
|
<!--
|
||||||
|
//////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
FREE HTML5 TEMPLATE
|
||||||
|
DESIGNED & DEVELOPED by FREEHTML5.CO
|
||||||
|
|
||||||
|
Website: http://freehtml5.co/
|
||||||
|
Email: info@freehtml5.co
|
||||||
|
Twitter: http://twitter.com/fh5co
|
||||||
|
Facebook: https://www.facebook.com/fh5co
|
||||||
|
|
||||||
|
//////////////////////////////////////////////////////
|
||||||
|
-->
|
||||||
|
|
||||||
|
<!-- Facebook and Twitter integration -->
|
||||||
|
<meta property="og:title" content=<?php echo '"About '.$SiteName.'" />';?>
|
||||||
|
|
||||||
|
<meta property="og:image" content=<?php echo '"'.$SiteURL.'/images/og-site-avatar.jpg" />';?>
|
||||||
|
|
||||||
|
<meta property="og:url" content=<?php echo '"'.$SiteURL.'" />';?>
|
||||||
|
|
||||||
|
<meta property="og:site_name" content=<?php echo '"'.$SiteName.' - '.$SubName.'" />';?>
|
||||||
|
|
||||||
|
<meta property="og:description" content=<?php echo '"'.$SubName.'" />';?>
|
||||||
|
|
||||||
|
<meta name="twitter:title" content=<?php echo '"About '.$SiteName.' - '.$SubName.'" />';?>
|
||||||
|
|
||||||
|
<meta name="twitter:image" content=<?php echo '"'.$SiteURL.'/images/og-site-avatar.jpg" />';?>
|
||||||
|
|
||||||
|
<meta name="twitter:url" content=<?php echo '"'.$SiteURL.'" />';?>
|
||||||
|
|
||||||
|
<meta name="twitter:card" content="summary" />
|
||||||
|
|
||||||
|
<!-- Place favicon.ico and apple-touch-icon.png in the root directory -->
|
||||||
|
<link rel="shortcut icon" href="favicon.ico">
|
||||||
|
<!-- Google Fonts -->
|
||||||
|
<link href='http://fonts.googleapis.com/css?family=Playfair+Display:400,700,400italic|Roboto:400,300,700' rel='stylesheet' type='text/css'>
|
||||||
|
<!-- Animate -->
|
||||||
|
<link rel="stylesheet" href="css/animate.css">
|
||||||
|
<!-- Icomoon -->
|
||||||
|
<link rel="stylesheet" href="css/icomoon.css">
|
||||||
|
<!-- Bootstrap -->
|
||||||
|
<link rel="stylesheet" href="css/bootstrap.css">
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="css/style.css">
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Modernizr JS -->
|
||||||
|
<script src="js/modernizr-2.6.2.min.js"></script>
|
||||||
|
<!-- FOR IE9 below -->
|
||||||
|
<!--[if lt IE 9]>
|
||||||
|
<script src="js/respond.min.js"></script>
|
||||||
|
<![endif]-->
|
||||||
|
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="fh5co-offcanvas">
|
||||||
|
<a href="#" class="fh5co-close-offcanvas js-fh5co-close-offcanvas"><span><i class="icon-cross3"></i> <span>Close</span></span></a>
|
||||||
|
<div class="fh5co-bio">
|
||||||
|
<figure>
|
||||||
|
<a href="index.php"><img src="images/avatar.jpg" alt="Infopump Avatar" class="img-responsive"></a>
|
||||||
|
</figure>
|
||||||
|
<h3 class="heading">About the Project</h3>
|
||||||
|
<a href="index.php"><h2>Infopump</h2></a>
|
||||||
|
<p>A bibliographic management and display system.<br /><a href="about.php">More info</a></p>
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
<p>A free, open source project from:<br />
|
||||||
|
<a href="https://rss.com/podcasts/l0wl1f3podcast/">The L0WL1F3 Podcast</a><br />
|
||||||
|
<a href="https://www.neondystopia.com/">Neon Dystopia</a><br />
|
||||||
|
<a href="https://cyberpunklibrarian.com">Cyberpunk Librarian</a>
|
||||||
|
</p>
|
||||||
|
<hr>
|
||||||
|
<p>
|
||||||
|
<a href="https://cyberpunklibrarian.nohost.me/gitlab/code/infopump">GitLab</a>
|
||||||
|
</p>
|
||||||
|
<ul class="fh5co-social">
|
||||||
|
<!--<li><a href="#"><i class="icon-twitter"></i></a></li>
|
||||||
|
<li><a href="#"><i class="icon-facebook"></i></a></li>
|
||||||
|
<li><a href="#"><i class="icon-instagram"></i></a></li>-->
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="fh5co-menu">
|
||||||
|
<div class="fh5co-box">
|
||||||
|
<h3 class="heading">Recent Additions</h3>
|
||||||
|
<ul>
|
||||||
|
<?php
|
||||||
|
while ($row = $types->fetchArray()) {
|
||||||
|
$row_value = $row['value'];
|
||||||
|
$row_titlecase = mb_convert_case($row_value, MB_CASE_TITLE, "UTF-8");
|
||||||
|
echo '<li><a href="recent.php?ty='.$row_value.'">'.$row_titlecase.'</a></li>';
|
||||||
|
//echo '<li>'.$row_value.'</li>';
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="fh5co-box">
|
||||||
|
<h3 class="heading">Search</h3>
|
||||||
|
<form action="results.php" method="get">
|
||||||
|
<div class="form-group">
|
||||||
|
<input type="text" class="form-control" name="kw" placeholder="Keyword search">
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- END #fh5co-offcanvas -->
|
||||||
|
<header id="fh5co-header">
|
||||||
|
|
||||||
|
<div class="container-fluid">
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<a href="#" class="js-fh5co-nav-toggle fh5co-nav-toggle"><i></i></a>
|
||||||
|
<!-- <ul class="fh5co-social">
|
||||||
|
<li><a href="#"><i class="icon-twitter"></i></a></li>
|
||||||
|
<li><a href="#"><i class="icon-facebook"></i></a></li>
|
||||||
|
<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.php">Infopump</a></h1>
|
||||||
|
<h3>A bibliographic display system</h3>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</header>
|
||||||
|
<!-- END #fh5co-header -->
|
||||||
|
<div class="container-fluid">
|
||||||
|
<div class="row fh5co-post-entry single-entry">
|
||||||
|
<article class="col-lg-8 col-lg-offset-2 col-md-8 col-md-offset-2 col-sm-8 col-sm-offset-2 col-xs-12 col-xs-offset-0">
|
||||||
|
<figure class="animate-box">
|
||||||
|
<img src="images/og-site-avatar.jpg" alt="A woman wearing a neon cybervisor over her eyes" class="img-responsive">
|
||||||
|
</figure>
|
||||||
|
<!-- <span class="fh5co-meta animate-box"><a href="single.html">Travel</a></span> -->
|
||||||
|
<h2 class="fh5co-article-title animate-box">About Infopump</h2>
|
||||||
|
<!-- <span class="fh5co-meta fh5co-date animate-box">March 6th, 2016</span> -->
|
||||||
|
|
||||||
|
<div class="col-lg-12 col-lg-offset-0 col-md-12 col-md-offset-0 col-sm-12 col-sm-offset-0 col-xs-12 col-xs-offset-0 text-left content-article">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-lg-8 cp-r animate-box">
|
||||||
|
<p>There are two things behind the creation of Infopump, the thought directly above and an almost obsessively compiled spreadsheet of cyberpunk media. Shadowlink, from Neon Dystopia and the L0WL1F3 Podcast, created something amazing. It's a gigantic Google Sheet of cyberpunk related books, movies, games, music, and more. When I first saw it, the librarian in me went wild. Because what I saw wasn't a spreadsheet, I saw a bibliography.</p>
|
||||||
|
|
||||||
|
<p>After a couple conversations, I got to work on something that would take that data and display it in an attractive manner, and maybe even make it fun. We needed more than just titles and authors though, especially if this was going to be a useful bibliography. After some attempts to build a cataloguing interface, I had an epiphany while working on some eBook collections for my everyday job. (Hello, <a href="https://cyberpunklibrarian.com/about/">I'm Dan</a>. I'm a <a href="https://www.linkedin.com/in/danielmesser/">Systems Librarian</a>, library technologist, and researcher.) It dawned on me that there is already a piece of software that could handle the cataloguing, the metadata, the collection, and all the rest. And it's free, open source, and cross platform. It has an excellent, well designed database powered by SQLite which I could query using PHP and display the results in a web browser.</p>
|
||||||
|
|
||||||
|
<p><a href="https://calibre-ebook.com/">Calibre</a>.</p>
|
||||||
|
</div>
|
||||||
|
<div class="col-lg-4 animate-box">
|
||||||
|
<div class="fh5co-highlight right">
|
||||||
|
<h4>...</h4>
|
||||||
|
<p> I'm adding new features quite frequently because, as a librarian, I want to get Infopump up to a state where I can start focusing more on cataloguing than coding. I'll write more about the project later, but at least you know what's going on now, and what this software is for.</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- <div class="row rp-b">
|
||||||
|
<div class="col-md-12 animate-box">
|
||||||
|
<blockquote>
|
||||||
|
<p>“She packed her seven versalia, put her initial into the belt and made herself on the way. When she reached the first hills of the Italic Mountains, she had a last view back on the skyline of her hometown Bookmarksgrove ” <cite>— Jean Smith</cite></p>
|
||||||
|
</blockquote>
|
||||||
|
</div>
|
||||||
|
</div> -->
|
||||||
|
|
||||||
|
<div class="row rp-b">
|
||||||
|
<div class="col-lg-6 col-md-12 animate-box">
|
||||||
|
<figure>
|
||||||
|
<img src="images/1.jpg" alt="The cover of Neuromancer, by William Gibson" class="img-responsive">
|
||||||
|
<!-- <figcaption>This is a sweet image caption. Far far away, behind the word mountains, far from the countries Vokalia and Consonantia</figcaption> -->
|
||||||
|
</figure>
|
||||||
|
</div>
|
||||||
|
<div class="col-lg-6 col-md-12 cp-l animate-box">
|
||||||
|
<p>I threw out the original MariaDB database and threw some records into Calibre, using dummy PDFs as books. We're not interested in the eBook files, we want the delicious *data*. And so long as you have an ISBN and/or decent starting data, Calibre can automatically fetch all the other metadata about an item. After cataloguing a few items, I copied the database to my development server and went to work.</p>
|
||||||
|
|
||||||
|
<p>Infopump is a free and open source bibliographic display system for people and groups who want to offer a curated collection of media about a topic. While this initial Infopump instance focuses on Shadowlink's cyberpunk collection, it could be used for any collection. All the cataloging is handled by Calibre and the web display is handled by Infopump.</p>
|
||||||
|
|
||||||
|
<p>Infopump is still in development, so you may spot some bugs before I do. But I'm adding new features quite frequently because, as a librarian, I want to get Infopump up to a state where I can start focusing more on cataloguing than coding. I'll write more about the project later, but at least you know what's going on now, and what this software is for.</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row rp-b">
|
||||||
|
<div class="col-lg-6 col-lg-push-6 col-md-12 col-md-push-0 animate-box">
|
||||||
|
<figure>
|
||||||
|
<img src="images/infopump-featured.jpg" alt="A man stands in a cyberpunk city, looking up at the connections above him" class="img-responsive">
|
||||||
|
<!-- <figcaption>This is a sweet image caption. Far far away, behind the word mountains, far from the countries Vokalia and Consonantia</figcaption> -->
|
||||||
|
</figure>
|
||||||
|
</div>
|
||||||
|
<div class="col-lg-6 col-lg-pull-6 col-md-12 col-md-pull-0 cp-r animate-box">
|
||||||
|
<p>It's for collections, and it's for you.</p>
|
||||||
|
|
||||||
|
<p>Thank you from your little free Cyberpunk Librarian, and the L0WL1F3 lads at Neon Dystopia.</p>
|
||||||
|
|
||||||
|
<p>Contact: cyberpunklibrarian [at] protonmail [dot] com<br />Code: <a href="https://cyberpunklibrarian.nohost.me/gitlab/code/infopump">GitLab</a></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</article>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<footer id="fh5co-footer">
|
||||||
|
<p><small>© Creative Commons By-NC-SA<br> Design by <a href="http://freehtml5.co" target="_blank">FREEHTML5.co</a></small></p>
|
||||||
|
</footer>
|
||||||
|
|
||||||
|
<!-- jQuery -->
|
||||||
|
<script src="js/jquery.min.js"></script>
|
||||||
|
<!-- jQuery Easing -->
|
||||||
|
<script src="js/jquery.easing.1.3.js"></script>
|
||||||
|
<!-- Bootstrap -->
|
||||||
|
<script src="js/bootstrap.min.js"></script>
|
||||||
|
<!-- Waypoints -->
|
||||||
|
<script src="js/jquery.waypoints.min.js"></script>
|
||||||
|
<!-- Main JS -->
|
||||||
|
<script src="js/main.js"></script>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
||||||
215
archive/index-old.php
Normal file
215
archive/index-old.php
Normal file
@@ -0,0 +1,215 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
include_once "settings.php";
|
||||||
|
|
||||||
|
// Set up Calibre database connection
|
||||||
|
$db = new SQLite3('metadata.sqlite');
|
||||||
|
|
||||||
|
$feature = $db->query("SELECT
|
||||||
|
books.id AS id,
|
||||||
|
books.title AS title,
|
||||||
|
authors.name AS author
|
||||||
|
FROM books
|
||||||
|
INNER JOIN books_authors_link ON books.id = books_authors_link.book
|
||||||
|
INNER JOIN authors on authors.id = books_authors_link.author
|
||||||
|
ORDER BY books.id DESC
|
||||||
|
LIMIT 4");
|
||||||
|
|
||||||
|
$types = $db->query("SELECT
|
||||||
|
value
|
||||||
|
FROM custom_column_1
|
||||||
|
ORDER BY value ASC");
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
|
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
|
||||||
|
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
|
||||||
|
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
|
||||||
|
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
|
<title><?php echo $SiteName.': '.$SubName;?></title>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<meta name="description" content=<?php echo '"'.$SiteName.' - '.$SubName.'"/>';?>
|
||||||
|
<meta name="keywords" content="free software, open source, bibliography, cyberpunk, books, media, movies, video games" />
|
||||||
|
<meta name="author" content="Daniel Messer" />
|
||||||
|
|
||||||
|
<!--
|
||||||
|
//////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
FREE HTML5 TEMPLATE
|
||||||
|
DESIGNED & DEVELOPED by FREEHTML5.CO
|
||||||
|
|
||||||
|
Website: http://freehtml5.co/
|
||||||
|
Email: info@freehtml5.co
|
||||||
|
Twitter: http://twitter.com/fh5co
|
||||||
|
Facebook: https://www.facebook.com/fh5co
|
||||||
|
|
||||||
|
//////////////////////////////////////////////////////
|
||||||
|
-->
|
||||||
|
|
||||||
|
<!-- Facebook and Twitter integration -->
|
||||||
|
<meta property="og:title" content=<?php echo '"'.$SiteName.'" />';?>
|
||||||
|
|
||||||
|
<meta property="og:image" content=<?php echo '"'.$SiteURL.'/images/og-site-avatar.jpg" />';?>
|
||||||
|
|
||||||
|
<meta property="og:url" content=<?php echo '"'.$SiteURL.'" />';?>
|
||||||
|
|
||||||
|
<meta property="og:site_name" content=<?php echo '"'.$SiteName.' - '.$SubName.'" />';?>
|
||||||
|
|
||||||
|
<meta property="og:description" content=<?php echo '"'.$SubName.'" />';?>
|
||||||
|
|
||||||
|
<meta name="twitter:title" content=<?php echo '"'.$SiteName.' - '.$SubName.'" />';?>
|
||||||
|
|
||||||
|
<meta name="twitter:image" content=<?php echo '"'.$SiteURL.'/images/og-site-avatar.jpg" />';?>
|
||||||
|
|
||||||
|
<meta name="twitter:url" content=<?php echo '"'.$SiteURL.'" />';?>
|
||||||
|
|
||||||
|
<meta name="twitter:card" content="summary" />
|
||||||
|
|
||||||
|
<!-- Place favicon.ico and apple-touch-icon.png in the root directory -->
|
||||||
|
<link rel="shortcut icon" href="favicon.ico">
|
||||||
|
<!-- Google Fonts -->
|
||||||
|
<link href='http://fonts.googleapis.com/css?family=Playfair+Display:400,700,400italic|Roboto:400,300,700' rel='stylesheet' type='text/css'>
|
||||||
|
<!-- Animate -->
|
||||||
|
<link rel="stylesheet" href="css/animate.css">
|
||||||
|
<!-- Icomoon -->
|
||||||
|
<link rel="stylesheet" href="css/icomoon.css">
|
||||||
|
<!-- Bootstrap -->
|
||||||
|
<link rel="stylesheet" href="css/bootstrap.css">
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="css/style.css">
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Modernizr JS -->
|
||||||
|
<script src="js/modernizr-2.6.2.min.js"></script>
|
||||||
|
<!-- FOR IE9 below -->
|
||||||
|
<!--[if lt IE 9]>
|
||||||
|
<script src="js/respond.min.js"></script>
|
||||||
|
<![endif]-->
|
||||||
|
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="fh5co-offcanvas">
|
||||||
|
<a href="#" class="fh5co-close-offcanvas js-fh5co-close-offcanvas"><span><i class="icon-cross3"></i> <span>Close</span></span></a>
|
||||||
|
<div class="fh5co-bio">
|
||||||
|
<figure>
|
||||||
|
<a href="index.php"><img src="images/avatar.jpg" alt="Infopump Avatar" class="img-responsive"></a>
|
||||||
|
</figure>
|
||||||
|
<h3 class="heading">About the Project</h3>
|
||||||
|
<a href="index.php"><h2>Infopump</h2></a>
|
||||||
|
<p>A bibliographic management and display system.<br /><a href="about.php">More info</a></p>
|
||||||
|
<hr>
|
||||||
|
<p>A free, open source project from:<br />
|
||||||
|
<a href="https://rss.com/podcasts/l0wl1f3podcast/">The L0WL1F3 Podcast</a><br />
|
||||||
|
<a href="https://www.neondystopia.com/">Neon Dystopia</a><br />
|
||||||
|
<a href="https://cyberpunklibrarian.com">Cyberpunk Librarian</a>
|
||||||
|
</p>
|
||||||
|
<hr>
|
||||||
|
<p>
|
||||||
|
<a href="https://cyberpunklibrarian.nohost.me/gitlab/code/infopump">GitLab</a>
|
||||||
|
</p>
|
||||||
|
<ul class="fh5co-social">
|
||||||
|
<!--<li><a href="#"><i class="icon-twitter"></i></a></li>
|
||||||
|
<li><a href="#"><i class="icon-facebook"></i></a></li>
|
||||||
|
<li><a href="#"><i class="icon-instagram"></i></a></li>-->
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="fh5co-menu">
|
||||||
|
<div class="fh5co-box">
|
||||||
|
<h3 class="heading">Recent Additions</h3>
|
||||||
|
<ul>
|
||||||
|
<?php
|
||||||
|
while ($row = $types->fetchArray()) {
|
||||||
|
$row_value = $row['value'];
|
||||||
|
$row_titlecase = mb_convert_case($row_value, MB_CASE_TITLE, "UTF-8");
|
||||||
|
echo '<li><a href="recent.php?ty='.$row_value.'">'.$row_titlecase.'</a></li>';
|
||||||
|
//echo '<li>'.$row_value.'</li>';
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="fh5co-box">
|
||||||
|
<h3 class="heading">Search</h3>
|
||||||
|
<form action="results.php" method="get">
|
||||||
|
<div class="form-group">
|
||||||
|
<input type="text" class="form-control" name="kw" placeholder="Keyword search">
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- END #fh5co-offcanvas -->
|
||||||
|
<header id="fh5co-header">
|
||||||
|
|
||||||
|
<div class="container-fluid">
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<a href="#" class="js-fh5co-nav-toggle fh5co-nav-toggle"><i></i></a>
|
||||||
|
<ul class="fh5co-social">
|
||||||
|
<!--<li><a href="#"><i class="icon-twitter"></i></a></li>
|
||||||
|
<li><a href="#"><i class="icon-facebook"></i></a></li>
|
||||||
|
<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.php">Infopump - Cyberpunk Culture Database</a></h1>
|
||||||
|
<h3>Latest Additions</h3>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</header>
|
||||||
|
<!-- END #fh5co-header -->
|
||||||
|
|
||||||
|
<!-- BEGIN Featured Covers -->
|
||||||
|
<div class="container-fluid">
|
||||||
|
<div class="row fh5co-post-entry">
|
||||||
|
|
||||||
|
<?php
|
||||||
|
while ($row = $feature->fetchArray()) {
|
||||||
|
$row_id = $row['id'];
|
||||||
|
$row_title = $row['title'];
|
||||||
|
$row_author = $row['author'];
|
||||||
|
|
||||||
|
echo '<article class="col-lg-3 col-md-3 col-sm-3 col-xs-6 col-xxs-12 animate-box">';
|
||||||
|
echo '<figure>';
|
||||||
|
echo '<a href="itemrecord.php?itemid='.$row_id.'"><img src="images/'.$row_id.'.jpg" title="'.$row_title.'" class="img-responsive"></a>';
|
||||||
|
echo '</figure>';
|
||||||
|
echo '<h2 class="fh5co-article-title"><a href="single.html">'.$row_title.'</a></h2>';
|
||||||
|
echo '<span class="fh5co-meta fh5co-date">'.$row_author.'</span>';
|
||||||
|
echo '</article>';
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- END Featured Covers -->
|
||||||
|
|
||||||
|
<footer id="fh5co-footer">
|
||||||
|
<p><small>© Creative Commons By-NC-SA<br> Design by <a href="http://freehtml5.co" target="_blank">FREEHTML5.co</a></small></p>
|
||||||
|
</footer>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!-- jQuery -->
|
||||||
|
<script src="js/jquery.min.js"></script>
|
||||||
|
<!-- jQuery Easing -->
|
||||||
|
<script src="js/jquery.easing.1.3.js"></script>
|
||||||
|
<!-- Bootstrap -->
|
||||||
|
<script src="js/bootstrap.min.js"></script>
|
||||||
|
<!-- Waypoints -->
|
||||||
|
<script src="js/jquery.waypoints.min.js"></script>
|
||||||
|
<!-- Main JS -->
|
||||||
|
<script src="js/main.js"></script>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
||||||
502
archive/itemrecord-old.php
Normal file
502
archive/itemrecord-old.php
Normal file
@@ -0,0 +1,502 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
include_once "settings.php";
|
||||||
|
|
||||||
|
// Get and use an item record ID (ItemRecordID) to use for a data pull
|
||||||
|
$ItemID = htmlspecialchars($_GET["itemid"]);
|
||||||
|
|
||||||
|
// -------------------- BEGIN DATABASE QUERIES --------------------
|
||||||
|
|
||||||
|
// Establish atabase connection
|
||||||
|
$db = new SQLite3('metadata.sqlite');
|
||||||
|
|
||||||
|
// ---------- Pull data from books table ----------
|
||||||
|
$book = $db->query("SELECT id, title, date(timestamp), author_sort, strftime('%Y',pubdate) AS pubyear, date(last_modified) FROM books WHERE id = '$ItemID'");
|
||||||
|
|
||||||
|
while ($row = $book->fetchArray()) {
|
||||||
|
$row_id = $row['id'];
|
||||||
|
$row_title = $row['title'];
|
||||||
|
$row_created = $row['date(timestamp)'];
|
||||||
|
$row_author_sort = $row['author_sort'];
|
||||||
|
$row_pubdate = $row['pubyear'];
|
||||||
|
$row_modified = $row['date(last_modified)'];
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------- Pull data from authors table ----------
|
||||||
|
$author = $db->query("SELECT name FROM authors
|
||||||
|
INNER JOIN books_authors_link
|
||||||
|
ON books_authors_link.author = authors.id
|
||||||
|
WHERE books_authors_link.book = '$ItemID'");
|
||||||
|
|
||||||
|
while ($row = $author->fetchArray()) {
|
||||||
|
$row_creator = $row['name'];
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------- Pull data from comments table ----------
|
||||||
|
$summary = $db->query("SELECT text FROM comments WHERE book = '$ItemID'");
|
||||||
|
|
||||||
|
while ($row = $summary->fetchArray()) {
|
||||||
|
$row_summary = $row['text'];
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------- Pull data from publishers table ----------
|
||||||
|
|
||||||
|
$publisher = $db->query("SELECT name from publishers
|
||||||
|
INNER JOIN books_publishers_link
|
||||||
|
ON books_publishers_link.publisher = publishers.id
|
||||||
|
WHERE books_publishers_link.book = '$ItemID'");
|
||||||
|
|
||||||
|
while ($row = $publisher->fetchArray()) {
|
||||||
|
$row_publisher = $row['name'];
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------- Pull data from tags table ----------
|
||||||
|
|
||||||
|
$tags = $db->query("SELECT name FROM tags
|
||||||
|
INNER JOIN books_tags_link
|
||||||
|
ON books_tags_link.tag = tags.id
|
||||||
|
WHERE tags.name NOT LIKE 'infopump%'
|
||||||
|
AND books_tags_link.book = '$ItemID'");
|
||||||
|
|
||||||
|
// ---------- Pull data from tags table for Similar items ----------
|
||||||
|
|
||||||
|
// New similar tags query
|
||||||
|
$similartags = $db->query("SELECT name FROM tags
|
||||||
|
WHERE name IN (SELECT name FROM tags
|
||||||
|
INNER JOIN books_tags_link
|
||||||
|
ON books_tags_link.tag = tags.id
|
||||||
|
AND books_tags_link.book = '$ItemID'
|
||||||
|
ORDER BY RANDOM() LIMIT 2)");
|
||||||
|
|
||||||
|
$simtag = array();
|
||||||
|
|
||||||
|
while($row = $similartags->fetchArray()) {
|
||||||
|
$simtag[] = $row['name'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$getsimilar = $db->query("SELECT books.id, title, author_sort
|
||||||
|
FROM books
|
||||||
|
INNER JOIN books_tags_link
|
||||||
|
ON books_tags_link.book = books.id
|
||||||
|
INNER JOIN tags
|
||||||
|
ON tags.id = books_tags_link.tag
|
||||||
|
WHERE (tags.name LIKE '$simtag[0]'
|
||||||
|
OR tags.name LIKE '$simtag[1]')
|
||||||
|
AND books.id != '$ItemID' LIMIT 4");
|
||||||
|
|
||||||
|
|
||||||
|
// ---------- Pull data from identifiers table ----------
|
||||||
|
|
||||||
|
$identifiers = $db->query("SELECT type, val FROM identifiers WHERE book = '$ItemID'");
|
||||||
|
|
||||||
|
// ---------- Pull data from languages table ----------
|
||||||
|
|
||||||
|
$languages = $db->query("SELECT languages.lang_code AS lang_code FROM languages
|
||||||
|
INNER JOIN books_languages_link
|
||||||
|
ON books_languages_link.lang_code = languages.id
|
||||||
|
WHERE book = '$ItemID'
|
||||||
|
ORDER BY books_languages_link.item_order");
|
||||||
|
|
||||||
|
// ---------- Pull data from tags table to dertermine type ----------
|
||||||
|
|
||||||
|
$type = $db->query("SELECT custom_column_1.value AS itemtype
|
||||||
|
FROM books_custom_column_1_link
|
||||||
|
INNER JOIN custom_column_1
|
||||||
|
ON custom_column_1.id = books_custom_column_1_link.value
|
||||||
|
WHERE books_custom_column_1_link.book = '$ItemID'");
|
||||||
|
|
||||||
|
while ($row = $type->fetchArray()) {
|
||||||
|
$row_type = mb_convert_case($row['itemtype'], MB_CASE_TITLE, "UTF-8");
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------- Pull series information ----------
|
||||||
|
|
||||||
|
$series = $db->query("SELECT series.name AS series, books.series_index AS seriesindex
|
||||||
|
FROM series
|
||||||
|
INNER JOIN books_series_link
|
||||||
|
ON books_series_link.series = series.id
|
||||||
|
INNER JOIN books
|
||||||
|
ON books.id = books_series_link.book
|
||||||
|
WHERE books_series_link.book = '$ItemID'");
|
||||||
|
|
||||||
|
while ($row = $series->fetchArray()) {
|
||||||
|
$row_series = $row['series'];
|
||||||
|
$row_seriesindex = $row['seriesindex'];
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------- Pull publisher location information ----------
|
||||||
|
|
||||||
|
$publisher_location = $db->query("SELECT custom_column_2.value AS publoc
|
||||||
|
FROM books
|
||||||
|
INNER JOIN
|
||||||
|
books_custom_column_2_link
|
||||||
|
ON books_custom_column_2_link.book = books.id
|
||||||
|
INNER JOIN
|
||||||
|
custom_column_2
|
||||||
|
ON custom_column_2.id = books_custom_column_2_link.value
|
||||||
|
WHERE
|
||||||
|
books.id = '$ItemID'");
|
||||||
|
|
||||||
|
while ($row = $publisher_location->fetchArray()) {
|
||||||
|
$row_publocation = $row['publoc'];
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------- Pull subtype information ----------
|
||||||
|
|
||||||
|
$subtype = $db->query("SELECT custom_column_3.value AS subtype
|
||||||
|
FROM books
|
||||||
|
INNER JOIN
|
||||||
|
books_custom_column_3_link
|
||||||
|
ON books_custom_column_3_link.book = books.id
|
||||||
|
INNER JOIN
|
||||||
|
custom_column_3
|
||||||
|
ON custom_column_3.id = books_custom_column_3_link.value
|
||||||
|
WHERE
|
||||||
|
books.id = '$ItemID'");
|
||||||
|
|
||||||
|
while ($row = $subtype->fetchArray()) {
|
||||||
|
$row_subtype = $row['subtype'];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// -------------------- END DATABASE QUERIES --------------------
|
||||||
|
|
||||||
|
?>
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
|
||||||
|
<meta name="description" content=<?php echo '"Infopump - Item record - '.$row_title.'"/>'; ?>
|
||||||
|
<meta name="keywords" content="infopump, bibliography, media, catalog" />
|
||||||
|
<meta name="author" content="Daniel Messer" />
|
||||||
|
|
||||||
|
<!-- Social Media Integration -->
|
||||||
|
<meta property="og:title" content=<?php echo '"'.$SiteName.' - Item Record" />';?>
|
||||||
|
|
||||||
|
<meta property="og:image" content=<?php echo '"'.$SiteURL.'/images/'.$row_id.'.jpg" />'; ?>
|
||||||
|
|
||||||
|
<meta property="og:url" content=<?php echo '"'.$SiteURL.'/itemrecord.php?itemid='.$row_id.'" />'; ?>
|
||||||
|
|
||||||
|
<meta property="og:site_name" content=<?php echo '"'.$SiteName.'" />'; ?>
|
||||||
|
|
||||||
|
<meta property="og:description" content=<?php echo '"'.$row_title.' - '.$row_creator.'" />'; ?>
|
||||||
|
|
||||||
|
<meta name="twitter:title" content=<?php echo '"'.$row_title.' - '.$row_creator.'" />'; ?>
|
||||||
|
|
||||||
|
<meta name="twitter:image" content=<?php echo '"'.$SiteURL.'/images/'.$row_id.'.jpg" />'; ?>
|
||||||
|
|
||||||
|
<meta name="twitter:url" content=<?php echo '"'.$SiteURL.'/itemrecord.php?itemid='.$row_id.'" />'; ?>
|
||||||
|
|
||||||
|
<meta name="twitter:card" content="summary" />
|
||||||
|
|
||||||
|
<!-- Zotero and RDF Related Metadata -->
|
||||||
|
|
||||||
|
<meta name="citation_title" content=<?php echo '"'.$row_title.'" />'; ?>
|
||||||
|
|
||||||
|
<meta name="citation_authors" content=<?php echo '"'.$row_author_sort.'" />'; ?>
|
||||||
|
|
||||||
|
<meta name="citation_publisher" content=<?php echo '"'.$row_publisher.'" />'; ?>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
while ($row = $identifiers->fetchArray()) {
|
||||||
|
$row_id_type = $row['type'];
|
||||||
|
$row_id_val = $row['val'];
|
||||||
|
if ($row_id_type == 'isbn') {
|
||||||
|
echo '<meta name="citation_isbn" content="'.$row_id_val.'" />';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
|
<?php echo '<title>Item Record: '.$row_title.'</title>'; ?>
|
||||||
|
<!-- Favicon-->
|
||||||
|
<link rel="icon" type="image/x-icon" href="item/assets/favicon.ico" />
|
||||||
|
<!-- Bootstrap icons-->
|
||||||
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.5.0/font/bootstrap-icons.css" rel="stylesheet" />
|
||||||
|
<!-- Core theme CSS (includes Bootstrap)-->
|
||||||
|
<link href="item/css/styles.css" rel="stylesheet" />
|
||||||
|
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<!-- Navigation-->
|
||||||
|
<nav class="navbar navbar-expand-lg navbar-light bg-light">
|
||||||
|
<div class="container px-4 px-lg-5">
|
||||||
|
<a class="navbar-brand" href="#!"><?php echo '<strong>'.$row_title.'</strong> | Item Record '.$ItemID; ?></a>
|
||||||
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"><span class="navbar-toggler-icon"></span></button>
|
||||||
|
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
||||||
|
<ul class="navbar-nav me-auto mb-2 mb-lg-0 ms-lg-4">
|
||||||
|
<li class="nav-item"><a class="nav-link active" aria-current="page" href="index.php">Home</a></li>
|
||||||
|
<!-- <li class="nav-item"><a class="nav-link" href="#!">About</a></li>
|
||||||
|
<li class="nav-item dropdown">
|
||||||
|
<a class="nav-link dropdown-toggle" id="navbarDropdown" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">Shop</a>
|
||||||
|
<ul class="dropdown-menu" aria-labelledby="navbarDropdown">
|
||||||
|
<li><a class="dropdown-item" href="#!">All Products</a></li>
|
||||||
|
<li><hr class="dropdown-divider" /></li>
|
||||||
|
<li><a class="dropdown-item" href="#!">Popular Items</a></li>
|
||||||
|
<li><a class="dropdown-item" href="#!">New Arrivals</a></li>
|
||||||
|
</ul>
|
||||||
|
</li> -->
|
||||||
|
</ul>
|
||||||
|
<!-- <form class="d-flex">
|
||||||
|
<button class="btn btn-outline-dark" type="submit">
|
||||||
|
<i class="bi-cart-fill me-1"></i>
|
||||||
|
Cart
|
||||||
|
<span class="badge bg-dark text-white ms-1 rounded-pill">0</span>
|
||||||
|
</button>
|
||||||
|
</form> -->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
|
<!-- Product section-->
|
||||||
|
<section class="py-5">
|
||||||
|
<div class="container px-4 px-lg-5 my-5">
|
||||||
|
<div class="row gx-4 gx-lg-5 align-items-top">
|
||||||
|
<div class="col-md-6"><img class="card-img-top mb-5 mb-md-0" src="images/<?php echo $row_id.'.jpg' ?>" alt="<?php echo $row_title; ?>" title="<?php echo $row_title; ?>" /></div>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="small mb-1"><?php echo 'Item Record '.$ItemID; ?></div>
|
||||||
|
<h1 class="display-5 fw-bolder"><?php echo $row_title; ?></h1>
|
||||||
|
<div class="medium">
|
||||||
|
<?php
|
||||||
|
if ($row_series) {
|
||||||
|
echo '<hr />';
|
||||||
|
echo '<strong>Number '.$row_seriesindex.' in the <a href="results.php?se='.$row_series.'">'.$row_series.' </a>series</strong><br />';
|
||||||
|
echo '<hr />';
|
||||||
|
} else {
|
||||||
|
echo '<hr>';
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
<p class="lead"><?php echo $row_summary; ?></p>
|
||||||
|
<div class="d-flex">
|
||||||
|
<!-- <input class="form-control text-center me-3" id="inputQuantity" type="num" value="1" style="max-width: 3rem" />
|
||||||
|
<button class="btn btn-outline-dark flex-shrink-0" type="button">
|
||||||
|
<i class="bi-cart-fill me-1"></i>
|
||||||
|
Add to cart
|
||||||
|
</button> -->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row gx-4 gx-lg-5 align-items-top">
|
||||||
|
<div class="col-md-6"> <!-- BEGIN CITATIONS -->
|
||||||
|
<a name="citations"></a>
|
||||||
|
<h3 class="fw-bolder"><u>Bibliographic Citations</u></h3><br />
|
||||||
|
<p class = "small"><em>Note: You may need to slightly edit citations for final use. Citations are based upon available data. Refer to your format guides for proper bibliographic citations.</em></p>
|
||||||
|
|
||||||
|
<!-- BEGIN CHICAGO CITATION -->
|
||||||
|
<p class="metadata"><strong>Chicago</strong></p>
|
||||||
|
<?php
|
||||||
|
if ($row_type == 'Text') {
|
||||||
|
echo '<p class="metadata">'.$row_author_sort.'. <em>'.$row_title.'.</em> '.$row_publocation.': '.$row_publisher.', '.$row_pubdate.'.<br />';
|
||||||
|
echo '<div id=chicago style="display: none;">';
|
||||||
|
echo '<p>'.$row_author_sort.'. <em>'.$row_title.'.</em> '.$row_publocation.': '.$row_publisher.', '.$row_pubdate.'</p>';
|
||||||
|
echo '</div>';
|
||||||
|
} elseif ($row_type == 'Music') {
|
||||||
|
echo '<p class="metadata">'.$row_author_sort.', <em>'.$row_title.'.</em> '.$row_publisher.', '.$row_pubdate.'.<br />';
|
||||||
|
echo '<div id=chicago style="display: none;">';
|
||||||
|
echo '<p>'.$row_author_sort.', "'.$row_title.'." '.$row_publisher.', '.$row_pubdate.'</p>';
|
||||||
|
echo '</div>';
|
||||||
|
} else {
|
||||||
|
echo '<p class="metadata">'.$row_author_sort.', director. <em>'.$row_title.'.</em> '.$row_publisher.', '.$row_pubdate.'.<br />';
|
||||||
|
echo '<div id=chicago style="display: none;">';
|
||||||
|
echo '<p><p class="metadata">'.$row_author_sort.', director. <em>'.$row_title.'.</em> '.$row_publisher.', '.$row_pubdate.'</p>';
|
||||||
|
echo '</div>';
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<a href="#citations" onclick="copyToClip(document.getElementById('chicago').innerHTML)">Copy Chicago citation</a></p>
|
||||||
|
<script>
|
||||||
|
function copyToClip(str) {
|
||||||
|
function listener(e) {
|
||||||
|
e.clipboardData.setData("text/html", str);
|
||||||
|
e.clipboardData.setData("text/plain", str);
|
||||||
|
e.preventDefault();
|
||||||
|
}
|
||||||
|
document.addEventListener("copy", listener);
|
||||||
|
document.execCommand("copy");
|
||||||
|
document.removeEventListener("copy", listener);
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<!-- END CHICAGO CITATION -->
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
<!-- BEGIN APA CITATION -->
|
||||||
|
<p class="metadata"><strong>APA</strong></p>
|
||||||
|
<?php
|
||||||
|
$APA_author = explode(', ' ,$row_author_sort);
|
||||||
|
$APA_first = mb_strimwidth($APA_author[1], 0, 1);
|
||||||
|
|
||||||
|
if ($row_type == 'Text') {
|
||||||
|
echo '<p class="metadata">'.$APA_author[0].', '.$APA_first.'. ('.$row_pubdate.'). '.$row_title.'. '.$row_publisher.'.</p>';
|
||||||
|
echo '<div id=apa style="display: none;">';
|
||||||
|
echo '<p>'.$APA_author[0].', '.$APA_first.'. ('.$row_pubdate.'). '.$row_title.'. '.$row_publisher.'.</p>';
|
||||||
|
echo '</div>';
|
||||||
|
} elseif ($row_type == 'Music') {
|
||||||
|
echo '<p class="metadata">'.$row_creator.'. ('.$row_pubdate.'). <em>'.$row_title.'</em> [Album]. '.$row_publisher.'.</p>';
|
||||||
|
echo '<div id=apa style="display: none;">';
|
||||||
|
echo '<p>'.$row_creator.'. ('.$row_pubdate.'). <em>'.$row_title.'</em>. '.$row_publisher.'.</p>';
|
||||||
|
echo '</div>';
|
||||||
|
} else {
|
||||||
|
echo '<p class="metadata">'.$APA_author[0].', '.$APA_first.'. (Director). ('.$row_pubdate.'). <em>'.$row_title.'</em> [Film]. '.$row_publisher.'.</p>';
|
||||||
|
echo '<div id=apa style="display: none;">';
|
||||||
|
echo '<p>'.$APA_author[0].', '.$APA_first.'. (Director). ('.$row_pubdate.'). <em>'.$row_title.'</em> [Film]. '.$row_publisher.'.</p>';
|
||||||
|
echo '</div>';
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<a href="#citations" onclick="copyToClip(document.getElementById('apa').innerHTML)">Copy APA citation</a></p>
|
||||||
|
<script>
|
||||||
|
function copyToClip(str) {
|
||||||
|
function listener(e) {
|
||||||
|
e.clipboardData.setData("text/html", str);
|
||||||
|
e.clipboardData.setData("text/plain", str);
|
||||||
|
e.preventDefault();
|
||||||
|
}
|
||||||
|
document.addEventListener("copy", listener);
|
||||||
|
document.execCommand("copy");
|
||||||
|
document.removeEventListener("copy", listener);
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<!-- END APA CITATION -->
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
<!-- MLA CITATION -->
|
||||||
|
<p class="metadata"><strong>MLA</strong></p>
|
||||||
|
<?php
|
||||||
|
if ($row_type == 'Text') {
|
||||||
|
echo '<p class="metadata">'.$row_author_sort.'. <em>'.$row_title.'.</em> '.$row_publisher.', '.$row_pubdate.'.<br />';
|
||||||
|
echo '<div id=mla style="display: none;">';
|
||||||
|
echo '<p>'.$row_author_sort.'. <em>'.$row_title.'.</em> '.$row_publisher.', '.$row_pubdate.'.</p>';
|
||||||
|
echo '</div>';
|
||||||
|
} elseif ($row_type == 'Music') {
|
||||||
|
echo '<p class="metadata">'.$row_author_sort.'. <em>'.$row_title.'.</em> '.$row_publisher.', '.$row_pubdate.'.<br />';
|
||||||
|
echo '<div id=mla style="display: none;">';
|
||||||
|
echo '<p>'.$row_author_sort.'. <em>'.$row_title.'.</em> '.$row_publisher.', '.$row_pubdate.'.</p>';
|
||||||
|
echo '</div>';
|
||||||
|
} else {
|
||||||
|
echo '<p class="metadata">'.$row_author_sort.', director. <em>'.$row_title.'.</em> '.$row_publisher.', '.$row_pubdate.'.<br />';
|
||||||
|
echo '<div id=mla style="display: none;">';
|
||||||
|
echo '<p>'.$row_author_sort.', director. <em>'.$row_title.'.</em> '.$row_publisher.', '.$row_pubdate.'.</p>';
|
||||||
|
echo '</div>';
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
<a href="#citations" onclick="copyToClip(document.getElementById('mla').innerHTML)">Copy MLA citation</a></p>
|
||||||
|
<script>
|
||||||
|
function copyToClip(str) {
|
||||||
|
function listener(e) {
|
||||||
|
e.clipboardData.setData("text/html", str);
|
||||||
|
e.clipboardData.setData("text/plain", str);
|
||||||
|
e.preventDefault();
|
||||||
|
}
|
||||||
|
document.addEventListener("copy", listener);
|
||||||
|
document.execCommand("copy");
|
||||||
|
document.removeEventListener("copy", listener);
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
</div> <!-- END CITATIONS -->
|
||||||
|
|
||||||
|
<!-- BEGIN METADATA -->
|
||||||
|
<div class="col-md-6">
|
||||||
|
<h3 class="fw-bolder"><u>Metadata</u></h3>
|
||||||
|
<p class="metadata"><br />
|
||||||
|
<?php
|
||||||
|
echo '<strong>Item Control Number: </strong>'.$ItemID.'<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 />';
|
||||||
|
if ($row_series) {
|
||||||
|
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>Publisher:</strong> '.$row_publisher.'<br />';
|
||||||
|
echo '<strong>Location:</strong> '.$row_publocation.'<br />';
|
||||||
|
echo '<strong>Date: </strong>'.$row_pubdate.'<br />';
|
||||||
|
echo '<strong>Type: </strong> <a href="results.php?ty='.$row_type.'">'.$row_type.'</a><br />';
|
||||||
|
echo '<strong>Subtype: </strong> <a href="results.php?st='.$row_subtype.'">'.$row_subtype.'</a><br />';
|
||||||
|
echo '<strong>Subjects: </strong>';
|
||||||
|
while ($row = $tags->fetchArray()) {
|
||||||
|
$row_tags = $row['name'];
|
||||||
|
//echo '['.$row_tags.'] ';
|
||||||
|
echo '[<a href="results.php?su='.$row_tags.'">'.$row_tags.'</a>]';
|
||||||
|
}
|
||||||
|
echo '<br/ ><strong>Identifiers: </strong><br />';
|
||||||
|
while ($row = $identifiers->fetchArray()) {
|
||||||
|
$row_id_type = $row['type'];
|
||||||
|
$row_id_val = $row['val'];
|
||||||
|
//echo '<span style="margin-left: 10px;">'.$row_id_type.': ' .$row_id_val.'</span><br />';
|
||||||
|
if ($row_id_type == 'google') {
|
||||||
|
$identifierURL = 'https://books.google.com/books?id=';
|
||||||
|
} elseif ($row_id_type == 'isbn') {
|
||||||
|
$identifierURL = 'https://www.librarything.com/isbn/';
|
||||||
|
} elseif ($row_id_type == 'oclc') {
|
||||||
|
$identifierURL = 'https://worldcat.org/title/';
|
||||||
|
} elseif ($row_id_type == 'tmdb') {
|
||||||
|
$identifierURL = 'https://www.themoviedb.org/movie/';
|
||||||
|
} else {
|
||||||
|
$identifierURL = '#';
|
||||||
|
}
|
||||||
|
echo '<span style="margin-left: 10px;">'.$row_id_type.': <a href="'.$identifierURL.$row_id_val.'" target="_blank">'.$row_id_val.'</a></span><br />';
|
||||||
|
}
|
||||||
|
echo '<strong>Language(s): </strong>';
|
||||||
|
while ($row = $languages->fetchArray()) {
|
||||||
|
$row_lang_code = $row['lang_code'];
|
||||||
|
echo '[ '.$row_lang_code.' ] ';
|
||||||
|
}
|
||||||
|
echo '<br /><strong>Created: </strong>'.$row_created.'<br />';
|
||||||
|
echo '<strong>Last Modified: </strong>'.$row_modified;
|
||||||
|
?>
|
||||||
|
</p>
|
||||||
|
</div> <!-- END METADATA -->
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
<!-- Related items section-->
|
||||||
|
<section class="py-5 bg-light">
|
||||||
|
<div class="container px-4 px-lg-5 mt-5">
|
||||||
|
<h2 class="fw-bolder mb-4">Similar items</h2>
|
||||||
|
<div class="row gx-4 gx-lg-5 row-cols-2 row-cols-md-3 row-cols-xl-4 justify-content-center"> <!-- Begin Similar Items display area -->
|
||||||
|
<?php
|
||||||
|
while ($row = $getsimilar->fetchArray()) {
|
||||||
|
$row_simbookid = $row['id'];
|
||||||
|
$row_simtitle = $row['title'];
|
||||||
|
$row_simauthorsort = $row['author_sort'];
|
||||||
|
echo '<div class="col mb-5"> <!-- Begin Similar Items card -->';
|
||||||
|
echo '<div class="card h-100">';
|
||||||
|
echo '<!-- Item image-->';
|
||||||
|
echo '<a href="itemrecord.php?itemid='.$row_simbookid.'"><img class="card-img-top" src="images/'.$row_simbookid.'.jpg" /></a>';
|
||||||
|
echo '<!-- Product details-->';
|
||||||
|
echo '<div class="card-body p-4">';
|
||||||
|
echo '<div class="text-center">';
|
||||||
|
echo '<!-- Item name-->';
|
||||||
|
echo '<h5 class="fw-bolder">'.$row_simtitle.'</h5>';
|
||||||
|
echo '<!-- Item creator-->';
|
||||||
|
echo $row_simauthorsort;
|
||||||
|
echo '</div>';
|
||||||
|
echo '</div>';
|
||||||
|
echo '<!-- Item actions-->';
|
||||||
|
echo '<div class="card-footer p-4 pt-0 border-top-0 bg-transparent">';
|
||||||
|
echo '<div class="text-center"><a class="btn btn-outline-dark mt-auto" href="itemrecord.php?itemid='.$row_simbookid.'">View Item</a></div>';
|
||||||
|
echo '</div>';
|
||||||
|
echo '</div>';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
echo '</div> <!-- End Similar Items card -->';
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</div> <!-- End Similar Items display area -->
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
<!-- Footer-->
|
||||||
|
<footer class="py-5 bg-dark">
|
||||||
|
<div class="container"><p class="m-0 text-center text-white">Copyright - Creative Commons By-NC-SA - Infopump</p></div>
|
||||||
|
</footer>
|
||||||
|
<!-- Bootstrap core JS-->
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js"></script>
|
||||||
|
<!-- Core theme JS-->
|
||||||
|
<script src="item/js/scripts.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
381
archive/results-old.php
Normal file
381
archive/results-old.php
Normal file
@@ -0,0 +1,381 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
include_once "settings.php";
|
||||||
|
|
||||||
|
// Get and use a basic title search for pulling records.
|
||||||
|
$keywordsearch = htmlspecialchars($_GET["kw"]);
|
||||||
|
$authorsearch = htmlspecialchars($_GET["au"]);
|
||||||
|
$typesearch = htmlspecialchars($_GET["ty"]);
|
||||||
|
$subtypesearch = htmlspecialchars($_GET["st"]);
|
||||||
|
$seriessearch = htmlspecialchars($_GET["se"]);
|
||||||
|
$subjectsearch = htmlspecialchars($_GET["su"]);
|
||||||
|
|
||||||
|
$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");
|
||||||
|
$socialst = mb_convert_case($subtypesearch, MB_CASE_TITLE, "UTF-8");
|
||||||
|
$socialse = mb_convert_case($seriessearch, MB_CASE_TITLE, "UTF-8");
|
||||||
|
$socialsu = mb_convert_case($subjectsearch, MB_CASE_TITLE, "UTF-8");
|
||||||
|
|
||||||
|
if (!empty($keywordsearch)) {
|
||||||
|
$searchtopic = 'Keyword: '.$socialkw;
|
||||||
|
} elseif (!empty($authorsearch)) {
|
||||||
|
$searchtopic = 'Author: '.$socialau;
|
||||||
|
} elseif (!empty($typesearch)) {
|
||||||
|
$searchtopic = 'Type: '.$socialty;
|
||||||
|
} elseif (!empty($seriessearch)) {
|
||||||
|
$searchtopic = 'Series: '.$socialse;
|
||||||
|
} elseif (!empty($subjectsearch)) {
|
||||||
|
$searchtopic = 'Subject: '.$socialsu;
|
||||||
|
} else {
|
||||||
|
$searchtopic = 'Subtype: '.$socialst;
|
||||||
|
}
|
||||||
|
|
||||||
|
// -------------------- BEGIN DATABASE QUERIES --------------------
|
||||||
|
|
||||||
|
// Establish atabase connection
|
||||||
|
$db = new SQLite3('metadata.sqlite');
|
||||||
|
|
||||||
|
$keywordquery = $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.title LIKE '%$keywordsearch%'
|
||||||
|
OR books.author_sort LIKE '%$keywordsearch%'
|
||||||
|
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
|
||||||
|
WHERE books.author_sort LIKE '%$authorsearch%'
|
||||||
|
ORDER BY books.title ASC");
|
||||||
|
|
||||||
|
$typequery = $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_custom_column_1_link ON books_custom_column_1_link.book = books.id
|
||||||
|
INNER JOIN
|
||||||
|
custom_column_1 ON custom_column_1.id = books_custom_column_1_link.value
|
||||||
|
WHERE
|
||||||
|
custom_column_1.value = '$typesearch'
|
||||||
|
ORDER BY books.title ASC");
|
||||||
|
|
||||||
|
$subtypequery = $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_custom_column_3_link ON books_custom_column_3_link.book = books.id
|
||||||
|
INNER JOIN
|
||||||
|
custom_column_3 ON custom_column_3.id = books_custom_column_3_link.value
|
||||||
|
WHERE
|
||||||
|
custom_column_3.value = '$subtypesearch'
|
||||||
|
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");
|
||||||
|
|
||||||
|
$subjectquery = $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 tags.name = '$subjectsearch'
|
||||||
|
ORDER BY books.title ASC");
|
||||||
|
|
||||||
|
$types = $db->query("SELECT
|
||||||
|
value
|
||||||
|
FROM custom_column_1
|
||||||
|
ORDER BY value ASC");
|
||||||
|
|
||||||
|
$subtypes = $db->query("SELECT
|
||||||
|
value
|
||||||
|
FROM custom_column_3
|
||||||
|
ORDER BY value ASC");
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
|
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
|
||||||
|
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
|
||||||
|
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
|
||||||
|
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
|
<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" />
|
||||||
|
<meta name="author" content="FREEHTML5.CO" />
|
||||||
|
|
||||||
|
<!--
|
||||||
|
//////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
FREE HTML5 TEMPLATE
|
||||||
|
DESIGNED & DEVELOPED by FREEHTML5.CO
|
||||||
|
|
||||||
|
Website: http://freehtml5.co/
|
||||||
|
Email: info@freehtml5.co
|
||||||
|
Twitter: http://twitter.com/fh5co
|
||||||
|
Facebook: https://www.facebook.com/fh5co
|
||||||
|
|
||||||
|
//////////////////////////////////////////////////////
|
||||||
|
-->
|
||||||
|
|
||||||
|
<!-- Facebook and Twitter integration -->
|
||||||
|
<meta property="og:title" content=<?php echo '"'.$SiteName.' - Search - '.$searchtopic.'" />';?>
|
||||||
|
|
||||||
|
<meta property="og:image" content=<?php echo '"'.$SiteURL.'/images/og-site-avatar.jpg" />';?>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
if (!empty($keywordsearch)) {
|
||||||
|
echo '<meta property="og:url" content="'.$SiteURL.'/results.php?kw='.$socialkw.'" />';
|
||||||
|
echo '<meta name="twitter:url" content="'.$SiteURL.'/results.php?kw='.$socialkw.'" />';
|
||||||
|
} elseif (!empty($authorsearch)) {
|
||||||
|
echo '<meta property="og:url" content="'.$SiteURL.'/results.php?au='.$socialau.'" />';
|
||||||
|
echo '<meta name="twitter:url" content="'.$SiteURL.'/results.php?au='.$socialau.'" />';
|
||||||
|
} elseif (!empty($typesearch)) {
|
||||||
|
echo '<meta property="og:url" content="'.$SiteURL.'/results.php?ty='.$socialty.'" />';
|
||||||
|
echo '<meta name="twitter:url" content="'.$SiteURL.'/results.php?ty='.$socialty.'" />';
|
||||||
|
} elseif (!empty($seriessearch)) {
|
||||||
|
echo '<meta property="og:url" content="'.$SiteURL.'/results.php?ty='.$socialse.'" />';
|
||||||
|
echo '<meta name="twitter:url" content="'.$SiteURL.'/results.php?ty='.$socialse.'" />';
|
||||||
|
} elseif (!empty($subjectsearch)) {
|
||||||
|
echo '<meta property="og:url" content="'.$SiteURL.'/results.php?ty='.$socialsu.'" />';
|
||||||
|
echo '<meta name="twitter:url" content="'.$SiteURL.'/results.php?ty='.$socialsu.'" />';
|
||||||
|
} else {
|
||||||
|
echo '<meta property="og:url" content="'.$SiteURL.'/results.php?ty='.$socialst.'" />';
|
||||||
|
echo '<meta name="twitter:url" content="'.$SiteURL.'/results.php?ty='.$socialst.'" />';
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
|
<meta property="og:site_name" content=<?php echo '"'.$SiteName.' - Search Results" />';?>
|
||||||
|
|
||||||
|
<meta property="og:description" content=<?php echo '"'.$SubName.'" />';?>
|
||||||
|
|
||||||
|
<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:card" content="summary" />
|
||||||
|
|
||||||
|
<!-- Place favicon.ico and apple-touch-icon.png in the root directory -->
|
||||||
|
<link rel="shortcut icon" href="favicon.ico">
|
||||||
|
<!-- Google Fonts -->
|
||||||
|
<link href='http://fonts.googleapis.com/css?family=Playfair+Display:400,700,400italic|Roboto:400,300,700' rel='stylesheet' type='text/css'>
|
||||||
|
<!-- Animate -->
|
||||||
|
<link rel="stylesheet" href="css/animate.css">
|
||||||
|
<!-- Icomoon -->
|
||||||
|
<link rel="stylesheet" href="css/icomoon.css">
|
||||||
|
<!-- Bootstrap -->
|
||||||
|
<link rel="stylesheet" href="css/bootstrap.css">
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="css/style.css">
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Modernizr JS -->
|
||||||
|
<script src="js/modernizr-2.6.2.min.js"></script>
|
||||||
|
<!-- FOR IE9 below -->
|
||||||
|
<!--[if lt IE 9]>
|
||||||
|
<script src="js/respond.min.js"></script>
|
||||||
|
<![endif]-->
|
||||||
|
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="fh5co-offcanvas">
|
||||||
|
<a href="#" class="fh5co-close-offcanvas js-fh5co-close-offcanvas"><span><i class="icon-cross3"></i> <span>Close</span></span></a>
|
||||||
|
<div class="fh5co-bio">
|
||||||
|
<figure>
|
||||||
|
<a href="index.php"><img src="images/avatar.jpg" alt="Infopump Avatar" class="img-responsive"></a>
|
||||||
|
</figure>
|
||||||
|
<h3 class="heading">About the Project</h3>
|
||||||
|
<a href="index.php"><h2>Infopump</h2></a>
|
||||||
|
<p>A bibliographic management and display system.</p>
|
||||||
|
<hr>
|
||||||
|
<p>A free, open source project from:<br />
|
||||||
|
<a href="https://rss.com/podcasts/l0wl1f3podcast/">The L0WL1F3 Podcast</a><br />
|
||||||
|
<a href="https://www.neondystopia.com/">Neon Dystopia</a><br />
|
||||||
|
<a href="https://cyberpunklibrarian.com">Cyberpunk Librarian</a>
|
||||||
|
</p>
|
||||||
|
<ul class="fh5co-social">
|
||||||
|
<!--<li><a href="#"><i class="icon-twitter"></i></a></li>-->
|
||||||
|
<!--<li><a href="#"><i class="icon-facebook"></i></a></li>
|
||||||
|
<li><a href="#"><i class="icon-instagram"></i></a></li>-->
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="fh5co-menu">
|
||||||
|
<div class="fh5co-box">
|
||||||
|
<h3 class="heading">Recent Additions</h3>
|
||||||
|
<ul>
|
||||||
|
<?php
|
||||||
|
while ($row = $types->fetchArray()) {
|
||||||
|
$row_value = $row['value'];
|
||||||
|
$row_titlecase = mb_convert_case($row_value, MB_CASE_TITLE, "UTF-8");
|
||||||
|
echo '<li><a href="recent.php?ty='.$row_value.'">'.$row_titlecase.'</a></li>';
|
||||||
|
//echo '<li>'.$row_value.'</li>';
|
||||||
|
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="fh5co-box">
|
||||||
|
<h3 class="heading">Search</h3>
|
||||||
|
<form action="results.php" method="get">
|
||||||
|
<div class="form-group">
|
||||||
|
<input type="text" class="form-control" name="kw" placeholder="Keyword search">
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- END #fh5co-offcanvas -->
|
||||||
|
<header id="fh5co-header">
|
||||||
|
|
||||||
|
<div class="container-fluid">
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<a href="#" class="js-fh5co-nav-toggle fh5co-nav-toggle"><i></i></a>
|
||||||
|
<!-- <ul class="fh5co-social">
|
||||||
|
<li><a href="#"><i class="icon-twitter"></i></a></li>
|
||||||
|
<li><a href="#"><i class="icon-facebook"></i></a></li>
|
||||||
|
<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.php">Search Results<br /><br /><?php echo $searchtopic; ?></a></h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</header>
|
||||||
|
<!-- END #fh5co-header -->
|
||||||
|
<div class="container-fluid">
|
||||||
|
<div class="row fh5co-post-entry single-entry">
|
||||||
|
<article class="col-lg-8 col-lg-offset-2 col-md-8 col-md-offset-2 col-sm-8 col-sm-offset-2 col-xs-12 col-xs-offset-0">
|
||||||
|
<div class="col-lg-12 col-lg-offset-0 col-md-12 col-md-offset-0 col-sm-12 col-sm-offset-0 col-xs-12 col-xs-offset-0 text-left content-article">
|
||||||
|
<div class="row rp-b">
|
||||||
|
<div class="col-md-12 animate-box">
|
||||||
|
<?php
|
||||||
|
if ($keywordsearch != '') {
|
||||||
|
while ($row = $keywordquery->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>';
|
||||||
|
}
|
||||||
|
} elseif ($typesearch != '') {
|
||||||
|
while ($row = $typequery->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>';
|
||||||
|
}
|
||||||
|
} elseif ($authorsearch != '') {
|
||||||
|
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>';
|
||||||
|
}
|
||||||
|
} elseif ($seriessearch != '') {
|
||||||
|
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>';
|
||||||
|
}
|
||||||
|
} elseif ($subjectsearch != '') {
|
||||||
|
while ($row = $subjectquery->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>';
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
while ($row = $subtypequery->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>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</article>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<footer id="fh5co-footer">
|
||||||
|
<p><small>© Creative Commons By-NC-SA<br> Design by <a href="http://freehtml5.co" target="_blank">FREEHTML5.co</a></small></p>
|
||||||
|
</footer>
|
||||||
|
|
||||||
|
<!-- jQuery -->
|
||||||
|
<script src="js/jquery.min.js"></script>
|
||||||
|
<!-- jQuery Easing -->
|
||||||
|
<script src="js/jquery.easing.1.3.js"></script>
|
||||||
|
<!-- Bootstrap -->
|
||||||
|
<script src="js/bootstrap.min.js"></script>
|
||||||
|
<!-- Waypoints -->
|
||||||
|
<script src="js/jquery.waypoints.min.js"></script>
|
||||||
|
<!-- Main JS -->
|
||||||
|
<script src="js/main.js"></script>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
||||||
24
archive/settings-old.php
Normal file
24
archive/settings-old.php
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
$sitesettings = new SQLite3('settings.sqlite');
|
||||||
|
|
||||||
|
$getName = $sitesettings->query('SELECT description FROM site WHERE id = 1');
|
||||||
|
|
||||||
|
while ($row = $getName->fetchArray()) {
|
||||||
|
$SiteName = $row['description'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$getSubName = $sitesettings->query('SELECT description FROM site WHERE id = 2');
|
||||||
|
|
||||||
|
while ($row = $getSubName->fetchArray()) {
|
||||||
|
$SubName = $row['description'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$getURL = $sitesettings->query('SELECT description FROM site WHERE id = 3');
|
||||||
|
|
||||||
|
while ($row = $getURL->fetchArray()) {
|
||||||
|
$SiteURL = $row['description'];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
?>
|
||||||
213
index.php
213
index.php
@@ -1,28 +1,78 @@
|
|||||||
<?php
|
<?php
|
||||||
|
// Enable error reporting for development (remove in production)
|
||||||
|
error_reporting(E_ALL);
|
||||||
|
ini_set('display_errors', 1);
|
||||||
|
|
||||||
|
// Include settings
|
||||||
include_once "settings.php";
|
include_once "settings.php";
|
||||||
|
|
||||||
// Set up Calibre database connection
|
// Initialize variables
|
||||||
$db = new SQLite3('metadata.sqlite');
|
$feature = null;
|
||||||
|
$types = null;
|
||||||
|
$db = null;
|
||||||
|
|
||||||
$feature = $db->query("SELECT
|
try {
|
||||||
|
// Set up Calibre database connection with error handling
|
||||||
|
if (!file_exists('metadata.sqlite')) {
|
||||||
|
throw new Exception('Database file not found');
|
||||||
|
}
|
||||||
|
|
||||||
|
$db = new SQLite3('metadata.sqlite');
|
||||||
|
if (!$db) {
|
||||||
|
throw new Exception('Unable to open database');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set timeout to prevent locks
|
||||||
|
$db->busyTimeout(5000);
|
||||||
|
|
||||||
|
// Get featured items (latest 4 by timestamp, not ID)
|
||||||
|
$feature = $db->query("
|
||||||
|
SELECT
|
||||||
books.id AS id,
|
books.id AS id,
|
||||||
books.title AS title,
|
books.title AS title,
|
||||||
authors.name AS author
|
authors.name AS author
|
||||||
FROM books
|
FROM books
|
||||||
INNER JOIN books_authors_link ON books.id = books_authors_link.book
|
INNER JOIN books_authors_link ON books.id = books_authors_link.book
|
||||||
INNER JOIN authors on authors.id = books_authors_link.author
|
INNER JOIN authors ON authors.id = books_authors_link.author
|
||||||
ORDER BY books.id DESC
|
ORDER BY books.timestamp DESC
|
||||||
LIMIT 4");
|
LIMIT 4
|
||||||
|
");
|
||||||
|
|
||||||
$types = $db->query("SELECT
|
if (!$feature) {
|
||||||
value
|
throw new Exception('Failed to fetch featured items');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get types for menu
|
||||||
|
$types = $db->query("
|
||||||
|
SELECT value
|
||||||
FROM custom_column_1
|
FROM custom_column_1
|
||||||
ORDER BY value ASC");
|
ORDER BY value ASC
|
||||||
|
");
|
||||||
|
|
||||||
|
if (!$types) {
|
||||||
|
throw new Exception('Failed to fetch types');
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (Exception $e) {
|
||||||
|
error_log('Database error in index.php: ' . $e->getMessage());
|
||||||
|
// Display user-friendly error
|
||||||
|
$error_message = 'Unable to load content. Please try again later.';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Safely escape output for HTML
|
||||||
|
*/
|
||||||
|
function esc_html($text) {
|
||||||
|
return htmlspecialchars($text ?? '', ENT_QUOTES, 'UTF-8');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Safely escape output for HTML attributes
|
||||||
|
*/
|
||||||
|
function esc_attr($text) {
|
||||||
|
return htmlspecialchars($text ?? '', ENT_QUOTES, 'UTF-8');
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
|
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
|
||||||
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
|
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
|
||||||
@@ -31,68 +81,49 @@ ORDER BY value ASC");
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<title><?php echo $SiteName.': '.$SubName;?></title>
|
<title><?php echo esc_html($SiteName . ': ' . $SubName); ?></title>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<meta name="description" content=<?php echo '"'.$SiteName.' - '.$SubName.'"/>';?>
|
<meta name="description" content="<?php echo esc_attr($SiteName . ' - ' . $SubName); ?>">
|
||||||
<meta name="keywords" content="free software, open source, bibliography, cyberpunk, books, media, movies, video games" />
|
<meta name="keywords" content="free software, open source, bibliography, cyberpunk, books, media, movies, video games">
|
||||||
<meta name="author" content="Daniel Messer" />
|
<meta name="author" content="Daniel Messer">
|
||||||
|
|
||||||
<!--
|
|
||||||
//////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
FREE HTML5 TEMPLATE
|
|
||||||
DESIGNED & DEVELOPED by FREEHTML5.CO
|
|
||||||
|
|
||||||
Website: http://freehtml5.co/
|
|
||||||
Email: info@freehtml5.co
|
|
||||||
Twitter: http://twitter.com/fh5co
|
|
||||||
Facebook: https://www.facebook.com/fh5co
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////
|
|
||||||
-->
|
|
||||||
|
|
||||||
<!-- Facebook and Twitter integration -->
|
<!-- Facebook and Twitter integration -->
|
||||||
<meta property="og:title" content=<?php echo '"'.$SiteName.'" />';?>
|
<meta property="og:title" content="<?php echo esc_attr($SiteName); ?>">
|
||||||
|
<meta property="og:image" content="<?php echo esc_attr($SiteURL . '/images/og-site-avatar.jpg'); ?>">
|
||||||
<meta property="og:image" content=<?php echo '"'.$SiteURL.'/images/og-site-avatar.jpg" />';?>
|
<meta property="og:url" content="<?php echo esc_attr($SiteURL); ?>">
|
||||||
|
<meta property="og:site_name" content="<?php echo esc_attr($SiteName . ' - ' . $SubName); ?>">
|
||||||
<meta property="og:url" content=<?php echo '"'.$SiteURL.'" />';?>
|
<meta property="og:description" content="<?php echo esc_attr($SubName); ?>">
|
||||||
|
<meta name="twitter:title" content="<?php echo esc_attr($SiteName . ' - ' . $SubName); ?>">
|
||||||
<meta property="og:site_name" content=<?php echo '"'.$SiteName.' - '.$SubName.'" />';?>
|
<meta name="twitter:image" content="<?php echo esc_attr($SiteURL . '/images/og-site-avatar.jpg'); ?>">
|
||||||
|
<meta name="twitter:url" content="<?php echo esc_attr($SiteURL); ?>">
|
||||||
<meta property="og:description" content=<?php echo '"'.$SubName.'" />';?>
|
<meta name="twitter:card" content="summary">
|
||||||
|
|
||||||
<meta name="twitter:title" content=<?php echo '"'.$SiteName.' - '.$SubName.'" />';?>
|
|
||||||
|
|
||||||
<meta name="twitter:image" content=<?php echo '"'.$SiteURL.'/images/og-site-avatar.jpg" />';?>
|
|
||||||
|
|
||||||
<meta name="twitter:url" content=<?php echo '"'.$SiteURL.'" />';?>
|
|
||||||
|
|
||||||
<meta name="twitter:card" content="summary" />
|
|
||||||
|
|
||||||
<!-- Place favicon.ico and apple-touch-icon.png in the root directory -->
|
<!-- Place favicon.ico and apple-touch-icon.png in the root directory -->
|
||||||
<link rel="shortcut icon" href="favicon.ico">
|
<link rel="shortcut icon" href="favicon.ico">
|
||||||
<!-- Google Fonts -->
|
|
||||||
<link href='http://fonts.googleapis.com/css?family=Playfair+Display:400,700,400italic|Roboto:400,300,700' rel='stylesheet' type='text/css'>
|
<!-- Google Fonts - Updated to HTTPS -->
|
||||||
<!-- Animate -->
|
<link href='https://fonts.googleapis.com/css?family=Playfair+Display:400,700,400italic|Roboto:400,300,700' rel='stylesheet' type='text/css'>
|
||||||
|
|
||||||
|
<!-- Stylesheets -->
|
||||||
<link rel="stylesheet" href="css/animate.css">
|
<link rel="stylesheet" href="css/animate.css">
|
||||||
<!-- Icomoon -->
|
|
||||||
<link rel="stylesheet" href="css/icomoon.css">
|
<link rel="stylesheet" href="css/icomoon.css">
|
||||||
<!-- Bootstrap -->
|
|
||||||
<link rel="stylesheet" href="css/bootstrap.css">
|
<link rel="stylesheet" href="css/bootstrap.css">
|
||||||
|
|
||||||
<link rel="stylesheet" href="css/style.css">
|
<link rel="stylesheet" href="css/style.css">
|
||||||
|
|
||||||
|
|
||||||
<!-- Modernizr JS -->
|
<!-- Modernizr JS -->
|
||||||
<script src="js/modernizr-2.6.2.min.js"></script>
|
<script src="js/modernizr-2.6.2.min.js"></script>
|
||||||
<!-- FOR IE9 below -->
|
|
||||||
<!--[if lt IE 9]>
|
<!--[if lt IE 9]>
|
||||||
<script src="js/respond.min.js"></script>
|
<script src="js/respond.min.js"></script>
|
||||||
<![endif]-->
|
<![endif]-->
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
|
<?php if (isset($error_message)): ?>
|
||||||
|
<div class="alert alert-danger" role="alert">
|
||||||
|
<?php echo esc_html($error_message); ?>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
<div id="fh5co-offcanvas">
|
<div id="fh5co-offcanvas">
|
||||||
<a href="#" class="fh5co-close-offcanvas js-fh5co-close-offcanvas"><span><i class="icon-cross3"></i> <span>Close</span></span></a>
|
<a href="#" class="fh5co-close-offcanvas js-fh5co-close-offcanvas"><span><i class="icon-cross3"></i> <span>Close</span></span></a>
|
||||||
<div class="fh5co-bio">
|
<div class="fh5co-bio">
|
||||||
@@ -101,22 +132,17 @@ ORDER BY value ASC");
|
|||||||
</figure>
|
</figure>
|
||||||
<h3 class="heading">About the Project</h3>
|
<h3 class="heading">About the Project</h3>
|
||||||
<a href="index.php"><h2>Infopump</h2></a>
|
<a href="index.php"><h2>Infopump</h2></a>
|
||||||
<p>A bibliographic management and display system.<br /><a href="about.php">More info</a></p>
|
<p>A bibliographic management and display system.<br><a href="about.php">More info</a></p>
|
||||||
<hr>
|
<hr>
|
||||||
<p>A free, open source project from:<br />
|
<p>A free, open source project from:<br>
|
||||||
<a href="https://rss.com/podcasts/l0wl1f3podcast/">The L0WL1F3 Podcast</a><br />
|
<a href="https://rss.com/podcasts/l0wl1f3podcast/">The L0WL1F3 Podcast</a><br>
|
||||||
<a href="https://www.neondystopia.com/">Neon Dystopia</a><br />
|
<a href="https://www.neondystopia.com/">Neon Dystopia</a><br>
|
||||||
<a href="https://cyberpunklibrarian.com">Cyberpunk Librarian</a>
|
<a href="https://cyberpunklibrarian.com">Cyberpunk Librarian</a>
|
||||||
</p>
|
</p>
|
||||||
<hr>
|
<hr>
|
||||||
<p>
|
<p>
|
||||||
<a href="https://cyberpunklibrarian.nohost.me/gitlab/code/infopump">GitLab</a>
|
<a href="https://cyberpunklibrarian.nohost.me/gitea/Public/infopump">Repo</a>
|
||||||
</p>
|
</p>
|
||||||
<ul class="fh5co-social">
|
|
||||||
<!--<li><a href="#"><i class="icon-twitter"></i></a></li>
|
|
||||||
<li><a href="#"><i class="icon-facebook"></i></a></li>
|
|
||||||
<li><a href="#"><i class="icon-instagram"></i></a></li>-->
|
|
||||||
</ul>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="fh5co-menu">
|
<div class="fh5co-menu">
|
||||||
@@ -124,70 +150,76 @@ ORDER BY value ASC");
|
|||||||
<h3 class="heading">Recent Additions</h3>
|
<h3 class="heading">Recent Additions</h3>
|
||||||
<ul>
|
<ul>
|
||||||
<?php
|
<?php
|
||||||
|
if ($types) {
|
||||||
while ($row = $types->fetchArray()) {
|
while ($row = $types->fetchArray()) {
|
||||||
$row_value = $row['value'];
|
$row_value = $row['value'];
|
||||||
$row_titlecase = mb_convert_case($row_value, MB_CASE_TITLE, "UTF-8");
|
$row_titlecase = mb_convert_case($row_value, MB_CASE_TITLE, "UTF-8");
|
||||||
echo '<li><a href="recent.php?ty='.$row_value.'">'.$row_titlecase.'</a></li>';
|
echo '<li><a href="recent.php?ty=' . urlencode($row_value) . '">'
|
||||||
//echo '<li>'.$row_value.'</li>';
|
. esc_html($row_titlecase) . '</a></li>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="fh5co-box">
|
<div class="fh5co-box">
|
||||||
<h3 class="heading">Search</h3>
|
<h3 class="heading">Search</h3>
|
||||||
<form action="results.php" method="get">
|
<form action="results.php" method="get">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<input type="text" class="form-control" name="kw" placeholder="Keyword search">
|
<input type="text" class="form-control" name="kw" placeholder="Keyword search" required>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- END #fh5co-offcanvas -->
|
<!-- END #fh5co-offcanvas -->
|
||||||
|
|
||||||
<header id="fh5co-header">
|
<header id="fh5co-header">
|
||||||
|
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<a href="#" class="js-fh5co-nav-toggle fh5co-nav-toggle"><i></i></a>
|
<a href="#" class="js-fh5co-nav-toggle fh5co-nav-toggle"><i></i></a>
|
||||||
<ul class="fh5co-social">
|
|
||||||
<!--<li><a href="#"><i class="icon-twitter"></i></a></li>
|
|
||||||
<li><a href="#"><i class="icon-facebook"></i></a></li>
|
|
||||||
<li><a href="#"><i class="icon-instagram"></i></a></li>-->
|
|
||||||
</ul>
|
|
||||||
<div class="col-lg-12 col-md-12 text-center">
|
<div class="col-lg-12 col-md-12 text-center">
|
||||||
<h1 id="fh5co-logo"><a href="index.php">Infopump - Cyberpunk Culture Database</a></h1>
|
<h1 id="fh5co-logo"><a href="index.php">Infopump - Cyberpunk Culture Database</a></h1>
|
||||||
<h3>Latest Additions</h3>
|
<h3>Latest Additions</h3>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</header>
|
</header>
|
||||||
<!-- END #fh5co-header -->
|
<!-- END #fh5co-header -->
|
||||||
|
|
||||||
<!-- BEGIN Featured Covers -->
|
<!-- BEGIN Featured Covers -->
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row fh5co-post-entry">
|
<div class="row fh5co-post-entry">
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
if ($feature) {
|
||||||
while ($row = $feature->fetchArray()) {
|
while ($row = $feature->fetchArray()) {
|
||||||
$row_id = $row['id'];
|
$row_id = (int)$row['id'];
|
||||||
$row_title = $row['title'];
|
$row_title = $row['title'];
|
||||||
$row_author = $row['author'];
|
$row_author = $row['author'];
|
||||||
|
|
||||||
|
// Check if image exists, otherwise use placeholder
|
||||||
|
$image_path = "images/{$row_id}.jpg";
|
||||||
|
if (!file_exists($image_path)) {
|
||||||
|
$image_path = "images/placeholder.jpg";
|
||||||
|
}
|
||||||
|
|
||||||
echo '<article class="col-lg-3 col-md-3 col-sm-3 col-xs-6 col-xxs-12 animate-box">';
|
echo '<article class="col-lg-3 col-md-3 col-sm-3 col-xs-6 col-xxs-12 animate-box">';
|
||||||
echo ' <figure>';
|
echo ' <figure>';
|
||||||
echo '<a href="itemrecord.php?itemid='.$row_id.'"><img src="images/'.$row_id.'.jpg" title="'.$row_title.'" class="img-responsive"></a>';
|
echo ' <a href="itemrecord.php?itemid=' . $row_id . '">';
|
||||||
|
echo ' <img src="' . esc_attr($image_path) . '" ';
|
||||||
|
echo ' alt="' . esc_attr($row_title) . '" ';
|
||||||
|
echo ' title="' . esc_attr($row_title) . '" ';
|
||||||
|
echo ' class="img-responsive">';
|
||||||
|
echo ' </a>';
|
||||||
echo ' </figure>';
|
echo ' </figure>';
|
||||||
echo '<h2 class="fh5co-article-title"><a href="single.html">'.$row_title.'</a></h2>';
|
echo ' <h2 class="fh5co-article-title">';
|
||||||
echo '<span class="fh5co-meta fh5co-date">'.$row_author.'</span>';
|
echo ' <a href="itemrecord.php?itemid=' . $row_id . '">' . esc_html($row_title) . '</a>';
|
||||||
|
echo ' </h2>';
|
||||||
|
echo ' <span class="fh5co-meta fh5co-date">' . esc_html($row_author) . '</span>';
|
||||||
echo '</article>';
|
echo '</article>';
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
echo '<div class="col-lg-12"><p class="text-center">No items found.</p></div>';
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -197,8 +229,6 @@ ORDER BY value ASC");
|
|||||||
<p><small>© Creative Commons By-NC-SA<br> Design by <a href="http://freehtml5.co" target="_blank">FREEHTML5.co</a></small></p>
|
<p><small>© Creative Commons By-NC-SA<br> Design by <a href="http://freehtml5.co" target="_blank">FREEHTML5.co</a></small></p>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- jQuery -->
|
<!-- jQuery -->
|
||||||
<script src="js/jquery.min.js"></script>
|
<script src="js/jquery.min.js"></script>
|
||||||
<!-- jQuery Easing -->
|
<!-- jQuery Easing -->
|
||||||
@@ -212,4 +242,9 @@ ORDER BY value ASC");
|
|||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
<?php
|
||||||
|
// Clean up database connection
|
||||||
|
if ($db) {
|
||||||
|
$db->close();
|
||||||
|
}
|
||||||
|
?>
|
||||||
860
itemrecord.php
860
itemrecord.php
@@ -1,502 +1,612 @@
|
|||||||
<?php
|
<?php
|
||||||
|
// Enable error reporting for development (remove in production)
|
||||||
|
error_reporting(E_ALL);
|
||||||
|
ini_set('display_errors', 1);
|
||||||
|
|
||||||
|
// Include settings
|
||||||
include_once "settings.php";
|
include_once "settings.php";
|
||||||
|
|
||||||
// Get and use an item record ID (ItemRecordID) to use for a data pull
|
/**
|
||||||
$ItemID = htmlspecialchars($_GET["itemid"]);
|
* Safely escape output for HTML
|
||||||
|
*/
|
||||||
|
function esc_html($text) {
|
||||||
|
return htmlspecialchars($text ?? '', ENT_QUOTES, 'UTF-8');
|
||||||
|
}
|
||||||
|
|
||||||
// -------------------- BEGIN DATABASE QUERIES --------------------
|
/**
|
||||||
|
* Safely escape output for HTML attributes
|
||||||
|
*/
|
||||||
|
function esc_attr($text) {
|
||||||
|
return htmlspecialchars($text ?? '', ENT_QUOTES, 'UTF-8');
|
||||||
|
}
|
||||||
|
|
||||||
// Establish atabase connection
|
/**
|
||||||
|
* Generate Chicago citation
|
||||||
|
*/
|
||||||
|
function generate_chicago_citation($type, $author_sort, $title, $location, $publisher, $pubdate) {
|
||||||
|
if ($type == 'Text') {
|
||||||
|
return "{$author_sort}. <em>{$title}.</em> {$location}: {$publisher}, {$pubdate}.";
|
||||||
|
} elseif ($type == 'Music') {
|
||||||
|
return "{$author_sort}, <em>{$title}.</em> {$publisher}, {$pubdate}.";
|
||||||
|
} else {
|
||||||
|
return "{$author_sort}, director. <em>{$title}.</em> {$publisher}, {$pubdate}.";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generate APA citation
|
||||||
|
*/
|
||||||
|
function generate_apa_citation($type, $author_sort, $title, $publisher, $pubdate, $creator) {
|
||||||
|
$name_parts = explode(', ', $author_sort);
|
||||||
|
$last_name = $name_parts[0] ?? '';
|
||||||
|
$first_initial = isset($name_parts[1]) ? mb_substr($name_parts[1], 0, 1) : '';
|
||||||
|
|
||||||
|
if ($type == 'Text') {
|
||||||
|
return "{$last_name}, {$first_initial}. ({$pubdate}). {$title}. {$publisher}.";
|
||||||
|
} elseif ($type == 'Music') {
|
||||||
|
return "{$creator}. ({$pubdate}). <em>{$title}</em> [Album]. {$publisher}.";
|
||||||
|
} else {
|
||||||
|
return "{$last_name}, {$first_initial}. (Director). ({$pubdate}). <em>{$title}</em> [Film]. {$publisher}.";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generate MLA citation
|
||||||
|
*/
|
||||||
|
function generate_mla_citation($type, $author_sort, $title, $publisher, $pubdate) {
|
||||||
|
if ($type == 'Text' || $type == 'Music') {
|
||||||
|
return "{$author_sort}. <em>{$title}.</em> {$publisher}, {$pubdate}.";
|
||||||
|
} else {
|
||||||
|
return "{$author_sort}, director. <em>{$title}.</em> {$publisher}, {$pubdate}.";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Initialize variables
|
||||||
|
$ItemID = null;
|
||||||
|
$db = null;
|
||||||
|
$error_message = null;
|
||||||
|
|
||||||
|
// Data arrays to store results
|
||||||
|
$book_data = [];
|
||||||
|
$identifiers = [];
|
||||||
|
$languages = [];
|
||||||
|
$tags = [];
|
||||||
|
$similar_items = [];
|
||||||
|
|
||||||
|
try {
|
||||||
|
// Validate and sanitize ItemID - CRITICAL for SQL injection prevention
|
||||||
|
if (!isset($_GET["itemid"]) || !is_numeric($_GET["itemid"])) {
|
||||||
|
throw new Exception('Invalid item ID');
|
||||||
|
}
|
||||||
|
|
||||||
|
$ItemID = (int)$_GET["itemid"];
|
||||||
|
|
||||||
|
if ($ItemID <= 0) {
|
||||||
|
throw new Exception('Invalid item ID');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check if database exists
|
||||||
|
if (!file_exists('metadata.sqlite')) {
|
||||||
|
throw new Exception('Database file not found');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Establish database connection
|
||||||
$db = new SQLite3('metadata.sqlite');
|
$db = new SQLite3('metadata.sqlite');
|
||||||
|
if (!$db) {
|
||||||
// ---------- Pull data from books table ----------
|
throw new Exception('Unable to open database');
|
||||||
$book = $db->query("SELECT id, title, date(timestamp), author_sort, strftime('%Y',pubdate) AS pubyear, date(last_modified) FROM books WHERE id = '$ItemID'");
|
|
||||||
|
|
||||||
while ($row = $book->fetchArray()) {
|
|
||||||
$row_id = $row['id'];
|
|
||||||
$row_title = $row['title'];
|
|
||||||
$row_created = $row['date(timestamp)'];
|
|
||||||
$row_author_sort = $row['author_sort'];
|
|
||||||
$row_pubdate = $row['pubyear'];
|
|
||||||
$row_modified = $row['date(last_modified)'];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------- Pull data from authors table ----------
|
$db->busyTimeout(5000);
|
||||||
$author = $db->query("SELECT name FROM authors
|
|
||||||
INNER JOIN books_authors_link
|
|
||||||
ON books_authors_link.author = authors.id
|
|
||||||
WHERE books_authors_link.book = '$ItemID'");
|
|
||||||
|
|
||||||
while ($row = $author->fetchArray()) {
|
// Pull data from books table - Using parameterized query for safety
|
||||||
$row_creator = $row['name'];
|
$stmt = $db->prepare("
|
||||||
|
SELECT
|
||||||
|
id,
|
||||||
|
title,
|
||||||
|
date(timestamp) as created,
|
||||||
|
author_sort,
|
||||||
|
strftime('%Y',pubdate) AS pubyear,
|
||||||
|
date(last_modified) as modified
|
||||||
|
FROM books
|
||||||
|
WHERE id = :itemid
|
||||||
|
");
|
||||||
|
$stmt->bindValue(':itemid', $ItemID, SQLITE3_INTEGER);
|
||||||
|
$result = $stmt->execute();
|
||||||
|
|
||||||
|
if ($result && $row = $result->fetchArray(SQLITE3_ASSOC)) {
|
||||||
|
$book_data = $row;
|
||||||
|
} else {
|
||||||
|
throw new Exception('Item not found');
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------- Pull data from comments table ----------
|
// Pull author data
|
||||||
$summary = $db->query("SELECT text FROM comments WHERE book = '$ItemID'");
|
$stmt = $db->prepare("
|
||||||
|
SELECT name
|
||||||
|
FROM authors
|
||||||
|
INNER JOIN books_authors_link ON books_authors_link.author = authors.id
|
||||||
|
WHERE books_authors_link.book = :itemid
|
||||||
|
");
|
||||||
|
$stmt->bindValue(':itemid', $ItemID, SQLITE3_INTEGER);
|
||||||
|
$result = $stmt->execute();
|
||||||
|
|
||||||
while ($row = $summary->fetchArray()) {
|
if ($result && $row = $result->fetchArray(SQLITE3_ASSOC)) {
|
||||||
$row_summary = $row['text'];
|
$book_data['creator'] = $row['name'];
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------- Pull data from publishers table ----------
|
// Pull summary/comments
|
||||||
|
$stmt = $db->prepare("SELECT text FROM comments WHERE book = :itemid");
|
||||||
|
$stmt->bindValue(':itemid', $ItemID, SQLITE3_INTEGER);
|
||||||
|
$result = $stmt->execute();
|
||||||
|
|
||||||
$publisher = $db->query("SELECT name from publishers
|
if ($result && $row = $result->fetchArray(SQLITE3_ASSOC)) {
|
||||||
INNER JOIN books_publishers_link
|
$book_data['summary'] = $row['text'];
|
||||||
ON books_publishers_link.publisher = publishers.id
|
|
||||||
WHERE books_publishers_link.book = '$ItemID'");
|
|
||||||
|
|
||||||
while ($row = $publisher->fetchArray()) {
|
|
||||||
$row_publisher = $row['name'];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------- Pull data from tags table ----------
|
// Pull publisher
|
||||||
|
$stmt = $db->prepare("
|
||||||
|
SELECT name
|
||||||
|
FROM publishers
|
||||||
|
INNER JOIN books_publishers_link ON books_publishers_link.publisher = publishers.id
|
||||||
|
WHERE books_publishers_link.book = :itemid
|
||||||
|
");
|
||||||
|
$stmt->bindValue(':itemid', $ItemID, SQLITE3_INTEGER);
|
||||||
|
$result = $stmt->execute();
|
||||||
|
|
||||||
$tags = $db->query("SELECT name FROM tags
|
if ($result && $row = $result->fetchArray(SQLITE3_ASSOC)) {
|
||||||
INNER JOIN books_tags_link
|
$book_data['publisher'] = $row['name'];
|
||||||
ON books_tags_link.tag = tags.id
|
}
|
||||||
|
|
||||||
|
// Pull tags (excluding infopump internal tags)
|
||||||
|
$stmt = $db->prepare("
|
||||||
|
SELECT name
|
||||||
|
FROM tags
|
||||||
|
INNER JOIN books_tags_link ON books_tags_link.tag = tags.id
|
||||||
WHERE tags.name NOT LIKE 'infopump%'
|
WHERE tags.name NOT LIKE 'infopump%'
|
||||||
AND books_tags_link.book = '$ItemID'");
|
AND books_tags_link.book = :itemid
|
||||||
|
");
|
||||||
|
$stmt->bindValue(':itemid', $ItemID, SQLITE3_INTEGER);
|
||||||
|
$result = $stmt->execute();
|
||||||
|
|
||||||
// ---------- Pull data from tags table for Similar items ----------
|
while ($result && $row = $result->fetchArray(SQLITE3_ASSOC)) {
|
||||||
|
$tags[] = $row['name'];
|
||||||
// New similar tags query
|
|
||||||
$similartags = $db->query("SELECT name FROM tags
|
|
||||||
WHERE name IN (SELECT name FROM tags
|
|
||||||
INNER JOIN books_tags_link
|
|
||||||
ON books_tags_link.tag = tags.id
|
|
||||||
AND books_tags_link.book = '$ItemID'
|
|
||||||
ORDER BY RANDOM() LIMIT 2)");
|
|
||||||
|
|
||||||
$simtag = array();
|
|
||||||
|
|
||||||
while($row = $similartags->fetchArray()) {
|
|
||||||
$simtag[] = $row['name'];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$getsimilar = $db->query("SELECT books.id, title, author_sort
|
// Pull identifiers
|
||||||
FROM books
|
$stmt = $db->prepare("SELECT type, val FROM identifiers WHERE book = :itemid");
|
||||||
INNER JOIN books_tags_link
|
$stmt->bindValue(':itemid', $ItemID, SQLITE3_INTEGER);
|
||||||
ON books_tags_link.book = books.id
|
$result = $stmt->execute();
|
||||||
INNER JOIN tags
|
|
||||||
ON tags.id = books_tags_link.tag
|
|
||||||
WHERE (tags.name LIKE '$simtag[0]'
|
|
||||||
OR tags.name LIKE '$simtag[1]')
|
|
||||||
AND books.id != '$ItemID' LIMIT 4");
|
|
||||||
|
|
||||||
|
while ($result && $row = $result->fetchArray(SQLITE3_ASSOC)) {
|
||||||
|
$identifiers[] = $row;
|
||||||
|
}
|
||||||
|
|
||||||
// ---------- Pull data from identifiers table ----------
|
// Pull languages
|
||||||
|
$stmt = $db->prepare("
|
||||||
|
SELECT languages.lang_code AS lang_code
|
||||||
|
FROM languages
|
||||||
|
INNER JOIN books_languages_link ON books_languages_link.lang_code = languages.id
|
||||||
|
WHERE book = :itemid
|
||||||
|
ORDER BY books_languages_link.item_order
|
||||||
|
");
|
||||||
|
$stmt->bindValue(':itemid', $ItemID, SQLITE3_INTEGER);
|
||||||
|
$result = $stmt->execute();
|
||||||
|
|
||||||
$identifiers = $db->query("SELECT type, val FROM identifiers WHERE book = '$ItemID'");
|
while ($result && $row = $result->fetchArray(SQLITE3_ASSOC)) {
|
||||||
|
$languages[] = $row['lang_code'];
|
||||||
|
}
|
||||||
|
|
||||||
// ---------- Pull data from languages table ----------
|
// Pull type
|
||||||
|
$stmt = $db->prepare("
|
||||||
$languages = $db->query("SELECT languages.lang_code AS lang_code FROM languages
|
SELECT custom_column_1.value AS itemtype
|
||||||
INNER JOIN books_languages_link
|
|
||||||
ON books_languages_link.lang_code = languages.id
|
|
||||||
WHERE book = '$ItemID'
|
|
||||||
ORDER BY books_languages_link.item_order");
|
|
||||||
|
|
||||||
// ---------- Pull data from tags table to dertermine type ----------
|
|
||||||
|
|
||||||
$type = $db->query("SELECT custom_column_1.value AS itemtype
|
|
||||||
FROM books_custom_column_1_link
|
FROM books_custom_column_1_link
|
||||||
INNER JOIN custom_column_1
|
INNER JOIN custom_column_1 ON custom_column_1.id = books_custom_column_1_link.value
|
||||||
ON custom_column_1.id = books_custom_column_1_link.value
|
WHERE books_custom_column_1_link.book = :itemid
|
||||||
WHERE books_custom_column_1_link.book = '$ItemID'");
|
");
|
||||||
|
$stmt->bindValue(':itemid', $ItemID, SQLITE3_INTEGER);
|
||||||
|
$result = $stmt->execute();
|
||||||
|
|
||||||
while ($row = $type->fetchArray()) {
|
if ($result && $row = $result->fetchArray(SQLITE3_ASSOC)) {
|
||||||
$row_type = mb_convert_case($row['itemtype'], MB_CASE_TITLE, "UTF-8");
|
$book_data['type'] = mb_convert_case($row['itemtype'], MB_CASE_TITLE, "UTF-8");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------- Pull series information ----------
|
// Pull series information
|
||||||
|
$stmt = $db->prepare("
|
||||||
$series = $db->query("SELECT series.name AS series, books.series_index AS seriesindex
|
SELECT series.name AS series, books.series_index AS seriesindex
|
||||||
FROM series
|
FROM series
|
||||||
INNER JOIN books_series_link
|
INNER JOIN books_series_link ON books_series_link.series = series.id
|
||||||
ON books_series_link.series = series.id
|
INNER JOIN books ON books.id = books_series_link.book
|
||||||
INNER JOIN books
|
WHERE books_series_link.book = :itemid
|
||||||
ON books.id = books_series_link.book
|
");
|
||||||
WHERE books_series_link.book = '$ItemID'");
|
$stmt->bindValue(':itemid', $ItemID, SQLITE3_INTEGER);
|
||||||
|
$result = $stmt->execute();
|
||||||
|
|
||||||
while ($row = $series->fetchArray()) {
|
if ($result && $row = $result->fetchArray(SQLITE3_ASSOC)) {
|
||||||
$row_series = $row['series'];
|
$book_data['series'] = $row['series'];
|
||||||
$row_seriesindex = $row['seriesindex'];
|
$book_data['series_index'] = $row['seriesindex'];
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------- Pull publisher location information ----------
|
// Pull publisher location
|
||||||
|
$stmt = $db->prepare("
|
||||||
$publisher_location = $db->query("SELECT custom_column_2.value AS publoc
|
SELECT custom_column_2.value AS publoc
|
||||||
FROM books
|
FROM books
|
||||||
INNER JOIN
|
INNER JOIN books_custom_column_2_link ON books_custom_column_2_link.book = books.id
|
||||||
books_custom_column_2_link
|
INNER JOIN custom_column_2 ON custom_column_2.id = books_custom_column_2_link.value
|
||||||
ON books_custom_column_2_link.book = books.id
|
WHERE books.id = :itemid
|
||||||
INNER JOIN
|
");
|
||||||
custom_column_2
|
$stmt->bindValue(':itemid', $ItemID, SQLITE3_INTEGER);
|
||||||
ON custom_column_2.id = books_custom_column_2_link.value
|
$result = $stmt->execute();
|
||||||
WHERE
|
|
||||||
books.id = '$ItemID'");
|
|
||||||
|
|
||||||
while ($row = $publisher_location->fetchArray()) {
|
if ($result && $row = $result->fetchArray(SQLITE3_ASSOC)) {
|
||||||
$row_publocation = $row['publoc'];
|
$book_data['publisher_location'] = $row['publoc'];
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------- Pull subtype information ----------
|
// Pull subtype
|
||||||
|
$stmt = $db->prepare("
|
||||||
$subtype = $db->query("SELECT custom_column_3.value AS subtype
|
SELECT custom_column_3.value AS subtype
|
||||||
FROM books
|
FROM books
|
||||||
INNER JOIN
|
INNER JOIN books_custom_column_3_link ON books_custom_column_3_link.book = books.id
|
||||||
books_custom_column_3_link
|
INNER JOIN custom_column_3 ON custom_column_3.id = books_custom_column_3_link.value
|
||||||
ON books_custom_column_3_link.book = books.id
|
WHERE books.id = :itemid
|
||||||
INNER JOIN
|
");
|
||||||
custom_column_3
|
$stmt->bindValue(':itemid', $ItemID, SQLITE3_INTEGER);
|
||||||
ON custom_column_3.id = books_custom_column_3_link.value
|
$result = $stmt->execute();
|
||||||
WHERE
|
|
||||||
books.id = '$ItemID'");
|
|
||||||
|
|
||||||
while ($row = $subtype->fetchArray()) {
|
if ($result && $row = $result->fetchArray(SQLITE3_ASSOC)) {
|
||||||
$row_subtype = $row['subtype'];
|
$book_data['subtype'] = $row['subtype'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Get similar items based on tags
|
||||||
|
if (count($tags) >= 2) {
|
||||||
|
// Get two random tags for similarity
|
||||||
|
$random_tags = array_rand(array_flip($tags), min(2, count($tags)));
|
||||||
|
if (!is_array($random_tags)) {
|
||||||
|
$random_tags = [$random_tags];
|
||||||
|
}
|
||||||
|
|
||||||
|
$tag_placeholders = implode(',', array_fill(0, count($random_tags), '?'));
|
||||||
|
|
||||||
// -------------------- END DATABASE QUERIES --------------------
|
$stmt = $db->prepare("
|
||||||
|
SELECT DISTINCT books.id, title, author_sort
|
||||||
|
FROM books
|
||||||
|
INNER JOIN books_tags_link ON books_tags_link.book = books.id
|
||||||
|
INNER JOIN tags ON tags.id = books_tags_link.tag
|
||||||
|
WHERE tags.name IN ($tag_placeholders)
|
||||||
|
AND books.id != :itemid
|
||||||
|
LIMIT 4
|
||||||
|
");
|
||||||
|
|
||||||
|
foreach ($random_tags as $index => $tag) {
|
||||||
|
$stmt->bindValue($index + 1, $tag, SQLITE3_TEXT);
|
||||||
|
}
|
||||||
|
$stmt->bindValue(':itemid', $ItemID, SQLITE3_INTEGER);
|
||||||
|
|
||||||
|
$result = $stmt->execute();
|
||||||
|
while ($result && $row = $result->fetchArray(SQLITE3_ASSOC)) {
|
||||||
|
$similar_items[] = $row;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (Exception $e) {
|
||||||
|
error_log('Error in itemrecord.php: ' . $e->getMessage());
|
||||||
|
$error_message = 'Unable to load item details. Please try again later.';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Helper function to get identifier URL
|
||||||
|
function get_identifier_url($type) {
|
||||||
|
$urls = [
|
||||||
|
'google' => 'https://books.google.com/books?id=',
|
||||||
|
'isbn' => 'https://www.librarything.com/isbn/',
|
||||||
|
'oclc' => 'https://worldcat.org/title/',
|
||||||
|
'tmdb' => 'https://www.themoviedb.org/movie/'
|
||||||
|
];
|
||||||
|
return $urls[$type] ?? '#';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check if image exists
|
||||||
|
$image_path = "images/{$ItemID}.jpg";
|
||||||
|
if (!file_exists($image_path)) {
|
||||||
|
$image_path = "images/placeholder.jpg";
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||||
<meta name="description" content=<?php echo '"Infopump - Item record - '.$row_title.'"/>'; ?>
|
<meta name="description" content="<?php echo esc_attr('Infopump - Item record - ' . ($book_data['title'] ?? 'Unknown')); ?>">
|
||||||
<meta name="keywords" content="infopump, bibliography, media, catalog" />
|
<meta name="keywords" content="infopump, bibliography, media, catalog">
|
||||||
<meta name="author" content="Daniel Messer" />
|
<meta name="author" content="Daniel Messer">
|
||||||
|
|
||||||
<!-- Social Media Integration -->
|
<!-- Social Media Integration -->
|
||||||
<meta property="og:title" content=<?php echo '"'.$SiteName.' - Item Record" />';?>
|
<meta property="og:title" content="<?php echo esc_attr($SiteName . ' - Item Record'); ?>">
|
||||||
|
<meta property="og:image" content="<?php echo esc_attr($SiteURL . '/' . $image_path); ?>">
|
||||||
|
<meta property="og:url" content="<?php echo esc_attr($SiteURL . '/itemrecord.php?itemid=' . $ItemID); ?>">
|
||||||
|
<meta property="og:site_name" content="<?php echo esc_attr($SiteName); ?>">
|
||||||
|
<meta property="og:description" content="<?php echo esc_attr(($book_data['title'] ?? 'Unknown') . ' - ' . ($book_data['creator'] ?? 'Unknown')); ?>">
|
||||||
|
|
||||||
<meta property="og:image" content=<?php echo '"'.$SiteURL.'/images/'.$row_id.'.jpg" />'; ?>
|
<meta name="twitter:title" content="<?php echo esc_attr(($book_data['title'] ?? 'Unknown') . ' - ' . ($book_data['creator'] ?? 'Unknown')); ?>">
|
||||||
|
<meta name="twitter:image" content="<?php echo esc_attr($SiteURL . '/' . $image_path); ?>">
|
||||||
<meta property="og:url" content=<?php echo '"'.$SiteURL.'/itemrecord.php?itemid='.$row_id.'" />'; ?>
|
<meta name="twitter:url" content="<?php echo esc_attr($SiteURL . '/itemrecord.php?itemid=' . $ItemID); ?>">
|
||||||
|
<meta name="twitter:card" content="summary">
|
||||||
<meta property="og:site_name" content=<?php echo '"'.$SiteName.'" />'; ?>
|
|
||||||
|
|
||||||
<meta property="og:description" content=<?php echo '"'.$row_title.' - '.$row_creator.'" />'; ?>
|
|
||||||
|
|
||||||
<meta name="twitter:title" content=<?php echo '"'.$row_title.' - '.$row_creator.'" />'; ?>
|
|
||||||
|
|
||||||
<meta name="twitter:image" content=<?php echo '"'.$SiteURL.'/images/'.$row_id.'.jpg" />'; ?>
|
|
||||||
|
|
||||||
<meta name="twitter:url" content=<?php echo '"'.$SiteURL.'/itemrecord.php?itemid='.$row_id.'" />'; ?>
|
|
||||||
|
|
||||||
<meta name="twitter:card" content="summary" />
|
|
||||||
|
|
||||||
<!-- Zotero and RDF Related Metadata -->
|
<!-- Zotero and RDF Related Metadata -->
|
||||||
|
<meta name="citation_title" content="<?php echo esc_attr($book_data['title'] ?? ''); ?>">
|
||||||
|
<meta name="citation_authors" content="<?php echo esc_attr($book_data['author_sort'] ?? ''); ?>">
|
||||||
|
<meta name="citation_publisher" content="<?php echo esc_attr($book_data['publisher'] ?? ''); ?>">
|
||||||
|
|
||||||
<meta name="citation_title" content=<?php echo '"'.$row_title.'" />'; ?>
|
<?php foreach ($identifiers as $identifier): ?>
|
||||||
|
<?php if ($identifier['type'] == 'isbn'): ?>
|
||||||
|
<meta name="citation_isbn" content="<?php echo esc_attr($identifier['val']); ?>">
|
||||||
|
<?php endif; ?>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
|
||||||
<meta name="citation_authors" content=<?php echo '"'.$row_author_sort.'" />'; ?>
|
<title><?php echo esc_html('Item Record: ' . ($book_data['title'] ?? 'Unknown')); ?></title>
|
||||||
|
|
||||||
<meta name="citation_publisher" content=<?php echo '"'.$row_publisher.'" />'; ?>
|
|
||||||
|
|
||||||
<?php
|
|
||||||
while ($row = $identifiers->fetchArray()) {
|
|
||||||
$row_id_type = $row['type'];
|
|
||||||
$row_id_val = $row['val'];
|
|
||||||
if ($row_id_type == 'isbn') {
|
|
||||||
echo '<meta name="citation_isbn" content="'.$row_id_val.'" />';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
|
|
||||||
<?php echo '<title>Item Record: '.$row_title.'</title>'; ?>
|
|
||||||
<!-- Favicon-->
|
<!-- Favicon-->
|
||||||
<link rel="icon" type="image/x-icon" href="item/assets/favicon.ico" />
|
<link rel="icon" type="image/x-icon" href="item/assets/favicon.ico">
|
||||||
<!-- Bootstrap icons-->
|
|
||||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.5.0/font/bootstrap-icons.css" rel="stylesheet" />
|
|
||||||
<!-- Core theme CSS (includes Bootstrap)-->
|
|
||||||
<link href="item/css/styles.css" rel="stylesheet" />
|
|
||||||
|
|
||||||
|
<!-- Bootstrap icons-->
|
||||||
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.5.0/font/bootstrap-icons.css" rel="stylesheet">
|
||||||
|
|
||||||
|
<!-- Core theme CSS (includes Bootstrap)-->
|
||||||
|
<link href="item/css/styles.css" rel="stylesheet">
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
<?php if ($error_message): ?>
|
||||||
|
<div class="alert alert-danger" role="alert">
|
||||||
|
<?php echo esc_html($error_message); ?>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
<!-- Navigation-->
|
<!-- Navigation-->
|
||||||
<nav class="navbar navbar-expand-lg navbar-light bg-light">
|
<nav class="navbar navbar-expand-lg navbar-light bg-light">
|
||||||
<div class="container px-4 px-lg-5">
|
<div class="container px-4 px-lg-5">
|
||||||
<a class="navbar-brand" href="#!"><?php echo '<strong>'.$row_title.'</strong> | Item Record '.$ItemID; ?></a>
|
<a class="navbar-brand" href="index.php">
|
||||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"><span class="navbar-toggler-icon"></span></button>
|
<strong><?php echo esc_html($book_data['title'] ?? 'Unknown'); ?></strong> | Item Record <?php echo (int)$ItemID; ?>
|
||||||
|
</a>
|
||||||
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent">
|
||||||
|
<span class="navbar-toggler-icon"></span>
|
||||||
|
</button>
|
||||||
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
||||||
<ul class="navbar-nav me-auto mb-2 mb-lg-0 ms-lg-4">
|
<ul class="navbar-nav me-auto mb-2 mb-lg-0 ms-lg-4">
|
||||||
<li class="nav-item"><a class="nav-link active" aria-current="page" href="index.php">Home</a></li>
|
<li class="nav-item"><a class="nav-link active" href="index.php">Home</a></li>
|
||||||
<!-- <li class="nav-item"><a class="nav-link" href="#!">About</a></li>
|
|
||||||
<li class="nav-item dropdown">
|
|
||||||
<a class="nav-link dropdown-toggle" id="navbarDropdown" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">Shop</a>
|
|
||||||
<ul class="dropdown-menu" aria-labelledby="navbarDropdown">
|
|
||||||
<li><a class="dropdown-item" href="#!">All Products</a></li>
|
|
||||||
<li><hr class="dropdown-divider" /></li>
|
|
||||||
<li><a class="dropdown-item" href="#!">Popular Items</a></li>
|
|
||||||
<li><a class="dropdown-item" href="#!">New Arrivals</a></li>
|
|
||||||
</ul>
|
</ul>
|
||||||
</li> -->
|
|
||||||
</ul>
|
|
||||||
<!-- <form class="d-flex">
|
|
||||||
<button class="btn btn-outline-dark" type="submit">
|
|
||||||
<i class="bi-cart-fill me-1"></i>
|
|
||||||
Cart
|
|
||||||
<span class="badge bg-dark text-white ms-1 rounded-pill">0</span>
|
|
||||||
</button>
|
|
||||||
</form> -->
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<!-- Product section-->
|
<!-- Product section-->
|
||||||
<section class="py-5">
|
<section class="py-5">
|
||||||
<div class="container px-4 px-lg-5 my-5">
|
<div class="container px-4 px-lg-5 my-5">
|
||||||
<div class="row gx-4 gx-lg-5 align-items-top">
|
<div class="row gx-4 gx-lg-5 align-items-top">
|
||||||
<div class="col-md-6"><img class="card-img-top mb-5 mb-md-0" src="images/<?php echo $row_id.'.jpg' ?>" alt="<?php echo $row_title; ?>" title="<?php echo $row_title; ?>" /></div>
|
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<div class="small mb-1"><?php echo 'Item Record '.$ItemID; ?></div>
|
<img class="card-img-top mb-5 mb-md-0"
|
||||||
<h1 class="display-5 fw-bolder"><?php echo $row_title; ?></h1>
|
src="<?php echo esc_attr($image_path); ?>"
|
||||||
|
alt="<?php echo esc_attr($book_data['title'] ?? 'Unknown'); ?>"
|
||||||
|
title="<?php echo esc_attr($book_data['title'] ?? 'Unknown'); ?>">
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="small mb-1">Item Record <?php echo (int)$ItemID; ?></div>
|
||||||
|
<h1 class="display-5 fw-bolder"><?php echo esc_html($book_data['title'] ?? 'Unknown'); ?></h1>
|
||||||
|
|
||||||
|
<?php if (isset($book_data['series'])): ?>
|
||||||
<div class="medium">
|
<div class="medium">
|
||||||
<?php
|
<hr>
|
||||||
if ($row_series) {
|
<strong>
|
||||||
echo '<hr />';
|
Number <?php echo esc_html($book_data['series_index']); ?> in the
|
||||||
echo '<strong>Number '.$row_seriesindex.' in the <a href="results.php?se='.$row_series.'">'.$row_series.' </a>series</strong><br />';
|
<a href="results.php?se=<?php echo urlencode($book_data['series']); ?>">
|
||||||
echo '<hr />';
|
<?php echo esc_html($book_data['series']); ?>
|
||||||
} else {
|
</a> series
|
||||||
echo '<hr>';
|
</strong>
|
||||||
}
|
<hr>
|
||||||
?>
|
|
||||||
</div>
|
</div>
|
||||||
<p class="lead"><?php echo $row_summary; ?></p>
|
<?php else: ?>
|
||||||
<div class="d-flex">
|
<hr>
|
||||||
<!-- <input class="form-control text-center me-3" id="inputQuantity" type="num" value="1" style="max-width: 3rem" />
|
<?php endif; ?>
|
||||||
<button class="btn btn-outline-dark flex-shrink-0" type="button">
|
|
||||||
<i class="bi-cart-fill me-1"></i>
|
<p class="lead"><?php echo $book_data['summary'] ?? ''; ?></p>
|
||||||
Add to cart
|
|
||||||
</button> -->
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<div class="row gx-4 gx-lg-5 align-items-top">
|
<div class="row gx-4 gx-lg-5 align-items-top mt-5">
|
||||||
<div class="col-md-6"> <!-- BEGIN CITATIONS -->
|
<!-- CITATIONS -->
|
||||||
|
<div class="col-md-6">
|
||||||
<a name="citations"></a>
|
<a name="citations"></a>
|
||||||
<h3 class="fw-bolder"><u>Bibliographic Citations</u></h3><br />
|
<h3 class="fw-bolder"><u>Bibliographic Citations</u></h3><br>
|
||||||
<p class="small"><em>Note: You may need to slightly edit citations for final use. Citations are based upon available data. Refer to your format guides for proper bibliographic citations.</em></p>
|
<p class="small"><em>Note: You may need to slightly edit citations for final use. Citations are based upon available data. Refer to your format guides for proper bibliographic citations.</em></p>
|
||||||
|
|
||||||
<!-- BEGIN CHICAGO CITATION -->
|
<?php if (isset($book_data['type'])): ?>
|
||||||
|
<!-- Chicago Citation -->
|
||||||
<p class="metadata"><strong>Chicago</strong></p>
|
<p class="metadata"><strong>Chicago</strong></p>
|
||||||
<?php
|
<?php
|
||||||
if ($row_type == 'Text') {
|
$chicago = generate_chicago_citation(
|
||||||
echo '<p class="metadata">'.$row_author_sort.'. <em>'.$row_title.'.</em> '.$row_publocation.': '.$row_publisher.', '.$row_pubdate.'.<br />';
|
$book_data['type'],
|
||||||
echo '<div id=chicago style="display: none;">';
|
$book_data['author_sort'] ?? '',
|
||||||
echo '<p>'.$row_author_sort.'. <em>'.$row_title.'.</em> '.$row_publocation.': '.$row_publisher.', '.$row_pubdate.'</p>';
|
$book_data['title'] ?? '',
|
||||||
echo '</div>';
|
$book_data['publisher_location'] ?? '',
|
||||||
} elseif ($row_type == 'Music') {
|
$book_data['publisher'] ?? '',
|
||||||
echo '<p class="metadata">'.$row_author_sort.', <em>'.$row_title.'.</em> '.$row_publisher.', '.$row_pubdate.'.<br />';
|
$book_data['pubyear'] ?? ''
|
||||||
echo '<div id=chicago style="display: none;">';
|
);
|
||||||
echo '<p>'.$row_author_sort.', "'.$row_title.'." '.$row_publisher.', '.$row_pubdate.'</p>';
|
|
||||||
echo '</div>';
|
|
||||||
} else {
|
|
||||||
echo '<p class="metadata">'.$row_author_sort.', director. <em>'.$row_title.'.</em> '.$row_publisher.', '.$row_pubdate.'.<br />';
|
|
||||||
echo '<div id=chicago style="display: none;">';
|
|
||||||
echo '<p><p class="metadata">'.$row_author_sort.', director. <em>'.$row_title.'.</em> '.$row_publisher.', '.$row_pubdate.'</p>';
|
|
||||||
echo '</div>';
|
|
||||||
}
|
|
||||||
?>
|
?>
|
||||||
|
<p class="metadata"><?php echo $chicago; ?><br>
|
||||||
|
<div id="chicago" style="display: none;"><?php echo $chicago; ?></div>
|
||||||
<a href="#citations" onclick="copyToClip(document.getElementById('chicago').innerHTML)">Copy Chicago citation</a></p>
|
<a href="#citations" onclick="copyToClip(document.getElementById('chicago').innerHTML)">Copy Chicago citation</a></p>
|
||||||
<script>
|
|
||||||
function copyToClip(str) {
|
|
||||||
function listener(e) {
|
|
||||||
e.clipboardData.setData("text/html", str);
|
|
||||||
e.clipboardData.setData("text/plain", str);
|
|
||||||
e.preventDefault();
|
|
||||||
}
|
|
||||||
document.addEventListener("copy", listener);
|
|
||||||
document.execCommand("copy");
|
|
||||||
document.removeEventListener("copy", listener);
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
<!-- END CHICAGO CITATION -->
|
|
||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
|
|
||||||
<!-- BEGIN APA CITATION -->
|
<!-- APA Citation -->
|
||||||
<p class="metadata"><strong>APA</strong></p>
|
<p class="metadata"><strong>APA</strong></p>
|
||||||
<?php
|
<?php
|
||||||
$APA_author = explode(', ' ,$row_author_sort);
|
$apa = generate_apa_citation(
|
||||||
$APA_first = mb_strimwidth($APA_author[1], 0, 1);
|
$book_data['type'],
|
||||||
|
$book_data['author_sort'] ?? '',
|
||||||
if ($row_type == 'Text') {
|
$book_data['title'] ?? '',
|
||||||
echo '<p class="metadata">'.$APA_author[0].', '.$APA_first.'. ('.$row_pubdate.'). '.$row_title.'. '.$row_publisher.'.</p>';
|
$book_data['publisher'] ?? '',
|
||||||
echo '<div id=apa style="display: none;">';
|
$book_data['pubyear'] ?? '',
|
||||||
echo '<p>'.$APA_author[0].', '.$APA_first.'. ('.$row_pubdate.'). '.$row_title.'. '.$row_publisher.'.</p>';
|
$book_data['creator'] ?? ''
|
||||||
echo '</div>';
|
);
|
||||||
} elseif ($row_type == 'Music') {
|
|
||||||
echo '<p class="metadata">'.$row_creator.'. ('.$row_pubdate.'). <em>'.$row_title.'</em> [Album]. '.$row_publisher.'.</p>';
|
|
||||||
echo '<div id=apa style="display: none;">';
|
|
||||||
echo '<p>'.$row_creator.'. ('.$row_pubdate.'). <em>'.$row_title.'</em>. '.$row_publisher.'.</p>';
|
|
||||||
echo '</div>';
|
|
||||||
} else {
|
|
||||||
echo '<p class="metadata">'.$APA_author[0].', '.$APA_first.'. (Director). ('.$row_pubdate.'). <em>'.$row_title.'</em> [Film]. '.$row_publisher.'.</p>';
|
|
||||||
echo '<div id=apa style="display: none;">';
|
|
||||||
echo '<p>'.$APA_author[0].', '.$APA_first.'. (Director). ('.$row_pubdate.'). <em>'.$row_title.'</em> [Film]. '.$row_publisher.'.</p>';
|
|
||||||
echo '</div>';
|
|
||||||
}
|
|
||||||
?>
|
?>
|
||||||
|
<p class="metadata"><?php echo $apa; ?><br>
|
||||||
|
<div id="apa" style="display: none;"><?php echo $apa; ?></div>
|
||||||
<a href="#citations" onclick="copyToClip(document.getElementById('apa').innerHTML)">Copy APA citation</a></p>
|
<a href="#citations" onclick="copyToClip(document.getElementById('apa').innerHTML)">Copy APA citation</a></p>
|
||||||
<script>
|
|
||||||
function copyToClip(str) {
|
|
||||||
function listener(e) {
|
|
||||||
e.clipboardData.setData("text/html", str);
|
|
||||||
e.clipboardData.setData("text/plain", str);
|
|
||||||
e.preventDefault();
|
|
||||||
}
|
|
||||||
document.addEventListener("copy", listener);
|
|
||||||
document.execCommand("copy");
|
|
||||||
document.removeEventListener("copy", listener);
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
<!-- END APA CITATION -->
|
|
||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
|
|
||||||
<!-- MLA CITATION -->
|
<!-- MLA Citation -->
|
||||||
<p class="metadata"><strong>MLA</strong></p>
|
<p class="metadata"><strong>MLA</strong></p>
|
||||||
<?php
|
<?php
|
||||||
if ($row_type == 'Text') {
|
$mla = generate_mla_citation(
|
||||||
echo '<p class="metadata">'.$row_author_sort.'. <em>'.$row_title.'.</em> '.$row_publisher.', '.$row_pubdate.'.<br />';
|
$book_data['type'],
|
||||||
echo '<div id=mla style="display: none;">';
|
$book_data['author_sort'] ?? '',
|
||||||
echo '<p>'.$row_author_sort.'. <em>'.$row_title.'.</em> '.$row_publisher.', '.$row_pubdate.'.</p>';
|
$book_data['title'] ?? '',
|
||||||
echo '</div>';
|
$book_data['publisher'] ?? '',
|
||||||
} elseif ($row_type == 'Music') {
|
$book_data['pubyear'] ?? ''
|
||||||
echo '<p class="metadata">'.$row_author_sort.'. <em>'.$row_title.'.</em> '.$row_publisher.', '.$row_pubdate.'.<br />';
|
);
|
||||||
echo '<div id=mla style="display: none;">';
|
|
||||||
echo '<p>'.$row_author_sort.'. <em>'.$row_title.'.</em> '.$row_publisher.', '.$row_pubdate.'.</p>';
|
|
||||||
echo '</div>';
|
|
||||||
} else {
|
|
||||||
echo '<p class="metadata">'.$row_author_sort.', director. <em>'.$row_title.'.</em> '.$row_publisher.', '.$row_pubdate.'.<br />';
|
|
||||||
echo '<div id=mla style="display: none;">';
|
|
||||||
echo '<p>'.$row_author_sort.', director. <em>'.$row_title.'.</em> '.$row_publisher.', '.$row_pubdate.'.</p>';
|
|
||||||
echo '</div>';
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
<p class="metadata"><?php echo $mla; ?><br>
|
||||||
|
<div id="mla" style="display: none;"><?php echo $mla; ?></div>
|
||||||
<a href="#citations" onclick="copyToClip(document.getElementById('mla').innerHTML)">Copy MLA citation</a></p>
|
<a href="#citations" onclick="copyToClip(document.getElementById('mla').innerHTML)">Copy MLA citation</a></p>
|
||||||
<script>
|
<?php endif; ?>
|
||||||
function copyToClip(str) {
|
</div>
|
||||||
function listener(e) {
|
|
||||||
e.clipboardData.setData("text/html", str);
|
|
||||||
e.clipboardData.setData("text/plain", str);
|
|
||||||
e.preventDefault();
|
|
||||||
}
|
|
||||||
document.addEventListener("copy", listener);
|
|
||||||
document.execCommand("copy");
|
|
||||||
document.removeEventListener("copy", listener);
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
</div> <!-- END CITATIONS -->
|
<!-- METADATA -->
|
||||||
|
|
||||||
<!-- BEGIN METADATA -->
|
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<h3 class="fw-bolder"><u>Metadata</u></h3>
|
<h3 class="fw-bolder"><u>Metadata</u></h3>
|
||||||
<p class="metadata"><br />
|
<p class="metadata"><br>
|
||||||
<?php
|
<strong>Item Control Number:</strong> <?php echo (int)$ItemID; ?><br>
|
||||||
echo '<strong>Item Control Number: </strong>'.$ItemID.'<br />';
|
<strong>Title:</strong> <?php echo esc_html($book_data['title'] ?? 'Unknown'); ?><br>
|
||||||
echo '<strong>Title:</strong> '.$row_title.'<br />';
|
<strong>Creator:</strong>
|
||||||
echo '<strong>Creator:</strong> <a href="results.php?au='.$row_author_sort.'">'.$row_author_sort.'</a><br />';
|
<a href="results.php?au=<?php echo urlencode($book_data['author_sort'] ?? ''); ?>">
|
||||||
if ($row_series) {
|
<?php echo esc_html($book_data['author_sort'] ?? 'Unknown'); ?>
|
||||||
echo '<strong>Series:</strong> <a href="results.php?se='.$row_series.'">'.$row_series.'</a><br />';
|
</a><br>
|
||||||
echo '<strong>Series Index:</strong> '.$row_seriesindex.'<br />';
|
|
||||||
}
|
|
||||||
echo '<strong>Publisher:</strong> '.$row_publisher.'<br />';
|
|
||||||
echo '<strong>Location:</strong> '.$row_publocation.'<br />';
|
|
||||||
echo '<strong>Date: </strong>'.$row_pubdate.'<br />';
|
|
||||||
echo '<strong>Type: </strong> <a href="results.php?ty='.$row_type.'">'.$row_type.'</a><br />';
|
|
||||||
echo '<strong>Subtype: </strong> <a href="results.php?st='.$row_subtype.'">'.$row_subtype.'</a><br />';
|
|
||||||
echo '<strong>Subjects: </strong>';
|
|
||||||
while ($row = $tags->fetchArray()) {
|
|
||||||
$row_tags = $row['name'];
|
|
||||||
//echo '['.$row_tags.'] ';
|
|
||||||
echo '[<a href="results.php?su='.$row_tags.'">'.$row_tags.'</a>]';
|
|
||||||
}
|
|
||||||
echo '<br/ ><strong>Identifiers: </strong><br />';
|
|
||||||
while ($row = $identifiers->fetchArray()) {
|
|
||||||
$row_id_type = $row['type'];
|
|
||||||
$row_id_val = $row['val'];
|
|
||||||
//echo '<span style="margin-left: 10px;">'.$row_id_type.': ' .$row_id_val.'</span><br />';
|
|
||||||
if ($row_id_type == 'google') {
|
|
||||||
$identifierURL = 'https://books.google.com/books?id=';
|
|
||||||
} elseif ($row_id_type == 'isbn') {
|
|
||||||
$identifierURL = 'https://www.librarything.com/isbn/';
|
|
||||||
} elseif ($row_id_type == 'oclc') {
|
|
||||||
$identifierURL = 'https://worldcat.org/title/';
|
|
||||||
} elseif ($row_id_type == 'tmdb') {
|
|
||||||
$identifierURL = 'https://www.themoviedb.org/movie/';
|
|
||||||
} else {
|
|
||||||
$identifierURL = '#';
|
|
||||||
}
|
|
||||||
echo '<span style="margin-left: 10px;">'.$row_id_type.': <a href="'.$identifierURL.$row_id_val.'" target="_blank">'.$row_id_val.'</a></span><br />';
|
|
||||||
}
|
|
||||||
echo '<strong>Language(s): </strong>';
|
|
||||||
while ($row = $languages->fetchArray()) {
|
|
||||||
$row_lang_code = $row['lang_code'];
|
|
||||||
echo '[ '.$row_lang_code.' ] ';
|
|
||||||
}
|
|
||||||
echo '<br /><strong>Created: </strong>'.$row_created.'<br />';
|
|
||||||
echo '<strong>Last Modified: </strong>'.$row_modified;
|
|
||||||
?>
|
|
||||||
</p>
|
|
||||||
</div> <!-- END METADATA -->
|
|
||||||
|
|
||||||
|
<?php if (isset($book_data['series'])): ?>
|
||||||
|
<strong>Series:</strong>
|
||||||
|
<a href="results.php?se=<?php echo urlencode($book_data['series']); ?>">
|
||||||
|
<?php echo esc_html($book_data['series']); ?>
|
||||||
|
</a><br>
|
||||||
|
<strong>Series Index:</strong> <?php echo esc_html($book_data['series_index']); ?><br>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<strong>Publisher:</strong> <?php echo esc_html($book_data['publisher'] ?? 'Unknown'); ?><br>
|
||||||
|
<strong>Location:</strong> <?php echo esc_html($book_data['publisher_location'] ?? 'Unknown'); ?><br>
|
||||||
|
<strong>Date:</strong> <?php echo esc_html($book_data['pubyear'] ?? 'Unknown'); ?><br>
|
||||||
|
<strong>Type:</strong>
|
||||||
|
<a href="results.php?ty=<?php echo urlencode($book_data['type'] ?? ''); ?>">
|
||||||
|
<?php echo esc_html($book_data['type'] ?? 'Unknown'); ?>
|
||||||
|
</a><br>
|
||||||
|
|
||||||
|
<?php if (isset($book_data['subtype'])): ?>
|
||||||
|
<strong>Subtype:</strong>
|
||||||
|
<a href="results.php?st=<?php echo urlencode($book_data['subtype']); ?>">
|
||||||
|
<?php echo esc_html($book_data['subtype']); ?>
|
||||||
|
</a><br>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<strong>Subjects:</strong>
|
||||||
|
<?php foreach ($tags as $tag): ?>
|
||||||
|
[<a href="results.php?su=<?php echo urlencode($tag); ?>"><?php echo esc_html($tag); ?></a>]
|
||||||
|
<?php endforeach; ?>
|
||||||
|
|
||||||
|
<br><strong>Identifiers:</strong><br>
|
||||||
|
<?php foreach ($identifiers as $identifier): ?>
|
||||||
|
<?php $url = get_identifier_url($identifier['type']); ?>
|
||||||
|
<span style="margin-left: 10px;">
|
||||||
|
<?php echo esc_html($identifier['type']); ?>:
|
||||||
|
<a href="<?php echo esc_attr($url . $identifier['val']); ?>" target="_blank">
|
||||||
|
<?php echo esc_html($identifier['val']); ?>
|
||||||
|
</a>
|
||||||
|
</span><br>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
|
||||||
|
<strong>Language(s):</strong>
|
||||||
|
<?php foreach ($languages as $lang): ?>
|
||||||
|
[ <?php echo esc_html($lang); ?> ]
|
||||||
|
<?php endforeach; ?>
|
||||||
|
|
||||||
|
<br><strong>Created:</strong> <?php echo esc_html($book_data['created'] ?? 'Unknown'); ?><br>
|
||||||
|
<strong>Last Modified:</strong> <?php echo esc_html($book_data['modified'] ?? 'Unknown'); ?>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<!-- Related items section-->
|
<!-- Related items section-->
|
||||||
|
<?php if (count($similar_items) > 0): ?>
|
||||||
<section class="py-5 bg-light">
|
<section class="py-5 bg-light">
|
||||||
<div class="container px-4 px-lg-5 mt-5">
|
<div class="container px-4 px-lg-5 mt-5">
|
||||||
<h2 class="fw-bolder mb-4">Similar items</h2>
|
<h2 class="fw-bolder mb-4">Similar items</h2>
|
||||||
<div class="row gx-4 gx-lg-5 row-cols-2 row-cols-md-3 row-cols-xl-4 justify-content-center"> <!-- Begin Similar Items display area -->
|
<div class="row gx-4 gx-lg-5 row-cols-2 row-cols-md-3 row-cols-xl-4 justify-content-center">
|
||||||
|
<?php foreach ($similar_items as $item): ?>
|
||||||
<?php
|
<?php
|
||||||
while ($row = $getsimilar->fetchArray()) {
|
$item_id = (int)$item['id'];
|
||||||
$row_simbookid = $row['id'];
|
$item_image = "images/{$item_id}.jpg";
|
||||||
$row_simtitle = $row['title'];
|
if (!file_exists($item_image)) {
|
||||||
$row_simauthorsort = $row['author_sort'];
|
$item_image = "images/placeholder.jpg";
|
||||||
echo '<div class="col mb-5"> <!-- Begin Similar Items card -->';
|
|
||||||
echo '<div class="card h-100">';
|
|
||||||
echo '<!-- Item image-->';
|
|
||||||
echo '<a href="itemrecord.php?itemid='.$row_simbookid.'"><img class="card-img-top" src="images/'.$row_simbookid.'.jpg" /></a>';
|
|
||||||
echo '<!-- Product details-->';
|
|
||||||
echo '<div class="card-body p-4">';
|
|
||||||
echo '<div class="text-center">';
|
|
||||||
echo '<!-- Item name-->';
|
|
||||||
echo '<h5 class="fw-bolder">'.$row_simtitle.'</h5>';
|
|
||||||
echo '<!-- Item creator-->';
|
|
||||||
echo $row_simauthorsort;
|
|
||||||
echo '</div>';
|
|
||||||
echo '</div>';
|
|
||||||
echo '<!-- Item actions-->';
|
|
||||||
echo '<div class="card-footer p-4 pt-0 border-top-0 bg-transparent">';
|
|
||||||
echo '<div class="text-center"><a class="btn btn-outline-dark mt-auto" href="itemrecord.php?itemid='.$row_simbookid.'">View Item</a></div>';
|
|
||||||
echo '</div>';
|
|
||||||
echo '</div>';
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
echo '</div> <!-- End Similar Items card -->';
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</div> <!-- End Similar Items display area -->
|
<div class="col mb-5">
|
||||||
|
<div class="card h-100">
|
||||||
|
<a href="itemrecord.php?itemid=<?php echo $item_id; ?>">
|
||||||
|
<img class="card-img-top"
|
||||||
|
src="<?php echo esc_attr($item_image); ?>"
|
||||||
|
alt="<?php echo esc_attr($item['title']); ?>">
|
||||||
|
</a>
|
||||||
|
<div class="card-body p-4">
|
||||||
|
<div class="text-center">
|
||||||
|
<h5 class="fw-bolder"><?php echo esc_html($item['title']); ?></h5>
|
||||||
|
<?php echo esc_html($item['author_sort']); ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="card-footer p-4 pt-0 border-top-0 bg-transparent">
|
||||||
|
<div class="text-center">
|
||||||
|
<a class="btn btn-outline-dark mt-auto"
|
||||||
|
href="itemrecord.php?itemid=<?php echo $item_id; ?>">
|
||||||
|
View Item
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
<!-- Footer-->
|
<!-- Footer-->
|
||||||
<footer class="py-5 bg-dark">
|
<footer class="py-5 bg-dark">
|
||||||
<div class="container"><p class="m-0 text-center text-white">Copyright - Creative Commons By-NC-SA - Infopump</p></div>
|
<div class="container">
|
||||||
|
<p class="m-0 text-center text-white">Copyright - Creative Commons By-NC-SA - Infopump</p>
|
||||||
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<!-- Bootstrap core JS-->
|
<!-- Bootstrap core JS-->
|
||||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js"></script>
|
||||||
|
|
||||||
|
<!-- Citation copy script -->
|
||||||
|
<script>
|
||||||
|
function copyToClip(str) {
|
||||||
|
function listener(e) {
|
||||||
|
e.clipboardData.setData("text/html", str);
|
||||||
|
e.clipboardData.setData("text/plain", str);
|
||||||
|
e.preventDefault();
|
||||||
|
}
|
||||||
|
document.addEventListener("copy", listener);
|
||||||
|
document.execCommand("copy");
|
||||||
|
document.removeEventListener("copy", listener);
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
<!-- Core theme JS-->
|
<!-- Core theme JS-->
|
||||||
<script src="item/js/scripts.js"></script>
|
<script src="item/js/scripts.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
<?php
|
||||||
|
// Clean up database connection
|
||||||
|
if ($db) {
|
||||||
|
$db->close();
|
||||||
|
}
|
||||||
|
?>
|
||||||
BIN
original-template/.DS_Store
vendored
BIN
original-template/.DS_Store
vendored
Binary file not shown.
251
recent.php
251
recent.php
@@ -2,80 +2,131 @@
|
|||||||
|
|
||||||
include_once "settings.php";
|
include_once "settings.php";
|
||||||
|
|
||||||
// Get and use a basic title search for pulling records.
|
// Initialize variables
|
||||||
$keywordsearch = htmlspecialchars($_GET["kw"]);
|
$keywordsearch = '';
|
||||||
$authorsearch = htmlspecialchars($_GET["au"]);
|
$authorsearch = '';
|
||||||
$typesearch = htmlspecialchars($_GET["ty"]);
|
$typesearch = '';
|
||||||
|
$searchtopic = '';
|
||||||
|
$searchtype = '';
|
||||||
|
|
||||||
$socialkw = mb_convert_case($keywordsearch, MB_CASE_TITLE, "UTF-8");
|
// Sanitize and validate input
|
||||||
$socialau = mb_convert_case($authorsearch, MB_CASE_TITLE, "UTF-8");
|
if (!empty($_GET["kw"])) {
|
||||||
$socialty = mb_convert_case($typesearch, MB_CASE_TITLE, "UTF-8");
|
$keywordsearch = trim($_GET["kw"]);
|
||||||
|
$searchtopic = 'Keyword: ' . htmlspecialchars($keywordsearch, ENT_QUOTES, 'UTF-8');
|
||||||
if (!empty($keywordsearch)) {
|
$searchtype = 'keyword';
|
||||||
$searchtopic = 'Keyword: '.$socialkw;
|
} elseif (!empty($_GET["au"])) {
|
||||||
} elseif (!empty($authorsearch)) {
|
$authorsearch = trim($_GET["au"]);
|
||||||
$searchtopic = 'Author: '.$socialau;
|
$searchtopic = 'Author: ' . htmlspecialchars($authorsearch, ENT_QUOTES, 'UTF-8');
|
||||||
} else {
|
$searchtype = 'author';
|
||||||
$searchtopic = 'Type: '.$socialty;
|
} elseif (!empty($_GET["ty"])) {
|
||||||
|
$typesearch = trim($_GET["ty"]);
|
||||||
|
$searchtopic = 'Type: ' . htmlspecialchars(mb_convert_case($typesearch, MB_CASE_TITLE, "UTF-8"), ENT_QUOTES, 'UTF-8');
|
||||||
|
$searchtype = 'type';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If no valid search parameter, redirect to index
|
||||||
|
if (empty($searchtype)) {
|
||||||
|
header('Location: index.php');
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
// -------------------- BEGIN DATABASE QUERIES --------------------
|
// -------------------- BEGIN DATABASE QUERIES --------------------
|
||||||
|
|
||||||
// Establish atabase connection
|
// Establish database connection
|
||||||
|
try {
|
||||||
$db = new SQLite3('metadata.sqlite');
|
$db = new SQLite3('metadata.sqlite');
|
||||||
|
$db->enableExceptions(true);
|
||||||
|
} catch (Exception $e) {
|
||||||
|
error_log("Database connection error: " . $e->getMessage());
|
||||||
|
die("Database connection failed");
|
||||||
|
}
|
||||||
|
|
||||||
$keywordquery = $db->query("SELECT
|
// Prepare the appropriate query based on search type
|
||||||
|
$results = null;
|
||||||
|
|
||||||
|
switch ($searchtype) {
|
||||||
|
case 'keyword':
|
||||||
|
$searchPattern = '%' . $keywordsearch . '%';
|
||||||
|
$stmt = $db->prepare("SELECT
|
||||||
DISTINCT books.id AS id,
|
DISTINCT books.id AS id,
|
||||||
books.title AS title,
|
books.title AS title,
|
||||||
SUBSTR(comments.text, 0, 120) AS excerpt
|
SUBSTR(comments.text, 0, 120) AS excerpt
|
||||||
FROM books
|
FROM books
|
||||||
INNER JOIN
|
INNER JOIN comments ON comments.book = books.id
|
||||||
comments ON comments.book = books.id
|
INNER JOIN books_tags_link ON books_tags_link.book = books.id
|
||||||
INNER JOIN
|
INNER JOIN tags ON tags.id = books_tags_link.tag
|
||||||
books_tags_link ON books_tags_link.book = books.id
|
WHERE books.title LIKE :search
|
||||||
INNER JOIN
|
OR books.author_sort LIKE :search
|
||||||
tags ON tags.id = books_tags_link.tag
|
OR comments.text LIKE :search
|
||||||
WHERE books.title LIKE '%$keywordsearch%'
|
OR tags.name LIKE :search
|
||||||
OR books.author_sort LIKE '%$keywordsearch%'
|
ORDER BY books.timestamp DESC
|
||||||
OR comments.text LIKE '%$keywordsearch%'
|
LIMIT 100");
|
||||||
OR tags.name LIKE '%$keywordsearch%'
|
$stmt->bindValue(':search', $searchPattern, SQLITE3_TEXT);
|
||||||
ORDER BY books.timestamp DESC");
|
break;
|
||||||
|
|
||||||
$authorquery = $db->query("SELECT
|
case 'author':
|
||||||
|
$searchPattern = '%' . $authorsearch . '%';
|
||||||
|
$stmt = $db->prepare("SELECT
|
||||||
DISTINCT books.id AS id,
|
DISTINCT books.id AS id,
|
||||||
books.title AS title,
|
books.title AS title,
|
||||||
SUBSTR(comments.text, 0, 120) AS excerpt
|
SUBSTR(comments.text, 0, 120) AS excerpt
|
||||||
FROM books
|
FROM books
|
||||||
INNER JOIN
|
INNER JOIN comments ON comments.book = books.id
|
||||||
comments ON comments.book = books.id
|
INNER JOIN books_tags_link ON books_tags_link.book = books.id
|
||||||
INNER JOIN
|
WHERE books.author_sort LIKE :search
|
||||||
books_tags_link ON books_tags_link.book = books.id
|
ORDER BY books.timestamp DESC
|
||||||
WHERE books.author_sort LIKE '%$authorsearch%'
|
LIMIT 100");
|
||||||
ORDER BY books.timestamp DESC");
|
$stmt->bindValue(':search', $searchPattern, SQLITE3_TEXT);
|
||||||
|
break;
|
||||||
|
|
||||||
$typequery = $db->query("SELECT
|
case 'type':
|
||||||
|
$stmt = $db->prepare("SELECT
|
||||||
DISTINCT books.id AS id,
|
DISTINCT books.id AS id,
|
||||||
books.title AS title,
|
books.title AS title,
|
||||||
SUBSTR(comments.text, 0, 120) AS excerpt
|
SUBSTR(comments.text, 0, 120) AS excerpt
|
||||||
FROM books
|
FROM books
|
||||||
INNER JOIN
|
INNER JOIN comments ON comments.book = books.id
|
||||||
comments ON comments.book = books.id
|
INNER JOIN books_custom_column_1_link ON books_custom_column_1_link.book = books.id
|
||||||
INNER JOIN
|
INNER JOIN custom_column_1 ON custom_column_1.id = books_custom_column_1_link.value
|
||||||
books_custom_column_1_link ON books_custom_column_1_link.book = books.id
|
WHERE custom_column_1.value = :search
|
||||||
INNER JOIN
|
ORDER BY books.timestamp DESC
|
||||||
custom_column_1 ON custom_column_1.id = books_custom_column_1_link.value
|
LIMIT 100");
|
||||||
WHERE
|
$stmt->bindValue(':search', $typesearch, SQLITE3_TEXT);
|
||||||
custom_column_1.value = '$typesearch'
|
break;
|
||||||
ORDER BY books.timestamp DESC");
|
}
|
||||||
|
|
||||||
|
// Execute query and handle errors
|
||||||
|
try {
|
||||||
|
$results = $stmt->execute();
|
||||||
|
} catch (Exception $e) {
|
||||||
|
error_log("Query execution error: " . $e->getMessage());
|
||||||
|
$results = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get types for menu
|
||||||
|
try {
|
||||||
|
$types = $db->query("SELECT value FROM custom_column_1 ORDER BY value ASC");
|
||||||
|
} catch (Exception $e) {
|
||||||
|
error_log("Types query error: " . $e->getMessage());
|
||||||
|
$types = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Build social media URLs safely
|
||||||
|
$socialUrl = '';
|
||||||
|
switch ($searchtype) {
|
||||||
|
case 'keyword':
|
||||||
|
$socialUrl = $SiteURL . '/recent.php?kw=' . urlencode($keywordsearch);
|
||||||
|
break;
|
||||||
|
case 'author':
|
||||||
|
$socialUrl = $SiteURL . '/recent.php?au=' . urlencode($authorsearch);
|
||||||
|
break;
|
||||||
|
case 'type':
|
||||||
|
$socialUrl = $SiteURL . '/recent.php?ty=' . urlencode($typesearch);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
$types = $db->query("SELECT
|
|
||||||
value
|
|
||||||
FROM custom_column_1
|
|
||||||
ORDER BY value ASC");
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
|
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
|
||||||
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
|
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
|
||||||
@@ -84,9 +135,9 @@ ORDER BY value ASC");
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<title>Infopump - Recently Added - <?php echo $searchtopic; ?></title>
|
<title>Infopump - Recently Added - <?php echo htmlspecialchars($searchtopic, ENT_QUOTES, 'UTF-8'); ?></title>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<meta name="description" content="Free HTML5 Template by FREEHTML5.CO" />
|
<meta name="description" content="Recently added items for <?php echo htmlspecialchars($searchtopic, ENT_QUOTES, 'UTF-8'); ?>" />
|
||||||
<meta name="keywords" content="free html5, free template, free bootstrap, html5, css3, mobile first, responsive" />
|
<meta name="keywords" content="free html5, free template, free bootstrap, html5, css3, mobile first, responsive" />
|
||||||
<meta name="author" content="FREEHTML5.CO" />
|
<meta name="author" content="FREEHTML5.CO" />
|
||||||
|
|
||||||
@@ -105,33 +156,14 @@ ORDER BY value ASC");
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
<!-- Facebook and Twitter integration -->
|
<!-- Facebook and Twitter integration -->
|
||||||
<meta property="og:title" content=<?php echo '"'.$SiteName.' - Recently Added - '.$searchtopic.'" />';?>
|
<meta property="og:title" content="<?php echo htmlspecialchars($SiteName . ' - Recently Added - ' . $searchtopic, ENT_QUOTES, 'UTF-8'); ?>" />
|
||||||
|
<meta property="og:image" content="<?php echo htmlspecialchars($SiteURL, ENT_QUOTES, 'UTF-8'); ?>/images/og-site-avatar.jpg" />
|
||||||
<meta property="og:image" content=<?php echo '"'.$SiteURL.'/images/og-site-avatar.jpg" />';?>
|
<meta property="og:url" content="<?php echo htmlspecialchars($socialUrl, ENT_QUOTES, 'UTF-8'); ?>" />
|
||||||
|
<meta property="og:site_name" content="<?php echo htmlspecialchars($SiteName . ' - Recently Added', ENT_QUOTES, 'UTF-8'); ?>" />
|
||||||
<?php
|
<meta property="og:description" content="<?php echo htmlspecialchars($SubName, ENT_QUOTES, 'UTF-8'); ?>" />
|
||||||
if (!empty($keywordsearch)) {
|
<meta name="twitter:title" content="<?php echo htmlspecialchars($SiteName . ' - Recently Added - ' . $searchtopic, ENT_QUOTES, 'UTF-8'); ?>" />
|
||||||
echo '<meta property="og:url" content="'.$SiteURL.'/recent.php?kw='.$socialkw.'" />';
|
<meta name="twitter:image" content="<?php echo htmlspecialchars($SiteURL, ENT_QUOTES, 'UTF-8'); ?>/images/og-site-avatar.jpg" />
|
||||||
echo '<meta name="twitter:url" content="'.$SiteURL.'/recent.php?kw='.$socialkw.'" />';
|
<meta name="twitter:url" content="<?php echo htmlspecialchars($socialUrl, ENT_QUOTES, 'UTF-8'); ?>" />
|
||||||
} elseif (!empty($authorsearch)) {
|
|
||||||
echo '<meta property="og:url" content="'.$SiteURL.'/recent.php?au='.$socialau.'" />';
|
|
||||||
echo '<meta name="twitter:url" content="'.$SiteURL.'/recent.php?au='.$socialau.'" />';
|
|
||||||
} else {
|
|
||||||
echo '<meta property="og:url" content="'.$SiteURL.'/recent.php?ty='.$socialty.'" />';
|
|
||||||
echo '<meta name="twitter:url" content="'.$SiteURL.'/recent.php?ty='.$socialty.'" />';
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
|
|
||||||
<meta property="og:site_name" content=<?php echo '"'.$SiteName.' - Recently Added" />';?>
|
|
||||||
|
|
||||||
<meta property="og:description" content=<?php echo '"'.$SubName.'" />';?>
|
|
||||||
|
|
||||||
<meta name="twitter:title" content=<?php echo '"'.$SiteName.' - Recently Added - '.$searchtopic.'" />';?>
|
|
||||||
|
|
||||||
<meta name="twitter:image" content=<?php echo '"'.$SiteURL.'/images/og-site-avatar.jpg" />';?>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<meta name="twitter:card" content="summary" />
|
<meta name="twitter:card" content="summary" />
|
||||||
|
|
||||||
<!-- Place favicon.ico and apple-touch-icon.png in the root directory -->
|
<!-- Place favicon.ico and apple-touch-icon.png in the root directory -->
|
||||||
@@ -144,10 +176,8 @@ ORDER BY value ASC");
|
|||||||
<link rel="stylesheet" href="css/icomoon.css">
|
<link rel="stylesheet" href="css/icomoon.css">
|
||||||
<!-- Bootstrap -->
|
<!-- Bootstrap -->
|
||||||
<link rel="stylesheet" href="css/bootstrap.css">
|
<link rel="stylesheet" href="css/bootstrap.css">
|
||||||
|
|
||||||
<link rel="stylesheet" href="css/style.css">
|
<link rel="stylesheet" href="css/style.css">
|
||||||
|
|
||||||
|
|
||||||
<!-- Modernizr JS -->
|
<!-- Modernizr JS -->
|
||||||
<script src="js/modernizr-2.6.2.min.js"></script>
|
<script src="js/modernizr-2.6.2.min.js"></script>
|
||||||
<!-- FOR IE9 below -->
|
<!-- FOR IE9 below -->
|
||||||
@@ -165,7 +195,7 @@ ORDER BY value ASC");
|
|||||||
</figure>
|
</figure>
|
||||||
<h3 class="heading">About the Project</h3>
|
<h3 class="heading">About the Project</h3>
|
||||||
<a href="index.php"><h2>Infopump</h2></a>
|
<a href="index.php"><h2>Infopump</h2></a>
|
||||||
<p>A bibliographic management and display system.</p>
|
<p>A bibliographic management and display system.<br /><a href="about.php">More info</a></p>
|
||||||
<hr>
|
<hr>
|
||||||
<p>A free, open source project from:<br />
|
<p>A free, open source project from:<br />
|
||||||
<a href="https://rss.com/podcasts/l0wl1f3podcast/">The L0WL1F3 Podcast</a><br />
|
<a href="https://rss.com/podcasts/l0wl1f3podcast/">The L0WL1F3 Podcast</a><br />
|
||||||
@@ -173,8 +203,8 @@ ORDER BY value ASC");
|
|||||||
<a href="https://cyberpunklibrarian.com">Cyberpunk Librarian</a>
|
<a href="https://cyberpunklibrarian.com">Cyberpunk Librarian</a>
|
||||||
</p>
|
</p>
|
||||||
<ul class="fh5co-social">
|
<ul class="fh5co-social">
|
||||||
<!--<li><a href="#"><i class="icon-twitter"></i></a></li>-->
|
<!--<li><a href="#"><i class="icon-twitter"></i></a></li>
|
||||||
<!--<li><a href="#"><i class="icon-facebook"></i></a></li>
|
<li><a href="#"><i class="icon-facebook"></i></a></li>
|
||||||
<li><a href="#"><i class="icon-instagram"></i></a></li>-->
|
<li><a href="#"><i class="icon-instagram"></i></a></li>-->
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
@@ -184,22 +214,22 @@ ORDER BY value ASC");
|
|||||||
<h3 class="heading">Recent Additions</h3>
|
<h3 class="heading">Recent Additions</h3>
|
||||||
<ul>
|
<ul>
|
||||||
<?php
|
<?php
|
||||||
while ($row = $types->fetchArray()) {
|
if ($types) {
|
||||||
$row_value = $row['value'];
|
while ($row = $types->fetchArray(SQLITE3_ASSOC)) {
|
||||||
$row_titlecase = mb_convert_case($row_value, MB_CASE_TITLE, "UTF-8");
|
$row_value = htmlspecialchars($row['value'], ENT_QUOTES, 'UTF-8');
|
||||||
echo '<li><a href="recent.php?ty='.$row_value.'">'.$row_titlecase.'</a></li>';
|
$row_titlecase = htmlspecialchars(mb_convert_case($row['value'], MB_CASE_TITLE, "UTF-8"), ENT_QUOTES, 'UTF-8');
|
||||||
//echo '<li>'.$row_value.'</li>';
|
echo '<li><a href="recent.php?ty=' . urlencode($row['value']) . '">' . $row_titlecase . '</a></li>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="fh5co-box">
|
<div class="fh5co-box">
|
||||||
<h3 class="heading">Search</h3>
|
<h3 class="heading">Search</h3>
|
||||||
<form action="results.php" method="get">
|
<form action="results.php" method="get">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<input type="text" class="form-control" name="kw" placeholder="Keyword search">
|
<input type="text" class="form-control" name="kw" placeholder="Keyword search" maxlength="100">
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
@@ -219,7 +249,7 @@ ORDER BY value ASC");
|
|||||||
<li><a href="#"><i class="icon-instagram"></i></a></li>
|
<li><a href="#"><i class="icon-instagram"></i></a></li>
|
||||||
</ul> -->
|
</ul> -->
|
||||||
<div class="col-lg-12 col-md-12 text-center">
|
<div class="col-lg-12 col-md-12 text-center">
|
||||||
<h1 id="fh5co-logo"><a href="index.php">Recently Added<br /><br /><?php echo $searchtopic; ?></a></h1>
|
<h1 id="fh5co-logo"><a href="index.php">Recently Added<br /><br /><?php echo htmlspecialchars($searchtopic, ENT_QUOTES, 'UTF-8'); ?></a></h1>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@@ -235,30 +265,25 @@ ORDER BY value ASC");
|
|||||||
<div class="row rp-b">
|
<div class="row rp-b">
|
||||||
<div class="col-md-12 animate-box">
|
<div class="col-md-12 animate-box">
|
||||||
<?php
|
<?php
|
||||||
if ($keywordsearch != '') {
|
if ($results) {
|
||||||
while ($row = $keywordquery->fetchArray()) {
|
$hasResults = false;
|
||||||
$row_id = $row['id'];
|
while ($row = $results->fetchArray(SQLITE3_ASSOC)) {
|
||||||
$row_title = $row['title'];
|
$hasResults = true;
|
||||||
$row_excerpt = $row['excerpt'];
|
$row_id = (int)$row['id'];
|
||||||
|
$row_title = htmlspecialchars($row['title'], ENT_QUOTES, 'UTF-8');
|
||||||
|
$row_excerpt = htmlspecialchars(strip_tags($row['excerpt']), ENT_QUOTES, 'UTF-8');
|
||||||
|
|
||||||
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;">';
|
||||||
|
echo '<img style="float:left; max-height: 120px; padding: 10px 10px" src="images/' . $row_id . '.jpg" alt="' . $row_title . '">';
|
||||||
|
echo '<strong><em><a href="itemrecord.php?itemid=' . $row_id . '">' . $row_title . '</a></em> :</strong> ';
|
||||||
|
echo $row_excerpt . '...</p>';
|
||||||
}
|
}
|
||||||
} elseif ($typesearch != '') {
|
|
||||||
while ($row = $typequery->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>';
|
if (!$hasResults) {
|
||||||
|
echo '<p>No recent items found.</p>';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
while ($row = $authorquery->fetchArray()) {
|
echo '<p>An error occurred while retrieving recent items. Please try again.</p>';
|
||||||
$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>
|
||||||
@@ -287,3 +312,7 @@ ORDER BY value ASC");
|
|||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
// Close database connection
|
||||||
|
$db->close();
|
||||||
|
?>
|
||||||
371
results.php
371
results.php
@@ -2,140 +2,200 @@
|
|||||||
|
|
||||||
include_once "settings.php";
|
include_once "settings.php";
|
||||||
|
|
||||||
// Get and use a basic title search for pulling records.
|
// Initialize variables
|
||||||
$keywordsearch = htmlspecialchars($_GET["kw"]);
|
$keywordsearch = '';
|
||||||
$authorsearch = htmlspecialchars($_GET["au"]);
|
$authorsearch = '';
|
||||||
$typesearch = htmlspecialchars($_GET["ty"]);
|
$typesearch = '';
|
||||||
$subtypesearch = htmlspecialchars($_GET["st"]);
|
$subtypesearch = '';
|
||||||
$seriessearch = htmlspecialchars($_GET["se"]);
|
$seriessearch = '';
|
||||||
$subjectsearch = htmlspecialchars($_GET["su"]);
|
$subjectsearch = '';
|
||||||
|
$searchtopic = '';
|
||||||
|
$searchtype = '';
|
||||||
|
|
||||||
$socialkw = mb_convert_case($keywordsearch, MB_CASE_TITLE, "UTF-8");
|
// Sanitize and validate input
|
||||||
$socialau = mb_convert_case($authorsearch, MB_CASE_TITLE, "UTF-8");
|
if (!empty($_GET["kw"])) {
|
||||||
$socialty = mb_convert_case($typesearch, MB_CASE_TITLE, "UTF-8");
|
$keywordsearch = trim($_GET["kw"]);
|
||||||
$socialst = mb_convert_case($subtypesearch, MB_CASE_TITLE, "UTF-8");
|
$searchtopic = 'Keyword: ' . htmlspecialchars($keywordsearch, ENT_QUOTES, 'UTF-8');
|
||||||
$socialse = mb_convert_case($seriessearch, MB_CASE_TITLE, "UTF-8");
|
$searchtype = 'keyword';
|
||||||
$socialsu = mb_convert_case($subjectsearch, MB_CASE_TITLE, "UTF-8");
|
} elseif (!empty($_GET["au"])) {
|
||||||
|
$authorsearch = trim($_GET["au"]);
|
||||||
|
$searchtopic = 'Author: ' . htmlspecialchars($authorsearch, ENT_QUOTES, 'UTF-8');
|
||||||
|
$searchtype = 'author';
|
||||||
|
} elseif (!empty($_GET["ty"])) {
|
||||||
|
$typesearch = trim($_GET["ty"]);
|
||||||
|
$searchtopic = 'Type: ' . htmlspecialchars(mb_convert_case($typesearch, MB_CASE_TITLE, "UTF-8"), ENT_QUOTES, 'UTF-8');
|
||||||
|
$searchtype = 'type';
|
||||||
|
} elseif (!empty($_GET["st"])) {
|
||||||
|
$subtypesearch = trim($_GET["st"]);
|
||||||
|
$searchtopic = 'Subtype: ' . htmlspecialchars(mb_convert_case($subtypesearch, MB_CASE_TITLE, "UTF-8"), ENT_QUOTES, 'UTF-8');
|
||||||
|
$searchtype = 'subtype';
|
||||||
|
} elseif (!empty($_GET["se"])) {
|
||||||
|
$seriessearch = trim($_GET["se"]);
|
||||||
|
$searchtopic = 'Series: ' . htmlspecialchars($seriessearch, ENT_QUOTES, 'UTF-8');
|
||||||
|
$searchtype = 'series';
|
||||||
|
} elseif (!empty($_GET["su"])) {
|
||||||
|
$subjectsearch = trim($_GET["su"]);
|
||||||
|
$searchtopic = 'Subject: ' . htmlspecialchars($subjectsearch, ENT_QUOTES, 'UTF-8');
|
||||||
|
$searchtype = 'subject';
|
||||||
|
}
|
||||||
|
|
||||||
if (!empty($keywordsearch)) {
|
// If no valid search parameter, redirect to index
|
||||||
$searchtopic = 'Keyword: '.$socialkw;
|
if (empty($searchtype)) {
|
||||||
} elseif (!empty($authorsearch)) {
|
header('Location: index.php');
|
||||||
$searchtopic = 'Author: '.$socialau;
|
exit;
|
||||||
} elseif (!empty($typesearch)) {
|
|
||||||
$searchtopic = 'Type: '.$socialty;
|
|
||||||
} elseif (!empty($seriessearch)) {
|
|
||||||
$searchtopic = 'Series: '.$socialse;
|
|
||||||
} elseif (!empty($subjectsearch)) {
|
|
||||||
$searchtopic = 'Subject: '.$socialsu;
|
|
||||||
} else {
|
|
||||||
$searchtopic = 'Subtype: '.$socialst;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// -------------------- BEGIN DATABASE QUERIES --------------------
|
// -------------------- BEGIN DATABASE QUERIES --------------------
|
||||||
|
|
||||||
// Establish atabase connection
|
// Establish database connection
|
||||||
|
try {
|
||||||
$db = new SQLite3('metadata.sqlite');
|
$db = new SQLite3('metadata.sqlite');
|
||||||
|
$db->enableExceptions(true);
|
||||||
|
} catch (Exception $e) {
|
||||||
|
error_log("Database connection error: " . $e->getMessage());
|
||||||
|
die("Database connection failed");
|
||||||
|
}
|
||||||
|
|
||||||
$keywordquery = $db->query("SELECT
|
// Prepare the appropriate query based on search type
|
||||||
|
$results = null;
|
||||||
|
|
||||||
|
switch ($searchtype) {
|
||||||
|
case 'keyword':
|
||||||
|
$searchPattern = '%' . $keywordsearch . '%';
|
||||||
|
$stmt = $db->prepare("SELECT
|
||||||
DISTINCT books.id AS id,
|
DISTINCT books.id AS id,
|
||||||
books.title AS title,
|
books.title AS title,
|
||||||
SUBSTR(comments.text, 0, 120) AS excerpt
|
SUBSTR(comments.text, 0, 120) AS excerpt
|
||||||
FROM books
|
FROM books
|
||||||
INNER JOIN
|
INNER JOIN comments ON comments.book = books.id
|
||||||
comments ON comments.book = books.id
|
INNER JOIN books_tags_link ON books_tags_link.book = books.id
|
||||||
INNER JOIN
|
INNER JOIN tags ON tags.id = books_tags_link.tag
|
||||||
books_tags_link ON books_tags_link.book = books.id
|
WHERE books.title LIKE :search
|
||||||
INNER JOIN
|
OR books.author_sort LIKE :search
|
||||||
tags ON tags.id = books_tags_link.tag
|
OR comments.text LIKE :search
|
||||||
WHERE books.title LIKE '%$keywordsearch%'
|
OR tags.name LIKE :search
|
||||||
OR books.author_sort LIKE '%$keywordsearch%'
|
ORDER BY books.title ASC
|
||||||
OR comments.text LIKE '%$keywordsearch%'
|
LIMIT 100");
|
||||||
OR tags.name LIKE '%$keywordsearch%'
|
$stmt->bindValue(':search', $searchPattern, SQLITE3_TEXT);
|
||||||
ORDER BY books.title ASC");
|
break;
|
||||||
|
|
||||||
$authorquery = $db->query("SELECT
|
case 'author':
|
||||||
|
$searchPattern = '%' . $authorsearch . '%';
|
||||||
|
$stmt = $db->prepare("SELECT
|
||||||
DISTINCT books.id AS id,
|
DISTINCT books.id AS id,
|
||||||
books.title AS title,
|
books.title AS title,
|
||||||
SUBSTR(comments.text, 0, 120) AS excerpt
|
SUBSTR(comments.text, 0, 120) AS excerpt
|
||||||
FROM books
|
FROM books
|
||||||
INNER JOIN
|
INNER JOIN comments ON comments.book = books.id
|
||||||
comments ON comments.book = books.id
|
INNER JOIN books_tags_link ON books_tags_link.book = books.id
|
||||||
INNER JOIN
|
WHERE books.author_sort LIKE :search
|
||||||
books_tags_link ON books_tags_link.book = books.id
|
ORDER BY books.title ASC
|
||||||
WHERE books.author_sort LIKE '%$authorsearch%'
|
LIMIT 100");
|
||||||
ORDER BY books.title ASC");
|
$stmt->bindValue(':search', $searchPattern, SQLITE3_TEXT);
|
||||||
|
break;
|
||||||
|
|
||||||
$typequery = $db->query("SELECT
|
case 'type':
|
||||||
|
$stmt = $db->prepare("SELECT
|
||||||
DISTINCT books.id AS id,
|
DISTINCT books.id AS id,
|
||||||
books.title AS title,
|
books.title AS title,
|
||||||
SUBSTR(comments.text, 0, 120) AS excerpt
|
SUBSTR(comments.text, 0, 120) AS excerpt
|
||||||
FROM books
|
FROM books
|
||||||
INNER JOIN
|
INNER JOIN comments ON comments.book = books.id
|
||||||
comments ON comments.book = books.id
|
INNER JOIN books_custom_column_1_link ON books_custom_column_1_link.book = books.id
|
||||||
INNER JOIN
|
INNER JOIN custom_column_1 ON custom_column_1.id = books_custom_column_1_link.value
|
||||||
books_custom_column_1_link ON books_custom_column_1_link.book = books.id
|
WHERE custom_column_1.value = :search
|
||||||
INNER JOIN
|
ORDER BY books.title ASC
|
||||||
custom_column_1 ON custom_column_1.id = books_custom_column_1_link.value
|
LIMIT 100");
|
||||||
WHERE
|
$stmt->bindValue(':search', $typesearch, SQLITE3_TEXT);
|
||||||
custom_column_1.value = '$typesearch'
|
break;
|
||||||
ORDER BY books.title ASC");
|
|
||||||
|
|
||||||
$subtypequery = $db->query("SELECT
|
case 'subtype':
|
||||||
|
$stmt = $db->prepare("SELECT
|
||||||
DISTINCT books.id AS id,
|
DISTINCT books.id AS id,
|
||||||
books.title AS title,
|
books.title AS title,
|
||||||
SUBSTR(comments.text, 0, 120) AS excerpt
|
SUBSTR(comments.text, 0, 120) AS excerpt
|
||||||
FROM books
|
FROM books
|
||||||
INNER JOIN
|
INNER JOIN comments ON comments.book = books.id
|
||||||
comments ON comments.book = books.id
|
INNER JOIN books_custom_column_3_link ON books_custom_column_3_link.book = books.id
|
||||||
INNER JOIN
|
INNER JOIN custom_column_3 ON custom_column_3.id = books_custom_column_3_link.value
|
||||||
books_custom_column_3_link ON books_custom_column_3_link.book = books.id
|
WHERE custom_column_3.value = :search
|
||||||
INNER JOIN
|
ORDER BY books.title ASC
|
||||||
custom_column_3 ON custom_column_3.id = books_custom_column_3_link.value
|
LIMIT 100");
|
||||||
WHERE
|
$stmt->bindValue(':search', $subtypesearch, SQLITE3_TEXT);
|
||||||
custom_column_3.value = '$subtypesearch'
|
break;
|
||||||
ORDER BY books.title ASC");
|
|
||||||
|
|
||||||
$seriesquery = $db->query("SELECT
|
case 'series':
|
||||||
|
$stmt = $db->prepare("SELECT
|
||||||
DISTINCT books.id AS id,
|
DISTINCT books.id AS id,
|
||||||
books.title AS title,
|
books.title AS title,
|
||||||
SUBSTR(comments.text, 0, 120) AS excerpt
|
SUBSTR(comments.text, 0, 120) AS excerpt
|
||||||
FROM books
|
FROM books
|
||||||
INNER JOIN
|
INNER JOIN comments ON comments.book = books.id
|
||||||
comments ON comments.book = books.id
|
INNER JOIN books_series_link ON books_series_link.book = books.id
|
||||||
INNER JOIN
|
INNER JOIN series ON series.id = books_series_link.series
|
||||||
books_series_link ON books_series_link.book = books.id
|
WHERE series.name = :search
|
||||||
INNER JOIN
|
ORDER BY books.series_index ASC
|
||||||
series ON series.id = books_series_link.series
|
LIMIT 100");
|
||||||
WHERE series.name = '$seriessearch'
|
$stmt->bindValue(':search', $seriessearch, SQLITE3_TEXT);
|
||||||
ORDER BY books.series_index ASC");
|
break;
|
||||||
|
|
||||||
$subjectquery = $db->query("SELECT
|
case 'subject':
|
||||||
|
$stmt = $db->prepare("SELECT
|
||||||
DISTINCT books.id AS id,
|
DISTINCT books.id AS id,
|
||||||
books.title AS title,
|
books.title AS title,
|
||||||
SUBSTR(comments.text, 0, 120) AS excerpt
|
SUBSTR(comments.text, 0, 120) AS excerpt
|
||||||
FROM books
|
FROM books
|
||||||
INNER JOIN
|
INNER JOIN comments ON comments.book = books.id
|
||||||
comments ON comments.book = books.id
|
INNER JOIN books_tags_link ON books_tags_link.book = books.id
|
||||||
INNER JOIN
|
INNER JOIN tags ON tags.id = books_tags_link.tag
|
||||||
books_tags_link on books_tags_link.book = books.id
|
WHERE tags.name = :search
|
||||||
INNER JOIN
|
ORDER BY books.title ASC
|
||||||
tags on tags.id = books_tags_link.tag
|
LIMIT 100");
|
||||||
WHERE tags.name = '$subjectsearch'
|
$stmt->bindValue(':search', $subjectsearch, SQLITE3_TEXT);
|
||||||
ORDER BY books.title ASC");
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
$types = $db->query("SELECT
|
// Execute query and handle errors
|
||||||
value
|
try {
|
||||||
FROM custom_column_1
|
$results = $stmt->execute();
|
||||||
ORDER BY value ASC");
|
} catch (Exception $e) {
|
||||||
|
error_log("Query execution error: " . $e->getMessage());
|
||||||
|
$results = null;
|
||||||
|
}
|
||||||
|
|
||||||
$subtypes = $db->query("SELECT
|
// Get types for menu
|
||||||
value
|
try {
|
||||||
FROM custom_column_3
|
$types = $db->query("SELECT value FROM custom_column_1 ORDER BY value ASC");
|
||||||
ORDER BY value ASC");
|
} catch (Exception $e) {
|
||||||
|
error_log("Types query error: " . $e->getMessage());
|
||||||
|
$types = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Build social media URLs safely
|
||||||
|
$socialUrl = '';
|
||||||
|
switch ($searchtype) {
|
||||||
|
case 'keyword':
|
||||||
|
$socialUrl = $SiteURL . '/results.php?kw=' . urlencode($keywordsearch);
|
||||||
|
break;
|
||||||
|
case 'author':
|
||||||
|
$socialUrl = $SiteURL . '/results.php?au=' . urlencode($authorsearch);
|
||||||
|
break;
|
||||||
|
case 'type':
|
||||||
|
$socialUrl = $SiteURL . '/results.php?ty=' . urlencode($typesearch);
|
||||||
|
break;
|
||||||
|
case 'subtype':
|
||||||
|
$socialUrl = $SiteURL . '/results.php?st=' . urlencode($subtypesearch);
|
||||||
|
break;
|
||||||
|
case 'series':
|
||||||
|
$socialUrl = $SiteURL . '/results.php?se=' . urlencode($seriessearch);
|
||||||
|
break;
|
||||||
|
case 'subject':
|
||||||
|
$socialUrl = $SiteURL . '/results.php?su=' . urlencode($subjectsearch);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
|
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
|
||||||
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
|
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
|
||||||
@@ -144,9 +204,9 @@ ORDER BY value ASC");
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<title>Infopump - Search results - <?php echo $searchtopic; ?></title>
|
<title>Infopump - Search results - <?php echo htmlspecialchars($searchtopic, ENT_QUOTES, 'UTF-8'); ?></title>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<meta name="description" content="Free HTML5 Template by FREEHTML5.CO" />
|
<meta name="description" content="Search results for <?php echo htmlspecialchars($searchtopic, ENT_QUOTES, 'UTF-8'); ?>" />
|
||||||
<meta name="keywords" content="free html5, free template, free bootstrap, html5, css3, mobile first, responsive" />
|
<meta name="keywords" content="free html5, free template, free bootstrap, html5, css3, mobile first, responsive" />
|
||||||
<meta name="author" content="FREEHTML5.CO" />
|
<meta name="author" content="FREEHTML5.CO" />
|
||||||
|
|
||||||
@@ -165,42 +225,14 @@ ORDER BY value ASC");
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
<!-- Facebook and Twitter integration -->
|
<!-- Facebook and Twitter integration -->
|
||||||
<meta property="og:title" content=<?php echo '"'.$SiteName.' - Search - '.$searchtopic.'" />';?>
|
<meta property="og:title" content="<?php echo htmlspecialchars($SiteName . ' - Search - ' . $searchtopic, ENT_QUOTES, 'UTF-8'); ?>" />
|
||||||
|
<meta property="og:image" content="<?php echo htmlspecialchars($SiteURL, ENT_QUOTES, 'UTF-8'); ?>/images/og-site-avatar.jpg" />
|
||||||
<meta property="og:image" content=<?php echo '"'.$SiteURL.'/images/og-site-avatar.jpg" />';?>
|
<meta property="og:url" content="<?php echo htmlspecialchars($socialUrl, ENT_QUOTES, 'UTF-8'); ?>" />
|
||||||
|
<meta property="og:site_name" content="<?php echo htmlspecialchars($SiteName . ' - Search Results', ENT_QUOTES, 'UTF-8'); ?>" />
|
||||||
<?php
|
<meta property="og:description" content="<?php echo htmlspecialchars($SubName, ENT_QUOTES, 'UTF-8'); ?>" />
|
||||||
if (!empty($keywordsearch)) {
|
<meta name="twitter:title" content="<?php echo htmlspecialchars($SiteName . ' - Search - ' . $searchtopic, ENT_QUOTES, 'UTF-8'); ?>" />
|
||||||
echo '<meta property="og:url" content="'.$SiteURL.'/results.php?kw='.$socialkw.'" />';
|
<meta name="twitter:image" content="<?php echo htmlspecialchars($SiteURL, ENT_QUOTES, 'UTF-8'); ?>/images/og-site-avatar.jpg" />
|
||||||
echo '<meta name="twitter:url" content="'.$SiteURL.'/results.php?kw='.$socialkw.'" />';
|
<meta name="twitter:url" content="<?php echo htmlspecialchars($socialUrl, ENT_QUOTES, 'UTF-8'); ?>" />
|
||||||
} elseif (!empty($authorsearch)) {
|
|
||||||
echo '<meta property="og:url" content="'.$SiteURL.'/results.php?au='.$socialau.'" />';
|
|
||||||
echo '<meta name="twitter:url" content="'.$SiteURL.'/results.php?au='.$socialau.'" />';
|
|
||||||
} elseif (!empty($typesearch)) {
|
|
||||||
echo '<meta property="og:url" content="'.$SiteURL.'/results.php?ty='.$socialty.'" />';
|
|
||||||
echo '<meta name="twitter:url" content="'.$SiteURL.'/results.php?ty='.$socialty.'" />';
|
|
||||||
} elseif (!empty($seriessearch)) {
|
|
||||||
echo '<meta property="og:url" content="'.$SiteURL.'/results.php?ty='.$socialse.'" />';
|
|
||||||
echo '<meta name="twitter:url" content="'.$SiteURL.'/results.php?ty='.$socialse.'" />';
|
|
||||||
} elseif (!empty($subjectsearch)) {
|
|
||||||
echo '<meta property="og:url" content="'.$SiteURL.'/results.php?ty='.$socialsu.'" />';
|
|
||||||
echo '<meta name="twitter:url" content="'.$SiteURL.'/results.php?ty='.$socialsu.'" />';
|
|
||||||
} else {
|
|
||||||
echo '<meta property="og:url" content="'.$SiteURL.'/results.php?ty='.$socialst.'" />';
|
|
||||||
echo '<meta name="twitter:url" content="'.$SiteURL.'/results.php?ty='.$socialst.'" />';
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
|
|
||||||
<meta property="og:site_name" content=<?php echo '"'.$SiteName.' - Search Results" />';?>
|
|
||||||
|
|
||||||
<meta property="og:description" content=<?php echo '"'.$SubName.'" />';?>
|
|
||||||
|
|
||||||
<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:card" content="summary" />
|
<meta name="twitter:card" content="summary" />
|
||||||
|
|
||||||
<!-- Place favicon.ico and apple-touch-icon.png in the root directory -->
|
<!-- Place favicon.ico and apple-touch-icon.png in the root directory -->
|
||||||
@@ -213,10 +245,8 @@ ORDER BY value ASC");
|
|||||||
<link rel="stylesheet" href="css/icomoon.css">
|
<link rel="stylesheet" href="css/icomoon.css">
|
||||||
<!-- Bootstrap -->
|
<!-- Bootstrap -->
|
||||||
<link rel="stylesheet" href="css/bootstrap.css">
|
<link rel="stylesheet" href="css/bootstrap.css">
|
||||||
|
|
||||||
<link rel="stylesheet" href="css/style.css">
|
<link rel="stylesheet" href="css/style.css">
|
||||||
|
|
||||||
|
|
||||||
<!-- Modernizr JS -->
|
<!-- Modernizr JS -->
|
||||||
<script src="js/modernizr-2.6.2.min.js"></script>
|
<script src="js/modernizr-2.6.2.min.js"></script>
|
||||||
<!-- FOR IE9 below -->
|
<!-- FOR IE9 below -->
|
||||||
@@ -253,12 +283,12 @@ ORDER BY value ASC");
|
|||||||
<h3 class="heading">Recent Additions</h3>
|
<h3 class="heading">Recent Additions</h3>
|
||||||
<ul>
|
<ul>
|
||||||
<?php
|
<?php
|
||||||
while ($row = $types->fetchArray()) {
|
if ($types) {
|
||||||
$row_value = $row['value'];
|
while ($row = $types->fetchArray(SQLITE3_ASSOC)) {
|
||||||
$row_titlecase = mb_convert_case($row_value, MB_CASE_TITLE, "UTF-8");
|
$row_value = htmlspecialchars($row['value'], ENT_QUOTES, 'UTF-8');
|
||||||
echo '<li><a href="recent.php?ty='.$row_value.'">'.$row_titlecase.'</a></li>';
|
$row_titlecase = htmlspecialchars(mb_convert_case($row['value'], MB_CASE_TITLE, "UTF-8"), ENT_QUOTES, 'UTF-8');
|
||||||
//echo '<li>'.$row_value.'</li>';
|
echo '<li><a href="recent.php?ty=' . urlencode($row['value']) . '">' . $row_titlecase . '</a></li>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</ul>
|
</ul>
|
||||||
@@ -267,7 +297,7 @@ ORDER BY value ASC");
|
|||||||
<h3 class="heading">Search</h3>
|
<h3 class="heading">Search</h3>
|
||||||
<form action="results.php" method="get">
|
<form action="results.php" method="get">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<input type="text" class="form-control" name="kw" placeholder="Keyword search">
|
<input type="text" class="form-control" name="kw" placeholder="Keyword search" maxlength="100">
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
@@ -287,7 +317,7 @@ ORDER BY value ASC");
|
|||||||
<li><a href="#"><i class="icon-instagram"></i></a></li>
|
<li><a href="#"><i class="icon-instagram"></i></a></li>
|
||||||
</ul> -->
|
</ul> -->
|
||||||
<div class="col-lg-12 col-md-12 text-center">
|
<div class="col-lg-12 col-md-12 text-center">
|
||||||
<h1 id="fh5co-logo"><a href="index.php">Search Results<br /><br /><?php echo $searchtopic; ?></a></h1>
|
<h1 id="fh5co-logo"><a href="index.php">Search Results<br /><br /><?php echo htmlspecialchars($searchtopic, ENT_QUOTES, 'UTF-8'); ?></a></h1>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@@ -303,54 +333,25 @@ ORDER BY value ASC");
|
|||||||
<div class="row rp-b">
|
<div class="row rp-b">
|
||||||
<div class="col-md-12 animate-box">
|
<div class="col-md-12 animate-box">
|
||||||
<?php
|
<?php
|
||||||
if ($keywordsearch != '') {
|
if ($results) {
|
||||||
while ($row = $keywordquery->fetchArray()) {
|
$hasResults = false;
|
||||||
$row_id = $row['id'];
|
while ($row = $results->fetchArray(SQLITE3_ASSOC)) {
|
||||||
$row_title = $row['title'];
|
$hasResults = true;
|
||||||
$row_excerpt = $row['excerpt'];
|
$row_id = (int)$row['id'];
|
||||||
|
$row_title = htmlspecialchars($row['title'], ENT_QUOTES, 'UTF-8');
|
||||||
|
$row_excerpt = htmlspecialchars(strip_tags($row['excerpt']), ENT_QUOTES, 'UTF-8');
|
||||||
|
|
||||||
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;">';
|
||||||
|
echo '<img style="float:left; max-height: 120px; padding: 10px 10px" src="images/' . $row_id . '.jpg" alt="' . $row_title . '">';
|
||||||
|
echo '<strong><em><a href="itemrecord.php?itemid=' . $row_id . '">' . $row_title . '</a></em> :</strong> ';
|
||||||
|
echo $row_excerpt . '...</p>';
|
||||||
}
|
}
|
||||||
} elseif ($typesearch != '') {
|
|
||||||
while ($row = $typequery->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>';
|
if (!$hasResults) {
|
||||||
}
|
echo '<p>No results found for your search.</p>';
|
||||||
} elseif ($authorsearch != '') {
|
|
||||||
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>';
|
|
||||||
}
|
|
||||||
} elseif ($seriessearch != '') {
|
|
||||||
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>';
|
|
||||||
}
|
|
||||||
} elseif ($subjectsearch != '') {
|
|
||||||
while ($row = $subjectquery->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>';
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
while ($row = $subtypequery->fetchArray()) {
|
echo '<p>An error occurred while searching. Please try again.</p>';
|
||||||
$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>
|
||||||
@@ -379,3 +380,7 @@ ORDER BY value ASC");
|
|||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
// Close database connection
|
||||||
|
$db->close();
|
||||||
|
?>
|
||||||
BIN
sass/.DS_Store
vendored
BIN
sass/.DS_Store
vendored
Binary file not shown.
68
settings.php
68
settings.php
@@ -1,24 +1,68 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
$sitesettings = new SQLite3('settings.sqlite');
|
/**
|
||||||
|
* Site Settings Configuration
|
||||||
|
* Loads site settings from SQLite database
|
||||||
|
*/
|
||||||
|
|
||||||
$getName = $sitesettings->query('SELECT description FROM site WHERE id = 1');
|
// Initialize default values
|
||||||
|
$SiteName = 'Infopump';
|
||||||
|
$SubName = 'A bibliographic display system';
|
||||||
|
$SiteURL = '';
|
||||||
|
|
||||||
while ($row = $getName->fetchArray()) {
|
try {
|
||||||
$SiteName = $row['description'];
|
// Establish database connection
|
||||||
|
$sitesettings = new SQLite3('settings.sqlite', SQLITE3_OPEN_READONLY);
|
||||||
|
$sitesettings->enableExceptions(true);
|
||||||
|
|
||||||
|
// Fetch all settings in a single query for efficiency
|
||||||
|
$stmt = $sitesettings->prepare('SELECT id, description FROM site WHERE id IN (1, 2, 3) ORDER BY id');
|
||||||
|
$result = $stmt->execute();
|
||||||
|
|
||||||
|
// Process results
|
||||||
|
$settings = [];
|
||||||
|
while ($row = $result->fetchArray(SQLITE3_ASSOC)) {
|
||||||
|
$settings[(int)$row['id']] = $row['description'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$getSubName = $sitesettings->query('SELECT description FROM site WHERE id = 2');
|
// Assign settings to variables with validation
|
||||||
|
if (isset($settings[1]) && !empty(trim($settings[1]))) {
|
||||||
while ($row = $getSubName->fetchArray()) {
|
$SiteName = htmlspecialchars(trim($settings[1]), ENT_QUOTES, 'UTF-8');
|
||||||
$SubName = $row['description'];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$getURL = $sitesettings->query('SELECT description FROM site WHERE id = 3');
|
if (isset($settings[2]) && !empty(trim($settings[2]))) {
|
||||||
|
$SubName = htmlspecialchars(trim($settings[2]), ENT_QUOTES, 'UTF-8');
|
||||||
while ($row = $getURL->fetchArray()) {
|
|
||||||
$SiteURL = $row['description'];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isset($settings[3]) && !empty(trim($settings[3]))) {
|
||||||
|
// Validate and sanitize URL
|
||||||
|
$url = trim($settings[3]);
|
||||||
|
// Remove trailing slash for consistency
|
||||||
|
$url = rtrim($url, '/');
|
||||||
|
// Basic URL validation
|
||||||
|
if (filter_var($url, FILTER_VALIDATE_URL)) {
|
||||||
|
$SiteURL = htmlspecialchars($url, ENT_QUOTES, 'UTF-8');
|
||||||
|
} else {
|
||||||
|
error_log("Invalid site URL in settings: " . $url);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Close database connection
|
||||||
|
$sitesettings->close();
|
||||||
|
|
||||||
|
} catch (Exception $e) {
|
||||||
|
// Log error but continue with default values
|
||||||
|
error_log("Settings database error: " . $e->getMessage());
|
||||||
|
|
||||||
|
// Ensure variables are set even if database fails
|
||||||
|
if (!isset($SiteName)) $SiteName = 'Infopump';
|
||||||
|
if (!isset($SubName)) $SubName = 'A bibliographic display system';
|
||||||
|
if (!isset($SiteURL)) $SiteURL = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Verify all required settings are defined
|
||||||
|
if (empty($SiteName) || empty($SubName)) {
|
||||||
|
error_log("Critical site settings are missing or empty");
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
Reference in New Issue
Block a user