Loading...
 
Features / Usability

Features / Usability


Re: How to count (total) markers on GMap Usermap

posts: 214

If a user has added their self to the map, the coordinates are saved the the tiki_user_preferences table. If there are coordinates set, there should be both latitude and longitude values, so we could get a count of users with latitudes and that should be the number you are after.

Here is plugin USERGMAPCOUNT that will give you the count of users that have a latitude value set in tiki_user_preferences:

Copy to clipboard
~60~?php // Displays the number of users on usermap // Use: // {USERGMAPCOUNT()/} // require_once "lib/wiki/pluginslib.php"; function wikiplugin_usergmapcount_help() { return tra("Displays the number of users on usermap").":{USERGMAPCOUNT()/}"; } class CountGMapUsers extends ))PluginsLib(( { function run() { $query = "select count(*) FROM `tiki_user_preferences` where `prefName` = 'lat' and `value` != '0'"; $numusers = $this->getOne($query); return $numusers; } // run() } // class CountGMapUsers function wikiplugin_usergmapcount() { $plugin = new CountGMapUsers(); return $plugin->run(); } ?>
There are no comments at this time.