Add script for mapntour to test on dev page develop
authorLaury GvR <laury@gaslightmedia.com>
Wed, 14 Aug 2019 21:42:28 +0000 (17:42 -0400)
committerLaury GvR <laury@gaslightmedia.com>
Wed, 14 Aug 2019 21:42:28 +0000 (17:42 -0400)
page.php

index eca40c0..5c7ee46 100644 (file)
--- a/page.php
+++ b/page.php
@@ -6,6 +6,24 @@
       <article>
 
         <?php the_content() ?>
+        <?php if  ( is_page( 14766 ) ) { ?>
+          <script type="text/javascript">
+            var agent = navigator.userAgent.toLowerCase();
+            console.debug("User Agent: "+agent);
+            var isAndroid = (agent.match(/android/i)) ? true : false; var isiOS = (agent.match( /ipad/i ) || agent.match( /iphone/i) || agent.match( /ipod/i))? true: false; var appstore = "";
+            if (isAndroid) {
+                            appstore =
+            "https://play.google.com/store/apps/details?id=com.mapntour.android";
+            }
+            else if (isiOS)
+            {
+                            appstore = "https://itunes.apple.com/us/app/map-n-tour/id627557027"
+            }
+            if (appstore != "") {
+               window.open(appstore, "_self");
+            }
+          </script>
+        <?php } ?>
       </article>
     </div>
   </div>