<?php ###### Funktionsaufruf (alle Blog-Dateien finden, korrigieren und einbinden) ##################################################################################
$includedFiles= recursiveScan($convertedPath, $excludeArray);
foreach ($includedFiles as $file) {
include (phpConvertPageToFilesystemPath($file));
$includedBlogArrayId = key(array_slice($blogPageData, -1, 1, true));
//###### Erstelle Produktdatei mit Namespace-Template, falls Datei nicht vorhanden
$blogPageData[$includedBlogArrayId]['includeBlogData'] = str_replace('pagedata:', '', $file);
$cutPageData = str_replace('pagedata:', '', $file);
if (!(file_exists(phpConvertPageToFilesystemPath($cutPageData)))) {
$cutSearchPath = str_replace($unconvertedPath . ':', '', $cutPageData);
$cutFileName = explode(':', $cutSearchPath)[0];
echo $cutFileName . ' \\\\ ';
$nspTplFile = phpCreateDokuWikiConformName($unconvertedPath) . ':vorlagen:nsp_tpl_' . str_replace(':', '_', $unconvertedPath) . explode(':', str_replace($unconvertedPath . ':', '_', $cutPageData))[0];
$pageFileContent = '~~NOCACHE~~
<phpwikify>
include(phpConvertPageToFilesystemPath("' . $nspTplFile . '"));
</phpwikify>
';
file_put_contents( phpConvertPageToFilesystemPath($cutPageData), str_replace(' ', '', $pageFileContent) );
}
if (!(file_exists(phpConvertPageToFilesystemPath($blogPageData[$includedBlogArrayId]['includeFileData'])))) { echo 'Nicht da: ' . $blogPageData[$includedBlogArrayId]['includeFileData'] . ' \\\\ '; }
//###### Inkludiere Blog-Daten, falls Blog-Pagedata existiert
if ( (!($blogPageData[$includedBlogArrayId]['blogPageReleaseState'] == 'published')) || (!(file_exists(phpConvertPageToFilesystemPath($blogPageData[$includedBlogArrayId]['includeFileData'])))) ){
array_pop($blogPageData);
} else {
$blogPageData[$includedBlogArrayId]['blogPageCreationDate'] = date("d.m.Y",strtotime($blogPageData[$includedBlogArrayId]['blogPageCreationDate']));
$blogPageData[$includedBlogArrayId]['blogPageCreationTimeStamp'] = strtotime("{$blogPageData[$includedBlogArrayId]['blogPageCreationDate']} {$blogPageData[$includedBlogArrayId]['blogPageCreationTime']}");
$blogPageData[$includedBlogArrayId]['blogPageDataFile'] = $file;
//###### Dateinamen-Prefix für Images anhand der Produktseite ermitteln
$imageFilePrefix = '';
$imageFilePrefixArray = explode('_',end(explode(':',$blogPageData[$includedBlogArrayId]['includeFileData'])));
foreach ($imageFilePrefixArray as $imageFilePrefixString) {
if (strstr($blogCoverString, '-')) {
$imageFilePrefix .= $imageFilePrefixString. '_';
} else {
$imageFilePrefix .= substr($imageFilePrefixString, 0, 3) . '_';
}
}
//###### Dateinamen für Blog-Cover ermitteln
if ((!isset($blogPageData[$includedBlogArrayId]['blogPageCover'])) || (empty($blogPageData[$includedBlogArrayId]['blogPageCover']))) {
$blogPageData[$includedBlogArrayId]['blogPageCover'] = 'blog_cover.jpg';
}
}
}
array_multisort(array_column($blogPageData, 'blogPageCreationTimeStamp'), SORT_DESC, $blogPageData );
###### Variabeln korrigieren ##################################################################################
$displayedPagesStart = 0;
$displayedPagesPerPage = $displayedPagesMax - $displayedPagesStart;
if ($displayedPagesPerPage == -1) { $displayedPagesPerPage = sizeof( $blogPageData ); }
if (isset($_GET['displayedPagesStart'])) { $displayedPagesStart = $_GET['displayedPagesStart']; }
if (isset($_GET['displayedPagesMax'])) { $displayedPagesMax = $_GET['displayedPagesMax']; }
if (($displayedPagesMax == -1)) {
$displayedPagesMax = sizeof( $blogPageData );
} else {
}
###### Navigation ##################################################################################
if (!($displayedPagesPerPage == sizeof( $blogPageData ))) {
echo 'Artikel-Index: ';
echo '[[' . $_GET['id'] . '|[Neueste] ]]';
if ($displayedPagesStart >= $displayedPagesPerPage) {
echo '[[' . $_GET['id'] . '?displayedPagesStart=' . ( $displayedPagesStart - $displayedPagesPerPage ) . '&displayedPagesMax=' . $displayedPagesStart . '|[<<] ]]';
}
if ($displayedPagesMax < sizeof( $blogPageData )) {
echo '[[' . $_GET['id'] . '?displayedPagesStart=' . $displayedPagesStart . '&displayedPagesMax=' . ($displayedPagesMax + $displayedPagesPerPage) . '| [Ältere] ]]';
echo '[[' . $_GET['id'] . '?displayedPagesStart=' . $displayedPagesMax . '&displayedPagesMax=' . ( $displayedPagesMax + $displayedPagesPerPage ) . '|[>>] ]]';
}
if (($displayedPagesStart > 0) || ($displayedPagesMax < sizeof( $blogPageData ))) {
echo '[[' . $_GET['id'] . '?displayedPagesStart=0&displayedPagesMax=-1|[Alle]]]';
}
}
###### 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) -->
';
if ($displayedPagesMax > sizeof( $blogPageData )) { $displayedPagesMax = sizeof( $blogPageData ); }
if ($displayedPagesStart < 0) { $displayedPagesStart = 0; }
for ($articleCounter=$displayedPagesStart; $articleCounter < $displayedPagesMax ; $articleCounter++) {
if (array_key_exists($articleCounter, $blogPageData)) {
include(phpConvertPageToFilesystemPath($blogPageData[$articleCounter]['includeFileData']));
$includedProductArrayId = key(array_slice($product, -1, 1, true));
$namespaceOfProduct = phpCreateDokuWikiConformName('wiki:ernährung:marke:' . $product[$includedProductArrayId]['marke']['wert']);
$namespaceOfProduct = 'wiki:ernaehrung:marke:' . phpCreateDokuWikiConformName($product[$includedProductArrayId]['marke']['wert']) . ':' . phpCreateDokuWikiConformName($product[$includedProductArrayId]['produktlinie']['wert'] . ' -' . (!empty($product[$includedProductArrayId]['produktname']['wert']) ? ' ' . $product[$includedProductArrayId]['produktname']['wert']:'') . (!empty($product[$includedProductArrayId]['produktnamenszusatz']['wert']) ? ' ' . $product[$includedProductArrayId]['produktnamenszusatz']['wert']:'') );
$blogPageData[$articleCounter]['includedProductArrayId'] = $includedProductArrayId;
if (!(strstr($blogPageData[$articleCounter]['blogPageCover'],':'))) { $blogPageData[$articleCounter]['blogPageCover'] = $namespaceOfProduct . ':' . $blogPageData[$articleCounter]['blogPageCover']; }
if ($articleCounter == 0) {
echo "
<br />
<div>Aktuelles auf {$_SERVER['SERVER_NAME']}</div>
<hr /><br />
";
} elseif ( ($blogPageData[$articleCounter]['blogPageCreationDate'] != $blogPageData[$articleCounter - 1]['blogPageCreationDate']) || ($displayedPagesStart > 0) ){
echo "
<br />
<div class='dateBox'>Beiträge vom {$blogPageData[$articleCounter]['blogPageCreationDate']}</div>
<hr /><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'] . ' [[' . $blogPageData[$articleCounter]['includeBlogData'] . '|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>';
?>