ACC SHELL
<?php
$titleHTML = '';
$h1HTML = '';
$keywordsHTML = '';
$descriptionHTML = '';
$footerHTML = '';
$facebookHTMLheader = '';
$contentHTML = '';
$slideshowHTML = '';
$footerHomepageHTML = '';
$pageETS = new stdClass();
// FB like button URL
$pageETS->likeURL = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
$p = strpos( $pageETS->likeURL, '?' );
if ( $p === false )
$pageETS->likeURL = $pageETS->likeURL;
else
$pageETS->likeURL = substr( $pageETS->likeURL, 0, $p );
/// FB like URL redirect
$likeURL = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
$p = strpos( $likeURL, '?' );
if ( $p !== false )
{
$paramsURL = substr( $likeURL, $p );
$pp = strpos( $paramsURL, 'fb_' );
if ( $pp !== false )
{
$likeURL = substr( $likeURL, 0, $p );
header("HTTP/1.0 301 Moved Permanently");
header("Status: Moved Permanently");
header("Location: ".$likeURL);
}
}
///
// menu - begin
$showMenu = $settings['menuLeft'];//false;
// seo - title, footer
$seo_url = $_SERVER['REQUEST_URI'];
$str_pos = strpos( $seo_url, '?' );
if ( $str_pos !== false )
{
$seo_url = substr( $seo_url, 0, $str_pos );
}
$seo = $db->getItemWhere( 'seo', " WHERE `url`='" . $seo_url . "' " );
if ( isset( $seo['ID'] )/* && ( $seo['showMenu'] == '1' )*/ )
{
$showMenu = $seo['showMenu'];
}
// vertical menu
$verticalMenuHTML = '';
$verticalMenuHTMLmobile = '';
if ( $showMenu )
{
$menuRootID = 1;
$menu = new stdClass();
include( 'parts/menu.php' );
$verticalMenuHTML = sprintt( $menu, 'parts/vertical-menu.html' );
$verticalMenuHTMLmobile = sprintt( $menu, 'parts/vertical-menu-mobile.html' );
}
// horizontal menu
$horizontalMenuHTML = '';
$horizontalMenuHTMLmobile = '';
$menuRootID = 2;
$isHorizontalSubmenu = false;
$menu = new stdClass();
$menu->headerLayout = $settings[ 'headerLayout' ];
include( 'parts/menu.php' );
$horizontalMenuHTML = sprintt( $menu, 'parts/horizontal-menu.html' );
$horizontalMenuHTMLmobile = sprintt( $menu, 'parts/horizontal-menu-mobile.html' );
// menu - end
if ( $url_menu == $searchURL )
{
$contentType = 'showSearchResults';
}
if ( $url_menu == 'novinky' )
{
$contentType = 'novinky';
}
/*if ( $url_menu == 'kosik' ) TODO: ??? if ( $settings['isEshop'] ) ?
{
$contentType = 'kosik';
}*/
// article category ?
$articleCategory = 0;
if ( $url_menu != '' )
{
$articleCategory = $db->getItemWhere( 'category', " WHERE `url`='" . $url_menu . "' AND `categoryType`='article' " );
if ( isset( $articleCategory['ID'] ) )
{
if ( $url_submenu != '' )
$contentType = 'articleDetail';
else
$contentType = 'articleList';
}
}
// photogallery category ?
if ( ( $url_menu != '' ) && ( $articleCategory == 0 ) )
{
$articleCategory = $db->getItemWhere( 'category', " WHERE `url`='" . $url_menu . "' AND `categoryType`='photogallery' " );
if ( isset( $articleCategory['ID'] ) )
{
if ( $url_submenu != '' )
$contentType = 'photogalleryDetail';
else
$contentType = 'photogalleryList';
}
}
// ALL products list
if ( $url_menu == $productListURL )
{
if ( $url_submenu != '' )
$contentType = 'productDetail';
else
$contentType = 'productList';
}
// category ?
if ( $url_menu != '' )
{
$page = $db->getItemWhere( 'category', " WHERE `url`='" . $url_menu . "' AND `categoryType`='product' " );
if ( isset( $page['ID'] ) )
{
if ( $url_submenu != '' )
$contentType = 'productDetail';
else
$contentType = 'productList';
}
}
// manufacturer ?
if ( $url_menu != '' )
{
$_manufacturer = $db->getItemWhere( 'manufacturer', " WHERE `url`='" . $url_menu . "' " );
if ( isset( $_manufacturer['ID'] ) )
{
$contentType = 'manufacturerList';
}
}
// page ?
if ( $url_menu != '' )
{
$page = $db->getItemWhere( 'page', " WHERE `url`='" . $url_menu . "' AND `visibility`=1 AND `parentID`=0 " );
if ( $url_submenu != '' )
{
if ( isset( $page['ID'] ) )
{
$subPage = $db->getItemWhere( 'page', " WHERE `url`='" . $url_submenu . "' AND `visibility`=1 AND `parentID`=" . $page['ID'] );
if ( isset( $subPage['ID'] ) )
{
$contentType = 'showPage';
$page = $subPage;
}
}
}
else
{
if ( isset( $page['ID'] ) )
{
$contentType = 'showPage';
}
}
}
else
// home-page
{
$page = $db->getItemWhere( 'page', " WHERE `url`='homepage' " );
if ( isset( $page['ID'] ) )
{
$contentType = 'showPage';
}
}
// content for given URL
switch ( $contentType )
{
case 'showSearchResults':
$titleHTML .= ' | Vyhledávání';
include( 'parts/showSearchResults.php' );
break;
case 'showPage':
include( 'parts/showPage.php' );
break;
case 'manufacturerList':
case 'productList':
include( 'parts/productList.php' );
$titleHTML = $productList->getTitle() . ' | ' . $titleHTML;
break;
case 'productDetail':
include( 'parts/productDetail.php' );
include( 'parts/productList.php' );
$titleHTML = $product->getTitle() . ' | ' . $productList->getTitle() . ' | ' . $titleHTML;
break;
case 'articleList':
case 'photogalleryList':
include( 'parts/articleList.php' );
break;
case 'articleDetail':
include( 'parts/articleDetail.php' );
include( 'parts/articleList.php' );
break;
case 'photogalleryDetail':
include( 'parts/articleDetail.php' );
break;
case 'novinky':
if ( $url_submenu == '' )
{
include( 'parts/listNews.php' );
}
else
{
include( 'parts/showNewsDetail.php' );
}
break;
case 'download':
include( 'parts/article-file-download.php' );
break;
case 'kosik':
if ( $settings['isEshop'] )
{
switch ( $url_step )
{
case '2':
include( 'parts/cart-2.php' );
break;
case '3':
include( 'parts/cart-3.php' );
break;
case '1':
default:
include( 'parts/cart-1.php' );
break;
}
}
else
{
header("HTTP/1.0 301 Moved Permanently");
header("Status: Moved Permanently");
header("Location: http://".$_SERVER['HTTP_HOST']."/");
}
break;
default:
header("HTTP/1.0 301 Moved Permanently");
header("Status: Moved Permanently");
header("Location: http://".$_SERVER['HTTP_HOST']."/");
// home-page
$page = $db->getItemWhere( 'page', " WHERE `url`='homepage' " );
if ( isset( $page['ID'] ) )
{
$contentType = 'showPage';
include( 'parts/showPage.php' );
}
break;
}
// seo - title, footer
//$seo = $db->getItemWhere( 'seo', " WHERE `url`='" . $_SERVER['REQUEST_URI'] . "' " );
if ( isset( $seo['ID'] ) )
{
$titleHTML = $seo['title'];
$h1HTML = $seo['h1'];
$footerHTML = $seo['footer'];
$keywordsHTML = $seo['keywords'];
$descriptionHTML = $seo['description'];
}
?>
ACC SHELL 2018