Permalink
Browse files

added hook "google_maps_user_list" to be able to filter the users sho…

…wn on the map
  • Loading branch information...
1 parent b4127ea commit 1f297946244f64deac26221034e39d0c17f16456 @mysnip committed Sep 12, 2011
Showing with 48 additions and 1 deletion.
  1. +5 −0 Changelog
  2. +42 −0 addon/usermap.php
  3. +1 −1 info.txt
View
@@ -1,6 +1,11 @@
Changelog for @PACKAGE@
----------------------------------------------------------------------
+2011-09-12 v2.0.6 (Thomas Seifert)
+
+ - Added hook google_maps_user_list to be able to filter the list
+ of users shown on the map
+
2011-04-11 v2.0.5 (Maurice Makaay)
- Restored the functionality of searching for the user's location
View
@@ -33,6 +33,48 @@
// Retrieve the data for the users that were found.
$users = phorum_api_user_get($user_ids);
+/**
+ * [hook]
+ * google_maps_user_list
+ *
+ * [availability]
+ * Google Maps Module > 2.0.5
+ *
+ * [description]
+ * This hook can be used for filtering
+ * the list of users shown on the Google Maps Map.
+ *
+ * [category]
+ * Module Google Maps
+ *
+ * [when]
+ * Right before the Google Maps module shows the map
+ *
+ * [input]
+ * An array of users which are supposed to be shown on the map
+ *
+ * [output]
+ * Same as input.
+ *
+ * [example]
+ * <hookcode>
+ * function phorum_mod_foo_google_maps_user_list($users)
+ * {
+ * foreach($users as $uid => $user) {
+ * // remove user with username 'admin' from the shown users
+ * if($user['username'] == 'admin') {
+ * unset($users[$uid]);
+ * }
+ * }
+ *
+ * return $users;
+ * }
+ * </hookcode>
+ */
+if (isset($PHORUM['hooks']['google_maps_user_list'])) {
+ $users = phorum_hook('google_maps_user_list', $users);
+}
+
// Setup a list of markers to plot on the map.
$show = array();
foreach ($users as $user)
View
@@ -1,6 +1,6 @@
title: Google Maps
desc: This module implements Google Maps functionality in the user profile. The user can indicate in the control center where he/she lives and this location can be displayed to others on the profile viewing screen.
-version: 2.0.5
+version: 2.0.6
require_version: 5.2.16
author: Maurice Makaay <maurice@phorum.org>
url: http://www.phorum.org/phorum5/read.php?16,119681

0 comments on commit 1f29794

Please sign in to comment.