1
0

books_list + books_panel

This commit is contained in:
Mike Schwörer 2018-01-27 18:13:38 +01:00
parent a84a475008
commit 6db79d9447
Signed by: Mikescher
GPG Key ID: D3C7172E0A70F8CF
29 changed files with 600 additions and 8 deletions

View File

@ -202,6 +202,8 @@ body {
margin: 0; margin: 0;
padding: 0; padding: 0;
height: 42px; } height: 42px; }
#headerdiv .logowrapper a {
cursor: default; }
#headerdiv .logowrapper .logo { #headerdiv .logowrapper .logo {
min-width: 197.5px; min-width: 197.5px;
height: 30px; height: 30px;
@ -709,6 +711,8 @@ html, body {
color: black; } color: black; }
.prgl_elem:hover .prgl_elem_subinfo_data { .prgl_elem:hover .prgl_elem_subinfo_data {
color: black; } color: black; }
.prgl_elem:hover .prgl_elem_left img {
filter: grayscale(100%); }
.prgl_elem_left { .prgl_elem_left {
padding: 4px; padding: 4px;
@ -929,6 +933,80 @@ html, body {
#prgv_header h1 { #prgv_header h1 {
font-size: 28pt; } } font-size: 28pt; } }
/* 400px */ /* 400px */
.booklst_entry {
display: flex;
flex-direction: row;
text-decoration: none;
background: #BBB;
border: solid 1px #444;
margin: 5px 0; }
.booklst_entry:hover {
background: white;
color: black;
border: solid 1px black; }
.booklst_entry:hover .booklst_date {
color: black; }
.booklst_entry:hover .booklst_title {
color: black; }
.booklst_entry:hover .booklst_left img {
filter: grayscale(100%); }
.booklst_entry:hover .booklst_date span {
background: white;
border-left: 1px solid black;
border-bottom: 1px solid black; }
.booklst_left {
padding: 4px;
display: flex; }
.booklst_left img {
width: 150px;
height: auto; }
.booklst_right {
display: flex;
flex-direction: column;
flex-grow: 1; }
.booklst_title {
color: #222;
font-size: 40pt;
font-weight: bolder;
flex-grow: 1;
display: flex;
justify-content: center;
align-items: center;
text-align: center; }
.booklst_date {
display: flex;
flex-direction: row-reverse;
color: #222; }
.booklst_date span {
background: #AAA;
padding: 0 3px;
border-left: 1px solid transparent;
border-bottom: 1px solid transparent; }
.booklst_content p {
color: #333; }
@media (max-width: 767px) {
.booklst_left {
flex-direction: column;
align-items: center; }
.booklst_entry {
flex-direction: column; }
.booklst_date {
display: none;
visibility: hidden; }
.booklst_title {
font-size: 32pt; } }
/* 400px */
.aboutcontent { .aboutcontent {
display: block; display: block;
width: 100%; } width: 100%; }
@ -1187,6 +1265,8 @@ html, body {
.programs_pnl_entry:hover .programs_pnl_bottom { .programs_pnl_entry:hover .programs_pnl_bottom {
background: white; background: white;
border-top: 1px solid black; } border-top: 1px solid black; }
.programs_pnl_entry:hover .programs_pnl_img img {
filter: grayscale(100%); }
.programs_pnl_img { .programs_pnl_img {
display: flex; display: flex;
@ -1283,6 +1363,51 @@ html, body {
.blogpnl_title { .blogpnl_title {
text-align: center; } } text-align: center; } }
/* 400px */ /* 400px */
.books_pnl_content {
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: space-evenly; }
.books_pnl_entry {
display: flex;
flex-direction: column;
margin: 4px;
border: 1px solid #333;
background: #AAA;
text-decoration: none; }
.books_pnl_entry img {
margin: 4px;
width: 150px;
height: auto; }
.books_pnl_entry div {
display: flex;
justify-content: center;
align-items: flex-end;
flex-grow: 1;
border-top: 1px solid transparent;
text-align: center;
font-weight: bold;
color: #222;
text-decoration: none; }
@media (max-width: 850px) {
.books_pnl_extra {
display: none;
visibility: collapse; } }
.books_pnl_entry:hover {
border: 1px solid black;
background: white; }
.books_pnl_entry:hover div {
color: black; }
.books_pnl_entry:hover img {
filter: grayscale(100%); }
/* 400px */
.bfjoust_runner_owner { .bfjoust_runner_owner {
border: 1px solid #888; border: 1px solid #888;
background: #F8F8F8; background: #F8F8F8;

View File

@ -43,6 +43,7 @@ body{background-color:#EEE;color:#CCC;font-family:serif}
.stripedtable tbody tr:nth-child(odd){background-color:#ccc} .stripedtable tbody tr:nth-child(odd){background-color:#ccc}
#headerdiv{z-index:999;background-color:#333;display:flex;border-bottom:1px solid #111;box-shadow:0 0 8px #000;position:fixed;width:100%} #headerdiv{z-index:999;background-color:#333;display:flex;border-bottom:1px solid #111;box-shadow:0 0 8px #000;position:fixed;width:100%}
#headerdiv .logowrapper{flex:initial;margin:0;padding:0;height:42px} #headerdiv .logowrapper{flex:initial;margin:0;padding:0;height:42px}
#headerdiv .logowrapper a{cursor:default}
#headerdiv .logowrapper .logo{min-width:197.5px;height:30px;margin:4px 0 8px 6px;flex:initial} #headerdiv .logowrapper .logo{min-width:197.5px;height:30px;margin:4px 0 8px 6px;flex:initial}
#headerdiv .tabrow{display:flex;flex:auto} #headerdiv .tabrow{display:flex;flex:auto}
#headerdiv .tabrow .tab{display:flex;justify-content:center;align-items:center;background-color:#222;color:#CCC;border-left:1px solid #000;border-right:1px solid #000;font-weight:bold;text-decoration:none;margin:0 0 0 20px;padding:2px 5px;min-width:64px;text-align:center;flex:initial} #headerdiv .tabrow .tab{display:flex;justify-content:center;align-items:center;background-color:#222;color:#CCC;border-left:1px solid #000;border-right:1px solid #000;font-weight:bold;text-decoration:none;margin:0 0 0 20px;padding:2px 5px;min-width:64px;text-align:center;flex:initial}
@ -185,6 +186,7 @@ html,body{margin:0;padding:0;height:100%}
.prgl_elem:hover .prgl_elem_sdesc{color:black} .prgl_elem:hover .prgl_elem_sdesc{color:black}
.prgl_elem:hover .prgl_elem_subinfo_caption{color:black} .prgl_elem:hover .prgl_elem_subinfo_caption{color:black}
.prgl_elem:hover .prgl_elem_subinfo_data{color:black} .prgl_elem:hover .prgl_elem_subinfo_data{color:black}
.prgl_elem:hover .prgl_elem_left img{filter:grayscale(100%)}
.prgl_elem_left{padding:4px;display:flex} .prgl_elem_left{padding:4px;display:flex}
.prgl_elem_left img{width:250px;height:100%;min-height:100px} .prgl_elem_left img{width:250px;height:100%;min-height:100px}
.prgl_elem_right{display:flex;flex-direction:column;flex-grow:1} .prgl_elem_right{display:flex;flex-direction:column;flex-grow:1}
@ -236,6 +238,25 @@ html,body{margin:0;padding:0;height:100%}
.prgv_right_lang{justify-content:space-evenly} .prgv_right_lang{justify-content:space-evenly}
#prgv_header h1{font-size:28pt} #prgv_header h1{font-size:28pt}
} }
.booklst_entry{display:flex;flex-direction:row;text-decoration:none;background:#BBB;border:solid 1px #444;margin:5px 0}
.booklst_entry:hover{background:white;color:black;border:solid 1px black}
.booklst_entry:hover .booklst_date{color:black}
.booklst_entry:hover .booklst_title{color:black}
.booklst_entry:hover .booklst_left img{filter:grayscale(100%)}
.booklst_entry:hover .booklst_date span{background:white;border-left:1px solid black;border-bottom:1px solid black}
.booklst_left{padding:4px;display:flex}
.booklst_left img{width:150px;height:auto}
.booklst_right{display:flex;flex-direction:column;flex-grow:1}
.booklst_title{color:#222;font-size:40pt;font-weight:bolder;flex-grow:1;display:flex;justify-content:center;align-items:center;text-align:center}
.booklst_date{display:flex;flex-direction:row-reverse;color:#222}
.booklst_date span{background:#AAA;padding:0 3px;border-left:1px solid transparent;border-bottom:1px solid transparent}
.booklst_content p{color:#333}
@media(max-width:767px){
.booklst_left{flex-direction:column;align-items:center}
.booklst_entry{flex-direction:column}
.booklst_date{display:none;visibility:hidden}
.booklst_title{font-size:32pt}
}
.aboutcontent{display:block;width:100%} .aboutcontent{display:block;width:100%}
.aboutcontent .boxedcontent{margin-bottom:20px} .aboutcontent .boxedcontent{margin-bottom:20px}
.about_egh_container{display:flex;flex-direction:column;align-items:center} .about_egh_container{display:flex;flex-direction:column;align-items:center}
@ -292,6 +313,7 @@ html,body{margin:0;padding:0;height:100%}
.programs_pnl_entry:hover{background:white;color:black;border:1px solid black} .programs_pnl_entry:hover{background:white;color:black;border:1px solid black}
.programs_pnl_entry:hover .programs_pnl_center{color:black} .programs_pnl_entry:hover .programs_pnl_center{color:black}
.programs_pnl_entry:hover .programs_pnl_bottom{background:white;border-top:1px solid black} .programs_pnl_entry:hover .programs_pnl_bottom{background:white;border-top:1px solid black}
.programs_pnl_entry:hover .programs_pnl_img img{filter:grayscale(100%)}
.programs_pnl_img{display:flex;flex-direction:column;justify-content:flex-start;margin:4px} .programs_pnl_img{display:flex;flex-direction:column;justify-content:flex-start;margin:4px}
.programs_pnl_img img{width:100%;height:auto} .programs_pnl_img img{width:100%;height:auto}
.programs_pnl_center{display:flex;justify-content:center;align-items:flex-end;text-align:center;color:black;font-weight:bolder;font-size:15pt;flex-grow:1;margin:0 2px} .programs_pnl_center{display:flex;justify-content:center;align-items:flex-end;text-align:center;color:black;font-weight:bolder;font-size:15pt;flex-grow:1;margin:0 2px}
@ -312,6 +334,14 @@ html,body{margin:0;padding:0;height:100%}
.blogpnl_date{background-color:#AAA;border-bottom:1px solid transparent;padding:2px;font-size:.8em;font-style:italic} .blogpnl_date{background-color:#AAA;border-bottom:1px solid transparent;padding:2px;font-size:.8em;font-style:italic}
.blogpnl_title{font-weight:bold;font-size:1.2em;text-align:left;margin:2px 0 2px 10px} .blogpnl_title{font-weight:bold;font-size:1.2em;text-align:left;margin:2px 0 2px 10px}
@media(max-width:850px){.blogpnl_title{text-align:center}} @media(max-width:850px){.blogpnl_title{text-align:center}}
.books_pnl_content{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:space-evenly}
.books_pnl_entry{display:flex;flex-direction:column;margin:4px;border:1px solid #333;background:#AAA;text-decoration:none}
.books_pnl_entry img{margin:4px;width:150px;height:auto}
.books_pnl_entry div{display:flex;justify-content:center;align-items:flex-end;flex-grow:1;border-top:1px solid transparent;text-align:center;font-weight:bold;color:#222;text-decoration:none}
@media(max-width:850px){.books_pnl_extra{display:none;visibility:collapse}}
.books_pnl_entry:hover{border:1px solid black;background:white}
.books_pnl_entry:hover div{color:black}
.books_pnl_entry:hover img{filter:grayscale(100%)}
.bfjoust_runner_owner{border:1px solid #888;background:#f8f8f8;padding:6px} .bfjoust_runner_owner{border:1px solid #888;background:#f8f8f8;padding:6px}
.bfjoust_runner_owner .hsplit{display:flex;flex-direction:row;flex-wrap:nowrap} .bfjoust_runner_owner .hsplit{display:flex;flex-direction:row;flex-wrap:nowrap}
.bfjoust_runner_owner .hsplit_1{flex:1;margin:4px} .bfjoust_runner_owner .hsplit_1{flex:1;margin:4px}

View File

@ -9,6 +9,7 @@
@import 'styles_errorview'; @import 'styles_errorview';
@import 'styles_programslist'; @import 'styles_programslist';
@import 'styles_programsview'; @import 'styles_programsview';
@import 'styles_bookslist';
@import 'styles_about'; @import 'styles_about';
@import 'styles_admin'; @import 'styles_admin';
@import 'styles_login'; @import 'styles_login';
@ -16,5 +17,6 @@
@import 'styles_eulerpanel'; @import 'styles_eulerpanel';
@import 'styles_programspanel'; @import 'styles_programspanel';
@import 'styles_blogpanel'; @import 'styles_blogpanel';
@import 'styles_bookspanel';
@import 'styles_bfjoustrunner'; @import 'styles_bfjoustrunner';
@import 'styles_befungerunner'; @import 'styles_befungerunner';

View File

@ -0,0 +1,79 @@
@import 'styles_config';
.booklst_parent {
}
.booklst_entry {
display: flex;
flex-direction: row;
text-decoration: none;
background: #BBB;
border: solid 1px #444;
margin: 5px 0;
&:hover {
background: $COL_COMPLEXHOVER_BG;
color: $COL_COMPLEXHOVER_FG;
border: solid 1px $COL_COMPLEXHOVER_BRD;
.booklst_date { color: $COL_COMPLEXHOVER_FG; }
.booklst_title { color: $COL_COMPLEXHOVER_FG; }
.booklst_left img { filter: grayscale(100%); }
.booklst_date span { background: $COL_COMPLEXHOVER_BG; border-left: 1px solid $COL_COMPLEXHOVER_BRD; border-bottom: 1px solid $COL_COMPLEXHOVER_BRD; }
}
}
.booklst_left {
padding: 4px;
display: flex;
}
.booklst_left img {
width: 150px;
height: auto;
}
.booklst_right {
display: flex;
flex-direction: column;
flex-grow: 1;
}
.booklst_title {
color: $COL_TEXT_DARK_DARKER;
font-size: 40pt;
font-weight: bolder;
flex-grow: 1;
display: flex;
justify-content: center;
align-items: center;
text-align: center;
}
.booklst_date {
display: flex;
flex-direction: row-reverse;
color: $COL_TEXT_DARK_DARKER;
}
.booklst_date span {
background: #AAA;
padding: 0 3px;
border-left: 1px solid transparent;
border-bottom: 1px solid transparent;
}
.booklst_content p {
color: $COL_TEXT_DARK;
}
@include rdmedia(0) {
.booklst_left { flex-direction: column; align-items: center;}
.booklst_entry { flex-direction: column;}
.booklst_date { display:none; visibility: hidden; }
.booklst_title { font-size: 32pt; }
}

View File

@ -0,0 +1,60 @@
@import 'styles_config';
.books_pnl_content {
display:flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: space-evenly;
}
.books_pnl_entry {
display:flex;
flex-direction: column;
margin: 4px;
border: 1px solid #333;
background: #AAA;
text-decoration: none;
}
.books_pnl_entry img {
margin: 4px;
width: 150px;
height: auto;
}
.books_pnl_entry div {
display: flex;
justify-content: center;
align-items: flex-end;
flex-grow: 1;
border-top: 1px solid transparent;
text-align: center;
font-weight: bold;
color: $COL_TEXT_DARK_DARKER;
text-decoration: none;
}
@include rdmedia_range(0,1) {
.books_pnl_extra {
display: none;
visibility: collapse;
}
}
.books_pnl_entry:hover {
border: 1px solid $COL_COMPLEXHOVER_BRD;
background: $COL_COMPLEXHOVER_BG;
}
.books_pnl_entry:hover div {
color: $COL_COMPLEXHOVER_FG;
}
.books_pnl_entry:hover img {
filter: grayscale(100%);
}

View File

@ -15,6 +15,8 @@
padding: 0; padding: 0;
height: 42px; height: 42px;
a { cursor: default; }
.logo { .logo {
min-width: 197.5px; // prevents flickering after DOM load min-width: 197.5px; // prevents flickering after DOM load
height: 30px; height: 30px;

View File

@ -24,6 +24,7 @@
.prgl_elem_sdesc { color: $COL_COMPLEXHOVER_FG; } .prgl_elem_sdesc { color: $COL_COMPLEXHOVER_FG; }
.prgl_elem_subinfo_caption { color: $COL_COMPLEXHOVER_FG; } .prgl_elem_subinfo_caption { color: $COL_COMPLEXHOVER_FG; }
.prgl_elem_subinfo_data { color: $COL_COMPLEXHOVER_FG; } .prgl_elem_subinfo_data { color: $COL_COMPLEXHOVER_FG; }
.prgl_elem_left img { filter: grayscale(100%); }
} }
} }

View File

@ -27,6 +27,7 @@
.programs_pnl_center { color: $COL_COMPLEXHOVER_FG; } .programs_pnl_center { color: $COL_COMPLEXHOVER_FG; }
.programs_pnl_bottom { background: $COL_COMPLEXHOVER_BG; border-top: 1px solid $COL_COMPLEXHOVER_BRD; } .programs_pnl_bottom { background: $COL_COMPLEXHOVER_BG; border-top: 1px solid $COL_COMPLEXHOVER_BRD; }
.programs_pnl_img img { filter: grayscale(100%); }
} }
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 538 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 804 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 291 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 316 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 880 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 MiB

View File

@ -1,6 +1,6 @@
<div id="headerdiv"> <div id="headerdiv">
<div class="logowrapper"> <div class="logowrapper">
<img class="logo" src="/data/images/logo.png" /> <a href="/"><img class="logo" src="/data/images/logo.png" alt="Mikescher.com Logo" /></a>
</div> </div>
<div class="tabrow"> <div class="tabrow">

View File

@ -0,0 +1,34 @@
<?php
require_once(__DIR__ . '/../internals/books.php');
$allbooks = Books::listAllNewestFirst();
?>
<div class="index_pnl_base">
<div class="index_pnl_header">
<a href="/books">Converted books</a>
</div>
<div class="index_pnl_content books_pnl_content">
<?php
for ($i=0; $i<min(6, count($allbooks)); $i++)
{
$book = $allbooks[$i];
$extra = $i>=2 ? 'books_pnl_extra' : '';
echo "<a class='books_pnl_entry $extra' href='" . $book['url'] . "'>";
echo ' <img src="' . $book['preview_url'] . '" alt="' . $book['title'] . ' " />' . "\n";
echo "<div class='books_pnl_caption'>" . htmlspecialchars($book['title_short']) . "</div>";
echo "";
echo "</a>";
}
?>
</div>
</div>

View File

@ -25,6 +25,10 @@ $URL_RULES =
[ 'url' => ['programs', 'download', '?{id}'], 'target' => 'pages/programs_download.php', 'options' => [ 'id' => '%URL%' ], ], [ 'url' => ['programs', 'download', '?{id}'], 'target' => 'pages/programs_download.php', 'options' => [ 'id' => '%URL%' ], ],
[ 'url' => ['programs', 'download'], 'target' => 'pages/programs_download.php', 'options' => [ 'id' => '%GET%' ], ], [ 'url' => ['programs', 'download'], 'target' => 'pages/programs_download.php', 'options' => [ 'id' => '%GET%' ], ],
[ 'url' => ['books'], 'target' => 'pages/books_list.php', 'options' => [], ],
[ 'url' => ['books', 'list'], 'target' => 'pages/books_list.php', 'options' => [], ],
[ 'url' => ['books', 'view', '?{id}'], 'target' => 'pages/books_view.php', 'options' => [ 'id' => '%GET%' ], ],
[ 'url' => ['update.php'], 'target' => 'pages/api_updatecheck.php', 'options' => [ 'Name' => '%GET%' ], ], [ 'url' => ['update.php'], 'target' => 'pages/api_updatecheck.php', 'options' => [ 'Name' => '%GET%' ], ],
[ 'url' => ['update.php', '?{Name}'], 'target' => 'pages/api_updatecheck.php', 'options' => [ 'Name' => '%URL%' ], ], [ 'url' => ['update.php', '?{Name}'], 'target' => 'pages/api_updatecheck.php', 'options' => [ 'Name' => '%URL%' ], ],
[ 'url' => ['update'], 'target' => 'pages/api_updatecheck.php', 'options' => [ 'Name' => '%GET%' ], ], [ 'url' => ['update'], 'target' => 'pages/api_updatecheck.php', 'options' => [ 'Name' => '%GET%' ], ],

73
www/internals/books.php Normal file
View File

@ -0,0 +1,73 @@
<?php if(count(get_included_files()) ==1) exit("Direct access not permitted.");
require_once __DIR__ . '/base.php';
class Books
{
public static function readSingle($a)
{
$a['imgfront_url'] = '/data/images/book_img/' . $a['id'] . '_front.png';
$a['imgfront_path'] = __DIR__ . '/../data/images/book_img/' . $a['id'] . '_front.png';
$a['imgfull_url'] = '/data/images/book_img/' . $a['id'] . '_full.png';
$a['imgfull_path'] = __DIR__ . '/../data/images/book_img/' . $a['id'] . '_full.png';
$a['preview_url'] = '/data/dynamic/bookprev_' . $a['id'] . '.png';
$a['preview_path'] = __DIR__ . '/../data/dynamic/bookprev_' . $a['id'] . '.png';
$a['url'] = '/books/view/' . $a['id'];
return $a;
}
public static function listAll()
{
$all = require (__DIR__ . '/../statics/books/__all.php');
return array_map('self::readSingle', $all);
}
public static function listAllNewestFirst()
{
$data = self::listAll();
usort($data, function($a, $b) { return strcasecmp($b['date'], $a['date']); });
return $data;
}
public static function checkConsistency()
{
$warn = null;
$ids = [];
foreach (self::listAll() as $prog)
{
if (in_array($prog['id'], $ids)) return ['result'=>'err', 'message' => 'Duplicate id ' . $prog['id']];
$ids []= $prog['id'];
if (!file_exists($prog['imgfront_path'])) return ['result'=>'err', 'message' => 'Image not found ' . $prog['title_short']];
if (!file_exists($prog['imgfull_path'])) return ['result'=>'err', 'message' => 'Image not found ' . $prog['title_short']];
}
if ($warn != null) return $warn;
return ['result'=>'ok', 'message' => ''];
}
public static function checkThumbnails()
{
foreach (self::listAll() as $book)
{
if (!file_exists($book['preview_path'])) return ['result'=>'err', 'message' => 'Preview not found ' . $book['title_short']];
}
return ['result'=>'ok', 'message' => ''];
}
public static function createPreview($prog)
{
$src = $prog['imgfront_path'];
$dst = $prog['preview_path'];
smart_resize_image($src , null, 200, 0, true, $dst, 100);
}
}

View File

@ -9,14 +9,17 @@ require_once (__DIR__ . '/../internals/euler.php');
require_once (__DIR__ . '/../internals/highscores.php'); require_once (__DIR__ . '/../internals/highscores.php');
require_once (__DIR__ . '/../internals/mikeschergitgraph.php'); require_once (__DIR__ . '/../internals/mikeschergitgraph.php');
require_once (__DIR__ . '/../internals/programs.php'); require_once (__DIR__ . '/../internals/programs.php');
require_once (__DIR__ . '/../internals/books.php');
Database::connect(); Database::connect();
$consistency_blog = Blog::checkConsistency(); $consistency_blog = Blog::checkConsistency();
$consistency_prog = Programs::checkConsistency(); $consistency_prog = Programs::checkConsistency();
$consistency_euler = Euler::checkConsistency(); $consistency_euler = Euler::checkConsistency();
$consistency_books = Books::checkConsistency();
$consistency_egh = MikescherGitGraph::checkConsistency(); $consistency_egh = MikescherGitGraph::checkConsistency();
$consistency_progimg = Programs::checkThumbnails(); $consistency_progimg = Programs::checkThumbnails();
$consistency_bookimg = Books::checkThumbnails();
?> ?>
<?php <?php
@ -68,12 +71,13 @@ function dumpConsistency($c) {
<div class="bc_data"> <div class="bc_data">
<div class="keyvaluelist kvl_200"> <div class="keyvaluelist kvl_200">
<div><span>Program thumbnails:</span> <?php dumpConsistency($consistency_progimg); ?></div> <div><span>Program thumbnails:</span> <?php dumpConsistency($consistency_progimg); ?></div>
<div><span>ExtendedGitGraph:</span> <?php dumpConsistency($consistency_egh); ?></div> <div><span>ExtendedGitGraph:</span> <?php dumpConsistency($consistency_egh); ?></div>
<div><span>Book thumbnails:</span> <span>?</span></div> <div><span>Book thumbnails:</span> <?php dumpConsistency($consistency_bookimg); ?></div>
<div><span>Blog data:</span> <?php dumpConsistency($consistency_blog); ?></div> <div><span>Blog data:</span> <?php dumpConsistency($consistency_blog); ?></div>
<div><span>Euler data:</span> <?php dumpConsistency($consistency_euler); ?></div> <div><span>Euler data:</span> <?php dumpConsistency($consistency_euler); ?></div>
<div><span>Programs data:</span> <?php dumpConsistency($consistency_prog); ?></div> <div><span>Programs data:</span> <?php dumpConsistency($consistency_prog); ?></div>
<div><span>Books data:</span> <?php dumpConsistency($consistency_books); ?></div>
</div> </div>
<br/> <br/>
<a class="button" href="/admin/cmd/createProgramThumbnails">Update Program Thumbnails</a> <a class="button" href="/admin/cmd/createProgramThumbnails">Update Program Thumbnails</a>

View File

@ -3,6 +3,7 @@
global $OPTIONS; global $OPTIONS;
require_once (__DIR__ . '/../internals/base.php'); require_once (__DIR__ . '/../internals/base.php');
require_once (__DIR__ . '/../internals/books.php');
require_once (__DIR__ . '/../internals/programs.php'); require_once (__DIR__ . '/../internals/programs.php');
$cmd = $OPTIONS['cmd']; $cmd = $OPTIONS['cmd'];
@ -35,7 +36,27 @@ if ($cmd === 'createProgramThumbnails')
if ($cmd === 'createBookThumbnails') if ($cmd === 'createBookThumbnails')
{ {
//TODO echo '<!DOCTYPE html>';
echo '<html lang="en">';
echo '<head>';
echo '<meta charset="utf-8">';
echo '<title>Mikescher.com - AdminExec</title>';
echo '<link rel="icon" type="image/png" href="/data/images/favicon.png"/>';
echo '<link rel="canonical" href="https://www.mikescher.com/logout"/>';
echo '<meta http-equiv="refresh" content="3; url=/admin; ?>" />';
echo '</head>';
echo '<body>';
foreach (Books::listAll() as $book)
{
echo 'Create preview for ' . $book['title'] . '<br/>' . "\n";
Books::createPreview($book);
}
echo 'Finished.' . '<br/>' . "\n";
echo '<script>setTimeout(function () { window.location.href = "/admin"; }, 3000);</script>';
echo '</body>';
echo '</html>';
exit; exit;
} }

View File

@ -12,7 +12,9 @@ $post = Blog::getBlogpost($id);
if ($post === NULL) httpError(404, 'Blogpost not found'); if ($post === NULL) httpError(404, 'Blogpost not found');
$isSubEuler = ($post['type'] === 'euler' && $subview !== ''); $isSubEuler = ($post['type'] === 'euler' && $subview !== '');
$isBaseEuler = ($post['type'] === 'euler');
$eulerproblem = null; $eulerproblem = null;
if ($isSubEuler) if ($isSubEuler)
{ {
@ -34,7 +36,7 @@ if ($eulerproblem === null) $isSubEuler = false;
<body> <body>
<div id="mastercontainer"> <div id="mastercontainer">
<?php $HEADER_ACTIVE = ($isSubEuler ? 'euler' : 'none'); include (__DIR__ . '/../fragments/header.php'); ?> <?php $HEADER_ACTIVE = (($isSubEuler || $isBaseEuler) ? 'euler' : 'blog'); include (__DIR__ . '/../fragments/header.php'); ?>
<div id="content" class="content-responsive"> <div id="content" class="content-responsive">

62
www/pages/books_list.php Normal file
View File

@ -0,0 +1,62 @@
<!DOCTYPE html>
<html lang="en">
<?php
require_once (__DIR__ . '/../internals/base.php');
require_once (__DIR__ . '/../internals/books.php');
$allbooks = Books::listAllNewestFirst();
?>
<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 printCSS(); ?>
</head>
<body>
<div id="mastercontainer">
<?php $HEADER_ACTIVE = 'books'; include (__DIR__ . '/../fragments/header.php'); ?>
<div id="content" class="content-responsive">
<div class="blockcontent booklst_content">
<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="http://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
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>
</body>
</html>

View File

@ -22,6 +22,8 @@
<?php include (__DIR__ . '/../fragments/panel_blog.php'); ?> <?php include (__DIR__ . '/../fragments/panel_blog.php'); ?>
<?php include (__DIR__ . '/../fragments/panel_books.php'); ?>
</div> </div>
<?php include (__DIR__ . '/../fragments/footer.php'); ?> <?php include (__DIR__ . '/../fragments/footer.php'); ?>

View File

@ -0,0 +1,21 @@
<?php
require_once (__DIR__ . '/../internals/base.php');
require_once (__DIR__ . '/../internals/programs.php');
require_once (__DIR__ . '/../internals/ParsedownCustom.php');
$internalname = $OPTIONS['id'];
$prog = Programs::getProgramByInternalName($internalname);
if ($prog === NULL) httpError(404, 'Program not found');
// This page is only for old links.
// Current version does use direct links
foreach (Programs::getURLs($prog) as $xurl)
{
if ($xurl['type'] === 'download') { header('Location: ' . $xurl['href']); exit; }
if ($xurl['type'] === 'playstore') { header('Location: ' . $xurl['href']); exit; }
if ($xurl['type'] === 'amazonappstore') { header('Location: ' . $xurl['href']); exit; }
if ($xurl['type'] === 'windowsstore') { header('Location: ' . $xurl['href']); exit; }
if ($xurl['type'] === 'itunesstore') { header('Location: ' . $xurl['href']); exit; }
}

View File

@ -0,0 +1,69 @@
<?php
return
[
[
'id' => 'hpmor_1',
'title' => 'Harry Potter and the Methods of Rationality: Book 1',
'title_short' => 'HPMoR: Book 1',
'date' => '2015-04-04',
'github' => 'https://github.com/Mikescher/HPMOR-LyX',
'pages' => '597',
'pdf' => 'https://github.com/Mikescher/HPMOR-LyX/raw/master/hpmor_volume1_16x23.pdf',
'online' => 'http://www.hpmor.com/',
'author' => 'Eliezer Yudkowsky',
'size' => '17.0cm x 24.0cm',
],
[
'id' => 'hpmor_2',
'title' => 'Harry Potter and the Methods of Rationality: Book 2',
'title_short' => 'HPMoR: Book 2',
'date' => '2015-04-04',
'github' => 'https://github.com/Mikescher/HPMOR-LyX',
'pages' => '719',
'pdf' => 'https://github.com/Mikescher/HPMOR-LyX/raw/master/hpmor_volume2_16x23.pdf',
'online' => 'http://www.hpmor.com/',
'author' => 'Eliezer Yudkowsky',
'size' => '17.0cm x 24.0cm',
],
[
'id' => 'hpmor_3',
'title' => 'Harry Potter and the Methods of Rationality: Book 3',
'title_short' => 'HPMoR: Book 3',
'date' => '2015-04-04',
'github' => 'https://github.com/Mikescher/HPMOR-LyX',
'pages' => '493',
'pdf' => 'https://github.com/Mikescher/HPMOR-LyX/raw/master/hpmor_volume3_16x23.pdf',
'online' => 'http://www.hpmor.com/',
'author' => 'Eliezer Yudkowsky',
'size' => '17.0cm x 24.0cm',
],
[
'id' => 'apgte_1',
'title' => 'A Practical Guide to Evil: Book 1',
'title_short' => 'APGtE: Book 1',
'date' => '2016-12-23',
'github' => 'https://github.com/Mikescher/A-Practical-Guide-To-Evil-Lyx',
'pages' => '501',
'pdf' => 'https://github.com/Mikescher/A-Practical-Guide-To-Evil-Lyx/raw/master/APGTE_1/APGTE.pdf',
'online' => 'https://practicalguidetoevil.wordpress.com/',
'author' => 'David Verburg',
'size' => '12.5cm x 19.0cm',
],
[
'id' => 'mm',
'title' => 'The Metropolitan Man',
'title_short' => 'The Metropolitan Man',
'date' => '2017-12-02',
'github' => 'https://github.com/Mikescher/Metropolitan-Man-Lyx',
'pages' => '258',
'pdf' => 'https://github.com/Mikescher/Metropolitan-Man-Lyx/raw/master/src/MM.pdf',
'online' => 'https://www.fanfiction.net/s/10360716/1/',
'author' => 'Alexandr Wales',
'size' => '12.5cm x 19.0cm',
],
];