Loading...
 
Features / Usability

Features / Usability


How to count (total) markers on GMap Usermap

posts: 3665 United States

I'm still fine-tuning my Google User Map (see here for prior discussion).

Is there a way to show the total number of markers on the map? I'd like to be able to show:

  • How many registered users the site has (via the UserCount plugin)
  • How many users have added themself to the map.


-R

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(); } ?>

Upcoming Events

1)  18 Apr 2024 14:00 GMT-0000
Tiki Roundtable Meeting
2)  16 May 2024 14:00 GMT-0000
Tiki Roundtable Meeting
3)  20 Jun 2024 14:00 GMT-0000
Tiki Roundtable Meeting
4)  18 Jul 2024 14:00 GMT-0000
Tiki Roundtable Meeting
5)  15 Aug 2024 14:00 GMT-0000
Tiki Roundtable Meeting
6)  19 Sep 2024 14:00 GMT-0000
Tiki Roundtable Meeting
7) 
Tiki birthday
8)  17 Oct 2024 14:00 GMT-0000
Tiki Roundtable Meeting
9)  21 Nov 2024 14:00 GMT-0000
Tiki Roundtable Meeting
10)  19 Dec 2024 14:00 GMT-0000
Tiki Roundtable Meeting