Changeset 439512
- Timestamp:
- 09/17/2011 09:21:06 PM (14 years ago)
- Location:
- bp-members-avatar-map/trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
bp-members-avatar-map/trunk/admin/mam-admin.php
r436455 r439512 15 15 register_setting ( 'bp_wp_mam-settings-group', 'mam_navigation_size' ); 16 16 register_setting ( 'bp_wp_mam-settings-group', 'mam_max_number_of_members' ); 17 register_setting ( 'bp_wp_mam-settings-group', 'mam_default_location' ); 17 18 } 18 19 add_option( 'mam_width', '' ); … … 23 24 add_option( 'mam_navigation_size', '' ); 24 25 add_option( 'mam_max_number_of_members', '' ); 26 add_option( 'mam_default_location', '' ); 25 27 26 28 function bp_mam_admin() { … … 37 39 update_option( 'mam_map_type_control', $_POST['mam_map_type_control'] ); 38 40 update_option( 'mam_max_number_of_members', $_POST['mam_max_number_of_members'] ); 41 update_option( 'mam_default_location', $_POST['mam_default_location'] ); 39 42 40 43 $updated = true; … … 49 52 $map_type_control = get_option( 'mam_map_type_control' ); 50 53 $map_max_members = get_option('mam_max_number_of_members'); 54 $map_default_location = get_option('mam_default_location'); 51 55 52 56 ?> … … 59 63 <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> 60 64 <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> 63 67 <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> 64 68 … … 72 76 <col span="1" width="30%" /> 73 77 <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> 75 85 <tr valign="top"> 76 86 <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 30 30 if($latlongJson[0]['lat']!=null && $latlongJson[0]['lon']!=null){ 31 31 $latlong=$latlongJson[0]['lat'].",".$latlongJson[0]['lon']; 32 xprofile_set_field_data( ' latitude and longitude', bp_core_get_userid( $_POST['signup_username'] ), $latlong);}32 xprofile_set_field_data( 'Latitude and Longitude', bp_core_get_userid( $_POST['signup_username'] ), $latlong);} 33 33 34 34 } … … 45 45 if($latlongJson[0]['lat']!=null && $latlongJson[0]['lon']!=null){ 46 46 $latlong=$latlongJson[0]['lat'].",".$latlongJson[0]['lon']; 47 xprofile_set_field_data( ' latitude and longitude', bp_displayed_user_id(), $latlong);}47 xprofile_set_field_data( 'Latitude and Longitude', bp_displayed_user_id(), $latlong);} 48 48 49 49 } -
bp-members-avatar-map/trunk/mam.php
r439470 r439512 76 76 <?php 77 77 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 } 79 83 if ( get_option('mam_width')&&get_option('mam_width')<100 ) { 80 84 $map_width = get_option( 'mam_width' ); … … 145 149 function initialize() { 146 150 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; ?>); 148 152 var myOptions = { 149 153 zoom: <?php echo $map_zoom; ?>, … … 220 224 <?php if ( bp_has_members('type=active&max='.$map_max_members.'&per_page='.$map_max_members.'') ) : ?> 221 225 <?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') ?>");} );} 223 227 catch(err){} 224 228 <?php endwhile; ?> … … 226 230 <?php if ( bp_has_members( 'type=online' ) ) : ?> 227 231 <?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') ?>");} );}232 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') ?>");} );} 229 233 catch(err){} 230 234 <?php endwhile; ?> -
bp-members-avatar-map/trunk/readme.txt
r439471 r439512 15 15 Add a Google map to display the members Location. Maps are displayed in the all members page. 16 16 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 registration17 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 18 18 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.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. 20 20 21 21 The admin settings page allows the map to be assigned dimensions plus various map rendering options . … … 23 23 Important: 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 24 24 create 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.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. 27 27 You Can set up an extended profile field named 'Info' to show the member info in the map - not a must... 28 28 == Installation == … … 31 31 * Configure the plugin at Dashboard > BuddyPress > MAM Settings. 32 32 * 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. 34 34 35 35 == Frequently Asked Questions ==
Note: See TracChangeset
for help on using the changeset viewer.