Plugin Release New page: MyBB Google maps v3
Author Message Action
Andrew F.

Administrator
Posts: 221

An updated user map page using Google Maps JavaScript API v3. Apart from upgrading to the updated API functions, I am also experimenting with some of the new features available. Cool

[Image: MyBBStyles_Usermap.png]

Demo:
https://www.mybbstyles.com/page-usermap

Download:
https://www.mybbstyles.com/downloads.php?dlid=6&cat=3

Requirements:
Installation instructions:
  1. Login to your Admin CP and navigate to Configuration > Page Manager > Import Page. Select the usermapPage.xml file to import.
  2. To enable the page, go to the "Manage Pages" tab and edit the Usermap page. Add your Google Maps Key to the page by copying it into the key variable. The starting location and zoom level of the map are also set at the top of the page.
    $key = 'InsertKeyHere';
    $location = 'Australia';
    $zoom = 3;
    
    Finally, set the last option "Page enabled?" to "yes" and save changes.
  3. The page will be created at the url: http://www. yourforum .com/misc.php?page=usermap. The first run of the page will take longer to load as it builds the location cache, do not close the browser window.
Post: #1
15-04-2012, 02:51 AM
Andrew F.

Administrator
Posts: 221

Google Maps reference documentation:
https://developers.google.com/maps/docum.../reference
Post: #2
17-04-2012, 02:33 PM
enrinoMow

Junior Member
Posts: 1

Works great, thanks!
Post: #3
03-06-2012, 06:09 PM
pinkfrag

Junior Member
Posts: 3

hi i followed your instructions and everything works BUT there are no markers appearing.

I can set a marker manually and it is showing.
User group id's are correct and location is id1. The homepage is on a freehoster and extern connections are disabled may this be the problem?

thank you for your help
Post: #4
11-08-2012, 11:33 AM
Andrew F.

Administrator
Posts: 221

I assume this is the same issue reported here: http://community.mybb.com/thread-124063.html

It seems the problem can be narrowed down to getting the user locations from your forum database to populate the cache file.

Can you run the following SQL query in phpMyAdmin (replace dbprefix with your mybb database prefix)? See if it returns the users with location field set.

SELECT u.*, f.*
FROM dbprefix_users u
LEFT JOIN dbprefix_userfields f ON (f.ufid=u.uid)
WHERE f.fid1 != ''
Post: #5
12-08-2012, 07:44 AM
pinkfrag

Junior Member
Posts: 3

that query is working and prints all users with set location,
but no pins Wink changed the dbprefix in the page manager "usermap" page also
Post: #6
12-08-2012, 08:13 AM
(This post was last modified: 12-08-2012, 10:31 AM by pinkfrag.)
Andrew F.

Administrator
Posts: 221

Hmm, try printing some output for me. 001_unsure

Find:
$home = strtolower($user['fid' . $fid]);
Insert after:
echo 'h: '.$home.' ';

Find:
$contents = fetch_remote_file('http://maps.google.com/maps/geo?q=' . rawurlencode($index) . '&output=xml');
Insert after:
echo 'c: '.$contents.' ';

Actually, if your site is in German and so are the location names, use maps.google.de instead of maps.google.com if you aren't already.
Post: #7
12-08-2012, 12:45 PM
pinkfrag

Junior Member
Posts: 3

working too output on top of the homepage:

all the locations are printed c is empy
Code:
h: city [...]

c: c: c: c: c: c: c: c: c: c: c: c: c: c: c: c: c: c: c: c: c: c: c: c: c: c: c: c: c: c: c: c: c: c: c: c: c: c: c: c: c: c: c: c: c: c: c: c: c: c: c: c: c: c: c:
Post: #8
12-08-2012, 08:06 PM
Andrew F.

Administrator
Posts: 221

Ah right, fetch_remote_file() requires curl or fsockopen to be enabled on your server. Asking your host to enable one of them is the easiest potential solution.

This step is needed to convert a location name e.g. Germany, into its latitude and longitude coordinates. However, there is another way to do this using the Geocoding Service, which I will try out when I can find some spare time: https://developers.google.com/maps/docum.../geocoding.

You can have a go at testing this yourself as well.
Post: #9
13-08-2012, 12:29 AM
maat

Junior Member
Posts: 5

I try a lot but i always a blank page: no output. What's wrong?
coords file is generate but i can't see the map.

My version is 1.6.8

Please help
Thanks Matteo
Post: #10
26-08-2012, 06:18 PM


Possibly Related Threads...
Thread Author Replies Views Last Post
  [Release]  New page: MyBB Rules Page Andrew F. 1 10,057 06-01-2015, 07:02 PM
Last Post: 123
  [Release]  New page: MyBB Contact Form with reCAPTCHA Andrew F. 21 77,092 06-01-2015, 07:01 PM
Last Post: 123



Users browsing this thread: 1 Guest(s)