WordPress.org

Plugin Directory

Changeset 538966


Ignore:
Timestamp:
05/02/12 12:37:00 (5 years ago)
Author:
hnla
Message:

Add new feature map info popup, add new display region, correct friends loop rendering, tidy code.

Location:
bp-user-profile-map/trunk
Files:
2 added
2 deleted
8 edited

Legend:

Unmodified
Added
Removed
  • bp-user-profile-map/trunk

    • Property svn:ignore
      •  

        old new  
        11notes.txt 
         2readme-new.txt 
        23screenshot-2.png 
        3 screenshot-3.png 
  • bp-user-profile-map/trunk/admin/upm-admin.php

    r521033 r538966  
    136136    $upm_infowindow = get_option('upm_infowindow_values'); 
    137137    $upm_infowindow_options = get_option('upm_infowindow_options'); 
    138  // $upm_infowindow['upm_bp_regions'] == 'yes'; 
    139 //var_dump($upm_infowindow_options); 
     138// $upm_infowindow['upm_bp_regions'] == 'yes'; 
     139// var_dump($upm_infowindow_options); 
    140140    function checked_radio($num) { 
    141141   global $bp; 
     
    148148   return;  
    149149 } 
    150     
     150if( is_multisite() && function_exists( 'is_network_admin' ) ){ 
     151    $path_to = site_url() . "/wp-admin/network/admin.php"; 
     152    if(floatval(BP_VERSION) >= 1.6) { 
     153        $path_to_xprofile = site_url() . "/wp-admin/network/users.php"; 
     154    } 
     155} else { 
     156    $path_to = site_url() . "/wp-admin/admin.php"; 
     157    if(floatval(BP_VERSION) >= 1.6) { 
     158        $path_to_xprofile = site_url() . "/wp-admin/users.php";  
     159    } 
     160}  
    151161?> 
    152162    <div class="wrap"> 
     
    154164        <h2><?php _e( 'User Profile Map & single page maps configuration options', 'bp-upm' ) ?></h2> 
    155165         
    156  
    157166        <?php if ( isset($updated) ) : ?><?php echo "<div id='message' class='updated fade'><p>" . __( 'Settings Updated.', 'bp-upm' ) . "</p></div>" ?><?php endif; ?>      
    158167        <form action="<?php echo  $path_to  . '?page=bp-upm-settings' ?>" name="upm-settings-form" id="upm-settings-form" method="post"> 
    159168    
    160169         <p><?php _e('To use The BuddyPress profile or members list maps you must have first set up a new custom xprofile field to ask users for a location. This is important as the map script looks for this field and value to obtain map location data, you may name this field as you choose and then enter that name below.', 'bp_upm') ?></p> 
    161    <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_upm") ?></p> 
     170   <p><?php _e('If you have not yet set up a location field please visit the <a href="' . $path_to_xprofile . '?page=bp-profile-setup">Profile Field Setup</a> page.', 'bp_upm') ?></p> 
    162171   <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_upm') ?></p> 
    163          <p><?php _e('Styling of the map elements is kept to a minimum, you might need to add styles for your theme via a child theme style.css sheet.', 'bp_upm') ?></p> 
     172         <p><?php _e('Styling of the map elements is kept to a minimum, you might need to add styles for your theme via your primary styles, all elements of the maps are well tokenised so styling is fairly easy.', 'bp_upm') ?></p> 
    164173    
    165174         <h3><?php _e('Displaying Maps', 'bp-upm') ?></h3> 
     
    191200            <li><?php _e('Enable or disable built in styles - styles are minimal and users may need to further style their maps to fit their theme.', 'bp-upm') ?></li> 
    192201            <li><?php _e('Map title display the title <i>\'Location: your users location address\'</i> above each map. Uncheck the box to remove titles. Address parts are extracted and wrapped in spans for ease of styling.', 'bp-upm') ?></li> 
    193             <li><span style="font-style:italic;"><?php _e('Currently if you have members list maps and profile map in action there is an issue if viewing your friends list as it uses the members directory loop and map dimension will be the same for user profile as well as the looped friends rather than as you may have set as seperate sizes.', 'bp-upm'); ?></span></li> 
    194202            <li><?php _e('Map infoWindows are popups available when you click on the map marker. Currently these display the location address and a link to get map directions. Use the options to select on which maps you show these. Generally this option isn\'t required on maps displaying user locations but may be usefull on standalone maps via the function or shortcode methods. <b>N.B.</b> these info windows require a map of approx 300px width or greater to display correctly, they do not work well on small maps, currently if a map is set to display at less than \'300\' the infowindow popup will be disabled.</b>', 'bp-upm') ?></li> 
    195203            <!--<li><?php _e('', 'bp-upm') ?></li>--> 
  • bp-user-profile-map/trunk/languages

    • Property svn:ignore set to
      bp-upm.mo
      bp-upm.po
  • bp-user-profile-map/trunk/languages/bp-upm.pot

    r521254 r538966  
    33"Project-Id-Version: bp-user-profile-map\n" 
    44"Report-Msgid-Bugs-To: \n" 
    5 "POT-Creation-Date: 2012-03-20 08:43-0000\n" 
    6 "PO-Revision-Date: 2012-03-20 08:44-0000\n" 
    7 "Last-Translator: Hugo Ashmore <hugo@hugoashmore.co.uk>\n" 
     5"POT-Creation-Date: 2012-05-01 20:35-0000\n" 
     6"PO-Revision-Date: 2012-05-01 20:37-0000\n" 
     7"Last-Translator: Hugo - hnla <hugo.ashmore@gmail.com>\n" 
    88"Language-Team: team Hugo, hnla <hugo.ashmore@gmail.com>\n" 
    99"MIME-Version: 1.0\n" 
     
    225225#: e:\www\bp-repos\bp-user-profile-map/tags/1.3/upm-widget.php:36 
    226226#: e:\www\bp-repos\bp-user-profile-map/trunk/upm-widget.php:36 
     227#: e:\www\bp-repos\bp-user-profile-map/trunk/upm.php:485 
     228#: e:\www\bp-repos\bp-user-profile-map/trunk/upm.php:543 
     229#: e:\www\bp-repos\bp-user-profile-map/trunk/upm.php:627 
     230#: e:\www\bp-repos\bp-user-profile-map/trunk/upm.php:685 
    227231msgid "Location: " 
    228232msgstr "" 
     
    453457msgstr "" 
    454458 
    455 #: e:\www\bp-repos\bp-user-profile-map/trunk/admin/upm-admin.php:175 
     459#: e:\www\bp-repos\bp-user-profile-map/trunk/upm.php:335 
     460#: e:\www\bp-repos\bp-user-profile-map/trunk/upm.php:553 
     461#: e:\www\bp-repos\bp-user-profile-map/trunk/upm.php:676 
     462msgid "Get Directions" 
     463msgstr "" 
     464 
     465#: e:\www\bp-repos\bp-user-profile-map/trunk/admin/upm-admin.php:172 
     466msgid "Styling of the map elements is kept to a minimum, you might need to add styles for your theme via your primary styles, all elements of the maps are well tokenised so styling is fairly easy." 
     467msgstr "" 
     468 
     469#: e:\www\bp-repos\bp-user-profile-map/trunk/admin/upm-admin.php:184 
    456470msgid "('address string', 'width', 'height', 'unit', 'display address', 'zoom', 'show navigation', 'navigation size', 'navigation type')" 
    457471msgstr "" 
    458472 
    459 #: e:\www\bp-repos\bp-user-profile-map/trunk/admin/upm-admin.php:178 
     473#: e:\www\bp-repos\bp-user-profile-map/trunk/admin/upm-admin.php:187 
    460474msgid "<b>As a Shortcode</b>" 
    461475msgstr "" 
    462476 
    463 #: e:\www\bp-repos\bp-user-profile-map/trunk/admin/upm-admin.php:181 
     477#: e:\www\bp-repos\bp-user-profile-map/trunk/admin/upm-admin.php:190 
    464478#, php-format 
    465479msgid "Use all the values shown, ones left as empty i.e \"\" will simply default to pre set values. As with the function above leave both 'width' and 'unit' empty for a auto width, set unit to '%' for a percentage width. 'display_address' set to 'no' turns off the address as a title. Leave 'show_nav' and 'nav_size' empty for no navigation and nav size as google default adjusting according to map size dynamically. An empty map type control removes the map type, setting it as 'dropdown' forces the type control to dropdown setting 'horizontal' displays normal wide type bar." 
    466480msgstr "" 
    467481 
    468 #: e:\www\bp-repos\bp-user-profile-map/trunk/admin/upm-admin.php:183 
     482#: e:\www\bp-repos\bp-user-profile-map/trunk/admin/upm-admin.php:192 
    469483msgid "<b>On BuddyPress pages.</b>" 
    470484msgstr "" 
    471485 
    472 #: e:\www\bp-repos\bp-user-profile-map/trunk/admin/upm-admin.php:192 
     486#: e:\www\bp-repos\bp-user-profile-map/trunk/admin/upm-admin.php:201 
    473487msgid "Map title display the title <i>'Location: your users location address'</i> above each map. Uncheck the box to remove titles. Address parts are extracted and wrapped in spans for ease of styling." 
    474488msgstr "" 
    475489 
    476 #: e:\www\bp-repos\bp-user-profile-map/trunk/admin/upm-admin.php:194 
     490#: e:\www\bp-repos\bp-user-profile-map/trunk/admin/upm-admin.php:202 
    477491msgid "Map infoWindows are popups available when you click on the map marker. Currently these display the location address and a link to get map directions. Use the options to select on which maps you show these. Generally this option isn't required on maps displaying user locations but may be usefull on standalone maps via the function or shortcode methods. <b>N.B.</b> these info windows require a map of approx 300px width or greater to display correctly, they do not work well on small maps, currently if a map is set to display at less than '300' the infowindow popup will be disabled.</b>" 
    478492msgstr "" 
    479493 
    480 #: e:\www\bp-repos\bp-user-profile-map/trunk/admin/upm-admin.php:244 
     494#: e:\www\bp-repos\bp-user-profile-map/trunk/admin/upm-admin.php:252 
    481495msgid "Display titles for maps e.g 'Location: Buckingham Palace, London' for BP user account/members/groups screens" 
    482496msgstr "" 
    483497 
    484 #: e:\www\bp-repos\bp-user-profile-map/trunk/admin/upm-admin.php:252 
     498#: e:\www\bp-repos\bp-user-profile-map/trunk/admin/upm-admin.php:260 
    485499msgid "Enable map infowindow for member,group, user account screens" 
    486500msgstr "" 
    487501 
    488 #: e:\www\bp-repos\bp-user-profile-map/trunk/admin/upm-admin.php:260 
     502#: e:\www\bp-repos\bp-user-profile-map/trunk/admin/upm-admin.php:268 
    489503msgid "Enable map infowindow for shortcode maps" 
    490504msgstr "" 
    491505 
    492 #: e:\www\bp-repos\bp-user-profile-map/trunk/admin/upm-admin.php:268 
     506#: e:\www\bp-repos\bp-user-profile-map/trunk/admin/upm-admin.php:276 
    493507msgid "Enable map infowindow for function call maps" 
    494508msgstr "" 
    495509 
    496 #: e:\www\bp-repos\bp-user-profile-map/trunk/admin/upm-admin.php:274 
     510#: e:\www\bp-repos\bp-user-profile-map/trunk/admin/upm-admin.php:282 
    497511msgid "Info Window Options" 
    498512msgstr "" 
    499513 
    500 #: e:\www\bp-repos\bp-user-profile-map/trunk/admin/upm-admin.php:276 
     514#: e:\www\bp-repos\bp-user-profile-map/trunk/admin/upm-admin.php:284 
    501515msgid "<b>Link Text</b> - <i>Default 'Get Directions' if left blank</i>" 
    502516msgstr "" 
    503517 
    504 #: e:\www\bp-repos\bp-user-profile-map/trunk/admin/upm-admin.php:279 
     518#: e:\www\bp-repos\bp-user-profile-map/trunk/admin/upm-admin.php:287 
    505519msgid "Show Address" 
    506520msgstr "" 
    507521 
    508 #: e:\www\bp-repos\bp-user-profile-map/trunk/admin/upm-admin.php:487 
     522#: e:\www\bp-repos\bp-user-profile-map/trunk/admin/upm-admin.php:495 
    509523msgid "This option requires adding a function in the profile loop page \\members\\single\\profile-loop.php. Add <code>&lt;?php if( function_exists('upm_add_map_profile_field') ) : upm_add_map_profile_field(); endif ; ?></code> to the loop just before <code>'bp_the_profile_field_value()'</code> so it will look like <code>&lt;td class=\"data\">&lt;?php if( function_exists('upm_add_map_profile_field') ) : upm_add_map_profile_field(); endif ; ?><?php bp_the_profile_field_value(); ?></code>" 
    510524msgstr "" 
    511525 
    512 #: e:\www\bp-repos\bp-user-profile-map/trunk/admin/upm-admin.php:488 
     526#: e:\www\bp-repos\bp-user-profile-map/trunk/admin/upm-admin.php:496 
    513527msgid " Users profile screen <i>Displays the map on the public profile screen but in the profile entry for your 'location' field.</i>" 
    514528msgstr "" 
  • bp-user-profile-map/trunk/readme.txt

    r521266 r538966  
    44Requires at least: BuddyPress 1.5 
    55Tested up to: WP 3.3, BuddyPress 1.6 
    6 Stable tag: 1.3 
     6Stable tag: 1.4 
    77 
    88Add a map display of a members location to their BuddyPress profile. 
    99 
    1010== Description == 
    11 A simple user location  map plugin for BuddyPress sites. 
     11A simple user location  map plugin for BuddyPress sites combined with a separate function  and shortcode to enable standalone maps in posts/pages and embedded in template files. 
    1212 
    13 Add Google maps to display a members Location. Maps are displayed in the users profile / account page as well as member directory listing or group members listing if you enable them. 
     13Add Google maps to display a members Location. Maps are displayed in the users profile / account page as well as member directory listing or group members listing if enabled. 
    1414 
    15 A widget is available to allow finer control of map placement in custom widget areas that may exist. At present the widget works only for members profile areas but it would be possible to 
    16 code it so the map could display user location on other page views although it's not clear whether there is much point to this. 
     15A widget is available to allow finer control of map placement in custom widget areas that may exist. At present the widget works only for members profile areas and does not have the range of options available to the other maps.  
    1716 
    1817A nod to Andy Peatling for the inspiration of the original map php code. 
     
    2019This version  replaces the Google API with the V3 which benefits from not requiring an API key. 
    2120 
    22 The admin settings page allows the map to be assigned dimensions as well as basic control over the map overlay controls and to define which area of a page it should display in by selecting page action hooks. 
     21The admin settings page allows  maps to be assigned dimensions as well as basic options for map overlay controls and to define which area of a page maps should display in by selecting page action hooks. 
     22 
     23Maps can be set to display on both the BP members loop and the groups loop directories as well as the user account screens. 
     24 
     25A standalone function and shortcode are provided  to allow embedding single maps in templates or for calling from a post or page via shortcode. 
    2326 
    2427Important: You must have set up an extended profile field for members to use to add their location.  The location can be either set in the 'Base' profile group in which case it will appear on the signup page or you can 
    25 create a new group and have the field display on the members profile settings only. The map will only display once the member has added their location to this new field. 
     28create a new group and have the field display on the members profile settings only. The maps will only display once the member has added their location to this new field. 
    2629 
    2730== Installation == 
    2831 
    2932* Upload the directory '/bp-user-profile-map/' to your WP plugins directory and activate from the Dashboard of the main blog. 
    30 * Configure the plugin at Dashboard > BuddyPress > UPM Settings. 
     33* Configure the plugin at Dashboard > BuddyPress > UPM Setup or Dashboard > Settings > UPM Setup. 
    3134* Presently you can set map dimensions plus map overlay options and select BP screens such as 'Members', 'Groups' or 'Profile'. 
     35* A widget allows you to place a map in a widget aware region such as sidebar and displays the current displayed user 
     36* A function and shortcode provision allows maps in templates and rendered through posts/pages 
     37* To display a map in the members profile screen within the location field requires placing a specific function call in the template loop, instructions are in the settings page. 
    3238 
    3339 == Frequently Asked Questions == 
     
    3541 
    3642 == Upgrade Notice == 
    37     1.3 Major re-write. Provision to display maps on BP members directory & groups members screens. Various new options for map control & display including user set profile field name, turn off/on styles, increased flexibility for map dimensions. ability to embed  function call for templates & shortcodes for content body of pages/posts, REQUIRES: BP 1.5+ . 
     43    1.4 Adds new capability for gmap info window marker to display a 'get directions' link, adds new region for display, tidies code, corrects loop issues on bp friends screen. 
    3844    
    3945 == Screenshots == 
    40461. A view of a small map displayed floated right in the members public profile page. 
     472. Map showing the infowindow popup with 'get directions' link. 
     483. A view of a BuddyPress members list with small profile maps for each member 
    4149 
    4250== Changelog == 
     51** V 1.4 ** 29/04/12 
    4352 
     53- Add gmap infowindow map marker to display a 'Get Direction' link. 
     54- Add a new ability to display user profile map directly in a location profile field (requires adding function to loop). 
     55- Corrects friends screen in user account from showing account users address instead of individual ones. 
     56- Corrects or provides ability to size the user account map in member header independently of the friends list maps. 
     57- Adds various admin options for control of new functions 
     58- Adds additional class tokens for styling and span/incremented classes for address lines. 
     59- Add new args for standalone function and shortcode maps to turn on/off map address titles. 
     60- add missed text strings to translation files. 
     61- Moves settings screen to wp 'Settings' in accordance with BP 1.6 admin changes 
     62  
    4463** V 1.3 ** 16/01/12 
    45641.3 is a major re-write and requires BP 1.5 as a minimum it adds a number of new capabilities for Buddypress lists and for embedding map function in WP pages and additional option settings. 
  • bp-user-profile-map/trunk/upm-loader.php

    r521033 r538966  
    66Author URI: http://buddypress.org/developers/hnla 
    77Plugin URI: http://buddypress.org/groups/BP-User-Profile-Map 
    8 Version: 1.3.1 
    9  
     8Version: 1.4 
     9Network: true 
    1010License: CC-GNU-GPL http://creativecommons.org/licenses/GPL/2.0/ 
    11  
    1211*/ 
    1312 
  • bp-user-profile-map/trunk/upm.css

    r319727 r538966  
    22div.profile .map-display, 
    33div#item-header-content div.map-display { 
    4   float:right; 
    5   } 
     4 float:right; 
     5 } 
    66 
     7div.profile-map .profile-loop-field-Location {float: none;} 
     8         
    79div.profile, 
    810div.profile  div.bp-widget { 
    9   overflow:hidden; 
    10   } 
     11 overflow:hidden; 
     12 } 
    1113 
    1214div#item-header div.map-display { 
    13   margin-bottom:20px; 
    14   } 
     15 margin-bottom:20px; 
     16 } 
    1517 
    1618/* display map in /user-name/profile page public profile */ 
    1719 
    1820div.profile .map-display { 
    19   margin-left:20px; 
    20   } 
     21 margin-left:20px; 
     22 } 
    2123 
    2224/* display in header before header meta content */ 
    2325 
    2426div#item-header-content div.map-display { 
    25   margin:20px 0 20px 20px; 
    26   } 
     27 margin:20px 0 20px 20px; 
     28 } 
    2729/* display in header meta content */ 
    2830 
     
    3133 
    3234div#item-meta div.map-display { 
    33   margin:0 0 20px 20px; 
    34   } 
     35 margin:0 0 20px 20px; 
     36 } 
     37         
     38/* Widget map */ 
     39.widget_bp_upm_widget #map_canvas { 
     40    margin: 0 auto; 
     41    } 
  • bp-user-profile-map/trunk/upm.php

    r521052 r538966  
    33global $bp, $wp; 
    44 
     5define( 'BP_UPM_VERSION', '1.4' ); 
     6define( 'BP_UPM_ACTIVE', 1 ); 
    57/** 
    68* create url paths for multisite network admin screens or plain vanills admin screen 
    79* workaround for adding links to various other site admin pages e.g linking to 
    810* the BP extended profile screen. 
    9 * BP versionss later than 1.5 may use  
    1011*/ 
    1112if( is_multisite() && function_exists( 'is_network_admin' ) ){ 
    12 $path_to = site_url() . "/wp-admin/network/admin.php"; 
     13    $path_to = site_url() . "/wp-admin/network/admin.php"; 
    1314} else { 
    14 $path_to = site_url() . "/wp-admin/admin.php"; 
     15    $path_to = site_url() . "/wp-admin/admin.php"; 
    1516} 
    1617 
     
    2223require_once ( dirname( __FILE__ ) . '/upm-widget.php' ); 
    2324require_once ( dirname( __FILE__ ) . '/upm-classes.php' ); 
    24 require_once( dirname( __FILE__ ) . '/admin/upm-admin.php' ); 
     25require_once ( dirname( __FILE__ ) . '/admin/upm-admin.php' ); 
    2526 
    2627function upm_add_styles() { 
    27         $version = BP_UPM_DB_VERSION; 
    28          
     28        $version = BP_UPM_VERSION; 
    2929  $style_url = WP_PLUGIN_URL . '/bp-user-profile-map/upm.css'; 
    3030        $style_file = WP_PLUGIN_DIR . '/bp-user-profile-map/upm.css'; 
     31             
    3132            if (file_exists($style_file)) { 
    3233                // If BP parent is enqueueing then add in a dependency handle to array position 
    33                 if(function_exists('bp_dtheme_enqueue_styles') && wp_enqueue_style('bp-default-main') ){ 
    34                 wp_register_style('upm-style', $style_url, array('bp-default-main'), $version ); 
     34                if(function_exists('bp_dtheme_enqueue_styles') ){ 
     35                wp_enqueue_style('upm-style', $style_url, array('bp-default-main'), $version, 'all' ); 
    3536                }else{ 
    36                 wp_register_style('upm-style', $style_url, $version ); 
     37                wp_enqueue_style('upm-style', $style_url, $version, 'all' ); 
    3738                } 
    38                 wp_enqueue_style('upm-style'); 
     39                 
    3940            }     
    4041} 
     
    6667endif; 
    6768 
    68 ################## create the Admin dashboard settings ############ 
     69################## create the Admin dashboard settings ############### 
    6970/** create WP admin settings ***/ 
    7071function bp_upm_menu() { 
    7172    global $bp; 
    7273 
    73   if ( true == $bp->loggedin_user->is_super_admin ): 
     74 if ( true == $bp->loggedin_user->is_super_admin ): 
    7475   $user_is_admin = true; 
    75   elseif (true == $bp->loggedin_user->is_site_admin ): 
     76 elseif (true == $bp->loggedin_user->is_site_admin ): 
    7677   $user_is_admin = true; 
    77   else: 
     78 else: 
    7879   $user_is_admin = false; 
    79   endif; 
     80 endif; 
    8081     
    8182    if ( !$user_is_admin ) 
    8283        return false; 
    83  
     84    // try and place the settings page under correct parent due to BP's menu changes V 1.6 
     85    if(floatval(BP_VERSION) >= 1.6) { 
     86    add_submenu_page( 'options-general.php', __( 'UPM setup', 'bp-upm' ), __( 'UPM Setup', 'bp-upm' ), 'manage_options', 'bp-upm-settings', 'bp_upm_admin' ); 
     87    }else{ 
    8488    add_submenu_page( 'bp-general-settings', __( 'UPM setup', 'bp-upm' ), __( 'UPM Setup', 'bp-upm' ), 'manage_options', 'bp-upm-settings', 'bp_upm_admin' ); 
    85 } 
     89    } 
     90} 
     91 
    8692//bp versions later than 1.2.9 can use bp_core_activation_hook() 
    8793if(function_exists('bp_core_admin_hook') ) { 
     
    8995}else{ 
    9096    if( is_multisite() && function_exists( 'is_network_admin' ) ): 
    91         //add_action( 'network_admin_menu', 'bp_upm_menu' ); 
     97        add_action( 'network_admin_menu', 'bp_upm_menu' ); 
    9298    else: 
    93         //add_action( 'admin_menu', 'bp_upm_menu' ); 
     99        add_action( 'admin_menu', 'bp_upm_menu' ); 
    94100    endif; 
    95101} 
     
    118124 
    119125    // Set our member id's. 
    120     if( bp_is_members_component() ) { 
     126    // This isn't ideal later on we need to re-check $mem_id  
     127    // if we are on an acount screen to see if it's empty for first 
     128    // map loop i.e the profile members map and then assign it  bp_is_displayed_user again 
     129    if( bp_is_members_component() || bp_is_user_friends() ) { 
    121130        $mem_id = $members_template->member->id; 
    122     }elseif( bp_is_group_members()) { 
     131    } elseif ( bp_is_group_members()) { 
    123132        $mem_id = bp_get_group_member_id(); 
    124     }else { 
     133    } else { 
    125134        $mem_id = bp_displayed_user_id(); 
    126135    } 
     
    221230  
    222231    // create a display friendly address format 
    223             $format_address = explode(',', $location); 
    224             $i = '1'; // we need unique incremetal classes for address lines   
    225             foreach($format_address as  $value) {  
     232        $format_address = explode(',', $location); 
     233        $i = '1'; // we need unique incremetal classes for address lines   
     234        foreach($format_address as  $value) {  
    226235            $formatted_address .= '<span class="info-address-line address-line-' . $i++ . '">' . $value . '</span> '; 
    227             }            
     236        }            
    228237    //print_r($formatted_address); 
    229238                     
    230239 $map_navigation = get_option( 'upm_navigation_display' ); 
    231240 $navigation_size = get_option( 'upm_navigation_size' ); 
    232     $show_map_type_control = get_option( 'upm_show_map_type_control' ) ; 
    233  $map_type_control_style = get_option( 'upm_map_type_control_style' ) ;  
     241    $show_map_type_control = get_option( 'upm_show_map_type_control' ); 
     242 $map_type_control_style = get_option( 'upm_map_type_control_style' );  
    234243    //var_dump($where); 
    235  ?> 
    236  
     244  
     245    // Bit of a hack to check if we're on friends screen and add unique id to main profile avatar loop. 
     246    // As my earlier settings removed  the user_id appended to map canvas id all dimensions assume the friends/members loop sizes 
     247    // these 7 lines attempts to work around that  in an inelegant fashion. 
     248    ( bp_is_user_friends() && empty($mem_id) )? $mem_id = bp_displayed_user_id(). '_fr' : $mem_id = $mem_id ; 
     249     
     250    // likewise more hackishness need to reset the map canvas dimensions to stop friends loop overriding profile map dimensions. 
     251    if (bp_is_user_friends() && bp_displayed_user_id(). '_fr' == $mem_id ) : 
     252    // here we go re-do canvas widths - must be a better way? 
     253        $map_width = get_option( 'upm_width' ); 
     254        if( empty($map_width) ){ 
     255            $map_width = false; 
     256        } 
     257        $map_height = get_option( 'upm_height' ); 
     258    endif;  // end re-do map widths 
     259    ?> 
    237260  <div class="<?php echo $map_tokens; ?><?php if(isset($mem_id)): ?> user-<?php echo $mem_id; ?>-location<?php endif; ?>"> 
    238261   <?php if( get_option('upm_display_title') == 'yes'): ?> 
     
    242265        <script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script> 
    243266  <script type="text/javascript"> 
     267        <!--//--><![CDATA[//><!-- 
    244268    var directionsDisplay; 
    245269  var directionsService = new google.maps.DirectionsService();      
     
    310334                    var linkText = '<?php echo $upm_infowindow_options['upm_anchor_text'] ?>'; 
    311335                    <?php }else{ ?> 
    312                     var linkText = 'Get Directions'; 
     336                    var linkText = '<?php _e('Get Directions', 'bp-upm')?>'; 
    313337                    <?php } ?> 
    314338                    var html3 = '</p><p class="upm-directions-link"><a target="_blank" href="http://maps.google.com/maps?saddr=&daddr=' + address + '" >' + linkText + '</a></p>'; 
     
    334358       
    335359  jQuery(document).ready( function() { initialize<?php echo '_' . $mem_id ?>(); showAddress<?php echo '_' . $mem_id ?>('<?php echo $location ?>'); } ); 
    336  
     360        //--><!]]> 
    337361  </script> 
     362         
    338363  <div id="map_canvas<?php echo '_' . $mem_id ?>" class="upm-bp-maps" style="<?php if($map_width) : echo 'width: ' . $map_width . $upm_unit . ';'; endif; ?> height: <?php echo $map_height; ?>px;"></div> 
    339364   
     
    366391                    if ( bp_get_the_profile_field_name() == $upm_profile_field){ 
    367392                    //$grab_xprofile_data = $grab_xprofile_data . upm_gmap_display(); 
    368      
    369393                        return upm_gmap_display(); 
    370                     }else { 
    371                         return false; 
     394                    }else {  
     395                        return false;                        
    372396                    } 
    373397                } 
    374398            }            
    375399        } 
    376          
     400     
    377401  if (  $members_dir_listing == 'yes' && $where_members_dir ){ 
    378402    if($where_members_dir == '6')  
     
    460484  <div class="single-map-page"> 
    461485        <?php if('yes' == $upm_address_display ){ ?>     
    462             <p class="single-map-title"><span class="address-prefix">Location: </span><?php echo $formatted_address ?></p> 
     486            <p class="single-map-title"><span class="address-prefix"><?php _e('Location: ', 'bp-upm') ?> </span><?php echo $formatted_address ?></p> 
    463487        <?php } ?> 
    464488  <script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script> 
    465489  <script type="text/javascript"> 
    466        
     490        <!--//--><![CDATA[//><!--       
    467491  var geocoder; 
    468492  var map; 
     
    518542                    <?php if($upm_single_width >= '300'){ ?> 
    519543                    <?php if($upm_infowindow_options['upm_display_address'] == 'yes') { ?> 
    520                     var html1 = '<p class="upm-address-fields"><span class="upm-address-title">Location: </span><br />';  
     544                    var html1 = '<p class="upm-address-fields"><span class="upm-address-title"><?php _e('Location: ', 'bp-upm') ?> </span><br />';  
    521545                    var html2 =   '<?php echo $formatted_address ?>' ;               
    522546                    //alert(html2); 
     
    528552                    var linkText = '<?php echo $upm_infowindow_options['upm_anchor_text'] ?>'; 
    529553                    <?php }else{ ?> 
    530                     var linkText = 'Get Directions'; 
     554                    var linkText = '<?php _e('Get Directions', 'bp-upm')?>'; 
    531555                    <?php } ?>                   
    532556                    var html3 = '</p><p class="upm-directions-link"><a target="_blank" href="http://maps.google.com/maps?saddr=&daddr=' + address + '" >' + linkText + '</a></p>'; 
     
    552576       
    553577  jQuery(document).ready( function() { initialize(); showAddress('<?php echo $upm_single_address ?>'); } ); 
    554  
     578        //--><!]]> 
    555579  </script> 
    556580 
     
    602626  <div class="shortcode-single-map-page"> 
    603627            <?php if('yes' == $upm_display_address) { ?> 
    604             <p class="sortcode-map-title"><span class="address-prefix">Location: </span><?php echo $formatted_address ?></p> 
     628            <p class="sortcode-map-title"><span class="address-prefix"><?php _e('Location: ', 'bp-upm') ?></span><?php echo $formatted_address ?></p> 
    605629            <?php } ?> 
    606630  <script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script> 
    607631  <script type="text/javascript"> 
    608        
     632        <!--//--><![CDATA[//><!--       
    609633  var geocoder; 
    610634  var map; 
     
    651675                            <?php if($upm_infowindow['upm_shortcode'] == 'yes'){ ?> 
    652676                            <?php if($upm_single_width >= '300'){ ?> 
    653                             title: 'Get Directions', 
     677                            title: '<?php _e('Get Directions', 'bp-upm')?>', 
    654678                            <?php }  
    655679                            }?> 
     
    660684                    <?php if($upm_single_width >= '300'){ ?> 
    661685                    <?php if($upm_infowindow_options['upm_display_address'] == 'yes') { ?> 
    662                     var html1 = '<p class="upm-address-fields"><span class="upm-address-title">Location: </span><br />'; 
     686                    var html1 = '<p class="upm-address-fields"><span class="upm-address-title"><?php _e('Location: ', 'bp-upm') ?> </span><br />'; 
    663687                    var html2 =   '<?php echo $formatted_address ?>';            
    664688                    //alert(html2); 
     
    694718       
    695719  jQuery(document).ready( function() { initialize(); showAddress(' <?php echo $upm_address; ?> '); } ); 
    696  
     720        //--><!]]> 
    697721  </script> 
    698722 
Note: See TracChangeset for help on using the changeset viewer.