Exemplo n.º 1
0
function au_template_blog_preview()
{
    // Our template needs the big $aulis
    global $aulis;
    // Let's make this thing shorter
    $e = $aulis['blog_entry'];
    // If our blog has no seperate intro text, it is the same as the whole blog
    if ($e->blog_intro == '' and $e->blog_content != '') {
        $e->blog_intro = $e->blog_content;
    } else {
        if ($e->blog_intro == '' and $e->blog_content == '') {
            return au_error_box(BLOG_EMPTY);
        }
    }
    // We might have to highlight stuff
    if (isset($_GET['search'])) {
        // Explode the search string, so that we can highlight every word seperatly
        $exploded_search = explode(' ', $aulis['blog_search']);
        // Each word needs to be highlighted in blog_name and blog_intro
        foreach ($exploded_search as $keyword) {
            $e->blog_name = au_highlight($keyword, $e->blog_name, "<span class='highlight'>", "</span>");
            $e->blog_intro = au_highlight($keyword, $e->blog_intro, "<span class='highlight'>", "</span>");
        }
    }
    // The href to the blog entry page
    $href = au_blog_url($aulis['blog_url_input']);
    // The heading
    au_out("<h1><a href='" . $href . "'>" . $e->blog_name . "</a></h1>", true, 'blog_entries');
    // The sub heading with time and catergory
    au_out("<span class='sub'>" . au_icon('category', 12) . ' ' . sprintf(BLOG_POSTED_IN, "<a href='" . au_blog_url(array('app' => 'blogindex', 'category' => $e->blog_category, 'category_name' => $e->category_name)) . "'>" . $e->category_name . "</a>") . "\n\t\t " . au_icon('clock', 12) . ' ' . au_date($e->blog_date) . "</span>", true, 'blog_entries');
    // The content
    au_out("<p>" . au_parse_blog($e->blog_intro, $e->blog_parse_mode) . "</p>", true, 'blog_entries');
    // Comments bar!
    au_out('<div class="comments_bar"><a href="' . $href . '#comments">' . au_icon('comment', 12) . ' ' . ($aulis['blog_comment_count'] == 0 ? BLOG_NO_COMMENTS : $aulis['blog_comment_count'] . ' ' . ($aulis['blog_comment_count'] > 1 ? BLOG_COMMENTS : BLOG_COMMENT)) . '</a> | <a href="' . $href . '">' . au_icon('lamp', 12) . ' ' . BLOG_READMORE . '</a></div>', $e->blog_can_comment == 1, 'blog_entries');
    // We need this for the output
    $blog_preview = '';
    // Finish the output into $aulis['page']['blog_preview']
    foreach ($aulis['page']['blog_entries'] as $entry) {
        $blog_preview .= $entry;
    }
    // Transfer the output
    au_out($blog_preview, true, 'blog_preview');
    // Ready for the next one
    unset($aulis['blog']['entry'], $aulis['page']['blog_entries']);
}
Exemplo n.º 2
0
function au_show_entry()
{
    // Praise the big $aulis
    global $aulis;
    // We can't access this file, if not from index.php, so let's check
    if (!defined('aulis')) {
        header("Location: index.php");
    }
    // We need to decrypt the blog id, if numeric
    if (isset($_GET['id']) and is_numeric($_GET['id'])) {
        $entry_id = au_decrypt_blog_id($_GET['id']);
    } else {
        $entry_id = 0;
    }
    // Try to obtain the entry from the big (or small, it all depends) database
    if ($aulis['blog']['entry'] = au_get_blog_entry($entry_id)) {
        // Prepare some url inputs
        $aulis['blog']['url_input'] = array("app" => "blogentry", "id" => $aulis['blog']['entry']->entry_id, "title" => $aulis['blog']['entry']->blog_name);
        // Load the template
        au_load_template("blog_entry");
    } else {
        au_error_box(BLOG_NOT_FOUND);
    }
}
Exemplo n.º 3
0
function au_template_blog_index()
{
    // Our template needs the big $aulis
    global $aulis;
    // What error do we need to show if no entries are found?
    $no_entries = BLOG_NO_ENTRIES_FOUND;
    // The sidebar, needs to be on top
    au_load_template('blog_sidebar');
    // If we are searching, we need to have a title and such
    if (isset($_GET['search']) && !isset($_GET['category'], $_GET['tag']) && ($no_entries = sprintf(BLOG_SEARCH_NO_ENTRIES, $aulis['blog_search']))) {
        au_out('<div class="blog_preview_page_title"><span class="float-right lowercase">' . sprintf(BLOG_SEARCH_FOUND_HITS, au_format_number($aulis['blog_count'], 0), $aulis['blog_count'] > 1 || $aulis['blog_count'] == 0 ? BLOG_SEARCH_FOUND_HITS_PLURAL : BLOG_SEARCH_FOUND_HITS_SINGULAR) . '</span>
			<h1>' . sprintf(BLOG_SEARCH_TITLE, '\'' . $aulis['blog_search'] . '\'') . '</h1></div>
			<div class="blog_preview_page_title_sub"><a class="button" href="' . au_blog_url() . '">' . au_icon('arrow_left', 8) . 'Back to blog</a><br /><br /></div>');
    }
    // If we are in category, the title needs to show that
    if (isset($_GET['category']) && is_numeric($_GET['category']) && !isset($_GET['search'], $_GET['tag']) and $no_entries = BLOG_CATEGORY_NO_ENTRIES) {
        au_out('<div class="blog_preview_page_title"><span class="float-right lowercase">' . sprintf(BLOG_FOUND_HITS, au_format_number($aulis['blog_count'], 0), $aulis['blog_count'] > 1 || $aulis['blog_count'] == 0 ? BLOG_FOUND_HITS_PLURAL : BLOG_FOUND_HITS_SINGULAR) . '</span>
			<h1>' . sprintf(BLOG_CATEGORY_TITLE, '\'' . au_get_blog_category_name($aulis['blog_category']) . '\'') . '</h1></div>
			<div class="blog_preview_page_title_sub"><a class="button" href="' . au_blog_url() . '">' . au_icon('arrow_left', 8) . 'Back to blog</a><br /><br /></div>');
    }
    // If there are no entries parsed, we need to show that
    if (!isset($aulis['page']['blog_preview']) || empty($aulis['page']['blog_preview'])) {
        au_error_box($no_entries, 'blog_preview');
    }
    // Let's output the page links we want into $aulis['blog_preview'], so that it gets parsed in a nice wrapper
    au_out('<br /><div class="maxwidth">' . au_blog_index_timeline_links() . '</div>', $aulis['blog_count'] != 0 and $aulis['blog_max_offset'] != 0, 'blog_preview');
    // Finalize the output; rendering it into nice wrappers.
    $output = '';
    foreach ($aulis['page']['blog_preview'] as $number => $entry) {
        $output .= '<div class="blog_preview_wrapper w-' . $number . '">' . $entry . '</div>';
    }
    // Wrap it again, for easy jQuery selection of all preview elements
    au_out('<div class="blog_previews">' . $output . '</div>');
    // We want a clean page
    au_out('<br class="clear" />');
}
Exemplo n.º 4
0
<?php

/*
|| Aulis
|| Organisation:	Aulis International
|| Website:			http://germanics.org/aulis
|| Developed by: 	Robert Monden
					Thomas de Roo
|| License: 		MIT
|| Version: 		0.01
|| * File information * 
||		-> viewboard.php
| 		-> // This file contains the logic for the board
|| 		-> Last change: July, 2015
*/
// We can't access this file, if not from index.php, so let's check
if (!defined('aulis')) {
    header("Location: index.php");
}
au_error_box("Nothing to see here.");