Example #1
0
    /**
     * Search for the given term.
     * @param {string} $term Search term.
     */
    public function search($term)
    {
        $term = trim($term);
        if (mb_strlen($term) == 0) {
            return FALSE;
        }
        $filter = array('WHERE' => '
				po_status = :status AND
				po_datetime <= :date AND (
					po_title LIKE :term OR
					po_tags LIKE :term
				)
			', 'ORDER BY' => 'po_datetime DESC', 'LIMIT' => '0, ' . $this->numResults);
        $params = array(':date' => date('Y-m-d H:i:s'), ':status' => ae_PostModel::STATUS_PUBLISHED, ':term' => '%' . $term . '%');
        $poList = new ae_PostList($filter, $params);
        $this->items = $poList->getItems();
        $this->loadCategories();
        $this->loadNumComments();
    }
Example #2
0
<?php

define('IS_RSS', TRUE);
require_once '../core/autoload.php';
require_once '../core/config.php';
$filterUsers = array('LIMIT' => '0, 25');
$filterPosts = array('LIMIT' => '0, 25', 'ORDER BY' => 'po_datetime DESC', 'WHERE' => 'po_status = "' . ae_PostModel::STATUS_PUBLISHED . '"');
$userList = new ae_UserList($filterUsers);
$postList = new ae_PostList($filterPosts);
$postList->loadCategories();
$rssLink = URL . 'feed/';
$image = FALSE;
if (file_exists('../themes/' . THEME . '/img/favicon.png')) {
    $image = URL . 'themes/' . THEME . '/img/favicon.png';
}
echo '<?xml version="1.0" encoding="utf-8"?>' . PHP_EOL;
?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/">
	<channel>
		<title><?php 
echo ae_Settings::get('blog_title');
?>
</title>
		<description><?php 
echo ae_Settings::get('blog_description');
?>
</description>
	<?php 
if ($image !== FALSE) {
    ?>
		<image>
Example #3
0
<?php

define('IS_RSS', TRUE);
require_once '../core/autoload.php';
require_once '../core/config.php';
$filterPosts = array('LIMIT' => '0, 25', 'ODER BY' => 'po_datetime DESC', 'WHERE' => 'po_status = "' . ae_PostModel::STATUS_PUBLISHED . '"');
$filterComments = array('LIMIT' => '0, 25', 'ORDER BY' => 'co_datetime DESC', 'WHERE' => 'co_status = "' . ae_CommentModel::STATUS_APPROVED . '"');
$postList = new ae_PostList($filterPosts);
$commentList = new ae_CommentList($filterComments);
$rssLink = URL . 'feed/';
$image = FALSE;
if (file_exists('../themes/' . THEME . '/img/favicon.png')) {
    $image = URL . 'themes/' . THEME . '/img/favicon.png';
}
echo '<?xml version="1.0" encoding="utf-8"?>' . PHP_EOL;
?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/">
	<channel>
		<title><?php 
echo ae_Settings::get('blog_title');
?>
</title>
		<description><?php 
echo ae_Settings::get('blog_description');
?>
</description>
	<?php 
if ($image !== FALSE) {
    ?>
		<image>
			<url><?php 
Example #4
0
} else {
    if (ae_Permalink::isTag()) {
        $tag = ae_Permalink::getTagName();
        $tag = '%' . $tag . '%';
        $filter['WHERE'] .= ' AND po_tags LIKE :tag';
        $params[':tag'] = $tag;
    } else {
        if (ae_Permalink::isUser()) {
            if (($userId = ae_Permalink::getUserId()) !== FALSE) {
                $filter['WHERE'] .= ' AND po_user = :user';
                $params[':user'] = $userId;
            }
        }
    }
}
$postList = new ae_PostList($filter, $params);
$postList->loadCategories();
$postList->loadNumComments();
?>

<?php 
while ($post = $postList->next()) {
    ?>

	<?php 
    $class = 'post post-' . $post->getStatus();
    $class .= $post->getDatetime('YmdHis') > date('YmdHis') ? ' post-future' : '';
    ?>

<article class="<?php 
    echo $class;
Example #5
0
			) = :poStatus
		)
	');
$params = array(':coStatus' => ae_CommentModel::STATUS_APPROVED, ':poStatus' => ae_PostModel::STATUS_PUBLISHED, ':date' => date('Y-m-d H:i:s'));
$coList = new ae_CommentList($filter, $params, FALSE);
// Posts of the recent comments
$filter = array('LIMIT' => FALSE, 'WHERE' => '( ');
$params = array();
$i = 0;
while ($co = $coList->next()) {
    $filter['WHERE'] .= 'po_id = :id' . $i . ' OR ';
    $params[':id' . $i] = $co->getPostId();
    $i++;
}
$filter['WHERE'] = mb_substr($filter['WHERE'], 0, -4) . ' )';
$poList = new ae_PostList($filter, $params, FALSE);
$coList->reset();
?>
<aside class="recent-comments icon-add-before icon-before-comment">
	<h6>Neue Kommentare</h6>

<?php 
while ($co = $coList->next()) {
    ?>

	<?php 
    $gravUrl = GRAVATAR_BASE . md5($co->getAuthorEmail());
    $gravUrl .= '?d=mm';
    $gravUrl .= '&amp;s=' . GRAVATAR_SIZE;
    $p = $poList->find($co->getPostId());
    $postLink = $p->getLink() . '#comment-' . $co->getId();