Added site settings database and hookup.

This commit is contained in:
2022-10-19 08:25:06 -05:00
parent e24b84d843
commit 693777861c
4 changed files with 46 additions and 11 deletions

BIN
images/og-site-avatar.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 383 KiB

View File

@ -1,6 +1,8 @@
<?php
include_once "settings.php";
// Set up Calibre database connection
$db = new SQLite3('metadata.sqlite');
$feature = $db->query('SELECT
@ -12,6 +14,7 @@ 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');
?>
@ -23,9 +26,9 @@ LIMIT 4');
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Infopump - Cyberpunk Culture Database</title>
<title><?php echo $SiteName.': '.$SubName;?></title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="Infopump: A bibliographic display system" />
<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" />
@ -44,15 +47,23 @@ LIMIT 4');
-->
<!-- Facebook and Twitter integration -->
<meta property="og:title" content="Infopump"/>
<meta property="og:image" content="https://i.imgur.com/kC3rZ1f.jpg"/>
<meta property="og:url" content=""/>
<meta property="og:site_name" content="Infopump: A bibliographic display system"/>
<meta property="og:description" content="A bibliographic display system"/>
<meta name="twitter:title" content="Infopump: A bibliographic display system" />
<meta name="twitter:image" content="https://i.imgur.com/kC3rZ1f.jpg" />
<meta name="twitter:url" content="" />
<meta name="twitter:card" content="" />
<meta property="og:title" content=<?php echo '"'.$SiteName.'" />';?>
<meta property="og:image" content=<?php echo '"'.$SiteURL.'/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.'/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">

24
settings.php Normal file
View 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'];
}
?>

BIN
settings.sqlite Normal file

Binary file not shown.