WordPress.org

Plugin Directory

Changeset 762862


Ignore:
Timestamp:
08/27/13 08:53:28 (4 years ago)
Author:
hnla
Message:

Minor updates for style loading

Location:
bp-user-profile-map/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • bp-user-profile-map/trunk/readme.txt

    r590124 r762862  
    33Tags: buddypress, profiles, map, profile map, location 
    44Requires at least: BuddyPress 1.5 
    5 Tested up to: WP 3.3, BuddyPress 1.6 
    6 Stable tag: 1.4.1 
     5Tested up to: WP 3.6, BuddyPress 1.8.1 
     6Stable tag: 1.4.2 
    77 
    88Add a map display of a members location to their BuddyPress profile. 
     
    4141 
    4242 == Upgrade Notice == 
    43     1.4.1 Revises options settings screen, moves options screen out of BP altogether to WP settings, 'options-general' for single WP or 'settings' for network admin MS. This corrects issue with options page not displaying correctly on WP MS 
     43    1.4.2 Removes check for BP default theme for stylesheet loading order, returning true even if BP theme compatibility layer in use. Minor updates to widget - remove title/markup if no user location. 
    4444    
    4545 == Screenshots == 
     
    4949 
    5050== Changelog == 
     51** V 1.4.2 ** 27/08/13 
     52 
     53- Minor adjustments for BP theme compatibility - removing stylesheet enqueueing check for bp default theme as this returns true & styles with a loading based on bp-default stylesheet fails. 
     54- Remove unwanted functions and commented out code. 
     55- Update profile widget, remove widget markup if no user location set. 
     56 
    5157** V 1.4.1 ** 29/07/12 
    5258 
  • bp-user-profile-map/trunk/upm-loader.php

    r578804 r762862  
    66Author URI: http://buddypress.org/developers/hnla 
    77Plugin URI: http://buddypress.org/groups/BP-User-Profile-Map 
    8 Version: 1.4.1 
     8Version: 1.4.2 
    99Network: true 
    1010License: CC-GNU-GPL http://creativecommons.org/licenses/GPL/2.0/ 
  • bp-user-profile-map/trunk/upm-widget.php

    r493612 r762862  
    11<?php 
     2/** 
     3* Displays a user map for a member when viewing user account/profile screens 
     4* @package bp-user-profile-map 
     5*  
     6*/ 
     7    add_action('widgets_init', create_function('', 'return register_widget("BP_upm_Widget");') ); 
    28 
    3  
    4 //function bp_register_upm_widget() { 
    5     add_action('widgets_init', create_function('', 'return register_widget("BP_upm_Widget");') ); 
    6 //} 
    7 //add_action( 'plugins_loaded', 'bp_register_upm_widget' ); 
    89 
    910class BP_upm_Widget extends WP_Widget { 
    1011 
    11     function bp_upm_widget() { 
    12     
    13         parent::WP_Widget( false, $name = __( 'UPM User Location', 'buddypress' ) ); 
     12    function bp_upm_widget() {    
     13        parent::WP_Widget( false, $name = __( 'UPM User Location', 'upm' ) ); 
    1414    } 
    15  
     15         
    1616    function widget( $args, $instance ) { 
    1717        global $bp, $current_user, $wpdb; 
    18    if (  is_user_logged_in() && bp_displayed_user_id() ): 
     18         
     19        $field = get_option('upm_user_profile_field'); 
     20        $location = bp_get_profile_field_data( 'field=' . $field . '&user_id=' . bp_displayed_user_id() );   
     21         
     22        if (  is_user_logged_in() && bp_displayed_user_id() ): 
     23         
    1924        extract( $args ); 
    20     $title = apply_filters( 'widget_title', empty($instance['upm_wdg_title']) ? $widget_name : $instance['upm_wdg_title'], $instance ); 
    21         echo $before_widget; 
    22         echo $before_title . 
     25  $title = apply_filters( 'widget_title', empty($instance['upm_wdg_title']) ? $widget_name : $instance['upm_wdg_title'], $instance ); 
     26         
     27        if( $location ) : 
     28         
     29            echo $before_widget; 
     30            echo $before_title . 
    2331             $title . 
    24           $after_title; ?> 
    25  
    26     <?php   
    27  
     32          $after_title; 
     33             
    2834  /**  
    2935  * Presently Widget displays only for BP user profile account screens 
    3036  */ 
    31   
    32   $field = get_option('upm_user_profile_field'); 
    33         if ($location = bp_get_profile_field_data( 'field=' . $field . '&user_id=' . bp_displayed_user_id())): ?> 
    34   <div class="map-display user-id-<?php echo bp_displayed_user_id()?>"> 
    35   <?php if( get_option('upm_display_title') == 'yes'): ?> 
     37 
     38        ?>  
     39          
     40        <div class="map-display user-id-<?php echo bp_displayed_user_id()?>"> 
     41   
     42        <?php if( get_option('upm_display_title') == 'yes'): ?> 
    3643        <p class="map-title"><?php echo _e('Location: ', 'bp-upm') ?> <?php echo $location ?> <?php if ( bp_is_my_profile() ) : ?>. <a href="<?php echo bp_loggedin_user_domain() .'profile/edit/' ?>">Edit</a><?php endif; ?></p> 
    3744  <?php endif; ?> 
     45         
    3846        <script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script> 
    3947  <script type="text/javascript"> 
     
    7179  <div id="map_canvas" style="<?php if( !empty($instance['upm_wdg_width']) ) { ?>width: <?php echo $instance['upm_wdg_width'];?>px;<?php } ?><?php if( !empty($instance['upm_wdg_height']) ) { ?> height: <?php echo $instance['upm_wdg_height']; ?>px;<?php } ?>"></div> 
    7280  </div> 
    73   <?php endif; 
    74      
    75     
    76     
    77     
     81  <?php     
    7882    /*** 
    7983  * end map markup generation 
     
    8185  ?> 
    8286    
    83     <?php echo $after_widget; ?> 
    84     <?php 
    85   endif; 
     87    <?php  
     88        echo $after_widget;  
     89     
     90        endif; // if $location 
     91         
     92        endif; // if logged in  / displayed_user 
    8693    } 
    8794 
  • bp-user-profile-map/trunk/upm.php

    r578804 r762862  
    33global $bp, $wp; 
    44 
    5 define( 'BP_UPM_VERSION', '1.4.1' ); 
     5define( 'BP_UPM_VERSION', '1.4.2' ); 
    66define( 'BP_UPM_ACTIVE', 1 ); 
    77/** 
     
    3030             
    3131            if (file_exists($style_file)) { 
    32                 // If BP parent is enqueueing then add in a dependency handle to array position 
    33                 if(function_exists('bp_dtheme_enqueue_styles') ){ 
    34                 wp_enqueue_style('upm-style', $style_url, array('bp-default-main'), $version, 'all' ); 
    35                 }else{ 
    36                 wp_enqueue_style('upm-style', $style_url, $version, 'all' ); 
    37                 } 
    38                  
     32                wp_enqueue_style('upm-style', $style_url, $version, 'all' );             
    3933            }     
    4034} 
     
    4337} 
    4438 
    45 function upm_setup_globals() { 
    46     global $bp, $wpdb; 
    47  
    48     /* For internal identification */ 
    49     $bp->upm->id = 'upm'; 
    50   
    51     //$bp->upm->format_notification_function = 'bp_upm_format_notifications'; 
    52     //$bp->upm->slug = 'user-location'; 
    53  
    54     /* Register this in the active components array */ 
    55     //$bp->active_components[$bp->upm->slug] = $bp->upm->id; 
    56 } 
    57  
    58 //add_action( 'bp_setup_globals', 'bp_upm_setup_globals' ); 
    59   
    60  /* network_admin_menu */ 
    61 add_action( 'wp', 'upm_setup_globals', 2 ); 
    62 if( is_multisite() && function_exists( 'is_network_admin' ) ): 
    63 add_action( 'network_admin_menu', 'upm_setup_globals', 2 ); 
    64 else: 
    65 add_action( 'admin_menu', 'upm_setup_globals', 2 ); 
    66 endif; 
    6739 
    6840################## create the Admin dashboard settings ############### 
     
    9365} 
    9466 
    95 //bp versions later than 1.2.9 can use bp_core_activation_hook() 
    96 // if it workked that is! ? removed as causing issues 
    97 //if(function_exists('bp_core_admin_hook') ) { 
    98 //  add_action( 'bp_core_admin_hook', 'bp_upm_menu' ); 
    99 //}else{ 
    10067    if( is_multisite() && function_exists( 'is_network_admin' ) ): 
    10168        add_action( 'network_admin_menu', 'bp_upm_menu' ); 
     
    10370        add_action( 'admin_menu', 'bp_upm_menu' ); 
    10471    endif; 
    105 //} 
     72 
    10673 
    10774// Fetch values for map page location &  directory/screen displays. 
     
    392359                    $upm_profile_field = get_option('upm_user_profile_field'); 
    393360 
    394                     //$grab_xprofile_data   = $field->data->value = bp_unserialize_profile_field( $field->data->value) ; 
    395361                    if ( bp_get_the_profile_field_name() == $upm_profile_field){ 
    396                     //$grab_xprofile_data = $grab_xprofile_data . upm_gmap_display(); 
     362                         
    397363                        return upm_gmap_display(); 
     364                     
    398365                    }else {  
     366                         
    399367                        return false;                        
    400368                    } 
    401                 } 
    402             }            
    403         } 
     369                 
     370                }// close function 
     371             
     372            }   // close if $where       
     373         
     374        } // close if accountscreen users 
    404375     
    405376  if (  $members_dir_listing == 'yes' && $where_members_dir ){ 
Note: See TracChangeset for help on using the changeset viewer.