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"> <form class="ui form" method="post">
<div class="field"> <div class="field">
<label>URL</label> <label>URL</label>
<input type="url" name="url" value="<?= $url ?>" /> <input type="url" name="url" />
</div> </div>
<div class="field"> <div class="field">

View file

@ -41,65 +41,68 @@ if (isset($_GET['wishlist'])) {
</div> </div>
<?php if (!empty($products)) { ?> <?php if (!empty($products)) { ?>
<?php foreach ($products as $product) { ?> <div class="ui three column grid">
<?php
$embed = new Embed();
$info = $embed->get($product['url']);
// https://github.com/oscarotero/Embed <?php foreach ($products as $product) { ?>
echo '<pre>'; <?php
// var_dump($info->title); /**
// var_dump($info->description); * @link https://github.com/oscarotero/Embed
// var_dump($info->url); */
// var_dump($info->keywords); $embed = new Embed();
echo '</pre>'; $info = $embed->get($product['url']);
?> ?>
<div class="ui link cards"> <div class="column">
<div class="ui fluid card">
<div class="card"> <?php if ($info->image) { ?>
<?php if ($info->image) { ?> <div class="image">
<div class="image"> <img src="<?= $info->image ?>" />
<img src="<?= $info->image ?>" /> </div>
</div>
<?php } ?>
<div class="content">
<?php if ($info->title) { ?>
<div class="header">
<?= $info->title ?>
</div>
<?php } ?>
<?php if ($info->keywords) { ?>
<div class="meta">
<?= $info->keywords ?>
</div>
<?php } ?>
<?php if ($info->description) { ?>
<div class="description">
<?= $info->description ?>
</div>
<?php } ?>
</div>
<div class="extra content">
<?php if ($info->publishedTime) { ?>
<span class="right floated">
<?= $info->publishedTime ?>
</span>
<?php } ?>
<?php if ($info->favicon) { ?>
<?php if ($info->providerName) { ?>
<img src="<?= $info->favicon ?>" title="<?= $info->providerName ?>" alt="<?= $info->providerName ?>" />
<?php } else { ?>
<img src="<?= $info->favicon ?>" />
<?php } ?> <?php } ?>
<?php } ?>
</div>
</div>
</div> <div class="content">
<?php } ?> <?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 } ?>
<?php if ($info->keywords) { ?>
<div class="meta">
<?= $info->keywords ?>
</div>
<?php } ?>
<?php if ($info->description) { ?>
<div class="description">
<?= $info->description ?>
</div>
<?php } ?>
</div>
<div class="extra content">
<?php if ($info->publishedTime) { ?>
<span class="right floated">
<?= $info->publishedTime ?>
</span>
<?php } ?>
<?php if ($info->favicon) { ?>
<?php if ($info->providerName) { ?>
<img src="<?= $info->favicon ?>" title="<?= $info->providerName ?>" alt="<?= $info->providerName ?>" />
<?php } else { ?>
<img src="<?= $info->favicon ?>" />
<?php } ?>
<?php } ?>
</div>
</div>
</div>
<?php } ?>
</div>
<?php } ?> <?php } ?>
</div> </div>