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:

You can download this block from Moodle.org – or it’s in the Moodle contrib CVS
All feedback welcome – please post any comments/feedback etc below











I’m sorry to say, that the tool is not working.
Apologies for the delay in replying – I’ve been away the last couple of weeks. I made a quick checklist of things to look at if the online_user_map block isn’t working: http://moodle.org/mod/forum/discuss.php?d=75667#p342322.
Hopefully that should help fix the problem you are having,
Alex
I have just installed “online_users_map” block on a moodle v1.8.2 site.
I access this site through a satellite Internet connection with and without a secured VPN tunnel.
I set [block_online_users_map_timetosee] on 30 (minutes).
The database has only the table [mdl_block_online_users_map] and not a table name [mdl_block_online_users_map_coords] as you said.
The [cron] field in table [mdl_block_online_users_map] has the value 3600
The block doesn’t show any online users…
Cron jobs are run on this site every 10 minutes.
I ran a cron job from my computer and this gave the following result:
=====================================
Server Time: Thu, 09 Aug 2007 08:02:57 +0100
Starting activity modules
Processing module function assignment_cron …done.
Processing module function forum_cron …done.
Processing module function journal_cron …done.
Processing module function workshop_cron …done.
Finished activity modules
Starting blocks
Processing cron function for online_users_map….
=====================================
It seems that the cron job stops when it starts to process the [online_users_map] block…
I don’t know how to fix it…
Thanks in advance for your wise help,
Cheers.
Hi feliver.
Having the [prefix]block_online_users_map table is correct. In my very first version if was using a table called [prefix]block_online_users_map_coords, but this table name turned out to be too long for some people’s systems, so I had to reduce the length. All the code should be referring to [prefix]block_online_users_map.
I’m not sure why it’s stopping your cron.php – can you turn on the display of error messages (I think you can do this in moodle admin), as this should let us know what the actual error message is (alternatively the error message may be in the log files somewhere).
The problem may be that you need to enter a proxy host/port to access the internet from that machine? If that’s the case you need to enter the proxy detials in Moodle admin -> Server -> http.
Hope that help and please let me know how you get on,
Alex
Thanks for your fast response Alex,
1 – Well understood for the table name.
2 – Running the cron job with “debugging on” gives the following:
=========================================================
Server Time: Thu, 09 Aug 2007 12:32:45 +0100
Starting activity modules
Processing module function assignment_cron …done.
Processing module function forum_cron …done.
Processing module function journal_cron …done.
Processing module function workshop_cron …done.
Finished activity modules
Starting blocks
Processing cron function for online_users_map….
Fatal error: Call to undefined function: simplexml_load_string() in /home/geowide/public_html/cals182/blocks/online_users_map/lib.php on line 47
=========================================================
3 – My Internet access is direct (no proxy settings, etc…)
Thanks for your help,
Cheers.
feliver – thanks for the info, I can now see where the problem is – the block was written using PHP5 and so looks like you’re using PHP4 – the simplexml_load_string() function was only introduced in PHP5.
This also may explain some of the problems others have had with the block – just my oversight as I’m too used now to using PHP5. I’ll get the docs/info about the block updated so others know too, and also try and find the time to write a PHP4 version (shouldn’t be too hard using the PEAR libraries).
Alex
My web hosting has an Apache handler (i.e. application/x-httpd-php5 for files with .php5 extension).
To solve this problem, is it sound to rename [lib.php] to [lib.php5] ???
Thanks for your answer…
I just tried, and it did not work…
I will have to wait for your PHP4 version…
Thanks for your assistance,
Cheers.
hmm… yes you could try altering the references in the other files to include lib.php to be lib.php5, but suspect it still won’t work as the mapping of .php5 to the PHP5 engine is done by the web server, once you’ve called block_online_users_map.php which in turn calls lib.php5 there would be no way of getting parts of the page processed by PHP4 and some by PHP5 (it’s either all PHP4 or all PHP5 I think).
Alex
You’re right, and my site is a production site, so I do not want to risk too much…
I will definitely wait for your PHP4 version…
Thanks for all Alex,
Cheers.
Just found another little problem with this block, the GET request for getting users lat/lng coordinates was using HTTP 1.1, meaning the dat coul dbe ‘chunked’ on return, with extra seperators between the chunks, this then confused the XML processor so teh geocoding could fail. Still not quite sure why this only happened sometimes and not all the time, but anyway I’ve now updated the GET command to use HTTP 1.0 – and this is implemented in the latest verison of the block.
[...] Thanks to Pedro Crispim for giving me the Portuguese lanugauge file for the online users map block [...]
Hi Alex,
I’m running php 5.2.3, not using a proxy server,from php info I see SimpleXMLIterator under SPL
Is there something else I need to check it order for th euser map block to work?
Hi Bob,
In phpinfo(), there should be a seperate section for SimpleXML (if it’s enabled) – so if you can’t see that, I’d guess that SimpleXML isn’t enabled on your server.
Alex
Hi Alex,
it seems that file version.php is not in the actual package of the module. Isn’t it?
Thanks for adding the file.
Juergen
Hi Jürgen – I left a reply about this on the Moodle forums, see: http://moodle.org/mod/forum/discuss.php?d=75667#p361922.
Alex
I posted a fix for PHP4 here: http://moodle.org/mod/data/view.php?d=13&rid=890
Excellent – cheers telli
How about make page (linked from You block) to display all course users on the map, with optional filter by role and/or activity delay?
Cheers Nashev – that’s good suggestion and would be easy enough to implement (the hardest part is just getting users locations in the first place – and that’s already done) – will give it a go when I get some time
Alex
What are the step by step instructions for installing new Moodle block. I am running Apache, MySQL, PHP5, Windows server 2003
The basic instructions for installing the block are (essentially same as any other block install):
Hope that helps
Questions… I just installed this block on Moodle 1.8.3 + (2007021533) and it seem that it is not centering the map in the block as it should… and if you zoom out it does not retain the center that it had before. Also, I am not getting the user marker on the map. If I do not put a default zoom level in it does not show at all. Cron does not seem to show any evidence of this updating this either. Here is the output of http://moodle.gaettc.org/admin/cron.php
Server Time: Sat, 31 May 2008 00:39:29 -0400
Starting activity modules
Processing module function assignment_cron …done.
Processing module function chat_cron …done.
Processing module function forum_cron …Starting digest processing…
Cleaned old digest records
done.
Processing module function journal_cron …done.
Processing module function scorm_cron …done.
Processing module function workshop_cron …done.
Finished activity modules
Starting blocks
Processing cron function for search….Starting cron…
–DELETE—-
Lastly, is there a way for me to see a larger version of the map with the points on it that is show in the block… like maybe as full-size web page?
Hi Gene,
I’m really not sure why the centring doesn’t appear to be working quite right (I had a look at your site so can see the problem). I noticed that you’d set the initial zoom level to 14, so you may want to try something a bit smaller (maybe 10 or 11) and see if that makes any difference – or test with another set of initial coordinates to see if that’s where the problem is.
As for no users appearing on the map, there are a few reasons why this may be. The blocks cron function only runs at most once an hour – rather then every time cron runs, but you can change this by editing the mdl_blocks table. It would also be worth turning on the extra block debugging (in the blocks settings page) – then running cron again and it should give you more info as to where the problem is occuring. You can also look in mdl_block_online_users_map table to see how many ( if any) users’ locations have been geocoded.
HTH,
Alex
Hi Alex.
I installed user online map, but doesn´t work. I have Moodle 1.8.3 + (2007021531) with PHP 5.2.0 (The system is in windows 2003 server)
Just i finished configuring block, cron stopped. I installed cron program again. I was connected but it didn´t find me. The output of http://cursostelecom.lastingnet.com/admin/cron.php
Server Time: Thu, 26 Jun 2008 15:18:15 -0400
Starting activity modules
Processing module function assignment_cron …done.
Processing module function exercise_cron …done.
Processing module function forum_cron …done.
Processing module function journal_cron …done.
Processing module function workshop_cron …done.
Finished activity modules
Starting blocks
Processing cron function for online_users_map….
SimpleXML extension is loaded
Updating location for Andreina A Briceño M…location not found
Updating location for Jose Trompiz…location not found
Updating location for yelitza astrid martinez hidalgo…location not found
Updating location for Jose Trompiz…location not found
Updating location for Mariana Ramos…location not found
Updating location for Raiza Azuaje…location not found
Updating location for José Guevara…location not found
Updating location for virago virago…location not found
Updating location for ALEXIS QUINTERO…location not found
Updating location for argenis flores…location not found
Updating location for juan pacheco…location not found
Updating location for Gisela Gomez…location not found
Updating location for Ismael Medina…location not found
Updating location for Juan Freitez…location not found
Updating location for Juan Jose Lira…location not found
Updating location for liley Peña…location not found
Updating location for Oscar Marcano…location not found
Updating location for Rubén Dario Riera Rodriguez…location not found
Updating location for Angel Malaguera…location not found
Updating location for Rosanna Jaimes…location not found
Updating location for Carlos Lucena…location not found
Updating location for William Cuervo…location not found
Updating location for Fanny Mictil…location not found
Updating location for Francisco González…location not found
Updating location for Caterine Del Castillo Aliaga…location not found
Updating location for AILIN DIAZ…location not found
Updating location for Maderlyn Machado…location not found
Updating location for Samir Azrak…location not found
Updating location for Daniel Capriles…location not found
Updating location for Eiber Montiel…location not found
Updating location for Siegfrid kurz…location not found
Updating location for Michael Pardo Madrid…location not found
Updating location for Luz Contreras…location not found
Updating location for Jesus Casique…location not found
Updating location for Shamyr Ali…location not found
Updating location for Indra Griman…location not found
Updating location for Andrea E. Lopez…location not found
Updating location for Susana Salazar…location not found
Updating location for blanca vega…location not found
Updating location for jocabed prado…location not found
Updating location for luisana linares…location not found
Updating location for Pedro Peña…location not found
Updating location for Merliz Morles…location not found
Updating location for Daslim Luchini…location not found
Updating location for Alejandro Uribe…location not found
Updating location for daiyoseling palma…location not found
Updating location for Jose Hoyer…location not found
Updating location for Carlos Mendoza Leon…location not found
Updating location for blanca vega…location not found
Updating location for Katherine Vasquez…location not found
Updating location for johanet padron…location not found
Updating location for Maria Victoria Hernandez…location not found
Updating location for Robinson Colls…location not found
Updating location for andrés hernández…location not found
Updating location for Iván José Campos Madrid…location not found
Updating location for Thelma Melendez…location not found
Updating location for Jonmar Pineda…location not found
Updating location for daniel teles…location not found
Updating location for Evelyn Salazar…location not found
Updating location for Oswaldo Zara…location not found
Updating location for Maria Gabriela Bande Osorio…location not found
Updating location for maria morales…location not found
Updating location for Geraldine Sosa…location not found
Updating location for Andrea Padrón…location not found
Updating location for manuel cardona…location not found
Updating location for Claudia Perez…location not found
Updating location for Antonieta Vargas…location not found
Updating location for ELLIZ MARIA ESPINOZA PERDOMO…location not found
Updating location for Yenifer Perez…location not found
Updating location for JULIO MAYTA…location not found
Updating location for Hector Yepez…location not found
Updating location for Hector Martin…location not found
Updating location for Mushart mushart…location not found
Updating location for rafael guanda…location not found
Updating location for Argelimar Galindo…location not found
Updating location for Darwin Morales…location not found
Updating location for Miguel Monterola…location not found
Updating location for freddy useche…location not found
Updating location for Hugo Fernando Bolivar Hurtado…location not found
Updating location for Juan Lopez …location not found
Updating location for David Muñoz…location not found
Updating location for Merliz Morles…location not found
Updating location for Benny Busnego…location not found
Updating location for Alden Weech…location not found
Updating location for Esthela Urbano…location not found
Updating location for Giovanny Lugo Casacalenda…location not found
Updating location for claudia gonzalez…location not found
Updating location for Yirah Karelys Acevedo Reyes…location not found
Updating location for javier román…location not found
Updating location for sandra palacios…location not found
Updating location for Omar Palacios…location not found
Updating location for Reismary Armas…location not found
Updating location for Jessica Contreras…location not found
Updating location for Sergio Porras…location not found
Updating location for Jose Manuel Fuentes…location not found
Updating location for yajalith sanchez…location not found
Updating location for Jose Manuel Fuentes…location not found
Updating location for Nayley Pereira…location not found
Updating location for Katty Rodríguez…location not found
done.
Finished blocks
Updating languages cache
Removing expired enrolments …0 to delete
none found
Running backups if required…
Checking backup status…INACTIVE
Backup tasks finished.
Running auth crons if required…
Cron script completed correctly
Execution took 29.262481 seconds
Could you help with this
Also I send you spanish lang for online user map
<?php //
$string['blockname'] = ‘Mapa de Usuarios en linea’;
$string['configcentrelat'] = ‘Latitud inicial del centro del mapa – en grados decimales (no grados/minutos)’;
$string['configcentrelng'] = ‘Longitud inicial del centro del mapa – en grados decimales (no grados/minutos)’;
$string['configcentreuser'] = ‘Centro del mapa para la localizacion actual de usuarios, con el nivel de zoom establecido arriba. Esta configuracion tiene prioridad sobre las coordenadas de Lat/Long de arriba, salvo que el usuario no posea una localizacion valida’;
$string['configdebug'] = ‘Muestre los mensajes de depuracion cunado se ejecute el cron’;
$string['configgoogleapikey'] = ‘Key de la API Google Maps’;
$string['configoffline'] = ‘Mostrar los usuarios fuera de linea tambien?’;
$string['configtimetosee'] = ‘Numero de minutos que determinan el periodo de inactividad, luego del cual los usuarios son considerado fuera de linea.’;
$string['configzoomlevel'] = ‘Zoom inicial del mapa’;
$string['periodnminutes'] = ‘Ultimos $a minutos’;
Hi Jose,
I can think of a couple of reasons as to why it might not be working…
1) That the locations stored against the users aren’t found in the Geonames database.
2) Or that your server needs a proxy setting to access the internet (see Moodle -> Admin -> Server -> HTTP)
I’ve just updated the code to provide extra info to help see what is being looked up for each users lcoation, and to show whether the location isn’t found becuase it’s not in the Geonames database or if there’s a problem with the connection. So if you download the block, update and then run cron again, hopefully it’ll give some more helpful info.
I’ve also included the Spanish lang file, so thanks for doing this
Alex
ps. Remember that the cron for this block is only set to run once an hour, so if you want to keep running the cron for this block whilst you’re debugging, it might be worth changing the ‘cron’ setting to 1 in mdl_blocks for the online_users_map, and then change back to 3600 when it’s working ok.
Hi Alex
Thansk for your fast answer. I don´t have proxy.
I attach a cron (Using your update version) with details, where you can see “location not found due to no or invalid response” for all users, including me (I was online).
Do you have a site with online user map, where I can registry to check if my IP Address has a valid response?
Thanks a lot
Jose
Event Type: Information
Event Source: Moodle Cron
Event Category: None
Event ID: 0
Date: 6/27/2008
Time: 9:58:22 AM
User: N/A
Computer: UNKNOWN-CQN4KCZ
Description:
The description for Event ID ( 0 ) in Source ( Moodle Cron ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. You may be able to use the /AUXSOURCE= flag to retrieve this description; see Help and Support for details. The following information is part of the event: http://localhost/admin/cron.phpServer Time: Fri, 27 Jun 2008 09:57:50 -0400
Starting activity modules
Processing module function assignment_cron …done.
Processing module function chat_cron …done.
Processing module function exercise_cron …done.
Processing module function forum_cron …done.
Processing module function journal_cron …done.
Processing module function scorm_cron …done.
Processing module function workshop_cron …done.
Finished activity modules
Starting blocks
Processing cron function for online_users_map….
SimpleXML extension is loaded
Updating location for Andreina A Briceo M (looking up: Maracay,VE )…location not found due to no or invalid response
Updating location for Jose Trompiz (looking up: Maracay,VE )…location not found due to no or invalid response
Updating location for yelitza astrid martinez hidalgo (looking up: maracay,VE )…location not found due to no or invalid response
Updating location for Jose Trompiz (looking up: Maracay,VE )…location not found due to no or invalid response
Updating location for Mariana Ramos (looking up: Maracay,VE )…location not found due to no or invalid response
Updating location for Raiza Azuaje (looking up: Maracay,VE )…location not found due to no or invalid response
Updating location for Jos Guevara (looking up: Maracay,VE )…location not found due to no or invalid response
Updating location for virago virago (looking up: maracay,VE )…location not found due to no or invalid response
Updating location for ALEXIS QUINTERO (looking up: MARACAY,VE )…location not found due to no or invalid response
Updating location for argenis flores (looking up: maracay,VE )…location not found due to no or invalid response
Updating location for juan pacheco (looking up: maracay,VE )…location not found due to no or invalid response
Updating location for Gisela Gomez (looking up: Maracay,VE )…location not found due to no or invalid response
Updating location for Ismael Medina (looking up: Maracay,VE )…location not found due to no or invalid response
Updating location for Juan Freitez (looking up: Maracay,VE )…location not found due to no or invalid response
Updating location for Juan Jose Lira (looking up: Maracay,VE )…location not found due to no or invalid response
Updating location for liley Pea (looking up: Maracay,VE )…location not found due to no or invalid response
Updating location for Oscar Marcano (looking up: Maracay,VE )…location not found due to no or invalid response
Updating location for Rubn Dario Riera Rodriguez (looking up: Maracay,VE )…location not found due to no or invalid response
Updating location for Angel Malaguera (looking up: Maracay,VE )…location not found due to no or invalid response
Updating location for Rosanna Jaimes (looking up: Maracay,VE )…location not found due to no or invalid response
Updating location for Carlos Lucena (looking up: Maracay,VE )…location not found due to no or invalid response
Updating location for William Cuervo (looking up: Maracay,VE )…location not found due to no or invalid response
Updating location for Fanny Mictil (looking up: Maracay,VE )…location not found due to no or invalid response
Updating location for Francisco Gonzlez (looking up: Maracay,VE )…location not found due to no or invalid response
Updating location for Caterine Del Castillo Aliaga (looking up: La Paz,BO )…location not found due to no or invalid response
Updating location for AILIN DIAZ (looking up: MARACAY,VE )…location not found due to no or invalid response
Updating location for Maderlyn Machado (looking up: La Victoria,VE )…location not found due to no or invalid response
Updating location for Samir Azrak (looking up: La Victoria, Aragua,VE )…location not found due to no or invalid response
Updating location for Daniel Capriles (looking up: maracay,VE )…location not found due to no or invalid response
Updating location for Eiber Montiel (looking up: Caracas,VE )…location not found due to no or invalid response
Updating location for Siegfrid kurz (looking up: Sta Cruz de Aragua,VE )…location not found due to no or invalid response
Updating location for Michael Pardo Madrid (looking up: Maracay,VE )…location not found due to no or invalid response
Updating location for Luz Contreras (looking up: Maracay,VE )…location not found due to no or invalid response
Updating location for Jesus Casique (looking up: Maracay,VE )…location not found due to no or invalid response
Updating location for Shamyr Ali (looking up: Punto Fijo,VE )…location not found due to no or invalid response
Updating location for Indra Griman (looking up: Maracay,VE )…location not found due to no or invalid response
Updating location for Andrea E. Lopez (looking up: Maracay,VE )…location not found due to no or invalid response
Updating location for Susana Salazar (looking up: Maracay,VE )…location not found due to no or invalid response
Updating location for blanca vega (looking up: maracay,VE )…location not found due to no or invalid response
Updating location for jocabed prado (looking up: maracay,VE )…location not found due to no or invalid response
Updating location for luisana linares (looking up: maracay,VE )…location not found due to no or invalid response
Updating location for Pedro Pea (looking up: Maracay,VE )…location not found due to no or invalid response
Updating location for Merliz Morles (looking up: Maracay,VE )…location not found due to no or invalid response
Updating location for Daslim Luchini (looking up: Maracay,VE )…location not found due to no or invalid response
Updating location for Alejandro Uribe (looking up: Maracay,VE )…location not found due to no or invalid response
Updating location for daiyoseling palma (looking up: maracay,VE )…location not found due to no or invalid response
Updating location for Jose Hoyer (looking up: Maracay,VE )…location not found due to no or invalid response
Updating location for Carlos Mendoza Leon (looking up: Cagua,VE )…location not found due to no or invalid response
Updating location for blanca vega (looking up: maracay,VE )…location not found due to no or invalid response
Updating location for Katherine Vasquez (looking up: Maracay,VE )…location not found due to no or invalid response
Updating location for johanet padron (looking up: maracay,VE )…location not found due to no or invalid response
Updating location for Maria Victoria Hernandez (looking up: Maracay,VE )…location not found due to no or invalid response
Updating location for Robinson Colls (looking up: Maracay,VE )…location not found due to no or invalid response
Updating location for andrs hernndez (looking up: maracay,VE )…location not found due to no or invalid response
Updating location for Ivn Jos Campos Madrid (looking up: CORO,VE )…location not found due to no or invalid response
Updating location for Thelma Melendez (looking up: Tegucigalpa,HN )…location not found due to no or invalid response
Updating location for Jonmar Pineda (looking up: Maracay,VE )…location not found due to no or invalid response
Updating location for daniel teles (looking up: maracay,VE )…location not found due to no or invalid response
Updating location for Evelyn Salazar (looking up: Maracay,VE )…location not found due to no or invalid response
Updating location for Oswaldo Zara (looking up: Maracay,VE )…location not found due to no or invalid response
Updating location for Maria Gabriela Bande Osorio (looking up: Maracay,VE )…location not found due to no or invalid response
Updating location for maria morales (looking up: maracay,VE )…location not found due to no or invalid response
Updating location for Geraldine Sosa (looking up: Maracay,VE )…location not found due to no or invalid response
Updating location for Andrea Padrn (looking up: Maracay,VE )…location not found due to no or invalid response
Updating location for manuel cardona (looking up: maracay,VE )…location not found due to no or invalid response
Updating location for Claudia Perez (looking up: Maracay,VE )…location not found due to no or invalid response
Updating location for Antonieta Vargas (looking up: Marcay,VE )…location not found due to no or invalid response
Updating location for ELLIZ MARIA ESPINOZA PERDOMO (looking up: MARACAY,VE )…location not found due to no or invalid response
Updating location for Yenifer Perez (looking up: maracay,VE )…location not found due to no or invalid response
Updating location for JULIO MAYTA (looking up: LA PAZ,BO )…location not found due to no or invalid response
Updating location for Hector Yepez (looking up: Maracay,VE )…location not found due to no or invalid response
Updating location for Hector Martin (looking up: Maracay,VE )…location not found due to no or invalid response
Updating location for Mushart mushart (looking up: Mararay,VE )…location not found due to no or invalid response
Updating location for rafael guanda (looking up: maracay,VE )…location not found due to no or invalid response
Updating location for Argelimar Galindo (looking up: Maracay,VE )…location not found due to no or invalid response
Updating location for Darwin Morales (looking up: Caracas,VE )…location not found due to no or invalid response
Updating location for Miguel Monterola (looking up: Turmero,VE )…location not found due to no or invalid response
Updating location for freddy useche (looking up: maracay,VE )…location not found due to no or invalid response
Updating location for Hugo Fernando Bolivar Hurtado (looking up: Maracay,VE )…location not found due to no or invalid response
Updating location for Juan Lopez (looking up: Maracay,VE )…location not found due to no or invalid response
Updating location for David Muoz (looking up: Barcelona,ES )…location not found due to no or invalid response
Updating location for Merliz Morles (looking up: Maracay,VE )…location not found due to no or invalid response
Updating location for Benny Busnego (looking up: La Victoria,VE )…location not found due to no or invalid response
Updating location for Alden Weech (looking up: Mesa,US )…location not found due to no or invalid response
Updating location for Esthela Urbano (looking up: Maracay,VE )…location not found due to no or invalid response
Updating location for Giovanny Lugo Casacalenda (looking up: Maracay,VE )…location not found due to no or invalid response
Updating location for claudia gonzalez (looking up: maracay,VE )…location not found due to no or invalid response
Updating location for Yirah Karelys Acevedo Reyes (looking up: Maracay,VE )…location not found due to no or invalid response
Updating location for javier romn (looking up: bucaramanga,CO )…location not found due to no or invalid response
Updating location for sandra palacios (looking up: san salvador,SV )…location not found due to no or invalid response
Updating location for Omar Palacios (looking up: Irapuato,MX )…location not found due to no or invalid response
Updating location for Reismary Armas (looking up: Maracay,VE )…location not found due to no or invalid response
Updating location for Jessica Contreras (looking up: Maracay,VE )…location not found due to no or invalid response
Updating location for Sergio Porras (looking up: San Jos,CR )…location not found due to no or invalid response
Updating location for Jose Manuel Fuentes (looking up: estado de mexico,MX )…location not found due to no or invalid response
Updating location for yajalith sanchez (looking up: maracay,VE )…location not found due to no or invalid response
Updating location for Jose Manuel Fuentes (looking up: estado de mexico,MX )…location not found due to no or invalid response
Updating location for Nayley Pereira (looking up: Maracay,VE )…location not found due to no or invalid response
Updating location for Katty Rodrguez (looking up: Maracay,VE )…location not found due to no or invalid response
done.
Finished blocks
Updating languages cache
Removing expired enrolments …0 to delete
none found
Running backups if required…
Checking backup status…INACTIVE
Backup tasks finished.
Running auth crons if required…
Cron script completed correctly
Execution took 32.446573 seconds
.
Hi Jose,
On my test Moodle (unfortunately it’s behind a firewall so I can’t show you) I updated my location to the Maracay, VE and then run the cron and all updated fine. From your message it does look like there is a problem accessing the geonames site, rather than the location not being found in the ir database.
All I can suggest really is that you check you definitely don’t need a proxy server setting for your Moodle server to access the internet, or that you check what is being requested when you run cron with a packet sniffer (running on the Moodle server) to see what request/responses are being made.
Alex
Hi Alex,
We are planning to using your online users map block, but since your block updates all users, that can be too much time consuming in some cases (initial update for instance).
Can you put a parameter in the block with the maximal number of updates that will be done when the cron runs?
I guess you only need to change two lines in your lib.php file:
$results = get_records_sql($sql);
to something like this:
$results = get_records_sql($sql,0,$CFG->block_online_users_map_limit_updates);
This would guaranty that the block will not compromise the system performance, since we could limit to, lets say 100 updates each time.
Best regards,
José Coelho
Cheers José, yes good idea – I’ll get that done and let you know
Alex
I’ve just updated the block (on the download and Moodle Contrib CVS) – so there is now a block setting to specify the max number of locations you’d like to update for any given run of cron (for the perfomance reason José mentions above). The default number is 100, but if you set 0 as the max number then this basically turns the restriction off – so all locations (that need updating) are updated.
Alex
That was a fast response with code updated: less than two hours!
Thanks for your block and the code update.
This will be for sure one of the most popular bocks in the frontpage of moodle websites.
Regards,
José Coelho
no worries – it’s been quite a quiet day today!!
I tried NineHub.com provides free Moodle hosting with unlimited disk space and bandwidth. Good enough!
Hi Alex,
With the new version, the block was inserted in my institution site without any problem (www.moodle.univ-ab.pt).
I was asked to remove the names of the users in the block, for privacy reasons. Can you put in the block another configuration variable, to hide the names of the users and show only their locations?
Thanks,
José Coelho
Hi Jose,
I’ve just updated the block with a new setting to hide the user name as you suggested. Just download the block and update the online_users_map block then you should see the new setting. (note: this change isn’t yet in Moodle contrib CVS as I’m having a bit of trouble accessing that at the moment – will hopefully be there soon though).
Cheers,
Alex
Hi,
On our plataforms the online users map is 100%.
Just a problem, when the block is transfer to left column, not works correctly.
Hi Leandro,
I’ve just tried putting the block on the left side on my test site and can see what the problem is. I think it’s because the rest of the page doesn’t load straight away, so the width=100% on the google map means it spans the whole page, but doesn’t resize the map when the rest of the page is loaded. That what seems to be happening in my FireFox 3 anyway.
I think the easiest way around this is just to set the map width to be a fixed size (eg 200px)- you can set this on line 15 of /blocks/online_users_map/lib.php. I tried setting it to fixed width (200px) on my test site and seems to sort it out fine.
Hope that helps,
Alex
Sorry to post anonymously, I hate being on websites. I’m not from Moodle or Google. I think your block is excellent, but I think it may breach the Google lisence for sites that require a username and password:
http://code.google.com/apis/maps/terms.html
9.1 Free, Public Accessibility to Your Maps API Implementation. Your Maps API Implementation must be generally accessible to users without charge. You may require users to log in to your Maps API Implementation if you do not require users to pay a fee.
Well done for your work, but this means I won’t be able to use it on my own installation.
Alex,
How come it works for some users, but other users, like admin on my server, get a blank map once they login with a valid city and country? Get map back when admin logs out. Using IE seven. How come Firefox sends map to Asia when IE displays US.
I noticed that for IE I had to put in negative sign for longitude e.g. -100.0 for US city?
Tieku
I have Moodle 1.9.4 on Linux with PHP 5.26 and just installed your block it shows the map but no users online any suggestions
I got Google API and input the coordinates for the Dominican Republic in Manage Module
I went to ADMIN/LOCATIONS and saw that I have to download and install a MAXMIND geocities database as well as I have to input my Google API key again for the Moodle site, so I did both tasks but still your block is not showing any users in it
here is my CRON which doesnt show the block initiated or run
Server Time: Wed, 11 Feb 2009 10:45:45 -0500
Starting activity modules
Processing module function assignment_cron …done.
Processing module function chat_cron …done.
Processing module function forum_cron …Starting digest processing…
Cleaned old digest records
done.
Processing module function scorm_cron …done.
Finished activity modules
Starting blocks
Processing cron function for rss_client….
0 feeds refreshed (took 0.007017 seconds)
done.
Processing cron function for search….Global searching is not enabled. Nothing performed by search.
done.
Finished blocks
Starting admin reports
Finished admin reports
Updating languages cache
Removing expired enrolments …none found
Starting main gradebook job …
done.
Running backups if required…
Checking backup status…INACTIVE
Backup tasks finished.
Running auth crons if required…
Cron script completed correctly
Execution took 1.779539 seconds
HELP!
Hi,
The online users block does not use the geocities database – it only uses the geonames database which is accessed directly over the web (so no installation of locations databases should be needed). All the setting needed for the block are in the block settings (rather than in other parts of the moodle admin settings).
The cron for the block on runs every hour (not every time you run cron) so won’t appear every tie it’s run.
You should probably have a look at the queries/responses in the Moodle forums (at: http://moodle.org/mod/forum/discuss.php?d=75667 ) as others have had similar problems.
Cheers,
Alex
I have recently installed your block on 1.9+, and while I can see the map no pins have appeared for the users. I have gone through the complete discussion from January 11, 2008 on down, making the necessary changes referred to in this discussion. I still have no pins. My chron seems to be reading the block, but it never updates the locations. Do you have any suggestions?
Here is a copy of my chron
Processing cron function for online_users_map….
SimpleXML extension is loaded
There are no locations to update.done.
Finished blocks
Any help would be great regards
Hi Ray,
I think the best thing to check is that the locations (and countries) entered by users in you Moodle can be looked up using the geonames database (http://www.geonames.org). From the output you provided it seems there are no errors connecting , but just that the locations can’t be geocoded by the database?
hope that helps,
Alex
Thank you for responding Alex. I have looked up the cities in geonames.org, and they appear in their database. I have also put in major cities like Orlando, Florida (I used both Orlando and Orlando, Florida) and still no pins. Am I putting the longitude and latitude in correctly at (39.5 lat by 265 long)? I also ran the cron file again got the same message as before, Am I doing something wrong?
Regards
I’m not sure why you need to be entering the lat/long yourself – this is what the geocoding should be doing. I guess the thing to do it look at the block_online_user_map table and see what entries (if any are in there) – that should tell you whether the locations have been geocoded or not. Then also try to call up the xml/json file in the browser – sorry I don’t have all the code with me here – it’s something like getusers.php then you can see which users are currently online and who have their locations to display.
Hope that helps,
A
Again, thank you for responding. I input the lat/long in the for the settings of the block (is that bad). I ran my xml/json file on my browser and got the following output:
−
−
−
−
</XMLD
I also ran getusers.php and there was no output. Is there something that I am leaving out? Should I input something in the location settings of moodle?
Regards
Helo Alex,
Same problem with me, no map at all, same message while running cron:
Processing cron function for online_users_map….
SimpleXML extension is loaded
There are no locations to update.done.
Finished blocks
I force assigned everyone the role of Student, and still it wouldn’t update a single user.
The table used for location in mysql is empty. Any ideas ?