1
0

BooksList+BooksView

This commit is contained in:
Mike Schwörer 2020-01-16 11:05:38 +01:00
parent dc483ea4fd
commit cdec6903f6
3 changed files with 121 additions and 153 deletions

View File

@ -16,12 +16,12 @@ require_once (__DIR__ . '/../internals/website.php');
<meta name="google-site-verification" content="pZOhmjeJcQbRMNa8xRLam4dwJ2oYwMwISY1lRKreSSs"/>
<link rel="icon" type="image/png" href="/data/images/favicon.png"/>
<?php
if ($FRAME_OPTIONS->canonical_url !== null) echo '<link rel="canonical" href="'.$FRAME_OPTIONS->canonical_url.'"/>';
foreach ($FRAME_OPTIONS->stylesheets as $cssfile) echo '<link rel="stylesheet" href="' . $cssfile . '"/>';
if ($FRAME_OPTIONS->canonical_url !== null) echo '<link rel="canonical" href="'.$FRAME_OPTIONS->canonical_url.'"/>' . "\n";
foreach ($FRAME_OPTIONS->stylesheets as $cssfile) echo '<link rel="stylesheet" href="' . $cssfile . '"/>' . "\n";
foreach ($FRAME_OPTIONS->scripts as $scriptfile)
{
if ($scriptfile[1]) echo '<script src="' . $scriptfile[0] . '" defer></script>';
else echo '<script src="' . $scriptfile[0] . '" type="text/javascript" ></script>';
if ($scriptfile[1]) echo '<script src="' . $scriptfile[0] . '" defer></script>' . "\n";
else echo '<script src="' . $scriptfile[0] . '" type="text/javascript" ></script>' . "\n";
}
?>
</head>

View File

@ -1,64 +1,47 @@
<!DOCTYPE html>
<html lang="en">
<?php
require_once (__DIR__ . '/../internals/base.php');
require_once (__DIR__ . '/../internals/books.php');
$allbooks = Books::listAllNewestFirst();
require_once (__DIR__ . '/../internals/website.php');
/** @var PageFrameOptions $FRAME_OPTIONS */ global $FRAME_OPTIONS;
/** @var URLRoute $ROUTE */ global $ROUTE;
/** @var Website $SITE */ global $SITE;
?>
<head>
<meta charset="utf-8">
<title>Mikescher.com - Converted Books</title>
<link rel="icon" type="image/png" href="/data/images/favicon.png"/>
<link rel="canonical" href="https://www.mikescher.com/books"/>
<?php printHeaderCSS(); ?>
</head>
<body>
<div id="mastercontainer">
<?php $HEADER_ACTIVE = 'books'; include (__DIR__ . '/../fragments/header.php'); ?>
<?php
$FRAME_OPTIONS->title = 'Converted Books';
$FRAME_OPTIONS->canonical_url = 'https://www.mikescher.com/books';
$FRAME_OPTIONS->activeHeader = 'books';
<div id="content" class="content-responsive">
$allbooks = $SITE->modules->Books()->listAllNewestFirst();
?>
<div class="blockcontent booklst_content">
<div class="blockcontent booklst_content">
<div class="contentheader"><h1>Books/<wbr>Webserials I self-printed</h1><hr/></div>
<div class="contentheader"><h1>Books/<wbr>Webserials I self-printed</h1><hr/></div>
<p>
These are some books I read but that do not have an official print version.<br />
So I type-setted them myself (mostly in <a href="https://www.lyx.org/">LyX</a>) and printed them <a href="https://www.epubli.de/">online</a>.<br />
I do <b>not</b> own the rights of any of these books.<br />
The LyX files and generated PDF's are public and everyone who wants can print them on his own.
</p>
<p>
These are some books I read but that do not have an official print version.<br />
So I type-setted them myself (mostly in <a href="https://www.lyx.org/">LyX</a>) and printed them <a href="https://www.epubli.de/">online</a>.<br />
I do <b>not</b> own the rights of any of these books.<br />
The LyX files and generated PDF's are public and everyone who wants can print them on his own.
</p>
<?php
<?php
echo '<div class="booklst_parent">' . "\n";
foreach ($allbooks as $book)
{
echo '<a class="booklst_entry" href="'.$book['url'].'">';
echo ' <div class="booklst_left">';
echo ' <img src="' . $book['preview_url'] . '" alt="Thumbnail ' . $book['title'] . '" />';
echo ' </div>';
echo ' <div class="booklst_right">';
echo ' <div class="booklst_date"><span>' . $book['date'] . '</span></div>';
echo ' <div class="booklst_title">' . htmlspecialchars($book['title']) . '</div>';
echo ' </div>';
echo '</a>' . "\n";
}
echo '</div>' . "\n";
echo '<div class="booklst_parent">' . "\n";
foreach ($allbooks as $book)
{
echo '<a class="booklst_entry" href="'.$book['url'].'">';
echo ' <div class="booklst_left">';
echo ' <img src="' . $book['preview_url'] . '" alt="Thumbnail ' . $book['title'] . '" />';
echo ' </div>';
echo ' <div class="booklst_right">';
echo ' <div class="booklst_date"><span>' . $book['date'] . '</span></div>';
echo ' <div class="booklst_title">' . htmlspecialchars($book['title']) . '</div>';
echo ' </div>';
echo '</a>' . "\n";
}
echo '</div>' . "\n";
?>
</div>
</div>
<?php include (__DIR__ . '/../fragments/footer.php'); ?>
?>
</div>
<?php printAdditionalScripts(); ?>
<?php printAdditionalStylesheets(); ?>
</body>
</html>

View File

@ -1,127 +1,112 @@
<!DOCTYPE html>
<html lang="en">
<?php
require_once (__DIR__ . '/../internals/base.php');
require_once (__DIR__ . '/../internals/books.php');
$id = $OPTIONS['id'];
$book = Books::getBook($id);
if ($book === NULL) httpError(404, 'Book not found');
require_once (__DIR__ . '/../internals/website.php');
/** @var PageFrameOptions $FRAME_OPTIONS */ global $FRAME_OPTIONS;
/** @var URLRoute $ROUTE */ global $ROUTE;
/** @var Website $SITE */ global $SITE;
?>
<head>
<meta charset="utf-8">
<title>Mikescher.com - <?php echo $book['title']; ?></title>
<link rel="icon" type="image/png" href="/data/images/favicon.png"/>
<?php printHeaderCSS(); ?>
<?php echo '<link rel="canonical" href="' . $book['url'] . '"/>'; ?>
<?php includeAdditionalScript("/data/javascript/ms_basic.js", 'defer', true) ?>
</head>
<body>
<div id="mastercontainer">
<?php $HEADER_ACTIVE = 'book'; include (__DIR__ . '/../fragments/header.php'); ?>
<?php
$id = $ROUTE->parameter['id'];
<div id="content" class="content-responsive">
$book = $SITE->modules->Books()->getBook($id);
if ($book === null) { $FRAME_OPTIONS->setForced404("Books not found"); return; }
<div class="blockcontent">
$FRAME_OPTIONS->title = $book['title'];
$FRAME_OPTIONS->canonical_url = $book['url'];
$FRAME_OPTIONS->activeHeader = 'book';
<div class="bookv_content">
$FRAME_OPTIONS->addScript('/data/javascript/ms_basic.js', true);
?>
<div class="contentheader" id="bookv_header"><h1><?php echo htmlspecialchars($book['title']); ?></h1><hr/></div>
<div class="bookv_top">
<div class="bookv_left"><img src="<?php echo $book['imgfull_url']; ?>" alt="<?php echo $book['title'] ?>" /></div>
<div class="bookv_right">
<div class="bookv_right_key" style="grid-row:1">Name:</div>
<div class="bookv_right_value" style="grid-row:1"><?php echo htmlspecialchars($book['title_short']) ?></div>
<div class="blockcontent">
<div class="bookv_right_key" style="grid-row:2">Pages:</div>
<div class="bookv_right_value" style="grid-row:2"><?php
if (is_string($book['pages']))
{
echo $book['pages'];
}
else
{
$pagi = 1;
foreach ($book['pages'] as $page)
{
echo 'Buch ' . $pagi . ': ' . $page . '<br/>';
$pagi++;
}
}
?></div>
<div class="bookv_content">
<div class="bookv_right_key" style="grid-row:3">Author:</div>
<div class="bookv_right_value" style="grid-row:3"><?php echo htmlspecialchars($book['author']) ?></div>
<div class="contentheader" id="bookv_header"><h1><?php echo htmlspecialchars($book['title']); ?></h1><hr/></div>
<div class="bookv_right_key" style="grid-row:4">Size:</div>
<div class="bookv_right_value" style="grid-row:4"><?php echo $book['size'][0] . 'cm x ' . $book['size'][1] . 'cm'; ?></div>
<div class="bookv_top">
<div class="bookv_left"><img src="<?php echo $book['imgfull_url']; ?>" alt="<?php echo $book['title'] ?>" /></div>
<div class="bookv_right">
<div class="bookv_right_key" style="grid-row:1">Name:</div>
<div class="bookv_right_value" style="grid-row:1"><?php echo htmlspecialchars($book['title_short']) ?></div>
<div class="bookv_right_key" style="grid-row:5">Date:</div>
<div class="bookv_right_value" style="grid-row:5"><?php echo $book['date'] ?></div>
<div class="bookv_right_key" style="grid-row:2">Pages:</div>
<div class="bookv_right_value" style="grid-row:2"><?php
if (is_string($book['pages']))
{
echo $book['pages'];
}
else
{
$pagi = 1;
foreach ($book['pages'] as $page)
{
echo 'Buch ' . $pagi . ': ' . $page . '<br/>';
$pagi++;
}
}
?></div>
<div class="bookv_right_comb" style="grid-row:6">
<div class="bookv_right_key" style="grid-row:3">Author:</div>
<div class="bookv_right_value" style="grid-row:3"><?php echo htmlspecialchars($book['author']) ?></div>
<a class="iconbutton" href="<?php echo $book['repository'] ?>">
<div class="bookv_right_key" style="grid-row:4">Size:</div>
<div class="bookv_right_value" style="grid-row:4"><?php echo $book['size'][0] . 'cm x ' . $book['size'][1] . 'cm'; ?></div>
<div class="bookv_right_key" style="grid-row:5">Date:</div>
<div class="bookv_right_value" style="grid-row:5"><?php echo $book['date'] ?></div>
<div class="bookv_right_comb" style="grid-row:6">
<a class="iconbutton" href="<?php echo $book['repository'] ?>">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24">
<use xlink:href="/data/images/icons.svg#github"/>
</svg>
<span><?php echo $SITE->modules->Books()->getRepositoryHost($book); ?></span>
</a>
<a class="iconbutton" href="<?php echo $book['online'] ?>">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24">
<use xlink:href="/data/images/icons.svg#home"/>
</svg>
<span>Homepage</span>
</a>
<?php if (is_string($book['pdf'])): ?>
<a class="iconbutton" href="<?php echo $book['pdf'] ?>">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24">
<use xlink:href="/data/images/icons.svg#github"/>
<use xlink:href="/data/images/icons.svg#pdf"/>
</svg>
<span><?php echo Books::getRepositoryHost($book); ?></span>
<span>PDF</span>
</a>
<a class="iconbutton" href="<?php echo $book['online'] ?>">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24">
<use xlink:href="/data/images/icons.svg#home"/>
</svg>
<span>Homepage</span>
</a>
<?php if (is_string($book['pdf'])): ?>
<a class="iconbutton" href="<?php echo $book['pdf'] ?>">
<?php else: ?>
<?php $pdfi = 1; foreach ($book['pdf'] as $pdf): ?>
<a class="iconbutton" href="<?php echo $pdf ?>">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24">
<use xlink:href="/data/images/icons.svg#pdf"/>
</svg>
<span>PDF</span>
<span>PDF (Buch <?php echo $pdfi; $pdfi++; ?>)</span>
</a>
<?php else: ?>
<?php $pdfi = 1; foreach ($book['pdf'] as $pdf): ?>
<a class="iconbutton" href="<?php echo $pdf ?>">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24">
<use xlink:href="/data/images/icons.svg#pdf"/>
</svg>
<span>PDF (Buch <?php echo $pdfi; $pdfi++; ?>)</span>
</a>
<?php endforeach; ?>
<?php endif; ?>
<?php endforeach; ?>
<?php endif; ?>
</div>
</div>
</div>
<div class="bookv_extra imgcarousel_parent" data-imgcarousel-index="0" data-imgcarousel-images="<?php echo htmlspecialchars(json_encode($book['extraimages_urls'])); ?>" >
<a class="imgcarousel_prev">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24">
<use xlink:href="/data/images/icons.svg#arrow_left"/>
</svg>
</a>
<div class="imgcarousel_content" style="background-image: url(<?php echo $book['extraimages_urls'][0]; ?>);"></div>
<a class="imgcarousel_next">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24">
<use xlink:href="/data/images/icons.svg#arrow_right"/>
</svg>
</a>
</div>
</div>
</div>
</div>
<?php include (__DIR__ . '/../fragments/footer.php'); ?>
<div class="bookv_extra imgcarousel_parent" data-imgcarousel-index="0" data-imgcarousel-images="<?php echo htmlspecialchars(json_encode($book['extraimages_urls'])); ?>" >
<a class="imgcarousel_prev">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24">
<use xlink:href="/data/images/icons.svg#arrow_left"/>
</svg>
</a>
<div class="imgcarousel_content" style="background-image: url(<?php echo $book['extraimages_urls'][0]; ?>);"></div>
<a class="imgcarousel_next">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24">
<use xlink:href="/data/images/icons.svg#arrow_right"/>
</svg>
</a>
</div>
</div>
</div>
<?php printAdditionalScripts(); ?>
<?php printAdditionalStylesheets(); ?>
</body>
</html>