Enable previews in social media links. Also used in search results.
<meta charset="utf-8" />
<?php if (!empty($Place['title'])) { ?>
<title><?= htmlspecialchars($Place['title']) ?></title>
<meta charset="utf-8" />
<?php if (!empty($Place['title'])) { ?>
<title><?= htmlspecialchars($Place['title']) ?></title>
+<?php } ?>
+<?php if (!empty($Place['description'])) { ?>
+ <meta name="description" property="og:description" content="<?= strip_tags($Place['description']) ?>" />
<?php } ?>
<meta name="viewport" content="width=device-width" />
<!--[if lt IE 9]><script src="https://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.min.js"></script><![endif]-->
<?php } ?>
<meta name="viewport" content="width=device-width" />
<!--[if lt IE 9]><script src="https://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.min.js"></script><![endif]-->
+ function teaser()
+ {
+ if (preg_match('{<p>(.*?)</p>}s', $this->body, $bodyp)) {
+ return $bodyp[1];
+ }
+ }
+
function img()
{
$this->body;
function img()
{
$this->body;
$edit = !empty($User['admin']) ? htmlspecialchars(@$_GET['edit']) : NULL;
$article = new ArchiveArticle("$Page$Args.html");
$Place['title'] = $edit ?: $article->title;
$edit = !empty($User['admin']) ? htmlspecialchars(@$_GET['edit']) : NULL;
$article = new ArchiveArticle("$Page$Args.html");
$Place['title'] = $edit ?: $article->title;
+ $Place['description'] = $article->teaser;
$Place[1] = ' <small class="date">'.$article->date.'</small>';
print preg_replace('{(?<=<h2>)(.*?)(?=</h2>)}', ($edit ?: '\1').' [[1]]', ob_get_clean());
if ($article->file and $article->image) {
$Place[1] = ' <small class="date">'.$article->date.'</small>';
print preg_replace('{(?<=<h2>)(.*?)(?=</h2>)}', ($edit ?: '\1').' [[1]]', ob_get_clean());
if ($article->file and $article->image) {