G-Maps – Free Google Maps Module for Pligg
Last Updated on Friday, 05 August 2011 18:30 Written by vaggi Thursday, 04 August 2011 23:55
This module allows users to add an address during the submission process. It then displays a map from Google in a story's detail view. In the summary pages stories containing a map are marked with an icon in the story title which links to the story page.
The map does not require an API key from Google; it is embedded via inline frame, no JavaScript is used.
At the PliggPro shop the guys are asking for $ 18 USD or so for a module with essentially the same functionality (this module does not display a bubble with the story title as headline, check out a demo over at my-african-news.com). But as Geoserv over at Pliggs has noted:
“Some of the modules are worth the price, and if you have a few bucks, are worth the investment. But there are countless that are simply there to get newbies to part with their cash and nothing more.”
I believe that their Google maps module might be one of them. Maybe its easier to install, or has some other fancy stuff I can't even dream of which they have hidden somewhere where it secretly does its magic, but $ 18 bucks? So, I made my own and am now offering it to the world...
Installation
The module requires that five extra fields are enabled. Below I have briefly outlined how to do that.
First, you have to enable extra fields in the Pligg config. Go to configure->misc and set “Enable Extra Fields” to “true” .
Then open libs/extra_fields.php with your favourite editor and set: define('Enable_Extra_Field_1', false); to: define('Enable_Extra_Field_1', true);. Do that for the first five fields. Then name the fields and enter a description though that is not mandatory. I named the fields as follows:
define('Field_1_Title', 'Street Address');
define('Field_2_Title', 'City');
define('Field_3_Title', 'State');
define('Field_4_Title', 'ZIP Code');
define('Field_5_Title', 'Country');
To avoid that the address data is displayed at the summary pages you would need to edit link_summary.tpl located in your template folder. Find
{if $Enable_Extra_Field_1 eq 1}{if $link_field1 neq ""}<br/><b>{$Field_1_Title}:</b> {$link_field1}{/if}{/if}
at about line 138 and insert before: {if $pagename eq "story"}.
Paste the closing if-statement {/if} before the extra field you want to show in summary pages. So if you would like to show none paste it after:
{if $Enable_Extra_Field_5 eq 1}{if $link_field5 neq ""}<br/><b>{$Field_5_Title}:</b> {$link_field5}{/if}{/if}.
If you would like to show Extra_Field5 paste it before, etc. pp.
Download
That's pretty much it. Enjoy!
Bugs / Features
Bugs and feature requests may be reported here >>.
Blue Menu
Latest Comments
- mod_2ClickShare - Datenschutzf...
Thank you for your interest. I will try... Weiterlesen...
27.03.12 20:30
Von ΠΥΡΟΤΕΧΝΗΜΑΤΑ - mod_2ClickShare - Datenschutzf...
No, but feel free to take the javascript included ... Weiterlesen...
07.03.12 11:21
Von vaggi









