Meetings and Conventions Calgary
GetConfig(); include(dirname(__FILE__).'/function.tools.php'); $smarty->assign('tools', $this->ProcessTemplate('tools.tpl')); include(dirname(__FILE__).'/function.sidenav.php'); $smarty->assign('sidenav', $this->ProcessTemplate('sidenav.tpl')); $this->includeJS(true, $params['action']); $property = $this->GetPropertyById($params['pid']); $property->url = (strpos($property->url, 'http') == 0) ? $property->url : "http://{$property->url}"; $smarty->assign('property', $property); $smarty->assign('property_gallery_dir', str_ireplace('&', 'and', str_ireplace(' ', '_', strtolower($property->name_short)))); $smarty->assign('property_logo', str_ireplace(' ', '_', strtolower($property->name))); $smarty->assign('title', $property->name); $smarty->assign('category', ($this->categories[$property->category]) ? $this->categories[$property->category] : ''); $smarty->assign('distance_to_airport', $this->GetDistanceToAirport($property)); $smarty->assign('neighborhood', $this->neighborhoods[$property->neighborhood]); $smarty->assign('stars',($property->accommodation->stars > 0) ? "
accommodation->stars)."'>{$property->accommodation->stars}
" : ''); $smarty->assign('action', $params['action']); $latlong = (empty($property->map_latlong)) ? $this->GetLatLon($property) : $property->map_latlong; $temp_address = str_replace(array(' ', '&'),array('+', 'and'), "{$property->name}, {$property->address}, {$property->city}, {$property->province}, Canada"); $smarty->assign('google_url', "http://maps.google.com/maps?q={$temp_address}&ll={$latlong}&zoom=15"); $zoom = 15; $map_width = 205; $map_height = 140; if(!empty($property->map_latlong)) { $temp_address = $latlong; } //$smarty->assign('latlon', (!empty($property->map_latlong)) ? "[{$latlong[0]},{$latlong[1]}]" : 'null'); $marker = (!empty($this->markers[$property->category])) ? "{$config['root_url']}/{$this->markers[$property->category]}" :"default"; $url = "http://maps.google.com/maps/api/staticmap?zoom={$zoom}&size={$map_width}x{$map_height}&maptype=roadmap&sensor=false&markers=icon:{$marker}|".str_replace(array(' ', '&'),array('+', 'and'), "{$property->address}, {$property->city}, {$property->province}, Canada"); $smarty->assign('google_static_map', $url); if(in_array("property_".$property->id, $this->GetCompareCookie())) { $in_compare = " class='in-compare'"; $text = "Remove from Compare"; } else { $text = "Add to Compare"; } $smarty->assign('toggle_compare', $this->CreateLink($id, 'toggle_compare', $returnid, $text, $params, '', false, false, "id='add-to-compare'{$in_compare} data-property-id='property_{$property->id}'", false)); if(in_array("property_".$property->id, $this->GetFavoritesCookie())) { $in_favorites = " class='in-favorites'"; $text = "Remove from Favorites"; } else { $text = "Add to Favorites"; } $smarty->assign('toggle_favorites', $this->CreateLink($id, 'toggle_compare', $returnid, $text, $params, '', false, false, "id='add-to-favorite'{$in_favorites} data-property-id='property_{$property->id}'", false)); // Overview Tab $smarty->assign('meeting_surface_area_total_m', $property->meeting_spaces->meeting_surface_area_total_ft * 0.09290304); $smarty->assign('meeting_surface_area_largest_m', $property->meeting_spaces->meeting_surface_area_largest_ft * 0.09290304); $smarty->assign('exhibition_surface_area_total_m', $property->meeting_spaces->exhibition_surface_area_total_ft * 0.09290304); $smarty->assign('exhibition_surface_area_largest_m', $property->meeting_spaces->exhibition_surface_area_largest_ft * 0.09290304); $room_types = ''; $room_types .= ($property->accommodation->room_type_double) ? ' Double,' : ''; $room_types .= ($property->accommodation->room_type_queen) ? ' Queen,' : ''; $room_types .= ($property->accommodation->room_type_king) ? ' King,' : ''; $room_types .= ($property->accommodation->room_type_suites) ? ' Suites,' : ''; $room_types .= ($property->accommodation->room_type_club) ? ' Club,' : ''; $smarty->assign('room_types', substr(trim($room_types), 0, -1)); $parking = ''; $parking .= ($property->accommodation->services_outdoor_parking) ? ' Outdoor,' : ''; $parking .= ($property->accommodation->services_indoor_parking) ? ' Indoor,' : ''; $smarty->assign('parking', empty($parking) ? 'n/a' :substr(trim($parking), 0, -1)); // Meetings Tab $rooms = array(); foreach($property->rooms as $room) { $i = count($rooms); $rooms[$i]['room_name'] = $room->room_name; $rooms[$i]['area_ft'] = $room->area_ft; $rooms[$i]['area_m'] = $room->area_ft * 0.09290304; // TODO: trim this to 1 decimal $rooms[$i]['length_ft'] = $room->length_ft; $rooms[$i]['length_m'] = $room->length_ft * 0.3048; // TODO: trim this to 1 decimal $rooms[$i]['width_ft'] = $room->width_ft; $rooms[$i]['width_m'] = $room->width_ft * 0.3048; // TODO: trim this to 1 decimal $rooms[$i]['capacity_theater'] = $room->capacity_theater; $rooms[$i]['capacity_banquet'] = $room->capacity_banquet; $rooms[$i]['capacity_classroom'] = $room->capacity_classroom; $rooms[$i]['capacity_reception'] = $room->capacity_reception; } $smarty->assign('rooms', $rooms); // Amenities Tab $amenities_list = array(); $amenities = explode(';', $property->accommodation->amenities_list); natcasesort($amenities); foreach($amenities as $amenity) { $i = count($amenities_list); $amenities_list[$i]['amenity'] = trim($amenity); } $smarty->assign('amenities_list', $amenities_list); echo $this->ProcessTemplate('view_property.tpl'); ?>

What does this do?

Provides a simple way to easily add google analytics and outbound link tracking to your pages.

How do I use it?

Just insert the tag into your template/page like so: {google_analytics urchin="UA-XXXXX-X"} (and replace UA-XXXXX-X with your web property ID)

What parameters does it take?

Author: Russ Wilson<eyeamdigital@gmail.com>

Version: 1.2

Change History: