insanelyBlog/themes/murkyhellyeah/components/entry.php

39 lines
2.0 KiB
PHP
Raw Permalink Normal View History

<?php
if ($blog->entries)
while ($data = $blog->entry())
{
addTitle($data['entryTitle']);
if ($data['entryHidden']) echo "<p>{locale:hidden_content}</p>";
if ($data['entryPIN'] && get_pin() != $data['entryPIN'])
echo "<p>{locale:pin_protected_content}</p>
<form action='".get_entry_link($data['entrySlug'])."' method='post' name='entry-pin-input'>
<input type='text' name='read_entry_pin' placeholder='{locale:entry_pin}' />
<button type='submit'>{locale:unlock}</button>
</form>";
else
{
addDescription(entry_show_init($data['entryContent'], $data['entrySlug']));
addImage((preg_match('/< *img[^>]*src *= *["\']?([^"\']*)/i', $data['entryContent'], $images) ? $images[1] : 0));
headerImage($data['entryHeader']);
echo "<article class='full' itemscope itemtype='http://schema.org/Article'>";
echo "<header".(strlen($data['entryTitle']) < 50 ? " class='hidden'" : null)."><div><h2 itemprop='name'>".htmlspecialchars($data['entryTitle'])."</h2></div></header>";
echo "<div class='hidden' itemprop='headline'>".htmlspecialchars($data['entryTitle'])."</div>";
if ($data['entryHeader']) echo "<img class='hidden' itemprop='image' src='$data[entryHeader]' alt='Header image'/>";
echo "<div class='content' itemprop='articleBody'>".entry_show_all($data['entryContent'])."</div>
<p class='meta'>
<a href='".get_entry_link($data['entrySlug'])."' class='date' title='{locale:published_on}' itemprop='datePublished' content='".date('Y-m-d', $data['entryPublished'])."'>".show_date($data['entryPublished'])."</a>
<span itemprop='author' itemscope itemtype='http://schema.org/Person'>
<a href='".get_profile_link($data['userName'])."' class='by' title='{locale:entry_by}' itemprop='url'><span itemprop='name'>$data[publicName]</span></a>
</span>
".get_entry_admin($data)."
</article>\n";
}
}
else
echo "<h1>{locale:entry_not_found_title}</h1>"
."<p>{locale:entry_not_found}</p>\n";