From 1eeb95fcde8e23ea9493d74232f9e38d3fad6d02 Mon Sep 17 00:00:00 2001 From: Patrick Davison Date: Thu, 2 Feb 2012 22:39:09 -0800 Subject: Fix for JSON "MapData" div issue for search engines. --- includes/maps.php | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'includes/maps.php') diff --git a/includes/maps.php b/includes/maps.php index 6a8512c..a6787a7 100644 --- a/includes/maps.php +++ b/includes/maps.php @@ -104,12 +104,9 @@ function DisplayMap($mapMatrix, $idprefix = 1, $style = 'normal', $speed = NULL) $i -= 1; $height = (($i * 35) + -1).'px'; //$height = (($i * 22) + 2).'px'; - - $jsonmap = json_encode($mapdata); - - - + $jsonmap = str_replace("'", "\'", json_encode($mapdata)); + //This works in chrome, not sure about others. $preloaddiv .= "
@@ -122,9 +119,15 @@ function DisplayMap($mapMatrix, $idprefix = 1, $style = 'normal', $speed = NULL)
"; - $mapdatadiv .= "'; + //$mapdatadiv .= "'; + + //JSON Fix for search-engine cache. + $mapdatadiv = ""; + $maptable = "$preloaddiv -- cgit v1.2.3