Home/Featuredbox

* allow defining a time span during which the box should be displayed
 * added fields optional fields to point to diffenret header and home logos for the duration
This commit is contained in:
Sarjuuk
2017-01-20 18:10:31 +01:00
parent 8fd52835a6
commit d0f64fe66c
8 changed files with 89 additions and 50 deletions

View File

@@ -6,6 +6,14 @@
<body<?=(User::isPremium() ? ' class="premium-logo"' : null); ?>>
<div id="layers"></div>
<?php if ($this->headerLogo): ?>
<style type="text/css">
.header-logo {
background: url(<?=$this->headerLogo; ?>) no-repeat center 0 !important;
margin-bottom: 1px !important;
}
</style>
<?php endif; ?>
<div class="layout nosidebar" id="layout">
<div class="layout-inner" id="layout-inner">
<div class="header" id="header">

View File

@@ -6,6 +6,14 @@
</head>
<body class="home<?=(User::isPremium() ? ' premium-logo' : null); ?>">
<div id="layers"></div>
<?php if (!empty($this->featuredBox['altHomeLogo'])): ?>
<style type="text/css">
.home-logo {
background: url(<?=$this->featuredBox['altHomeLogo'];?>) no-repeat center 0 !important;
margin-bottom: 1px !important;
}
</style>
<?php endif; ?>
<div class="home-wrapper">
<h1>Aowow</h1>
<div class="home-logo" id="home-logo"></div>
@@ -26,18 +34,18 @@
<script type="text/javascript">//<![CDATA[
Markup.printHtml('<?=$this->oneliner;?>', 'home-oneliner');
//]]></script>
<?php elseif ($this->news): ?>
<?php elseif ($this->featuredBox): ?>
<div class="pad"></div>
<?php
endif;
if ($this->news):
if ($this->featuredBox):
?>
<div class="home-featuredbox<?=(empty($this->news['extraWide']) ? null : ' home-featuredbox-extended'); ?>" style="background-image: url(<?=$this->news['bgImgUrl']; ?>);" id="home-featuredbox">
<?php if ($this->news['overlays']): ?>
<div class="home-featuredbox<?=(empty($this->featuredBox['extraWide']) ? null : ' home-featuredbox-extended'); ?>" style="background-image: url(<?=$this->featuredBox['boxBG']; ?>);" id="home-featuredbox">
<?php if ($this->featuredBox['overlays']): ?>
<div class="home-featuredbox-links">
<?php
foreach ($this->news['overlays'] as $o):
foreach ($this->featuredBox['overlays'] as $o):
echo ' <a href="'.$o['url'].'" title="'.$o['title'].'" style="left: '.$o['left'].'px; top: 18px; width:'.$o['width'].'px; height: 160px"></a>'."\n";
echo ' <var style="left: '.$o['left'].'px; top: 18px; width:'.$o['width'].'px; height: 160px"></var>'."\n";
endforeach;
@@ -57,8 +65,8 @@ if (User::$localeId):
endif;
echo $this->writeGlobalVars();
if ($this->news):
echo " Markup.printHtml(".Util::toJSON($this->news['text']).", 'news-generic', { allow: Markup.CLASS_ADMIN });\n";
if ($this->featuredBox):
echo " Markup.printHtml(".Util::toJSON($this->featuredBox['text']).", 'news-generic', { allow: Markup.CLASS_ADMIN });\n";
endif;
?>
//]]></script>