New hooks for plugins and Sitemap
This commit is contained in:
parent
d1ebc605ae
commit
9a4b233dda
|
@ -75,7 +75,6 @@ function buildPage($key)
|
||||||
|
|
||||||
function buildAllPages()
|
function buildAllPages()
|
||||||
{
|
{
|
||||||
global $pages;
|
|
||||||
global $pagesParents;
|
global $pagesParents;
|
||||||
global $dbPages;
|
global $dbPages;
|
||||||
|
|
||||||
|
@ -133,6 +132,8 @@ function buildAllPages()
|
||||||
}
|
}
|
||||||
|
|
||||||
$pagesParents = array(NO_PARENT_CHAR=>$parents) + $tmpPageWithParent;
|
$pagesParents = array(NO_PARENT_CHAR=>$parents) + $tmpPageWithParent;
|
||||||
|
|
||||||
|
return $pages;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
|
@ -183,4 +184,4 @@ if($Url->notFound())
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build all pages
|
// Build all pages
|
||||||
buildAllPages();
|
$pages = buildAllPages();
|
||||||
|
|
|
@ -86,9 +86,10 @@ function buildPostsForPage($pageNumber=0, $amount=POSTS_PER_PAGE_ADMIN, $removeU
|
||||||
{
|
{
|
||||||
global $dbPosts;
|
global $dbPosts;
|
||||||
global $dbTags;
|
global $dbTags;
|
||||||
global $posts;
|
|
||||||
global $Url;
|
global $Url;
|
||||||
|
|
||||||
|
$posts = array();
|
||||||
|
|
||||||
if($tagKey) {
|
if($tagKey) {
|
||||||
// Get the keys list from tags database, this database is optimized for this case.
|
// Get the keys list from tags database, this database is optimized for this case.
|
||||||
$list = $dbTags->getList($pageNumber, $amount, $tagKey);
|
$list = $dbTags->getList($pageNumber, $amount, $tagKey);
|
||||||
|
@ -111,6 +112,8 @@ function buildPostsForPage($pageNumber=0, $amount=POSTS_PER_PAGE_ADMIN, $removeU
|
||||||
array_push($posts, $Post);
|
array_push($posts, $Post);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return $posts;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
|
@ -154,17 +157,17 @@ if( ($Url->whereAmI()==='post') && ($Url->notFound()===false) )
|
||||||
// Build posts by specific tag.
|
// Build posts by specific tag.
|
||||||
elseif( ($Url->whereAmI()==='tag') && ($Url->notFound()===false) )
|
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.
|
// Build posts for homepage or admin area.
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Posts for admin area.
|
// Posts for admin area.
|
||||||
if($Url->whereAmI()==='admin') {
|
if($Url->whereAmI()==='admin') {
|
||||||
buildPostsForPage($Url->pageNumber(), POSTS_PER_PAGE_ADMIN, false);
|
$posts = buildPostsForPage($Url->pageNumber(), POSTS_PER_PAGE_ADMIN, false);
|
||||||
}
|
}
|
||||||
// Posts for homepage
|
// Posts for homepage
|
||||||
else {
|
else {
|
||||||
buildPostsForPage($Url->pageNumber(), $Site->postsPerPage(), true);
|
$posts = buildPostsForPage($Url->pageNumber(), $Site->postsPerPage(), true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue