Plugin Directory

Changeset 439512


Ignore:
Timestamp:
09/17/2011 09:21:06 PM (14 years ago)
Author:
michaelvar
Message:
 
Location:
bp-members-avatar-map/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • bp-members-avatar-map/trunk/admin/mam-admin.php

    r436455 r439512  
    1515 register_setting ( 'bp_wp_mam-settings-group', 'mam_navigation_size' );
    1616 register_setting ( 'bp_wp_mam-settings-group', 'mam_max_number_of_members' );
     17 register_setting ( 'bp_wp_mam-settings-group', 'mam_default_location' );
    1718 }
    1819 add_option( 'mam_width', '' );
     
    2324 add_option( 'mam_navigation_size', '' );
    2425 add_option( 'mam_max_number_of_members', '' );
     26 add_option( 'mam_default_location', '' );
    2527
    2628 function bp_mam_admin() {
     
    3739  update_option( 'mam_map_type_control', $_POST['mam_map_type_control'] );
    3840  update_option( 'mam_max_number_of_members', $_POST['mam_max_number_of_members'] );
     41  update_option( 'mam_default_location', $_POST['mam_default_location'] );
    3942
    4043        $updated = true;
     
    4952 $map_type_control = get_option( 'mam_map_type_control' );
    5053 $map_max_members = get_option('mam_max_number_of_members');
     54 $map_default_location = get_option('mam_default_location');
    5155   
    5256?>
     
    5963     <p><?php _e("If you have not yet set up a location field please visit the <a href=\"" .  $path_to ."?page=bp-profile-setup\">Profile Field Setup</a> page.", "bp_mam") ?></p>
    6064     <p><?php _e('You can either set the location field in the base group to show it on the sign up page or create a new group for the field name in which case it will show in the users profle setup and public display only.', 'bp_mam') ?></p>
    61     <p><?php _e("You must also set up a <b>latitude and longitude</b> field please visit the <a href=\"" .  $path_to ."?page=bp-profile-setup\">Profile Field Setup</a> page.", "bp_mam") ?></p>
    62      <p><?php _e('You can either set the <b>latitude and longitude</b> field in the base group to show it on the sign up page or create a new group for the field name in which case it will show in the users profle setup and public display only.', 'bp_mam') ?></p>
     65    <p><?php _e("You must also set up a <b>Latitude and Longitude</b> field please visit the <a href=\"" .  $path_to ."?page=bp-profile-setup\">Profile Field Setup</a> page.", "bp_mam") ?></p>
     66     <p><?php _e('You can either set the <b>Latitude and Longitude</b> field in the base group to show it on the sign up page or create a new group for the field name in which case it will show in the users profle setup and public display only.', 'bp_mam') ?></p>
    6367    <p><?php _e('You can also set a <b>Info</b> field in the base group to show it on the sign up page or create a new group for the field name in which case it will show in the users profle setup and public display only.This field is for displaying member info on the info window that open by clicking on member avatar marker on the map. This field is not a must', 'bp_mam') ?></p>
    6468           
     
    7276       <col span="1" width="30%" />
    7377       <col span="1" width="70%" />
    74       </colgroup>       
     78      </colgroup>   
     79      <tr valign="top">
     80                      <th scope="row"><label for="mam-default"><?php _e( 'Map default location(put Latitude and Longitude of the desired default location)', 'bp-mam' ) ?></label></th>
     81                      <td>
     82                         <input name="default_location" type="text" id="mam-default_location"  value="<?php echo attribute_escape( $mam_default_location ); ?>" size="20" />
     83                      </td>
     84                  </tr>
    7585      <tr valign="top">
    7686                      <th scope="row"><label for="mam-width"><?php _e( 'Map width (e.g 70 to  = 70%)', 'bp-mam' ) ?></label></th>
  • bp-members-avatar-map/trunk/mam-loader.php

    r436450 r439512  
    3030if($latlongJson[0]['lat']!=null && $latlongJson[0]['lon']!=null){
    3131$latlong=$latlongJson[0]['lat'].",".$latlongJson[0]['lon'];
    32 xprofile_set_field_data( 'latitude and longitude', bp_core_get_userid( $_POST['signup_username'] ), $latlong);}
     32xprofile_set_field_data( 'Latitude and Longitude', bp_core_get_userid( $_POST['signup_username'] ), $latlong);}
    3333   
    3434    }
     
    4545if($latlongJson[0]['lat']!=null && $latlongJson[0]['lon']!=null){
    4646$latlong=$latlongJson[0]['lat'].",".$latlongJson[0]['lon'];
    47 xprofile_set_field_data( 'latitude and longitude', bp_displayed_user_id(), $latlong);}
     47xprofile_set_field_data( 'Latitude and Longitude', bp_displayed_user_id(), $latlong);}
    4848
    4949}
  • bp-members-avatar-map/trunk/mam.php

    r439470 r439512  
    7676 <?php
    7777 
    78    
     78    if ( get_option('map_default_location')) {
     79       $map_default_location = get_option( 'map_default_location' );
     80    } elseif ( empty($map_default_location) ) {
     81       $mam_default_location = '32.69801,35.14132';
     82    }
    7983    if ( get_option('mam_width')&&get_option('mam_width')<100 ) {
    8084       $map_width = get_option( 'mam_width' );
     
    145149  function initialize() {
    146150    geocoder = new google.maps.Geocoder();
    147        var latlng = new google.maps.LatLng(32.69801,35.14132);
     151       var latlng = new google.maps.LatLng(<?php echo $mam_default_location; ?>);
    148152       var myOptions = {
    149153       zoom: <?php echo $map_zoom; ?>,
     
    220224<?php if ( bp_has_members('type=active&max='.$map_max_members.'&per_page='.$map_max_members.'') ) : ?>
    221225                    <?php while ( bp_members() ) : bp_the_member(); ?>   
    222  try{jQuery(document).ready( function() {showAddress("<?php bp_member_permalink() ?>","<?php bp_member_name() ?>","<?php bp_member_profile_data('field=latitude and longitude') ?>","<?php bp_member_profile_data('field=Info') ?>");} );}
     226 try{jQuery(document).ready( function() {showAddress("<?php bp_member_permalink() ?>","<?php bp_member_name() ?>","<?php bp_member_profile_data('field=Latitude and Longitude') ?>","<?php bp_member_profile_data('field=Info') ?>");} );}
    223227catch(err){}
    224228<?php endwhile; ?>
     
    226230<?php if ( bp_has_members( 'type=online' ) ) : ?>
    227231                    <?php while ( bp_members() ) : bp_the_member(); ?>   
    228 try{jQuery(document).ready( function() {showAddress_online("<?php bp_member_permalink() ?>","<?php bp_member_name() ?>","<?php bp_member_profile_data('field=latitude and longitude') ?>","<?php bp_member_profile_data('field=Info') ?>");} );}
     232try{jQuery(document).ready( function() {showAddress_online("<?php bp_member_permalink() ?>","<?php bp_member_name() ?>","<?php bp_member_profile_data('field=Latitude and Longitude') ?>","<?php bp_member_profile_data('field=Info') ?>");} );}
    229233catch(err){}
    230234<?php endwhile; ?>
  • bp-members-avatar-map/trunk/readme.txt

    r439471 r439512  
    1515Add a Google map to display the members Location. Maps are displayed in the all members page.
    1616
    17 This is done with the users registering their address latitude and longitude and not by addressing the geolocation service all the time but only on registration
     17This is done with the users registering their address Latitude and Longitude and not by addressing the geolocation service all the time but only on registration
    1818
    19 by taking the Location field and requesting the latitude and longitude from Open Street Map Nominatim geolocation service  .This plugin will be developed more further than initial release.
     19by taking the Location field and requesting the Latitude and Longitude from Open Street Map Nominatim geolocation service  .This plugin will be developed more further than initial release.
    2020
    2121The admin settings page allows the map to be assigned dimensions plus various map rendering options .
     
    2323Important: You must have set up an extended profile field named 'Location'  this can be either set to in the 'Base' group in which case it will appear on the signup page or you can
    2424create a new group and have the field display on the members profile settings. The map will only display once the member has added their location to this new field.
    25 You must also set up a latitude and longitude field. !!very importent!!
    26 You can either set the latitude and longitude field in the base group to show it on the sign up page or create a new group for the field name in which case it will show in the users profle setup and public display only.
     25You must also set up a Latitude and Longitude field. !!very importent!!
     26You can either set the Latitude and Longitude field in the base group to show it on the sign up page or create a new group for the field name in which case it will show in the users profle setup and public display only.
    2727You Can set up an extended profile field named 'Info' to show the member info in the map -  not a must...           
    2828== Installation ==
     
    3131* Configure the plugin at Dashboard > BuddyPress > MAM Settings.
    3232* Presently you can set map dimensions plus map overlay options.
    33 * Set up 3 Profile fields - 1.Location 2.latitude and longitude 3.Info       -the info field is not a must.
     33* Set up 3 Profile fields - 1.Location 2.Latitude and Longitude 3.Info       -the info field is not a must.
    3434
    3535 == Frequently Asked Questions ==
Note: See TracChangeset for help on using the changeset viewer.