Exemplo n.º 1
0
        </div><!--//container-->
    </header><!--//header-->
    <div class="container sections-wrapper">
        <div class="row">
            <div class="primary col-md-8 col-sm-12 col-xs-12">
            <?php 
echo content();
?>
            </div><!--//primary-->
            <div class="secondary col-md-4 col-sm-12 col-xs-12">
                <aside class="aside section">
                    <div class="section-inner">
                        <h2 class="heading">About</h2>
                        <div class="content">
                         <?php 
echo blog_description();
?>
                                  
                        </div><!--//content-->  
                    </div><!--//section-inner-->                 
                </aside><!--//section-->
                <aside class="recent-posts aside section">
                    <div class="section-inner">
                        <!-- Tab nav -->
                        <ul class="nav nav-tabs" role="tablist">
                            <li role="presentation" class="active"><a href="#recent-posts" aria-controls="recent-posts" role="tab" data-toggle="tab">Recent Posts</a></li>
                            <?php 
if (config('views.counter') === 'true') {
    ?>
                            <li role="presentation"><a href="#popular-posts" aria-controls="popular-posts" role="tab" data-toggle="tab">Popular Posts</a></li>
                            <?php 
Exemplo n.º 2
0
    if (login()) {
        $user = $_SESSION[config("site.url")]['user'];
        $role = user('role', $user);
        config('views.root', 'system/admin/views');
        $post = find_post($year, $month, $name);
        if (!$post) {
            $post = find_draft($year, $month, $name);
            if (!$post) {
                not_found();
            }
        }
        $current = $post['current'];
        if ($user === $current->author || $role === 'admin') {
            render('delete-post', array('title' => 'Delete post - ' . blog_title(), 'description' => blog_description(), 'canonical' => site_url(), 'p' => $current, 'bodyclass' => 'deletepost', 'breadcrumb' => '<span typeof="v:Breadcrumb"><a property="v:title" rel="v:url" href="' . site_url() . '">' . config('breadcrumb.home') . '</a></span> &#187; ' . $current->tagb . ' &#187; ' . $current->title));
        } else {
            render('denied', array('title' => 'Delete post - ' . blog_title(), 'description' => blog_description(), 'canonical' => site_url(), 'p' => $current, 'bodyclass' => 'deletepost', 'breadcrumb' => '<span typeof="v:Breadcrumb"><a property="v:title" rel="v:url" href="' . site_url() . '">' . config('breadcrumb.home') . '</a></span> &#187; ' . $current->tagb . ' &#187; ' . $current->title));
        }
    } else {
        $login = site_url() . 'login';
        header("location: {$login}");
    }
});
// Get deleted data from blog post
post('/:year/:month/:name/delete', function () {
    $proper = is_csrf_proper(from($_REQUEST, 'csrf_token'));
    if ($proper && login()) {
        $file = from($_REQUEST, 'file');
        $destination = from($_GET, 'destination');
        delete_post($file, $destination);
    }
});
Exemplo n.º 3
0
function generate_opml()
{
    $opml_data = array('head' => array('title' => blog_title() . ' OPML File', 'ownerName' => blog_title(), 'ownerId' => site_url()), 'body' => array(array('text' => blog_title(), 'description' => blog_description(), 'htmlUrl' => site_url(), 'language' => 'unknown', 'title' => blog_title(), 'type' => 'rss', 'version' => 'RSS2', 'xmlUrl' => site_url() . 'feed/rss')));
    $opml = new opml($opml_data);
    echo $opml->render();
}
Exemplo n.º 4
0
            $url = $title;
            add_sub_page($title, $url, $content, $static, $description);
        }
    } else {
        $message['error'] = '';
        if (empty($title)) {
            $message['error'] .= '<li>Title field is required.</li>';
        }
        if (empty($content)) {
            $message['error'] .= '<li>Content field is required.</li>';
        }
        if (!$proper) {
            $message['error'] .= '<li>CSRF Token not correct.</li>';
        }
        config('views.root', 'system/admin/views');
        render('add-page', array('head_contents' => head_contents('Add page - ' . blog_title(), blog_description(), site_url()), 'error' => '<ul>' . $message['error'] . '</ul>', 'postTitle' => $title, 'postUrl' => $url, 'postContent' => $content, 'bodyclass' => 'addpage', 'breadcrumb' => '<a href="' . site_url() . '">' . config('breadcrumb.home') . '</a> &#187; <a href="' . $post->url . '">' . $post->title . '</a> Add page'));
    }
});
get('/:static/:sub', function ($static, $sub) {
    $father_post = get_static_post($static);
    if (!$father_post) {
        not_found();
    }
    $post = get_static_sub_post($static, $sub);
    if (!$post) {
        not_found();
    }
    $post = $post[0];
    if (config("views.counter") == "true") {
        add_view($post->file);
    }