Moving from another repo.

This commit is contained in:
2024-08-16 10:14:47 -05:00
parent ac30bc19d8
commit c3328c65b0
19 changed files with 5529 additions and 91 deletions

BIN
Libraries/.DS_Store vendored Executable file

Binary file not shown.

View File

@ -0,0 +1,224 @@
<?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.db');
// ---------- Pull data from books table ----------
$book = $db->query("SELECT id, title, date(timestamp), author_sort, path, 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_path = $row['path'];
$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 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'];
}
// -------------------- END DATABASE QUERIES --------------------
?>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<?php echo '<title>Item Record: '.$row_title.'</title>'; ?>
<!-- The following are some stylesheets for testing -->
<!-- Sanitize.css reset -->
<!-- <link href="https://unpkg.com/sanitize.css" rel="stylesheet" /> -->
<!-- Latest release version of Simple.css -->
<!-- <link rel="stylesheet" href="https://unpkg.com/simpledotcss/simple.css"> -->
<!-- Latest commit from GitHub -->
<!-- <link rel="stylesheet" href="https://cdn.simplecss.org/simple.css"> -->
<!-- Local version -->
<link rel="stylesheet" href="../../Styles/simple.css">
</head>
<body id="top">
<header>
<h1><?php echo $SiteName; ?></h1>
<p><?php echo $SiteSub; ?></p>
<nav>
<ul>
<li><a class="current" href="#text">Text</a></li>
<li><a href="#embedded">Embedded content</a></li>
<li><a href="#forms">Form elements</a></li>
<li><a href="https://simplecss.org/">Project homepage</a></li>
<li><a href="https://github.com/kevquirk/simple.css">GitHub repo</a></li>
</ul>
</nav>
</header>
<nav>
<ul>
<!-- <li>
<a href="#text">Text</a>
<ul>
<li><a href="#text__headings">Headings</a></li>
<li><a href="#text__paragraphs">Paragraphs</a></li>
<li><a href="#text__lists">Lists</a></li>
<li><a href="#text__blockquotes">Blockquotes</a></li>
<li><a href="#text__asides">Asides</a></li>
<li><a href="#text__details">Details / Summary</a></li>
<li><a href="#text__address">Address</a></li>
<li><a href="#text__hr">Horizontal rules</a></li>
<li><a href="#text__tables">Tabular data</a></li>
<li><a href="#text__code">Code</a></li>
<li><a href="#text__sections">Sections</a></li>
<li><a href="#text__inline">Inline elements</a></li>
<li><a href="#text__comments">HTML Comments</a></li>
</ul>
</li>
<li>
<a href="#embedded">Embedded content</a>
<ul>
<li><a href="#embedded__images">Images</a></li>
<li><a href="#embedded__bgimages">Background images</a></li>
<li><a href="#embedded__audio">Audio</a></li>
<li><a href="#embedded__video">Video</a></li>
<li><a href="#embedded__canvas">Canvas</a></li>
<li><a href="#embedded__meter">Meter</a></li>
<li><a href="#embedded__progress">Progress</a></li>
<li><a href="#embedded__svg">Inline SVG</a></li>
<li><a href="#embedded__iframe">IFrames</a></li>
<li><a href="#embedded__embed">Embed</a></li>
<li><a href="#embedded__object">Object</a></li>
<li><a href="#embedded__dialog">Dialog</a></li>
</ul>
</li>
<li>
<a href="#forms">Form elements</a>
<ul>
<li><a href="#forms__input">Input fields</a></li>
<li><a href="#forms__select">Select menus</a></li>
<li><a href="#forms__checkbox">Checkboxes</a></li>
<li><a href="#forms__radio">Radio buttons</a></li>
<li><a href="#forms__textareas">Textareas</a></li>
<li><a href="#forms__html5">HTML5 inputs</a></li>
<li><a href="#forms__action">Action buttons</a></li>
</ul>
</li> -->
</ul>
</nav>
<main>
<section id="text">
<article id="basic_info">
<header>
<h2><?php echo $row_title; ?></h2>
</header>
<aside>
<p><img src=<?php echo '"'.$row_path.'/cover.jpg"'; ?> width="250" alt=<?php echo '"Cover image for'.$row_title.'"'; ?> title=<?php echo '"'.$row_title.'"' ?></p>
</aside>
<p><strong>Author: </strong><?php echo $row_author_sort; ?></p>
<p><strong>Publisher: </strong><?php echo $row_publisher.' - '.$row_pubdate;?></p>
<p><?php echo $row_summary; ?></p>
</article>
</section>
</main>
<footer>
<p>Based on <a href="http://github.com/cbracco/html5-test-page">HTML5-test-page</a> by cbracco.</p>
</footer>
</body>
</html>

BIN
Libraries/Languages/metadata.db Executable file

Binary file not shown.

View File

@ -0,0 +1,608 @@
{
"bools_are_tristate": true,
"user_categories": {},
"saved_searches": {},
"grouped_search_terms": {},
"tag_browser_hidden_categories": [],
"library_view books view state": {
"column_alignment": {
"pubdate": "center",
"size": "center",
"timestamp": "center"
},
"column_positions": {
"authors": 2,
"languages": 11,
"last_modified": 10,
"ondevice": 0,
"pubdate": 9,
"publisher": 8,
"rating": 5,
"series": 7,
"size": 4,
"tags": 6,
"timestamp": 3,
"title": 1
},
"column_sizes": {
"authors": 91,
"languages": 0,
"last_modified": 0,
"pubdate": 92,
"publisher": 89,
"rating": 70,
"series": 68,
"size": 90,
"tags": 58,
"timestamp": 70,
"title": 298
},
"hidden_columns": [
"last_modified",
"languages"
],
"languages_injected": true,
"last_modified_injected": true,
"sort_history": [
[
"title",
true
],
[
"timestamp",
false
],
[
"authors",
true
],
[
"timestamp",
false
]
]
},
"books view split pane state": {
"column_positions": {
"authors": 2,
"languages": 11,
"last_modified": 10,
"ondevice": 0,
"pubdate": 9,
"publisher": 8,
"rating": 5,
"series": 7,
"size": 4,
"tags": 6,
"timestamp": 3,
"title": 1
},
"column_sizes": {
"authors": 100,
"languages": 100,
"last_modified": 100,
"pubdate": 100,
"publisher": 100,
"rating": 100,
"series": 100,
"size": 100,
"tags": 100,
"timestamp": 100,
"title": 100
},
"hidden_columns": []
},
"field_metadata": {
"au_map": {
"column": null,
"datatype": "text",
"display": {},
"is_category": false,
"is_csp": false,
"is_custom": false,
"is_editable": true,
"is_multiple": {
"cache_to_list": ",",
"list_to_ui": null,
"ui_to_list": null
},
"kind": "field",
"label": "au_map",
"name": null,
"rec_index": 18,
"search_terms": [],
"table": null
},
"author_sort": {
"column": null,
"datatype": "text",
"display": {},
"is_category": false,
"is_csp": false,
"is_custom": false,
"is_editable": true,
"is_multiple": {},
"kind": "field",
"label": "author_sort",
"name": "Author sort",
"rec_index": 12,
"search_terms": [
"author_sort"
],
"table": null
},
"authors": {
"category_sort": "sort",
"column": "name",
"datatype": "text",
"display": {},
"is_category": true,
"is_csp": false,
"is_custom": false,
"is_editable": true,
"is_multiple": {
"cache_to_list": ",",
"list_to_ui": " & ",
"ui_to_list": "&"
},
"kind": "field",
"label": "authors",
"link_column": "author",
"name": "Authors",
"rec_index": 2,
"search_terms": [
"authors",
"author"
],
"table": "authors"
},
"comments": {
"column": null,
"datatype": "text",
"display": {},
"is_category": false,
"is_csp": false,
"is_custom": false,
"is_editable": true,
"is_multiple": {},
"kind": "field",
"label": "comments",
"name": "Comments",
"rec_index": 7,
"search_terms": [
"comments",
"comment"
],
"table": null
},
"cover": {
"column": null,
"datatype": "int",
"display": {},
"is_category": false,
"is_csp": false,
"is_custom": false,
"is_editable": true,
"is_multiple": {},
"kind": "field",
"label": "cover",
"name": "Cover",
"rec_index": 17,
"search_terms": [
"cover"
],
"table": null
},
"formats": {
"column": null,
"datatype": "text",
"display": {},
"is_category": true,
"is_csp": false,
"is_custom": false,
"is_editable": true,
"is_multiple": {
"cache_to_list": ",",
"list_to_ui": ", ",
"ui_to_list": ","
},
"kind": "field",
"label": "formats",
"name": "Formats",
"rec_index": 13,
"search_terms": [
"formats",
"format"
],
"table": null
},
"id": {
"column": null,
"datatype": "int",
"display": {},
"is_category": false,
"is_csp": false,
"is_custom": false,
"is_editable": true,
"is_multiple": {},
"kind": "field",
"label": "id",
"name": null,
"rec_index": 0,
"search_terms": [
"id"
],
"table": null
},
"identifiers": {
"column": null,
"datatype": "text",
"display": {},
"is_category": true,
"is_csp": true,
"is_custom": false,
"is_editable": true,
"is_multiple": {
"cache_to_list": ",",
"list_to_ui": ", ",
"ui_to_list": ","
},
"kind": "field",
"label": "identifiers",
"name": "Identifiers",
"rec_index": 20,
"search_terms": [
"identifiers",
"identifier",
"isbn"
],
"table": null
},
"languages": {
"category_sort": "lang_code",
"column": "lang_code",
"datatype": "text",
"display": {},
"is_category": true,
"is_csp": false,
"is_custom": false,
"is_editable": true,
"is_multiple": {
"cache_to_list": ",",
"list_to_ui": ", ",
"ui_to_list": ","
},
"kind": "field",
"label": "languages",
"link_column": "lang_code",
"name": "Languages",
"rec_index": 21,
"search_terms": [
"languages",
"language"
],
"table": "languages"
},
"last_modified": {
"column": null,
"datatype": "datetime",
"display": {
"date_format": "dd MMM yyyy"
},
"is_category": false,
"is_csp": false,
"is_custom": false,
"is_editable": true,
"is_multiple": {},
"kind": "field",
"label": "last_modified",
"name": "Modified",
"rec_index": 19,
"search_terms": [
"last_modified"
],
"table": null
},
"marked": {
"column": null,
"datatype": "text",
"display": {},
"is_category": false,
"is_csp": false,
"is_custom": false,
"is_editable": true,
"is_multiple": {},
"kind": "field",
"label": "marked",
"name": null,
"rec_index": 23,
"search_terms": [
"marked"
],
"table": null
},
"news": {
"category_sort": "name",
"column": "name",
"datatype": null,
"display": {},
"is_category": true,
"is_csp": false,
"is_custom": false,
"is_editable": true,
"is_multiple": {},
"kind": "category",
"label": "news",
"name": "News",
"search_terms": [],
"table": "news"
},
"ondevice": {
"column": null,
"datatype": "text",
"display": {},
"is_category": false,
"is_csp": false,
"is_custom": false,
"is_editable": true,
"is_multiple": {},
"kind": "field",
"label": "ondevice",
"name": "On device",
"rec_index": 22,
"search_terms": [
"ondevice"
],
"table": null
},
"path": {
"column": null,
"datatype": "text",
"display": {},
"is_category": false,
"is_csp": false,
"is_custom": false,
"is_editable": true,
"is_multiple": {},
"kind": "field",
"label": "path",
"name": "Path",
"rec_index": 14,
"search_terms": [],
"table": null
},
"pubdate": {
"column": null,
"datatype": "datetime",
"display": {
"date_format": "MMM yyyy"
},
"is_category": false,
"is_csp": false,
"is_custom": false,
"is_editable": true,
"is_multiple": {},
"kind": "field",
"label": "pubdate",
"name": "Published",
"rec_index": 15,
"search_terms": [
"pubdate"
],
"table": null
},
"publisher": {
"category_sort": "name",
"column": "name",
"datatype": "text",
"display": {},
"is_category": true,
"is_csp": false,
"is_custom": false,
"is_editable": true,
"is_multiple": {},
"kind": "field",
"label": "publisher",
"link_column": "publisher",
"name": "Publisher",
"rec_index": 9,
"search_terms": [
"publisher"
],
"table": "publishers"
},
"rating": {
"category_sort": "rating",
"column": "rating",
"datatype": "rating",
"display": {},
"is_category": true,
"is_csp": false,
"is_custom": false,
"is_editable": true,
"is_multiple": {},
"kind": "field",
"label": "rating",
"link_column": "rating",
"name": "Rating",
"rec_index": 5,
"search_terms": [
"rating"
],
"table": "ratings"
},
"series": {
"category_sort": "(title_sort(name))",
"column": "name",
"datatype": "series",
"display": {},
"is_category": true,
"is_csp": false,
"is_custom": false,
"is_editable": true,
"is_multiple": {},
"kind": "field",
"label": "series",
"link_column": "series",
"name": "Series",
"rec_index": 8,
"search_terms": [
"series"
],
"table": "series"
},
"series_index": {
"column": null,
"datatype": "float",
"display": {},
"is_category": false,
"is_csp": false,
"is_custom": false,
"is_editable": true,
"is_multiple": {},
"kind": "field",
"label": "series_index",
"name": null,
"rec_index": 10,
"search_terms": [
"series_index"
],
"table": null
},
"series_sort": {
"column": null,
"datatype": "text",
"display": {},
"is_category": false,
"is_csp": false,
"is_custom": false,
"is_editable": true,
"is_multiple": {},
"kind": "field",
"label": "series_sort",
"name": "Series sort",
"rec_index": 24,
"search_terms": [
"series_sort"
],
"table": null
},
"size": {
"column": null,
"datatype": "float",
"display": {},
"is_category": false,
"is_csp": false,
"is_custom": false,
"is_editable": true,
"is_multiple": {},
"kind": "field",
"label": "size",
"name": "Size",
"rec_index": 4,
"search_terms": [
"size"
],
"table": null
},
"sort": {
"column": null,
"datatype": "text",
"display": {},
"is_category": false,
"is_csp": false,
"is_custom": false,
"is_editable": true,
"is_multiple": {},
"kind": "field",
"label": "sort",
"name": "Title sort",
"rec_index": 11,
"search_terms": [
"title_sort"
],
"table": null
},
"tags": {
"category_sort": "name",
"column": "name",
"datatype": "text",
"display": {},
"is_category": true,
"is_csp": false,
"is_custom": false,
"is_editable": true,
"is_multiple": {
"cache_to_list": ",",
"list_to_ui": ", ",
"ui_to_list": ","
},
"kind": "field",
"label": "tags",
"link_column": "tag",
"name": "Tags",
"rec_index": 6,
"search_terms": [
"tags",
"tag"
],
"table": "tags"
},
"timestamp": {
"column": null,
"datatype": "datetime",
"display": {
"date_format": "dd MMM yyyy"
},
"is_category": false,
"is_csp": false,
"is_custom": false,
"is_editable": true,
"is_multiple": {},
"kind": "field",
"label": "timestamp",
"name": "Date",
"rec_index": 3,
"search_terms": [
"date"
],
"table": null
},
"title": {
"column": null,
"datatype": "text",
"display": {},
"is_category": false,
"is_csp": false,
"is_custom": false,
"is_editable": true,
"is_multiple": {},
"kind": "field",
"label": "title",
"name": "Title",
"rec_index": 1,
"search_terms": [
"title"
],
"table": null
},
"uuid": {
"column": null,
"datatype": "text",
"display": {},
"is_category": false,
"is_csp": false,
"is_custom": false,
"is_editable": true,
"is_multiple": {},
"kind": "field",
"label": "uuid",
"name": null,
"rec_index": 16,
"search_terms": [
"uuid"
],
"table": null
}
}
}

BIN
Libraries/Travel/metadata.db Executable file

Binary file not shown.