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

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]



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.

Posts: 221

Google Maps reference documentation:
Post: #2
17-04-2012, 02:33 PM

Junior Member
Posts: 1

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

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.

Posts: 221

I assume this is the same issue reported here:

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

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.

Posts: 221

Hmm, try printing some output for me. 001_unsure

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

$contents = fetch_remote_file('' . rawurlencode($index) . '&output=xml');
Insert after:
echo 'c: '.$contents.' ';

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

Junior Member
Posts: 3

working too output on top of the homepage:

all the locations are printed c is empy
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.

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:

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

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 37,431 06-01-2015, 07:02 PM
Last Post: 123
  [Release]  New page: MyBB Contact Form with reCAPTCHA Andrew F. 21 95,104 06-01-2015, 07:01 PM
Last Post: 123

Users browsing this thread: 1 Guest(s)