insanelyBlog/themes/murkymodern/components/entry.php

32 lines
1.4 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'>
".(strlen($data['entryTitle']) > 50 ? "<h2>".htmlspecialchars($data['entryTitle'])."</h2>" : null)."
<p class='meta'><time class='date' title='{locale:published_on}'>".show_date($data['entryPublished'])."</time><a href='".get_profile_link($data['userName'])."' class='by' title='{locale:entry_by}'>$data[publicName]</a>
<div class='content'>".entry_show_all($data['entryContent'])."</div>
<p clasS='meta'>".get_entry_admin($data)."</p>
</article>\n";
}
}
else
echo "<h1>{locale:entry_not_found_title}</h1>"
."<p>{locale:entry_not_found}</p>\n";