Posts tagged ‘online users map’

Update to Online Users Map

I’ve just updated the version of my Online Users Map block for Moodle 1.9 so you have the option of using OpenStreetMap for the map display. I’d already done this for the version of the block for Moodle 2, so was quite easy to retrospectively add this to the 1.9 version too.

You can see a live demo running on my Moodle installation.

Any feedback or comments welcome 🙂

Updates to Online Users Map

Online Users Map with OpenStreetMap

I’ve finally had a bit of time to work on the online users map block I wrote a while ago – the recent release of Moodle 2 being a bit of a spur. Two main changes I’ve made:

Firstly, I added the option to use either Google Maps or OpenStreetMap, with the default being OpenStreetMap, but you can easily change it in the block settings.

Secondly, I managed to get the block up and running in Moodle 2 (see it in action). It needed a few changes over the previous version to get it to work. I’m still having a few issues with getting the block to update the cron field in the mdl_blocks table – so currently you need to update the blocks table manually to enable the cron function, which automatically updates the user locations.

Any feedback welcome 🙂

Fix for ‘bad gateway’ issues with Online Users Map

After a long, long delay, I finally had chance to look at the ‘Bad Gateway’ problem that seemed to be stopping the Moodle Online Users Map block working. Whilst in Ethiopia my internet connection there wasn’t good enough to be able to spend time debugging this, but now I’m back on a more reliable connection I’ve been able to have a look.

It turned out to be a relatively simple issue to resolve, basically I wasn’t correctly constructing the call to the geonames website, so it gave the ‘bad gateway’ response.

If you are using (or trying to use) this block then please update to the latest version as soon as possible (go to: Moodle Modules and Plugins).

I’ve not yet had chance to test the changes when the Moodle server is behind a proxy server, I’ll try to get this tested soon. If you are using a proxy server I’d be very interested to know if it’s now working (or not).

[Update 20 Apr 12:30]: have just tested by going through a proxy server and appears to be working fine, but please let me know if it doesn’t work for you.

Online Users Map for Moodle 2

moodleAfter a long time of not doing much (ok, any) development on my Moodle online users map block, I’ve finally had chance to return to the code to make the necessary changes for the block to run on Moodle 2.

It was always going to be tricky trying to maintain this block whilst in Ethiopia, not only with the slow internet connection, but the university firewall blocks many ports and this is my normal internet access point. So now that I’m temporarily back in the UK, I thought I’ve got chance to get back up to speed.

In the end only minor changes were needed to get the block running on Moodle 2. If you’re downloading the block from the Moodle modules & plugins pages, then please check you get the right one (v1.9 and earlier or v2) for your Moodle installation.

If you’re getting the code via CVS then HEAD currently contains the version for v2 and the MOODLE_19_STABLE branch has the version for 1.9 and earlier.

I’ve also set up a demonstration Moodle site so you can see the block in action. Just sign up, and you should see yourself marked on the Google map. You may have to wait until the location lookup script has run before you appear on the map, but this should only be a few minutes.

Please let me know if you have any problems with either getting the block to run on Moodle 2 or with the demonstration site.

Online Users Map now shows offline users too

I’ve just updated the online_user_map block so you can optionally show offline users too – the offline users will be displayed by a grey marker and the online users will be in green.

To enable the display of offline users, update the block with the new code, run ‘notifications’ from Moodle admin to update the database, then go to the block settings and select Yes to the option to display offline users.

For info, only the 50 most recent online users, and (if applicable) 50 most recent offline users will be displayed – this is just to ensure that the map doesn’t try to download 100’s or 1000’s of users to display.

Any comments, feedback etc welcome 🙂

Debugging the online_users_map block

I’ve just updated the online_user_map block to try and make it easier to debug. I know some people have a little trouble getting it to work, probably because they have trouble connecting to the external service which does the geocoding.

Now if you go to the block settings and turn debugging on, when you run the cron script it will report which users it is trying to update the locations for, and for which users it has successfully updated their location.

Hope you find it useful 🙂

Moodle Online Users Map block

I’ve just made a few updates to the online users map block:

  • made the initial centre point and zoom level options in the block settings
  • Fixed a bug with getting the lat/lng of locations when not url encoded
  • Applied the moodle “fullnamedisplay” setting for mouse overs on the map
  • Translated into French and Hungarian – not by me, but by Valery Fremaux and Peter Csaszar-Cs – cheers 🙂

Multilingual online users map block

well, English and Portuguese, so maybe bilingual rather than multilingual!

Thanks to Pedro Crispim for giving me the Portuguese lanugauge file for the online users map block 🙂

It’s in the Moodle CVS if you’d like to download it and if anyone else feels like translating into other languages, please do – if you already have then send me the lang file so I can add it to the package for others to use 🙂

Back to work

Got back to work after couple of weeks holiday yesterday (holiday pics!) so spent the last day or so trying to remember what I was actually doing before I went away! None of the notes I made before I went away made any sense to me yesterday morning – but it’s all starting to become clear again!

Have been working a bit more on the Netvibes widget, and there’s now also talk of creating a Facebook widget for MSG – but for now I’ll stick with getting just one widget finished. Also managed to update the MSG BuddyXML service so that it can accept the username and password as part of HTTPBasic authentication – rather than just as get/post parameters (this was the problem I was struggling with a couple of weeks ago). One thing that’s slowing me down slightly at the moment is that our died over the weekend and we’re awaiting the engineer to fix it up.

A few people seems to have been trying out my Online Users Map block, did find a problem with it though (which is now resolved) – in that my original table name seemed to be too long for some Moodle installations (or more precisely ADODB) – which appear to have a restriction of 28 chars on the table name length.

Also beginning to look at how to manipulate images using PHP, the main functions I need to do is overlay one jpg onto another jpg to create a third image, and create lines for one set of coordinates to another on the image – sure there must be things out there which do this – just need to have a google…

Moodle block – online users map

I’ve just finished writing a new Moodle block, which is a variation on the standard online users block, but rather than showing a list of users, it uses the location information from users profiles to display online users on a Google map:

Online users map block

You can download this block from – or it’s in the Moodle contrib CVS

All feedback welcome – please post any comments/feedback etc below 🙂