le monde include images

This commit is contained in:
quenousimporte 2024-06-11 15:00:15 +02:00
parent 92a98c13eb
commit cb706113cd
1 changed files with 5 additions and 11 deletions

View File

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