* @access public
*/
public function banners(array $page)
+ {
+ $this->getHorizontalBanners($page);
+ $this->getVerticalBanners($page);
+ }
+
+ function getHorizontalBanners(array $page)
{
$bannerConf = new Config;
$bannerRoot = & $bannerConf->parseConfig(
);
$dbh = Toolkit_Database::getInstance();
- $banners = & Toolkit_Banners_BannersIterator::create('Bottom');
+
+ $banners = & Toolkit_Banners_BannersIterator::create('Horizontal');
if (defined('MEMBERS_DB') && MEMBERS_DB) {
$categoriesIterator = Toolkit_Members_CategoriesIterator::create();
$banners->fetchAllAvailable(
BASE . 'Toolkit/Banners/config.ini', 'IniFile'
);
- $this->hasBanner = count($decorators->getIterator());
- if ($this->hasBanner) {
+ $this->hasHorizontalBanners = count($decorators->getIterator());
+ if ($this->hasHorizontalBanners) {
+
+ $mailerFactory = new Toolkit_Banners_MailerFactory(
+ $bannersRoot,
+ $GLOBALS['flexyOptions']
+ );
+
+ $notifier = new Toolkit_Banners_Notifier($mailerFactory, $dbh);
+
+ $this->horizontalBannerAds = $decorators->toHtml(
+ $dbh, new Toolkit_Image_Server(), $notifier, $page['id']
+ );
+ }
+ }
+ }
+
+ function getVerticalBanners(array $page)
+ {
+ $bannerConf = new Config;
+ $bannerRoot = & $bannerConf->parseConfig(
+ BASE . 'Toolkit/Banners/config.ini', 'IniFile'
+ );
+
+ $dbh = Toolkit_Database::getInstance();
+
+ $banners = & Toolkit_Banners_BannersIterator::create('Vertical');
+ if (defined('MEMBERS_DB') && MEMBERS_DB) {
+ $categoriesIterator = Toolkit_Members_CategoriesIterator::create();
+ $banners->fetchAllAvailable(
+ $dbh, $bannerRoot, $categoriesIterator, $page['id']
+ );
+ } else {
+ $banners->fetchAllAssignedToPage($dbh, $bannerRoot, $page['id']);
+ }
+
+ $availableBanners = $banners->getAvailable();
+
+ // Are there any banners even available
+ if (count($availableBanners)) {
+ $GLOBALS['bottomScripts'][]
+ = $this->glmAppBaseURL . 'libjs/banner-link.js';
+ $decorators = Toolkit_Banners_StaticBannersDecorator::create();
+ foreach ($availableBanners as $i) {
+ $decorator = Toolkit_Banners_VerticalDecorator::create($i);
+ $decorators->add($decorator);
+ }
+
+ // application configuration
+ $conf = new Config;
+ $bannersRoot = & $conf->parseConfig(
+ BASE . 'Toolkit/Banners/config.ini', 'IniFile'
+ );
+
+ $this->hasVerticleBanners = count($decorators->getIterator());
+ if ($this->hasVerticleBanners) {
$mailerFactory = new Toolkit_Banners_MailerFactory(
$bannersRoot,
$notifier = new Toolkit_Banners_Notifier($mailerFactory, $dbh);
- $this->bannerAds = $decorators->toHtml(
+ $this->verticleBannerAds = $decorators->toHtml(
$dbh, new Toolkit_Image_Server(), $notifier, $page['id']
);
}
} else {
$this->isHomePage = false;
}
-
+
if($this->isHomePage) {
$GLOBALS['bottomScripts'][] = $this->glmAppBaseURL . "libjs/plugins/cycle/2.73/jquery.cycle.all.min.js";
$GLOBALS['bottomScripts'][] = $this->baseURL . "libjs/blogRotate.js";
}
-
+
if ($this->_catid != HOME_ID) {
$this->parentPageId = $this->_pageGateway->findTopParent($this->_catid);
$this->pageId = $this->_catid;
<div id="slideshow_wrapper" flexy:if="!isHomePage">
<img src="basesecureurl/TMP_slideshow1.jpg" width="990" height="250">
</div>
+ <!-- Horizontal Banners
+ {if:hasHorizontalBanners}{horizontalBannerAds:h}{end:}
+ -->
</header>
<nav id="topnav">
<ul>
<a id="enews" href="baseurl/newsletter-7/">Sign Up For Our Enewsletter</a>
<a id="tripplanner" href="baseurl/trip-planner-6/">Trip And Trail Planner (<span class="trip-list-count">{tripPlannerCount:h}</span>)</a>
</div>
-
+ <!-- Verticle Banners
+ {if:hasVerticleBanners}{verticleBannerAds:h}{end:}
+ -->
<div id="toolbox">
<div id="addthis_wrapper">
<!-- AddThis Button BEGIN -->
<a class="blog_link" href="{item.getGuid():h}">{item.getTitle()}</a>
<p class="blog_desc">{item.getDescription():h}</p>
</article>
-
+
</div><!--/#blog_wrapper-->
<!--<div id="prev-blog">Prev</div>-->
<div id="next-blog">Next</div>