<?php ###### Funktionsaufruf (alle Blog-Dateien finden, korrigieren und einbinden) ##################################################################################
$includedFiles= recursiveScan($convertedPath, $excludeArray);
foreach ($includedFiles as $file) {
include (phpConvertPageToFilesystemPath($file));
$givenProductArrayId = key(array_slice($blogPageData, -1, 1, true));
if ( (!($blogPageData[$givenProductArrayId]['blogPageReleaseState'] == 'published')) || (!(file_exists(phpConvertPageToFilesystemPath($blogPageData[$givenProductArrayId]['includeFileData'])))) ){
array_pop($blogPageData);
} else {
$blogPageData[$givenProductArrayId]['blogPageCreationDate'] = date("d.m.Y",strtotime($blogPageData[$givenProductArrayId]['blogPageCreationDate']));
$blogPageData[$givenProductArrayId]['blogPageCreationTimeStamp'] = strtotime("{$blogPageData[$givenProductArrayId]['blogPageCreationDate']} {$blogPageData[$givenProductArrayId]['blogPageCreationTime']}");
$blogPageData[$givenProductArrayId]['blogPageDataFile'] = $file;
if ((!isset($blogPageData[$givenProductArrayId]['blogPageCover'])) || (empty($blogPageData[$givenProductArrayId]['blogPageCover']))) {
$blogCover = '';
$blogCoverArray = explode('_',end(explode(':',$blogPageData[$givenProductArrayId]['includeFileData'])));
foreach ($blogCoverArray as $blogCoverString) {
if (strstr($blogCoverString, '-')) {
$blogCover .= $blogCoverString . '_';
} else {
$blogCover .= substr($blogCoverString, 0, 3) . '_';
}
}
$blogPageData[$givenProductArrayId]['blogPageCover'] = $blogCover . 'blog_cover.jpg';
}
}
}
array_multisort(array_column($blogPageData, 'blogPageCreationTimeStamp'), SORT_DESC, $blogPageData );
###### Variabeln korrigieren ##################################################################################
if (!($displayedPagesMax == -1)) { $displayedPagesPerPage = $displayedPagesMax - $displayedPagesStart; }
if (isset($_GET['displayedPagesStart'])) { $displayedPagesStart = $_GET['displayedPagesStart']; }
if (isset($_GET['displayedPagesMax'])) { $displayedPagesMax = $_GET['displayedPagesMax']; }
if (($displayedPagesMax == -1) || ($displayedPagesMax > sizeof( $blogPageData ))) {
$displayedPagesMax = sizeof( $blogPageData );
}
if (($displayedPagesMax + $displayedPagesPerPage) > sizeof( $blogPageData )) {
$lastArticleToDisplay = '-' . sizeof( $blogPageData );
} else {
$lastArticleToDisplay = '-' . ($displayedPagesMax + $displayedPagesPerPage);
}
if (($displayedPagesMax + 1) == sizeof( $blogPageData )) {
$lastArticleToDisplay = '';
}
###### Navigation ##################################################################################
echo '[[' . $_GET['id'] . '|Home]]';
if ($displayedPagesMax < sizeof( $blogPageData )) {
echo '[[' . $_GET['id'] . '?displayedPagesStart=' . $displayedPagesMax . '&displayedPagesMax=' . ( $displayedPagesMax + $displayedPagesPerPage ) . '| Artikel ' . ($displayedPagesMax + 1) . $lastArticleToDisplay . ']]';
echo '[[' . $_GET['id'] . '?displayedPagesStart=0&displayedPagesMax=' . ($displayedPagesMax + $displayedPagesPerPage) . '| +' . $displayedPagesPerPage . ' Artikel]]';
}
if (($displayedPagesStart > 0) || ($displayedPagesMax < sizeof( $blogPageData ))) {
echo '[[' . $_GET['id'] . '?displayedPagesStart=0&displayedPagesMax=-1| Alle Artikel]]';
}
###### CSS-Datei inkludieren ##################################################################################
include($includeCss);
###### HTML-Tag öffnen ##################################################################################
echo '<html>';
###### Darstellungsstruktur ##################################################################################
echo '
<div class="parentbox"><!-- ###### parentbox umspannender Inhalts-Container (öffnen) -->
<div class="sectionbox-row"><!-- ###### Sectionbox für Spalten im umspannenden Inhalts-Container (öffnen) -->
<div class="contentbox-left"><!-- ###### Linke Spalte (öffnen) -->
';
for ($articleCounter=$displayedPagesStart; $articleCounter < $displayedPagesMax ; $articleCounter++) {
echo $articleCounter;
if (array_key_exists($articleCounter, $blogPageData)) {
include(phpConvertPageToFilesystemPath($blogPageData[$articleCounter]['includeFileData']));
$includedProductArrayId = key(array_slice($product, -1, 1, true));
$namespaceProduct = phpCreateDokuWikiConformName('wiki:ernährung:marke:' . $product[$includedProductArrayId]['marke']['wert']);
$blogPageData[$articleCounter]['includedProductArrayId'] = $includedProductArrayId;
if (!(strstr($blogPageData[$articleCounter]['blogPageCover'],':'))) { $blogPageData[$articleCounter]['blogPageCover'] = $namespaceProduct . ':' . $blogPageData[$articleCounter]['blogPageCover']; }
if ($articleCounter == 0) {
echo "
<div>Aktuelles auf {$_SERVER['SERVER_NAME']}</div>
<br /><br />
";
} elseif ($blogPageData[$articleCounter]['blogPageCreationDate'] != $blogPageData[$articleCounter - 1]['blogPageCreationDate']) {
echo "
<hr /><br />
<div class='dateBox'>Beiträge vom {$blogPageData[$articleCounter]['blogPageCreationDate']}</div>
<br /><br />
";
}
echo '
<div class="sectionbox-column"><!-- Blogeintrag (Zusammenfassung) (öffnen) -->
<div class="titlebox"><!-- ###### Titel (öffnen) -->
<div class="titlebox-top"></html>' . $product[$includedProductArrayId]['marke']['wert'] . ' \\\\ ' . $product[$includedProductArrayId]['produktlinie']['wert'] . ' \\\\ ' . $product[$includedProductArrayId]['produktname']['wert'] . ' ' . $product[$includedProductArrayId]['produktnamenszusatz']['wert'] . '<html></div>
<div class="titlebox-bottom"></html>' . $blogPageData[$articleCounter]['blogPageCategories'] . '<html></div>
</div><!-- ###### Titel (schließen) -->
<div class="contentbox"><!-- ###### Titelbild (öffnen) -->
<div class="contentbox-information"></html>{{' . $blogPageData[$articleCounter]['blogPageCover'] . '?nolink}}<html><br /><br /></div>
</div><!-- ###### Titelbild (schließen) -->
<div class="eyecatcherbox"><!-- ###### Eyecatcher (öffnen) -->
<div class="eyecatcherbox-top"></html>' . $blogPageData[$articleCounter]['blogPageEyeCatcher'] . ' [[blog:ernaehrung:vorlagen:tpl_fleischlos_produkt_produkttest_call?currentPageId=' . end(explode( ':', $blogPageData[$articleCounter]['includeFileData'] )) . '¤tBlogContentFile=' . $blogPageData[$articleCounter]['blogPageDataFile'] . '|weiterlesen...]]<html></div>
<div class="eyecatcherbox-bottom"></html>' . $blogPageData[$articleCounter]['blogPageCreationDate'] . ', ' .$blogPageData[$articleCounter]['blogPageCreationTime'] . '<html></div>
</div><!-- ###### Eyecatcher (schließen) -->
</div><!-- Blogeintrag (Zusammenfassung) (schließen) -->
';
}
}
echo'
</div><!-- ###### Linke Spalte (schließen) -->
<div class="contentbox-right"><!-- ###### Rechte Spalte (öffnen) -->
';
include($sidebarRight);
echo '
</div><!-- ###### Rechte Spalte (schließen) -->
</div><!-- ###### Sectionbox für Spalten im umspannenden Inhalts-Container (schließen) --> </div><!-- parentbox umspannender Inhalts-Container (schließen) --> ';
###### JavaScript - tatsächliche Größe der ParentBox bestimmen und festlegen ##################################################################################
echo '
<script language="javascript">
var biggestHeight = 0;
// Loop through elements children to find & set the biggest height
$(".parentbox*").each(function(){
// If this elements height is bigger than the biggestHeight
if ($(this).height() > biggestHeight ) {
// Set the biggestHeight to this Height
biggestHeight = $(this).height();
}
});
// Set the container height
$(".parentbox").height(biggestHeight);
</script>
';
###### HTML-Tag schließen ##################################################################################
echo '</html>';
?>