Example #1
0
        /** 
         * @param Object $container   the page that contains the template 
         */
        public static function top($container = null)
        {
            global $active_tab, $page;
            // making sure we don't get error while trying to use the SEO layer down the page .
            if ($page) {
                $page->js = array_map(function ($item) {
                    return str_replace('{template}', self::$template_url, $item);
                }, self::$js);
            } else {
                $page = new stdClass();
            }
            // if(!$page->seo)
            // 	$page->seo = array() ;
            // // assign SEO values
            // self::buildSeo();
            if (!$active_tab) {
                $active_tab = '/';
            }
            $tabs = [['url' => '#markets_list', 'title' => 'Events'], ['url' => '/timessquare', 'title' => 'Times Square'], ['url' => '/partypasses', 'title' => 'Party Passes'], ['url' => '/bar-crawls', 'title' => 'Bar Crawls'], ['url' => '/cruises', 'title' => 'Cruises'], ['url' => '/dinners', 'title' => 'Dinners']];
            $market_name = $container && $container->market ? $container->market->name : 'Choose City';
            //TAKEOVER
            $takeover = new stdClass();
            $takeover->active = FALSE;
            $takeover->background_image = "";
            $takeover->background_link_active = FALSE;
            $takeover->background_link = "";
            $takeover->losangeles = TRUE;
            $takeover->la_bg = self::$template_url . "content/images/takeover/belvedere_skin.jpg";
            $template_url = "/templates/website/";
            // Get markets for city dropdown
            $where = 'market.skybox=1';
            $orderby = 'market.name ASC';
            $params = ['where' => $where, 'order_by' => $orderby];
            // Featured array
            $featured_array = ["newyork" => "New York", "brooklyn" => "Brooklyn", "newyork" => "Manhattan", "queens" => "Queens", "boston" => "Boston", "newjersey" => "New Jersey", "philadelphia" => "Philly", "baltimore" => "Baltimore", "washington" => "Washington DC", "miami" => "Miami", "losangeles" => "Los Angeles", "chicago" => "Chicago", "atlanta" => "Atlanta"];
            $markets = \Crave\Model\market::getMany($params);
            $num_cols = 3;
            $per_col = ceil(sizeof($markets) / $num_cols);
            foreach ($markets as $key => $m) {
                if ($m->country_code != 'US') {
                    $other_markets[$m->country_code][] = $m;
                    unset($markets[$key]);
                }
            }
            // Set url for markets
            $url_piece = explode('/', $page->urlpath);
            unset($url_piece[0]);
            //remove first value since we know it's blank
            unset($url_piece[1]);
            //remove first value since we know it's the market
            $new_url = "";
            foreach ($url_piece as $up) {
                $set_url .= "/" . $up;
            }
            foreach ($markets as $key => $m) {
                $columns[floor(($key + 1) / $per_col)][] = $m;
            }
            // Get slugs for all markets
            $selected_market = [];
            foreach ($markets as $m) {
                $selected_market[$m->slug] = $m->name;
            }
            // Check if queryfolder is in array of markets
            if ($page->vars['market_slug'] != "" && array_key_exists($page->vars['market_slug'], $selected_market)) {
                setcookie("current_market", $page->vars['market_slug']);
                $_SESSION['current_market'] = $page->vars['market_slug'];
            }
            $t = time();
            $market_slug_id = $page->vars['market_id'];
            $_GET['refresh'] = 1;
            if ($page->market && !$page->seo) {
                $page->seo = new stdClass();
            }
            // Meta_tag Formats pulled from page.php
            if ($page->market && !$page->seo->geo) {
                $page->seo->geo = new stdClass();
                $page->seo->geo->latitude = $page->market->latitude;
                $page->seo->geo->longitude = $page->market->longitude;
                $page->seo->geo->city = $page->market->city;
                $page->seo->geo->state = $page->market->state;
                $page->seo->geo->country = $page->market->country_name;
                $page->seo->geo->geo_position = $page->market->latitude . "; " . $page->market->longitude;
                $page->seo->geo->geo_region = $page->market->state;
            }
            ?>

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<title>Downtown Countdown</title>
		<link rel="stylesheet" href="<?php 
            echo $template_url;
            ?>
website.css" type="text/css">
		<link rel="stylesheet" href="<?php 
            echo $template_url;
            ?>
content/sidr.dark.css" type="text/css">
		<script src="<?php 
            echo $template_url;
            ?>
js/jquery-1.9.1.min.js" type="text/javascript"></script>
		<script src="<?php 
            echo $template_url;
            ?>
website.js" type="text/javascript"></script>
		<script src="<?php 
            echo $template_url;
            ?>
js/jquery.carouFredSel-6.0.4-packed.js" type="text/javascript"></script>
		<script src="<?php 
            echo $template_url;
            ?>
js/jquery.sidr.js" type="text/javascript"></script>
		<script src="<?php 
            echo $template_url;
            ?>
js/myjs.js" type="text/javascript"></script>
		<script src="<?php 
            echo $template_url;
            ?>
js/jquery-ui.js" type="text/javascript"></script>
	</head>
	<body>
		<div class="top_space" id="top"></div>
		<header>
			<div class="container">
				<img class="logo" src="<?php 
            echo $template_url;
            ?>
content/images/countdown-logo.png" alt="" />
				<div class="counter_col">
					<div class="social_media">
						<span>share with friends</span>
						<a href="#"><img src="<?php 
            echo $template_url;
            ?>
content/images/fb.jpg" alt="" /></a>
						<a href="#"><img src="<?php 
            echo $template_url;
            ?>
content/images/tw.jpg" alt="" /></a>
						<a href="#"><img src="<?php 
            echo $template_url;
            ?>
content/images/ig.jpg" alt="" /></a>
					</div>
					<div class="counter"></div>
					<!-- <form><input type="text" placeholder="Search"></form> -->
				</div>
			</div>

			<div class="nav_row">
				<nav>
					<a href="/newyork"><li>new york</li></a>
					<a href="/baltimore"><li>baltimore</li></a>
					<a href="/washington-dc"><li>washington</li></a>
					<a href="/atlanta"><li>atlanta</li></a>
				</nav>
			</div>
		</header>

		<style>
		.chosen_city {
		    display: inline-block;
		    vertical-align: top;
		}

		a.city_chosen {
		    display: block;
		    text-align: center;
		    font-size: 10px;
		}
		</style>

<script>
$(document).ready(function() {
    $('#right-menu').sidr({
      name: 'sidr-existing-content',
      side: 'right',
      source: '.sidr'
    });
});
</script>



<?php 
        }
Example #2
0
<?php

use Crave\Model\market;
?>
<div id="market_container">

<?
$num_cols = 3;
$markets = json_decode(json_encode(market::getSkybox()));
$per_col = ceil(sizeof($markets)/$num_cols);


foreach ($markets as $key => $m) {
	if ($m->country_code != 'US') {
		$other_markets[$m->country_code][] = $m;
		unset($markets[$key]);
	}
}

$country_codes = array(
	'UK' => 'Europe',
	'CA' => 'Canada'
);



foreach ($markets as $key =>$m) {
	$columns[floor(($key+1)/$per_col)][] = $m;
}

$this->title = "Choose a City";
Example #3
0
global $website, $cache_refresh;
?>

<section id="list-places"> <!-- state/place list -->
   <a id="markets_list" name="markets_list"></a>
   <span class="list-caption">choose city for your new year's destination</span>
	<nav>
<?php 
$cache_name = sprintf('jwebsite:%/id:markets_footer', $website->ct_promoter_website_id);
if (!$cache_refresh) {
    \elapsed("Footer : Getting the markets from cache");
    $markets = mem($cache_name);
}
if (!$markets) {
    $markets = [];
    $marketIds = \Crave\Model\market::getSlugsFeed(['ct_promoter_website_id' => $website->ct_promoter_website_id, 'where' => ["country_code='US'"], 'order_by' => 'name']);
    foreach ($marketIds as $marketId) {
        $market = new \Crave\Model\Market($marketId);
        if (!$market->country_code) {
            $market->country_code = 'us';
        }
        $market->url = strtolower("/" . $market->slug);
        $markets[] = $market;
    }
    mem($cache_name, $markets, '10 hours');
}
$panels = [];
$delimiter_index = ceil(count($markets) / 6);
$index = -1;
foreach ($markets as $market) {
    $panels[++$index / $delimiter_index][] = $market;