Skip to content

Please integrated this change. #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Changelog
Original file line number Diff line number Diff line change
@@ -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
Expand Down
42 changes: 42 additions & 0 deletions addon/usermap.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion info.txt
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>
url: http://www.phorum.org/phorum5/read.php?16,119681
Expand Down