The MU forums have moved to

Google Maps (5 posts)

  1. SteveAtty
    Posted 16 years ago #

    I'm hacking up some code which returns a googlemap when a specific tag is inserted into the post. Of course the problem is that kses strips the script tags out of the content.

    I don't want to open up script tags for obvious reasons so I was wondering how easy it would be to put some code in so that I can use say <stevescripttag> </stevescripttag> in my plugin and then right before the final rendering do a str_replace to change my obscure tag into the proper script tag.

    Does that make sense?

    Edited - to add:

    Its the category feed - it chops the post up and messes with the text. So I guess I need to supress my output if its going to the category view

  2. lunabyte
    Posted 16 years ago #

    You could add a filter, yes.

    Make it insert a tag like [tag], then do a str_replace on the content/excerpt.

    From there, if you only want the map on a full post, if is_single == true, show map (string replace with proper calls), else string replace the tag with a blank.

  3. Farms
    Posted 16 years ago #

  4. SteveAtty
    Posted 16 years ago #

    Well I've got it working - its rather hard to explain but basically I'm extending WPMU to allow people to blog about trips on the UK Canal system. So I've got some extra tables containing "trips" and place/co-ordinate data.

    When a post containing the tag is parsed the code works out if the post is part of a blogged trip and if it is inserts a map showing the appropriate part of the trip (i.e. the part travelled that day)

    Now all I've got to do is stop it appearing in RSS feeds!

  5. wpmupremium
    Posted 14 years ago #

    Not sure if you are still looking for tips with Google Maps and Wordpress MU, but if so, the following geoRSS article might be of help, as this explains how to add code to your function file in order to make your blog geoRSS compatible:

    As for all-out full-screen fun, please check-out gMaps:

About this Topic

  • Started 16 years ago by SteveAtty
  • Latest reply from wpmupremium