'."\n";
}
add_action('wp_head', 'ggmap_header');
/*
===============================================================================
group stuff
===============================================================================
*/
/* - HERE BEGINS THE CODE - */
// create the form to add the field for the map
function ggmap_add_map_form() {
?>
Must be in decimal format seperated by a comma eg: -12.34567,12.34567 Need help finding your co-ordinates?
groups->new_group_id)
$id = $bp->groups->new_group_id;
else
$id = $group_id;
if ( $_POST['group-map'] )
groups_update_groupmeta( $id, 'ggmap_group_map', $_POST['group-map'] );
}
// Get or return the map lat and long
function ggmap_group_map() {
echo ggmap_get_group_map();
}
function ggmap_get_group_map( $group = false ) {
global $groups_template;
if ( !$group )
$group =& $groups_template->group;
$group_map = groups_get_groupmeta( $group->id, 'ggmap_group_map' );
$group_map = stripcslashes( $group_map );
return apply_filters( 'ggmap_get_group_map', $group_map );
}
// show map in group header
function ggmap_show_map_in_header( $description ) {
global $ggmap_show_map_in_header;
if ( ggmap_get_group_map() && $ggmap_show_map_in_header ) {
$description .= '
';
}
return $description;
}
// show map for an individual group
function ggmap_make_map_for_group() {
global $bp, $wpdb, $ggmap_args;
$group_map = "
";
return $group_map;
}
// add directions for an individual group
function ggmap_make_directions_for_group() {
global $bp, $wpdb, $ggmap_args;
$directionsto = "
*enter your current location";
return $directionsto;
}
add_action( 'groups_create_group_step_save_group-details', 'ggmap_save_map' );
add_action( 'groups_details_updated', 'ggmap_save_map' );
/*
===============================================================================
Google Group Extension API - Map tab
===============================================================================
*/
class Google_Group_Extension extends BP_Group_Extension {
var $enable_create_step = false;
var $enable_edit_item = false;
function google_group_extension() {
$this->name = 'Map';
$this->slug = 'map';
$this->create_step_position = 21;
$this->nav_item_position = 31;
}
function display() {
global $bp;
echo '