From 6537eafc6f3100356b112d1785d88af646541e60 Mon Sep 17 00:00:00 2001 From: NomadDevs Date: Tue, 23 Jun 2015 15:03:26 +0100 Subject: [PATCH] bitbucket changes ported --- bp-compliments-core.php | 3 + bp-compliments.php | 24 ++- change_log.txt | 6 + includes/bp-compliments-actions.php | 2 +- includes/bp-compliments-forms.php | 13 +- includes/bp-compliments-notifications.php | 200 ++++++++++++++++++++++ includes/bp-compliments-taxonomies.php | 33 ++-- js/admin.js | 84 ++++----- readme.txt | 4 +- 9 files changed, 302 insertions(+), 67 deletions(-) create mode 100644 change_log.txt create mode 100644 includes/bp-compliments-notifications.php diff --git a/bp-compliments-core.php b/bp-compliments-core.php index 867d06a..312af53 100644 --- a/bp-compliments-core.php +++ b/bp-compliments-core.php @@ -40,6 +40,7 @@ public function includes( $includes = array() ) { require( $this->path . '/bp-compliments-screens.php' ); require( $this->path . '/bp-compliments-templatetags.php' ); require( $this->path . '/bp-compliments-actions.php' ); + require( $this->path . '/bp-compliments-notifications.php' ); require( $this->path . '/bp-compliments-forms.php' ); } @@ -56,6 +57,7 @@ public function setup_globals( $args = array() ) { // Set up the $globals array $globals = array( + 'notification_callback' => 'bp_compliments_format_notifications', 'global_tables' => array( 'table_name' => BP_COMPLIMENTS_TABLE, ) @@ -101,6 +103,7 @@ public function setup_hooks() { public function setup_nav( $main_nav = array(), $sub_nav = array() ) { global $bp; + do_action( 'bp_compliments_before_setup_nav' ); // Need to change the user ID, so if we're not on a member page, $counts variable is still calculated $user_id = bp_is_user() ? bp_displayed_user_id() : bp_loggedin_user_id(); $counts = bp_compliments_total_counts( array( 'user_id' => $user_id ) ); diff --git a/bp-compliments.php b/bp-compliments.php index f93cf4b..75f6363 100644 --- a/bp-compliments.php +++ b/bp-compliments.php @@ -3,7 +3,7 @@ Plugin Name: BuddyPress Compliments Plugin URI: http://wpgeodirectory.com/ Description: Compliments module for BuddyPress. -Version: 0.0.1 +Version: 0.1 Author: GeoDirectory Author URI: http://wpgeodirectory.com */ @@ -69,3 +69,25 @@ function bp_compliments_activate() { } register_activation_hook( __FILE__, 'bp_compliments_activate' ); +/** + * Custom text domain loader. + * + * Checks WP_LANG_DIR for the .mo file first, then the plugin's language folder. + * Allows for a custom language file other than those packaged with the plugin. + * + * @uses load_textdomain() Loads a .mo file into WP + */ +function bp_compliments_localization() { + $mo_file = sprintf( 'bp-compliments-%s.mo', get_locale() ); + $mo_file_global = trailingslashit( WP_LANG_DIR ) . $mo_file; + $mo_file_local = plugin_dir_path( __FILE__ ) . 'languages/' . $mo_file; + + if ( is_readable( $mo_file_global ) ) + return load_textdomain( 'bp-compliments', $mo_file_global ); + elseif ( is_readable( $mo_file_local ) ) + return load_textdomain( 'bp-compliments', $mo_file_local ); + else + return false; +} +add_action( 'plugins_loaded', 'bp_compliments_localization' ); + diff --git a/change_log.txt b/change_log.txt new file mode 100644 index 0000000..17d43cb --- /dev/null +++ b/change_log.txt @@ -0,0 +1,6 @@ +v0.0.2 +BP compliments now supports notification component - ADDED +Send compliment modal form z-index bug - FIXED +Compliment Icon upload form uses latest media uploader - CHANGED + + diff --git a/includes/bp-compliments-actions.php b/includes/bp-compliments-actions.php index 6529e50..c385b17 100644 --- a/includes/bp-compliments-actions.php +++ b/includes/bp-compliments-actions.php @@ -29,7 +29,7 @@ function handle_compliments_form_data() { } if ( ! bp_compliments_start_compliment($args)) { - bp_core_add_message( sprintf( __( 'There was a problem when trying to send compliment to %s, please contact administrator.', 'bp-follow' ), bp_get_displayed_user_fullname() ), 'error' ); + bp_core_add_message( sprintf( __( 'There was a problem when trying to send compliment to %s, please contact administrator.', BP_COMP_TEXTDOMAIN ), bp_get_displayed_user_fullname() ), 'error' ); } else { bp_core_add_message( sprintf( __( 'Your compliment sent to %s.', BP_COMP_TEXTDOMAIN ), bp_get_displayed_user_fullname() ) ); } diff --git a/includes/bp-compliments-forms.php b/includes/bp-compliments-forms.php index 5987437..19a9e61 100644 --- a/includes/bp-compliments-forms.php +++ b/includes/bp-compliments-forms.php @@ -73,19 +73,18 @@ function bp_compliments_modal_ajax() wp_die(); } -function bp_compliments_modal_shadow(){ ?> - - +