Added book [MoL]
BIN
www/data/images/book_img/mol_front.png
Normal file
After Width: | Height: | Size: 876 KiB |
BIN
www/data/images/book_img/mol_full.png
Normal file
After Width: | Height: | Size: 222 KiB |
BIN
www/data/images/book_img/mol_img1.jpg
Normal file
After Width: | Height: | Size: 217 KiB |
BIN
www/data/images/book_img/mol_img2.jpg
Normal file
After Width: | Height: | Size: 201 KiB |
BIN
www/data/images/book_img/mol_img3.jpg
Normal file
After Width: | Height: | Size: 152 KiB |
BIN
www/data/images/book_img/mol_img4.jpg
Normal file
After Width: | Height: | Size: 217 KiB |
BIN
www/data/images/book_img/mol_img5.jpg
Normal file
After Width: | Height: | Size: 165 KiB |
@ -26,6 +26,8 @@ class Books
|
|||||||
$a['extraimages_paths'] []= __DIR__ . '/../data/images/book_img/' . $a['id'] . '_img' . $i . '.jpg';
|
$a['extraimages_paths'] []= __DIR__ . '/../data/images/book_img/' . $a['id'] . '_img' . $i . '.jpg';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$a['book_count'] = is_array($a['pdf']) ? count($a['pdf']) : 1;
|
||||||
|
|
||||||
return $a;
|
return $a;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -61,6 +63,16 @@ class Books
|
|||||||
{
|
{
|
||||||
if (!file_exists($eipath)) return ['result'=>'err', 'message' => 'Extra-Image not found ' . $prog['title_short']];
|
if (!file_exists($eipath)) return ['result'=>'err', 'message' => 'Extra-Image not found ' . $prog['title_short']];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($prog['book_count'] <= 0) return ['result'=>'err', 'message' => 'BookCount must be greater than zero ' . $prog['title_short']];
|
||||||
|
|
||||||
|
if ($prog['book_count'] > 1 && !is_array($prog['pdf'])) return ['result'=>'err', 'message' => 'Attribute [pdf] must be an array ' . $prog['title_short']];
|
||||||
|
if ($prog['book_count'] > 1 && count($prog['pdf']) !== $prog['book_count']) return ['result'=>'err', 'message' => 'Attribute [pdf] must be the correct size ' . $prog['title_short']];
|
||||||
|
if ($prog['book_count'] === 1 && !is_string($prog['pdf'])) return ['result'=>'err', 'message' => 'Attribute [pdf] must be an string ' . $prog['title_short']];
|
||||||
|
|
||||||
|
if ($prog['book_count'] > 1 && !is_array($prog['pages'])) return ['result'=>'err', 'message' => 'Attribute [pages] must be an array ' . $prog['title_short']];
|
||||||
|
if ($prog['book_count'] > 1 && count($prog['pages']) !== $prog['book_count']) return ['result'=>'err', 'message' => 'Attribute [pages] must be the correct size ' . $prog['title_short']];
|
||||||
|
if ($prog['book_count'] === 1 && !is_string($prog['pages'])) return ['result'=>'err', 'message' => 'Attribute [pages] must be an string ' . $prog['title_short']];
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($warn != null) return $warn;
|
if ($warn != null) return $warn;
|
||||||
|
@ -39,7 +39,21 @@ if ($book === NULL) httpError(404, 'Book not found');
|
|||||||
<div class="bookv_right_value" style="grid-row:1"><?php echo htmlspecialchars($book['title_short']) ?></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:2">Pages:</div>
|
<div class="bookv_right_key" style="grid-row:2">Pages:</div>
|
||||||
<div class="bookv_right_value" style="grid-row:2"><?php echo $book['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_key" style="grid-row:3">Author:</div>
|
<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="bookv_right_value" style="grid-row:3"><?php echo htmlspecialchars($book['author']) ?></div>
|
||||||
@ -64,12 +78,23 @@ if ($book === NULL) httpError(404, 'Book not found');
|
|||||||
</svg>
|
</svg>
|
||||||
<span>Homepage</span>
|
<span>Homepage</span>
|
||||||
</a>
|
</a>
|
||||||
|
<?php if (is_string($book['pdf'])): ?>
|
||||||
<a class="iconbutton" href="<?php echo $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">
|
<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"/>
|
<use xlink:href="/data/images/icons.svg#pdf"/>
|
||||||
</svg>
|
</svg>
|
||||||
<span>PDF</span>
|
<span>PDF</span>
|
||||||
</a>
|
</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; ?>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -71,4 +71,28 @@ return
|
|||||||
'size' => [12.5, 19.0],
|
'size' => [12.5, 19.0],
|
||||||
'imagecount' => 4,
|
'imagecount' => 4,
|
||||||
],
|
],
|
||||||
|
|
||||||
|
[
|
||||||
|
'id' => 'mol',
|
||||||
|
'title' => 'Mother of Learning',
|
||||||
|
'title_short' => 'Mother of Learning',
|
||||||
|
'date' => '2019-11-24',
|
||||||
|
'repository' => 'https://github.com/Mikescher/Mother-of-Learning-Lyx',
|
||||||
|
'pages' => ['298', '328', '330', '362', '372', '346', '396', /*'???'*/],
|
||||||
|
'pdf' =>
|
||||||
|
[
|
||||||
|
'https://github.com/Mikescher/Mother-of-Learning-Lyx/blob/master/build/Book_1_1.pdf',
|
||||||
|
'https://github.com/Mikescher/Mother-of-Learning-Lyx/blob/master/build/Book_1_2.pdf',
|
||||||
|
'https://github.com/Mikescher/Mother-of-Learning-Lyx/blob/master/build/Book_2_1.pdf',
|
||||||
|
'https://github.com/Mikescher/Mother-of-Learning-Lyx/blob/master/build/Book_2_2.pdf',
|
||||||
|
'https://github.com/Mikescher/Mother-of-Learning-Lyx/blob/master/build/Book_3_1.pdf',
|
||||||
|
'https://github.com/Mikescher/Mother-of-Learning-Lyx/blob/master/build/Book_3_2.pdf',
|
||||||
|
'https://github.com/Mikescher/Mother-of-Learning-Lyx/blob/master/build/Book_3_3.pdf',
|
||||||
|
//'https://github.com/Mikescher/Mother-of-Learning-Lyx/blob/master/build/Book_3_4.pdf',
|
||||||
|
],
|
||||||
|
'online' => 'https://www.fictionpress.com/s/2961893',
|
||||||
|
'author' => 'Domagoj Kurmaic',
|
||||||
|
'size' => [12.5, 19.0],
|
||||||
|
'imagecount' => 5,
|
||||||
|
],
|
||||||
];
|
];
|
||||||
|