add page images for cafeyn
This commit is contained in:
parent
d22c73b14f
commit
28aa3f9fd3
20
epub.php
20
epub.php
|
@ -131,6 +131,7 @@
|
||||||
$epub->title = $pubname . ' ' . $date ;
|
$epub->title = $pubname . ' ' . $date ;
|
||||||
|
|
||||||
$list = (array)$publication->articles;
|
$list = (array)$publication->articles;
|
||||||
|
$page = 1;
|
||||||
foreach ($list as $entry)
|
foreach ($list as $entry)
|
||||||
{
|
{
|
||||||
$articleurl = str_replace('material', 'article/' . $entry->hash . '.json', $url);
|
$articleurl = str_replace('material', 'article/' . $entry->hash . '.json', $url);
|
||||||
|
@ -139,6 +140,7 @@
|
||||||
|
|
||||||
$content = '<h1>' . $article->title . '</h1>';
|
$content = '<h1>' . $article->title . '</h1>';
|
||||||
$content .= '<b>' . $article->abstract . '</b>';
|
$content .= '<b>' . $article->abstract . '</b>';
|
||||||
|
$content .= '<div>Page ' . $article->page . '</div>';
|
||||||
|
|
||||||
if (count($article->rubrics))
|
if (count($article->rubrics))
|
||||||
{
|
{
|
||||||
|
@ -171,10 +173,22 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*if ($article->imageUrl)
|
while ($article->page >= $page)
|
||||||
{
|
{
|
||||||
$epub->AddPage('<img style="width: 100%" src="' . $article->imageUrl . '">', false, 'Page ' . $article->page, true);
|
$path = $publication->pages[$page - 1]->tn;
|
||||||
}*/
|
$path = str_replace('material', $path, $url);
|
||||||
|
$path = str_replace('api.', 'content.', $path);
|
||||||
|
if ($page == 1)
|
||||||
|
{
|
||||||
|
// cover
|
||||||
|
$epub->AddImage($path, 'image/jpeg', true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$epub->AddPage('<img style="width: 100%" src="' . $path . '">', false, 'Page ' . $page, true);
|
||||||
|
}
|
||||||
|
$page++;
|
||||||
|
}
|
||||||
$epub->AddPage($content, false, $article->title);
|
$epub->AddPage($content, false, $article->title);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue