Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge from master #14

Merged
merged 7 commits into from
Mar 14, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 16 additions & 12 deletions bp-compliments.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,28 @@
/**
* This is the main BuddyPress Compliments plugin file, here we declare and call the important stuff
*
* @since 0.0.1
* @package BuddyPress_Compliments
* @package BuddyPress_Compliments
* @copyright 2016 AyeCode Ltd
* @license GPL-2.0+
*
* @wordpress-plugin
* Plugin Name: BuddyPress Compliments
* Plugin URI: http://wpgeodirectory.com/
* Description: Compliments module for BuddyPress.
* Version: 1.0.5
* Author: GeoDirectory
* Author URI: http://wpgeodirectory.com
* Text Domain: bp-compliments
* Domain Path: /languages
* Requires at least: 3.1
* Tested up to: 4.4
*/

/*
Plugin Name: BuddyPress Compliments
Plugin URI: http://wpgeodirectory.com/
Description: Compliments module for BuddyPress.
Version: 1.0.4
Author: GeoDirectory
Author URI: http://wpgeodirectory.com
*/

// Exit if accessed directly
if ( !defined( 'ABSPATH' ) ) exit;

// Define the plugin version.
define( 'BP_COMPLIMENTS_VER', '1.0.4' );
define( 'BP_COMPLIMENTS_VER', '1.0.5' );

/**
* BuddyPress compliments text domain.
Expand Down
4 changes: 4 additions & 0 deletions change_log.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
v1.0.5
Email notifications not working - FIXED
Compliment line break and clickable support removed. Use filter to override - CHANGED

v1.0.4
Compliment user settings page - ADDED
Linebreaks are removed on compliment messages - FIXED
Expand Down
18 changes: 4 additions & 14 deletions includes/bp-compliments-notifications.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function bp_compliments_format_notifications( $action, $item_id, $secondary_item
$text = false;

if ( 1 == $total_items ) {
$text = sprintf( __( '%s has sent you a %s', 'bp-compliments' ), bp_core_get_user_displayname( $item_id ), strtolower(BP_COMP_SINGULAR_NAME) );
$text = sprintf( __( '%s has sent you a %s', 'bp-compliments' ), bp_core_get_user_displayname( $item_id ), BP_COMP_SINGULAR_NAME );
$link = bp_core_get_user_domain( $bp->loggedin_user->id ) .BP_COMPLIMENTS_SLUG. '/?bpc_read=true&bpc_sender_id='.$item_id;
}
break;
Expand Down Expand Up @@ -151,10 +151,11 @@ function bp_compliments_notifications_add_on_compliment( BP_Compliments $complim
* @since 0.0.2
* @package BuddyPress_Compliments
*
* @param array $args Sender and Receiver user ID.
* @return bool
*/
function bp_compliments_new_compliment_email_notification() {
$args = '';
function bp_compliments_new_compliment_email_notification($args = array()) {
// $args = '';

$defaults = array(
'receiver_id' => bp_displayed_user_id(),
Expand All @@ -166,17 +167,6 @@ function bp_compliments_new_compliment_email_notification() {
if ( 'no' == bp_get_user_meta( (int) $r['receiver_id'], 'notification_on_compliments', true ) )
return false;

// Check to see if this receiver has already been notified of this sender before
$has_notified = bp_get_user_meta( $r['sender_id'], 'bp_compliments_has_notified', true );

// Already notified so don't send another email
if ( in_array( $r['receiver_id'], (array) $has_notified ) )
return false;

// Not been notified before, update usermeta and continue to mail
$has_notified[] = $r['receiver_id'];
bp_update_user_meta( $r['sender_id'], 'bp_compliments_has_notified', $has_notified );

$sender_name = bp_core_get_user_displayname( $r['sender_id'] );
$compliment_link = bp_core_get_user_domain( $r['receiver_id'] ) .BP_COMPLIMENTS_SLUG. '/?bpc_read=true&bpc_sender_id='.$r['sender_id'];

Expand Down
8 changes: 4 additions & 4 deletions includes/bp-compliments-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ function bp_compliments_settings_page() {
<td><input type="text" class="widefat" name="bp_compliment_slug" value="<?php echo BP_COMPLIMENTS_SLUG; ?>" /></td>
</tr>
<tr valign="top">
<th scope="row"><?php echo sprintf( __( 'Who can see other members %s page?', 'bp-compliments' ), strtolower(BP_COMP_SINGULAR_NAME) ); ?></th>
<th scope="row"><?php echo sprintf( __( 'Who can see other members %s page?', 'bp-compliments' ), BP_COMP_SINGULAR_NAME ); ?></th>
<td>
<select id="bp_compliment_can_see_others_comp" name="bp_compliment_can_see_others_comp">
<option value="yes" <?php selected( $bp_compliment_can_see_others_comp, 'yes' ); ?>><?php echo __( 'Anybody', 'bp-compliments' ); ?></option>
Expand All @@ -83,7 +83,7 @@ function bp_compliments_settings_page() {
</td>
</tr>
<tr valign="top">
<th scope="row"><?php echo sprintf( __( 'Members can delete %s received?', 'bp-compliments' ), strtolower(BP_COMP_PLURAL_NAME) ); ?></th>
<th scope="row"><?php echo sprintf( __( 'Members can delete %s received?', 'bp-compliments' ), BP_COMP_PLURAL_NAME ); ?></th>
<td>
<select id="bp_compliment_can_delete" name="bp_compliment_can_delete">
<option value="yes" <?php selected( $bp_compliment_can_delete, 'yes' ); ?>><?php echo __( 'Yes', 'bp-compliments' ); ?></option>
Expand All @@ -92,7 +92,7 @@ function bp_compliments_settings_page() {
</td>
</tr>
<tr valign="top">
<th scope="row"><?php echo sprintf( __( 'Enable activity component for %s ?', 'bp-compliments' ), strtolower(BP_COMP_PLURAL_NAME) ); ?></th>
<th scope="row"><?php echo sprintf( __( 'Enable activity component for %s ?', 'bp-compliments' ), BP_COMP_PLURAL_NAME ); ?></th>
<td>
<select id="bp_compliment_enable_activity" name="bp_compliment_enable_activity">
<option value="yes" <?php selected( $bp_compliment_enable_activity, 'yes' ); ?>><?php echo __( 'Yes', 'bp-compliments' ); ?></option>
Expand All @@ -101,7 +101,7 @@ function bp_compliments_settings_page() {
</td>
</tr>
<tr valign="top">
<th scope="row"><?php echo sprintf( __( 'Enable notification component for %s ?', 'bp-compliments' ), strtolower(BP_COMP_PLURAL_NAME) ); ?></th>
<th scope="row"><?php echo sprintf( __( 'Enable notification component for %s ?', 'bp-compliments' ), BP_COMP_PLURAL_NAME ); ?></th>
<td>
<select id="bp_compliment_enable_notifications" name="bp_compliment_enable_notifications">
<option value="yes" <?php selected( $bp_compliment_enable_notifications, 'yes' ); ?>><?php echo __( 'Yes', 'bp-compliments' ); ?></option>
Expand Down
3 changes: 2 additions & 1 deletion includes/templates/buddypress/members/single/compliments.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ class='preview-upload'/>
</div>
</div>
<?php
echo make_clickable(apply_filters('the_content', $comp->message)); ?>
$comp_message = apply_filters('bp_comp_message', $comp->message);
echo $comp_message; ?>
</div>
</div>
</li>
Expand Down
Binary file modified languages/bp-compliments-en_US.mo
Binary file not shown.
28 changes: 14 additions & 14 deletions languages/bp-compliments-en_US.po
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
msgid ""
msgstr ""
"Project-Id-Version: BuddyPress Compliments 1.0.3\n"
"POT-Creation-Date: 2016-02-25 14:58-0000\n"
"PO-Revision-Date: 2016-02-25 14:58-0000\n"
"Project-Id-Version: BuddyPress Compliments 1.0.5\n"
"POT-Creation-Date: 2016-03-11 11:11-0000\n"
"PO-Revision-Date: 2016-03-11 11:11-0000\n"
"Last-Translator: \n"
"Language-Team: GeoDirectory <[email protected]>\n"
"Language: en_US\n"
Expand Down Expand Up @@ -99,20 +99,20 @@ msgid "No compliments found."
msgstr ""

#: includes/bp-compliments-notifications.php:49
#: includes/bp-compliments-notifications.php:188
#: includes/bp-compliments-notifications.php:178
#, php-format
msgid "%s has sent you a %s"
msgstr ""

#: includes/bp-compliments-notifications.php:191
#: includes/bp-compliments-notifications.php:181
#, php-format
msgid ""
"%s has sent you a %s.\n"
"\n"
"To view %s's %s: %s"
msgstr ""

#: includes/bp-compliments-notifications.php:198
#: includes/bp-compliments-notifications.php:188
#, php-format
msgid ""
"\n"
Expand All @@ -122,21 +122,21 @@ msgid ""
"%s"
msgstr ""

#: includes/bp-compliments-notifications.php:281
#: includes/bp-compliments-notifications.php:271
#: includes/bp-compliments-settings.php:89
#: includes/bp-compliments-settings.php:98
#: includes/bp-compliments-settings.php:107
msgid "Yes"
msgstr ""

#: includes/bp-compliments-notifications.php:282
#: includes/bp-compliments-notifications.php:272
#: includes/bp-compliments-settings.php:90
#: includes/bp-compliments-settings.php:99
#: includes/bp-compliments-settings.php:108
msgid "No"
msgstr ""

#: includes/bp-compliments-notifications.php:289
#: includes/bp-compliments-notifications.php:279
#, php-format
msgid "A member sends you a %s"
msgstr ""
Expand Down Expand Up @@ -316,27 +316,27 @@ msgstr ""
msgid "Delete"
msgstr ""

#: includes/templates/buddypress/members/single/compliments.php:133
#: includes/templates/buddypress/members/single/compliments.php:134
#, php-format
msgid "1 of 1"
msgid_plural "%1$s to %2$s of %3$s"
msgstr[0] ""
msgstr[1] ""

#: includes/templates/buddypress/members/single/compliments.php:136
#: includes/templates/buddypress/members/single/compliments.php:137
msgid "Go to Page"
msgstr ""

#: includes/templates/buddypress/members/single/compliments.php:152
#: includes/templates/buddypress/members/single/compliments.php:153
msgid "You don't have permission to access this page."
msgstr ""

#: includes/templates/buddypress/members/single/compliments.php:159
#: includes/templates/buddypress/members/single/compliments.php:160
#, php-format
msgid "Aw, you have no %1$s yet. To get some try sending %1$s to others."
msgstr ""

#: includes/templates/buddypress/members/single/compliments.php:165
#: includes/templates/buddypress/members/single/compliments.php:166
#, php-format
msgid "Sorry, no %1$s just yet."
msgstr ""
12 changes: 8 additions & 4 deletions readme.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
=== BuddyPress Compliments ===
Contributors: viruthagiri, stiofansisland, paoltaia
Donate link: http://wpgeodirectory.com/
Tags: buddypress, buddypress compliments, wordpress yelp compliments, buddypress integration, business directory plugin, directory, directory plugin, geodirectory, geodirectory buddypress, geodirectory buddypress integration, social network, yelp clone, yelp compliments
Tags: buddypress, buddypress compliments, WordPress yelp compliments, buddypress integration, business directory plugin, directory, directory plugin, geodirectory, geodirectory buddypress, geodirectory buddypress integration, social network, yelp clone, yelp compliments
Requires at least: 3.1
Tested up to: 4.3
Stable tag: 1.0.4
Tested up to: 4.4
Stable tag: 1.0.5
License: GPLv3
License URI: http://www.gnu.org/licenses/gpl-3.0.html

Expand All @@ -20,7 +20,7 @@ BuddyPress compliments adds a smart way for BuddyPress members to interact with
* When you click the Compliments button, a popup will show up with compliment types
* Submitted compliments will be visible in user's compliments section.
* Compliments can be set as private and visible only to the member receiving them.
* A notification is optioonally sent to the compliment receiving member.
* A notification is optionally sent to the compliment receiving member.
* Compliments can optionally be tracked in BuddyPress Activity
* Members can delete compliments received (option to prevent this available).
* Compliments are now paginated
Expand Down Expand Up @@ -72,6 +72,10 @@ No questions so far, but don't hesitate to ask!

== Changelog ==

= 1.0.5 =
Email notifications not working - FIXED
Compliment line break and clickable support removed. Use filter to override - CHANGED

= 1.0.4 =
Compliment user settings page - ADDED
Linebreaks are removed on compliment messages - FIXED
Expand Down