diff --git a/epub.php b/epub.php index 9474939..1498cee 100644 --- a/epub.php +++ b/epub.php @@ -42,7 +42,7 @@ if (isset($_POST['lemonde']) && $_POST['lemonde']) { // hardcoded for now - $includeimages = false; + $includeimages = true; $includecover = false; $url = $_POST['lmurl']; @@ -112,21 +112,15 @@ $imageid = $image->ContentItemId; $imageurl = preg_replace('/GetPublicationContentItems-.*\.json/', 'Image-MEDIUM-' . $imageid . '.jpg', $url); + $tempimgpath = './temp/' . $imageid . '.jpg'; $tempcontent = file_get_contents($imageurl); - file_put_contents('temp/' . $imageid, $tempcontent); - - //$epub->AddImage('temp/' . $imageid, false, false ); - - $pagecontent .= '
'; - if ($image->HtmlText) - { - $pagecontent .= $image->HtmlText; - } + file_put_contents($tempimgpath, $tempcontent); + $pagecontent .= ''; } } $pagecontent .= $articlebody->HtmlText; - $epub->AddPage($pagecontent, false, strip_tags($articlebody->Title)); + $epub->AddPage($pagecontent, false, strip_tags($articlebody->Title), true); } } write_epub($epub);