1. <?php
  2. /*---------------------------------
  3. The footer of the theme
  4. ------------------------------------*/
  5.  
  6. $theme_options = get_option('option_tree');
  7. $is_contact = is_page_template('template-contact.php');
  8. $is_single = is_single();
  9. $is_project = is_singular('portfolio') || is_page_template('template-portfolio.php') || is_page_template('template-portfolio-paged.php');
  10. $is_gallery = is_singular('gallery') || is_page_template('template-gallery.php') || is_page_template('template-slideshow.php') || is_singular('portfolio') || is_page_template('template-portfolio.php') || is_page_template('template-portfolio-paged.php');
  11. $is_video = is_page_template('template-video.php');
  12.  
  13. ?>
  14.  
  15. </div>
  16.  
  17. <!-- top footer -->
  18. <footer class="footer" id="topFooter">
  19. <?php if(is_active_sidebar('rb_top_footer_widget_left')) : ?>
  20. <div class="left">
  21. <?php dynamic_sidebar('rb_top_footer_widget_left'); ?>
  22. </div>
  23. <?php endif; ?>
  24. <?php if(is_active_sidebar('rb_top_footer_widget_right')) : ?>
  25. <div class="right">
  26. <?php dynamic_sidebar('rb_top_footer_widget_right'); ?>
  27. </div>
  28. <?php endif; ?>
  29. </footer>
  30.  
  31. <!-- bottom footer -->
  32. <footer class="footer" id="bottomFooter">
  33. <?php if(is_active_sidebar('rb_bottom_footer_widget_left')) : ?>
  34. <div class="left">
  35. <?php dynamic_sidebar('rb_bottom_footer_widget_left'); ?>
  36. </div>
  37. <?php endif; ?>
  38. <a href="#" id="top">Go to Top <span>&uarr;</span></a>
  39. </footer>
  40.  
  41. </div>
  42.  
  43. <?php if($is_contact) : ?>
  44. <!-- contact map holder -->
  45. <div id="contactMapHolder"><div id="contactMap"></div></div>
  46. <?php endif; ?>
  47.  
  48. <div id="scripts">
  49.  
  50. <?php if($is_single || $is_gallery) : ?>
  51.  
  52. <!-- social sharing scripts -->
  53. <div id="fb-root"></div>
  54. <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");
  55. </script>
  56. <script>(function(d, s, id) {
  57. var js, fjs = d.getElementsByTagName(s)[0];
  58. if (d.getElementById(id)) return;
  59. js = d.createElement(s); js.id = id;
  60. js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=138053569594474";
  61. fjs.parentNode.insertBefore(js, fjs);
  62. }(document, 'script', 'facebook-jssdk'));
  63. </script>
  64. <script>
  65. (function() {
  66. var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
  67. po.src = 'https://apis.google.com/js/plusone.js';
  68. var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
  69. })();
  70. </script>
  71.  
  72. <?php endif; ?>
  73.  
  74. <?php
  75.  
  76. wp_register_script('theme_plugins', get_template_directory_uri().'/js/plugins.min.js', array('jquery'), NULL, true);
  77. wp_register_script('theme_scripts', get_template_directory_uri().'/js/scripts.js', array('theme_plugins'), NULL, true);
  78.  
  79. wp_enqueue_script('theme_plugins');
  80. wp_enqueue_script('theme_scripts');
  81.  
  82. ?>
  83.  
  84. <?php if(($is_contact) && get_option_tree('rb_map_display', $theme_options) == 'Yes') { ?>
  85.  
  86. <?php wp_enqueue_script('google_maps', 'http://maps.googleapis.com/maps/api/js?sensor=false', NULL, true); ?>
  87.  
  88. <script type="text/javascript">
  89.  
  90. function addMap(){
  91. var map;
  92.  
  93. var stylez = [
  94. {
  95. featureType: "all",
  96. elementType: "all",
  97. stylers: [
  98. { saturation: -100 }
  99. ]
  100. }
  101. ];
  102.  
  103. var mapOptions = {
  104. zoom: 14,
  105. center: new google.maps.LatLng('<?php get_option_tree("rb_map_lat1", $theme_options, true); ?>','<?php get_option_tree("rb_map_long1", $theme_options, true); ?>'),
  106. streetViewControl: false,
  107. scrollwheel: false,
  108. panControl: false,
  109. zoomControl: false,
  110. mapTypeControl: false,
  111. overviewMapControl: false,
  112. mapTypeControlOptions: {
  113. mapTypeIds: [google.maps.MapTypeId.ROADMAP, 'wowMap']
  114. }
  115. };
  116.  
  117. map = new google.maps.Map(document.getElementById("contactMap"), mapOptions);
  118.  
  119. var mapType = new google.maps.StyledMapType(stylez, { name:"Grayscale" });
  120. map.mapTypes.set('wowMap', mapType);
  121. map.setMapTypeId('wowMap');
  122.  
  123. var image = '<?php get_option_tree('rb_map_pin', $theme_options, true); ?>';
  124.  
  125. var myLatLng = new google.maps.LatLng('<?php get_option_tree("rb_map_lat2", $theme_options, true); ?>','<?php get_option_tree("rb_map_long2", $theme_options, true); ?>');
  126. var beachMarker = new google.maps.Marker({
  127. position: myLatLng,
  128. map: map,
  129. icon: image
  130. });
  131. }
  132.  
  133. if (!window.addEventListener)
  134. window.attachEvent('load', addMap);
  135. else
  136. window.addEventListener('load', addMap, false);
  137.  
  138.  
  139. </script>
  140.  
  141. <?php } else { ?>
  142.  
  143. <style type="text/css">
  144. #contactMapHolder {
  145. background:none;
  146. }
  147. </style>
  148.  
  149. <?php } ?>
  150.  
  151. <div id="mobileCheck"></div>
  152.  
  153. <script type="text/javascript">
  154. <?php if($is_contact) : ?>
  155. window.cn932fh = '<?php echo base64_encode(get_option_tree('rb_form_success', $theme_options)); ?>';
  156. <?php endif; ?>
  157. window.d280sw = '<?php echo base64_encode(get_template_directory_uri()); ?>';
  158. </script>
  159.  
  160. <?php get_option_tree('rb_tracking_code', $theme_options, true); ?>
  161.  
  162. <div id="oldie"><?php get_option_tree('rb_ie7', $theme_options, true); ?></div>
  163.  
  164. <?php wp_footer(); ?>
  165.  
  166. </div>
  167.  
  168. </body>
  169. </html>