| 
Welcome, Guest

How to add a Google map to the CB 1.2 user profile
(1 viewing) (1) Guest

TOPIC: How to add a Google map to the CB 1.2 user profile

How to add a Google map to the CB 1.2 user profile 2 years, 12 months ago #88040

  • JComeskey
  • JComeskey
  • OFFLINE
  • Junior Boarder
    Junior Boarder
  • Posts: 31
  • Karma: 2
If you want to add a dynamic Google map to your CB user profiles that automatically generates coordinates based upon each user’s address, don’t worry. It is very easy and can be done with FREE extensions.

Just follow these steps (note: This is for a Joomla 1.5.X site, NOT a 1.0.X site):
1. Download and install the Google map Joomla plugin from Mike Reumer (tech.reumer.net). You can download the file here: joomlacode.org/gf/project/mambot_google1/frs/. Install it using the normal Joomla component installer. Be sure to enable (publish) the plugin. You can define many elements of the plugin’s performance with the configuration parameters or override them when you insert the plugin tag (in step 4). Don't forget to get and insert your Google map API key!
2. Hack your Joomla installation’s index.php file to allow the plugin to work within extensions as described by Mike Reumer here: tech.reumer.net/google-maps/documentatio...ct-joomla-1.5.x.html
To perform the hack, add these lines at line 84 after “$mainframe->render();:”:

JPluginHelper::importPlugin('content');
$tmp_row->text = JResponse::getBody();
$tmp_params = new JParameter(null);
$mainframe->triggerEvent('onMap', array( &$tmp_row, &$tmp_params ), true );
JResponse::«»setBody($tmp_row->text);


Your index.php file is probably (hopefully) locked-down, for security reasons. So you may need to ask your hosting provider to temporarily adjust permissions, while you make the hack.
3. In the Community Builder Field Manager, create new ‘Text Field’ type user fields for ‘street address’, ‘city’, ‘state’, and ‘zip code’. As with any other CB field, you will have to decide if you want these fields to be required fields, whether they should display on the user profile, and if they should show on the registration form. (You probably want to say ‘yes’ to all 3.) Write down the database field names for each of these. (Example: ‘cb_streetaddress’, ‘cb_city’, ‘cb_state’, ‘cb_zip’.)
4. Create another new field of the type=’Fields delimiter’. Name it ‘Google Map’. In the description, enter this tag:
{mosmap address='[cb_streetaddress], [cb_city], [cb_state] [cb_zip]’}
Within the square brackets, use the correct database field names that you wrote down in step 3.
Set ‘Show on Profile’ to ‘Yes: on 1 Line’.
Set ‘Show at Registration?’ to ‘No’.
5. To add additional functionality, add the usual plugin tag details as described at
tech.reumer.net For example, to add a driving directions popup window, include “dir=’1’” within the curly brackets.
6. For an example of this process in action, please see www.locallyowneddayton.com/member-profil...le/littleriobio.html
The plugin tag used in this example is {mosmap address='[cb_busstreet1], [cb_city], [cb_state] [cb_zip]'|text='[name]'|zoom='11'|dir='1'}.

Post edited by: JComeskey, at: 2009/03/09 22:20

Post edited by: JComeskey, at: 2009/03/09 22:22

Post edited by: JComeskey, at: 2009/03/09 22:25
RESIST Theocratic Police-State Feudalism!!
The topic has been locked.

Re:How to add a Google map to the CB 1.2 user profile 2 years, 12 months ago #88064

  • crisscross
  • crisscross
  • OFFLINE
  • Junior Boarder
    Junior Boarder
  • Posts: 21
  • Karma: -
This works really well! I found instructions for Joomla 1.0.x on the website also.
This would be really nice combined with a map geocoding all users on one map with links to everybodys profiles. I saw there used to be a plug-in for this but it has not been updated for newer versions of CB.

Edit: Looking at joomlas extension site there are several commercial extensions that takes the adress data and geocodes it. There are also extensions that takes the geocoded data and displays a map of your users with links to cb profiles.

Post edited by: crisscross, at: 2009/02/08 23:32
The topic has been locked.

Re:How to add a Google map to the CB 1.2 user prof 2 years, 11 months ago #88113

Hi,

I installed googlemap plugin on joomla 1.0.15, with community builder 1.1 (I can't install cb 1.2, because I modified cb and I don't want to lose the changes).

Google map plugin works well, because if I insert the tag {mosmap} on an article, it visualize the map.
But, if I insert {mosimage} using the procedure written by Mike Reumer on the cb profile, I don't see the map, but I see {mosmap} text.

someone can help me?
thank you

Post edited by: mercurioweb, at: 2009/02/09 11:59

Post edited by: mercurioweb, at: 2009/02/09 12:01
Attachments:
The topic has been locked.

Re:How to add a Google map to the CB 1.2 user prof 2 years, 11 months ago #88114

...in attach how it appears
Attachments:
The topic has been locked.

Re:How to add a Google map to the CB 1.2 user prof 2 years, 11 months ago #88213

  • JComeskey
  • JComeskey
  • OFFLINE
  • Junior Boarder
    Junior Boarder
  • Posts: 31
  • Karma: 2
mercurioweb wrote:
...in attach how it appears


Looks like you might be using the wrong field type - because your tag is displaying beneath the field title. Also, you are not defining the map details. Use the address='[cb_address], [cb_city], [cb_state]' fields to define the coordinates.
RESIST Theocratic Police-State Feudalism!!
The topic has been locked.

Re:How to add a Google map to the CB 1.2 user prof 2 years, 11 months ago #88217

I used "Fields delimiter" as field type.
As you can see in the attached image I defined the map details, but the result is the same,
Attachments:
The topic has been locked.
Time to create page: 0.77 seconds