Exemplo n.º 1
0
				<div class="meta">
						<time datetime="<?php 
echo date(DATE_W3C, article_time());
?>
"><?php 
echo date('M j, Y - g:i a', article_time());
?>
</time>
					</div>
			</header>

			<?php 
echo article_markdown();
?>
			<?php 
if (user_authed() && user_authed_role() == 'administrator') {
    echo "<a href='/admin/posts/edit/" . article_id() . "' target='_blank'>Edit Article</a>";
}
?>
		</article>

		<?php 
if (has_comments()) {
    ?>
		<section id="comments">
			<h2><?php 
    echo total_comments(article_id());
    ?>
 comments</h2>
			<ul class="commentlist">
				<?php 
Exemplo n.º 2
0
<ul class="posts">
	<?php 
    while (search_results()) {
        ?>
	<li>
		<h3><?php 
        echo article_title();
        ?>
</h3>
		<p><?php 
        echo article_description();
        ?>
</p>
		
		<?php 
        if (user_authed()) {
            ?>
		<p><a  class="quiet" href="<?php 
            echo admin_url('posts/edit/' . article_id());
            ?>
">Edit this article</a></p>
		<?php 
        }
        ?>
		
		<p><a class="btn" href="<?php 
        echo article_url();
        ?>
" title="<?php 
        echo article_title();
        ?>
Exemplo n.º 3
0
        $Q->where('is_published', '=', 1);
    }
    if (!($record = $Q->fetch())) {
        return Response::create(new Template('404'), 404);
    }
    if (!empty($record->id_parent)) {
        $QP = new Query('bookz_record');
        $QP->where('id', '=', $record->id_parent);
        if (!user_authed()) {
            $QP->where('is_published', '=', 1);
        }
        $record->parent = $QP->fetch();
    }
    $QCh = new Query('bookz_record');
    $QCh->where('id_parent', '=', $record->id);
    if (!user_authed()) {
        $QCh->where('is_published', '=', 1);
    }
    $QCh->sort('ordkey', 'ASC');
    $QCh->sort('title', 'ASC');
    $record->child = $QCh->get();
    $posts_page->title = $record->title;
    Registry::set('page', $posts_page);
    Registry::set('record', $record);
    return new Template('bookz_record');
});
/**
 * View pages
 */
Route::get('(:all)', function ($uri) {
    if (!($page = Page::slug($slug = basename($uri)))) {