temporarily duplicated the code from the front page image map script to the nav bar...
authorAnthony Talarico <talarico@gaslightmedia.com>
Tue, 2 Aug 2016 17:47:00 +0000 (13:47 -0400)
committerAnthony Talarico <talarico@gaslightmedia.com>
Tue, 2 Aug 2016 17:47:00 +0000 (13:47 -0400)
parts/community-map.php

index 5bddc42..9d31d3a 100644 (file)
@@ -8,7 +8,7 @@
                         <area shape="poly" coords="135,152,126,136,130,126,138,122,148,124,153,128,155,133,155,141,155,144,158,150,160,152,163,155,165,159,159,161,158,184,149,173,143,171,138,167,135,167,128,167,124,157,134,154" data-id="273" alt="petoskey" nohref="nohref" onclick="get_id(this);"/>
                         <area shape="poly" coords="75,164,68,151,63,142,65,134,72,131,83,131,90,133,94,143,93,152,83,159,78,162,82,163,88,163,94,166,103,162,97,160,105,155,118,156,117,159,112,160,111,162,104,163,95,169,88,170,76,167,58,167,48,166,47,161,50,159" data-id="276" alt="bay-harbor" onclick="get_id(this);"  nohref="nohref" />
                         <area shape="poly" coords="90,300,90,294,96,292,101,293,104,287,108,282,123,279,129,285,131,292,128,303,120,308,119,311,125,317,131,319,133,325,142,325,144,326,139,330,125,322,123,324,124,331,111,327,110,329,106,331,102,327,99,326,89,328,89,326,86,322,95,320,105,315,103,307,99,301" alt="boyne-city" onclick="get_id(this);" data-id="275" nohref="nohref" />
-                        <area shape="poly" coords="260,88,261,82,260,73,256,63,256,57,259,49,265,48,276,50,281,53,282,60,281,67,278,71,274,75,276,89" alt="alanson"  onclick="get_id(this);" nohref="nohref" />
+                        <area shape="poly" coords="260,88,261,82,260,73,256,63,256,57,259,49,265,48,276,50,281,53,282,60,281,67,278,71,274,75,276,89" alt="alanson" onclick="get_id(this);" nohref="nohref" />
                         <area shape="poly" coords="169,141,178,136,187,126,184,109,167,107,159,113,156,121,162,130,167,135,169,139" alt="bay-view"  onclick="get_id(this);" nohref="nohref" />
                         <area shape="poly" coords="115,91,119,91,121,84,113,77,110,69,117,58,127,57,137,60,140,69,140,76,135,83,132,86,135,88,136,93,141,92,137,98,131,96,124,96,121,99,121,102,115,99,110,96,110,94" alt="harbor-springs" data-id="274" nohref="nohref" onclick="get_id(this);" />
                         <area shape="poly" coords="168,270,168,262,172,256,178,250,180,244,178,235,172,229,165,229,159,230,152,236,151,244,154,251,161,260,164,262,161,269" alt="walloon-lake"  nohref="nohref" onclick="get_id(this);" />
             </div>
         </ul>
     </li>
-</ul>
\ No newline at end of file
+</ul>
+<?php 
+    $args = array(
+    'post_type' => 'page',
+    'post__in' => array(276,275,274,273,983,981,985),
+    'posts_per_page' => -1, 
+    'numberposts' => -1
+//    'post__in' => array(69,71,73,75, 77, 79)
+);
+
+$posts = get_posts($args);
+
+foreach ($posts as $p){
+    $sites[$p->ID] = get_permalink($p->ID);
+}
+    $js_sites = json_encode($sites);
+?>
+    
+<script type="text/javascript">
+    imageMapResize();
+    var site_array = <?php echo $js_sites ?>;
+    var id;
+    
+    function get_id(el){
+//        console.log(el.getAttribute("data-id"));
+        id = el.getAttribute("data-id"); 
+        window.location.href = site_array[el.getAttribute("data-id")];
+//        console.log(site_array[el.getAttribute("data-id")]);
+    }
+    
+</script>
\ No newline at end of file