New hooks for plugins and Sitemap

This commit is contained in:
dignajar 2016-01-07 21:00:40 -03:00
parent d1ebc605ae
commit 9a4b233dda
2 changed files with 10 additions and 6 deletions

View File

@ -75,7 +75,6 @@ function buildPage($key)
function buildAllPages()
{
global $pages;
global $pagesParents;
global $dbPages;
@ -133,6 +132,8 @@ function buildAllPages()
}
$pagesParents = array(NO_PARENT_CHAR=>$parents) + $tmpPageWithParent;
return $pages;
}
// ============================================================================
@ -183,4 +184,4 @@ if($Url->notFound())
}
// Build all pages
buildAllPages();
$pages = buildAllPages();

View File

@ -86,9 +86,10 @@ function buildPostsForPage($pageNumber=0, $amount=POSTS_PER_PAGE_ADMIN, $removeU
{
global $dbPosts;
global $dbTags;
global $posts;
global $Url;
$posts = array();
if($tagKey) {
// Get the keys list from tags database, this database is optimized for this case.
$list = $dbTags->getList($pageNumber, $amount, $tagKey);
@ -111,6 +112,8 @@ function buildPostsForPage($pageNumber=0, $amount=POSTS_PER_PAGE_ADMIN, $removeU
array_push($posts, $Post);
}
}
return $posts;
}
// ============================================================================
@ -154,17 +157,17 @@ if( ($Url->whereAmI()==='post') && ($Url->notFound()===false) )
// Build posts by specific tag.
elseif( ($Url->whereAmI()==='tag') && ($Url->notFound()===false) )
{
buildPostsForPage($Url->pageNumber(), $Site->postsPerPage(), true, $Url->slug());
$posts = buildPostsForPage($Url->pageNumber(), $Site->postsPerPage(), true, $Url->slug());
}
// Build posts for homepage or admin area.
else
{
// Posts for admin area.
if($Url->whereAmI()==='admin') {
buildPostsForPage($Url->pageNumber(), POSTS_PER_PAGE_ADMIN, false);
$posts = buildPostsForPage($Url->pageNumber(), POSTS_PER_PAGE_ADMIN, false);
}
// Posts for homepage
else {
buildPostsForPage($Url->pageNumber(), $Site->postsPerPage(), true);
$posts = buildPostsForPage($Url->pageNumber(), $Site->postsPerPage(), true);
}
}