add meta data description

This commit is contained in:
ghost 2023-05-11 07:40:09 +03:00
parent b83ad6cc3a
commit 9ad03c8153

View File

@ -328,10 +328,15 @@ if (filter_var($q, FILTER_VALIDATE_URL) && preg_match(CRAWL_URL_REGEXP, $q)) {
<?php $hostPageURL = $hostPage->scheme . '://' . $hostPage->name . ($hostPage->port ? ':' . $hostPage->port : false) . $hostPage->uri ?> <?php $hostPageURL = $hostPage->scheme . '://' . $hostPage->name . ($hostPage->port ? ':' . $hostPage->port : false) . $hostPage->uri ?>
<div> <div>
<?php if ($hostPageDescription = $db->getLastPageDescription($result->id)) { ?> <?php if ($hostPageDescription = $db->getLastPageDescription($result->id)) { ?>
<h2><?php echo $hostPageDescription->title ?></h2> <?php if (!empty($hostPageDescription->title)) { ?>
<h2><?php echo $hostPageDescription->title ?></h2>
<?php } ?>
<?php if (!empty($hostPageDescription->description)) { ?> <?php if (!empty($hostPageDescription->description)) { ?>
<span><?php echo $hostPageDescription->description ?></span> <span><?php echo $hostPageDescription->description ?></span>
<?php } ?> <?php } ?>
<?php if (!empty($hostPageDescription->keywords)) { ?>
<span><?php echo $hostPageDescription->keywords ?></span>
<?php } ?>
<?php } ?> <?php } ?>
<a href="<?php echo $hostPageURL ?>"> <a href="<?php echo $hostPageURL ?>">
<img src="<?php echo WEBSITE_DOMAIN; ?>/image.php?q=<?php echo urlencode($hostPage->name) ?>" alt="favicon" width="16" height="16" class="icon" /> <img src="<?php echo WEBSITE_DOMAIN; ?>/image.php?q=<?php echo urlencode($hostPage->name) ?>" alt="favicon" width="16" height="16" class="icon" />