Improve view wishlist

This commit is contained in:
Jay Trees 2022-01-14 09:41:58 +01:00
parent a1d783b0b0
commit a280ca945e
2 changed files with 59 additions and 56 deletions

View file

@ -28,7 +28,7 @@ $user = new User();
<form class="ui form" method="post">
<div class="field">
<label>URL</label>
<input type="url" name="url" value="<?= $url ?>" />
<input type="url" name="url" />
</div>
<div class="field">

View file

@ -41,22 +41,19 @@ if (isset($_GET['wishlist'])) {
</div>
<?php if (!empty($products)) { ?>
<div class="ui three column grid">
<?php foreach ($products as $product) { ?>
<?php
/**
* @link https://github.com/oscarotero/Embed
*/
$embed = new Embed();
$info = $embed->get($product['url']);
// https://github.com/oscarotero/Embed
echo '<pre>';
// var_dump($info->title);
// var_dump($info->description);
// var_dump($info->url);
// var_dump($info->keywords);
echo '</pre>';
?>
<div class="ui link cards">
<div class="column">
<div class="ui fluid card">
<div class="card">
<?php if ($info->image) { ?>
<div class="image">
<img src="<?= $info->image ?>" />
@ -66,7 +63,11 @@ if (isset($_GET['wishlist'])) {
<div class="content">
<?php if ($info->title) { ?>
<div class="header">
<?php if ($info->url) { ?>
<a href="<?= $info->url ?>" target="_blank"><?= $info->title ?></a>
<?php } else { ?>
<?= $info->title ?>
<?php } ?>
</div>
<?php } ?>
@ -96,10 +97,12 @@ if (isset($_GET['wishlist'])) {
<?php } ?>
<?php } ?>
</div>
</div>
</div>
</div>
<?php } ?>
</div>
<?php } ?>
</div>