1
0

fix paths in books.php

This commit is contained in:
Mike Schwörer 2020-01-20 18:11:06 +01:00
parent 3c3d0bf51b
commit 76abb91b92
Signed by: Mikescher
GPG Key ID: D3C7172E0A70F8CF

View File

@ -24,13 +24,13 @@ class Books implements IWebsiteModule
private static function readSingle($a) private static function readSingle($a)
{ {
$a['imgfront_url'] = '/data/images/book_img/' . $a['id'] . '_front.png'; $a['imgfront_url'] = '/data/images/book_img/' . $a['id'] . '_front.png';
$a['imgfront_path'] = __DIR__ . '/../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_url'] = '/data/images/book_img/' . $a['id'] . '_full.png';
$a['imgfull_path'] = __DIR__ . '/../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_url'] = '/data/dynamic/bookprev_' . $a['id'] . '.png';
$a['preview_path'] = __DIR__ . '/../data/dynamic/bookprev_' . $a['id'] . '.png'; $a['preview_path'] = __DIR__ . '/../../data/dynamic/bookprev_' . $a['id'] . '.png';
$a['url'] = '/books/view/' . $a['id'] . '/' . destructiveUrlEncode($a['title']); $a['url'] = '/books/view/' . $a['id'] . '/' . destructiveUrlEncode($a['title']);
@ -73,8 +73,8 @@ class Books implements IWebsiteModule
if (in_array($prog['id'], $ids)) return ['result'=>'err', 'message' => 'Duplicate id ' . $prog['id']]; if (in_array($prog['id'], $ids)) return ['result'=>'err', 'message' => 'Duplicate id ' . $prog['id']];
$ids []= $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['imgfront_path'])) return ['result'=>'err', 'message' => 'Image (Front) not found ' . $prog['title_short']];
if (!file_exists($prog['imgfull_path'])) return ['result'=>'err', 'message' => 'Image not found ' . $prog['title_short']]; if (!file_exists($prog['imgfull_path'])) return ['result'=>'err', 'message' => 'Image (Full) not found ' . $prog['title_short']];
foreach ($prog['extraimages_paths'] as $eipath) foreach ($prog['extraimages_paths'] as $eipath)
{ {