Пример #1
0
<?php

require_once 'core/autoload.php';
require_once 'core/config.php';
ae_Permalink::init();
$sb = new ae_SiteBuilder();
$sb->render('themes/' . THEME . '/index.php');
Пример #2
0
 /**
  * Set user permalink.
  * @param  {string} $permalink User permalink
  * @return {string}            The actually used permalink.
  */
 public function setPermalink($permalink)
 {
     $this->permalink = ae_Permalink::generatePermalink($permalink);
     return $this->permalink;
 }
Пример #3
0
<?php

$tags = array();
foreach ($data as $tag) {
    $link = sprintf('<a class="tag icon-add-before icon-before-tag" href="%s">%s</a>', URL . PERMALINK_BASE_TAG . ae_Permalink::prepareTag($tag), $tag);
    $tags[$tag] = $link;
}
ksort($tags);
?>
<div class="post-tags">
	<?php 
foreach ($tags as $link) {
    echo $link;
}
?>
</div>
Пример #4
0
			AND po_id IN (
				SELECT DISTINCT pc_post FROM `' . AE_TABLE_POSTS2CATEGORIES . '`
				WHERE pc_category = :catId
			)
		';
        $params[':catId'] = $ca->getId();
    }
} 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()) {
    ?>
Пример #5
0
 /**
  * Initialize by setting the revelant URL part.
  */
 public static function init()
 {
     $urlBase = explode('/', $_SERVER['PHP_SELF']);
     array_pop($urlBase);
     $urlBase = implode('/', $urlBase);
     self::$regex['category'] = str_replace('%CATEGORY_BASE%', PERMALINK_BASE_CATEGORY, self::$regex['category']);
     self::$regex['offset'] = str_replace('%OFFSET_BASE%', PERMALINK_BASE_OFFSET, self::$regex['offset']);
     self::$regex['page'] = str_replace('%PAGE_BASE%', PERMALINK_BASE_PAGE, self::$regex['page']);
     self::$regex['post'] = str_replace('%POST_BASE%', PERMALINK_BASE_POST, self::$regex['post']);
     self::$regex['tag'] = str_replace('%TAG_BASE%', PERMALINK_BASE_TAG, self::$regex['tag']);
     self::$regex['user'] = str_replace('%USER_BASE%', PERMALINK_BASE_USER, self::$regex['user']);
     self::$url = str_replace('?' . $_SERVER['QUERY_STRING'], '', $_SERVER['REQUEST_URI']);
     self::$url = str_replace($urlBase, '', self::$url);
     self::$url = preg_replace(';/index.php$;', '', self::$url);
     self::$url = preg_replace(';/$;', '', self::$url);
     self::$urlNoOffset = preg_replace(self::$regex['offset'], '', self::$url);
 }
Пример #6
0
 public function testPrepareTag()
 {
     $this->assertEquals(ae_Permalink::prepareTag('foo/bär 4'), 'foo_b%C3%A4r%204');
 }
Пример #7
0
    } else {
        if (isset($_GET[PERMALINK_GET_SEARCH])) {
            $content = 'search';
        } else {
            $content = 'all-posts';
        }
    }
}
// HTTP 404: Not found
if ($content == '404') {
    header('HTTP/1.0 404 Not Found');
}
define('GRAVATAR_BASE', 'https://secure.gravatar.com/avatar/');
define('GRAVATAR_SIZE', 48);
define('IS_SINGLE_POST', $content == 'single-post');
define('POSTS_OFFSET', max(ae_Permalink::getPostOffset() - 1, 0));
define('POSTS_PER_PAGE', 5);
$sb = new ae_SiteBuilder();
$sb->setBasePath('themes/' . THEME);
?>
<!DOCTYPE html>

<html>
<?php 
include 'head.php';
?>
<body>

<?php 
$sb->render('header.php');
$sb->render('sidebar.php');