Compliments posting to activity stream
-
When someone gives a compliment to another person it displays in the activity stream as person A has sent or received a compliment from person B.
However, if you click on it in the activity link, it takes you to the persons page and displays ‘sorry, no compliments just yet’.
However, the compliment does appear if you go to compliments on the persons profile
-
Delete plugin data when you uninstall BuddyPress Compliments? -> Yes
then delete the plugin.
It will erase all data added by buddypress compliments. As a pre caution take backup before do that.
Thanks
The only option I am given is to deactivate then delete the plugin vial the plugins page which deleting the plugin still leaves tables in the database
Then you are not using the latest version I guess.
If thats the case try installing dev version. It might fix your issue.
https://github.com/mistergiri/buddypress-compliments
You will have Uninstall data setting at the bottom of setting page. So use that if nothing works for you.
Thanks
Plugin installed was 1.0.7 which does not have the option to delete data upon plugin deletion.
Installing the version in the link gives me version 1.0.6 which does include the option to delete data.
Unfortunately backtracking, deleting data, and reinstalling still do not resolve the issueAs opposed to fighting this issue is there a way to change the link that appears in the activity stream and in the notifications to just link to the users compliments page rather than to the specific compliment?
As opposed to fighting this issue is there a way to change the link that appears in the activity stream and in the notifications to just link to the users compliments page rather than to the specific compliment?
Is this a possibility?Hey sorry. I forgot to reply to your existing messages.
You can use phpmyadmin to find and replace the strings.
Other than that I have no other idea.
Sorry.
Hi there,
you can try this code in your functions.php file .add_filter('compliments_format_activity_action_compliment_received', 'modify_compliments_format_activity_action_compliment_received', 1, 2); function modify_compliments_format_activity_action_compliment_received( $action, $activity ) { global $bp; $receiver_link = bp_core_get_userlink( $activity->user_id ); $sender_link = bp_core_get_userlink( $activity->secondary_item_id ); $receiver_url = bp_core_get_userlink( $activity->user_id, false, true ); $compliment_url = $receiver_url . BP_COMPLIMENTS_SLUG; $compliment_link = '<a href="'.$compliment_url.'">'.strtolower(BP_COMP_SINGULAR_NAME).'</a>'; $bp_compliment_can_see_others_comp_value = esc_attr( get_option('bp_compliment_can_see_others_comp')); $bp_compliment_can_see_others_comp = $bp_compliment_can_see_others_comp_value ? $bp_compliment_can_see_others_comp_value : 'yes'; if (current_user_can('manage_options')) { $bp_compliment_can_see_others_comp = 'yes'; } else { if ($bp_compliment_can_see_others_comp == 'members_choice') { $bp_compliment_can_see_your_comp_value = esc_attr( get_user_meta($bp->displayed_user->id, 'bp_compliment_can_see_your_comp', true)); $bp_compliment_can_see_others_comp = $bp_compliment_can_see_your_comp_value ? $bp_compliment_can_see_your_comp_value : 'yes'; } if (bp_is_user() && ($bp->loggedin_user->id == $bp->displayed_user->id)) { $bp_compliment_can_see_others_comp = 'yes'; } } if ($bp_compliment_can_see_others_comp == 'yes') { $action = sprintf( __( '%1$s has received a %2$s from %3$s', 'bp-compliments' ), $receiver_link, $compliment_link, $sender_link ); } elseif ($bp_compliment_can_see_others_comp == 'members_only') { if (is_user_logged_in()) { $action = sprintf( __( '%1$s has received a %2$s from %3$s', 'bp-compliments' ), $receiver_link, $compliment_link, $sender_link ); } else { $action = sprintf( __( '%1$s has received a %2$s from %3$s', 'bp-compliments' ), $receiver_link, strtolower(BP_COMP_SINGULAR_NAME), $sender_link ); } } else { $action = sprintf( __( '%1$s has received a %2$s from %3$s', 'bp-compliments' ), $receiver_link, strtolower(BP_COMP_SINGULAR_NAME), $sender_link ); } return $action; } add_filter('compliments_format_activity_action_compliment_sent', 'modify_compliments_format_activity_action_compliment_sent', 1, 2); function modify_compliments_format_activity_action_compliment_sent( $action, $activity ) { global $bp; $sender_link = bp_core_get_userlink( $activity->user_id ); $receiver_link = bp_core_get_userlink( $activity->secondary_item_id ); $receiver_url = bp_core_get_userlink( $activity->secondary_item_id, false, true ); $compliment_url = $receiver_url . BP_COMPLIMENTS_SLUG; $compliment_link = '<a href="'.$compliment_url.'">'.strtolower(BP_COMP_SINGULAR_NAME).'</a>'; $bp_compliment_can_see_others_comp_value = esc_attr( get_option('bp_compliment_can_see_others_comp')); $bp_compliment_can_see_others_comp = $bp_compliment_can_see_others_comp_value ? $bp_compliment_can_see_others_comp_value : 'yes'; if (current_user_can('manage_options')) { $bp_compliment_can_see_others_comp = 'yes'; } else { if ($bp_compliment_can_see_others_comp == 'members_choice') { $bp_compliment_can_see_your_comp_value = esc_attr( get_user_meta($bp->displayed_user->id, 'bp_compliment_can_see_your_comp', true)); $bp_compliment_can_see_others_comp = $bp_compliment_can_see_your_comp_value ? $bp_compliment_can_see_your_comp_value : 'yes'; } if (bp_is_user() && ($bp->loggedin_user->id == $bp->displayed_user->id)) { $bp_compliment_can_see_others_comp = 'yes'; } } if ($bp_compliment_can_see_others_comp == 'yes') { $action = sprintf( __( '%1$s has sent a %2$s to %3$s', 'bp-compliments' ), $sender_link, $compliment_link, $receiver_link ); } elseif ($bp_compliment_can_see_others_comp == 'members_only') { if (is_user_logged_in()) { $action = sprintf( __( '%1$s has sent a %2$s to %3$s', 'bp-compliments' ), $sender_link, $compliment_link, $receiver_link ); } else { $action = sprintf( __( '%1$s has sent a %2$s to %3$s', 'bp-compliments' ), $sender_link, strtolower(BP_COMP_SINGULAR_NAME), $receiver_link ); } } else { $action = sprintf( __( '%1$s has sent a %2$s to %3$s', 'bp-compliments' ), $sender_link, strtolower(BP_COMP_SINGULAR_NAME), $receiver_link ); } return $action; }
Those absolutely fixed the issue with the compliments in the activity stream, thank you.
However, when they receive notifications, the notification links both in the widget and on the notifications page of their profile still try to point to the link that isn’t working. Is there a way to just point those to the compliments page also?Hi there,
Trust me mate. you need to hire someone for this kind of tasks. I cannot keep on writing code for you.
This issue is specific to your site. if it is really a bug I’m happy to fix the bug. But its not a bug.
Also note that this is a free plugin. We are not generating any revenue from this plugin. So our support is limited.
If I write code for for notifications, then i also write code for you for read, unread options.
Point is you are not trying to fix the bug, but trying to hide it from the users. This is very bad. It will break other functionality.
If you are seeing 404 for compliment, that just means your database doesn’t save the compliment correctly.
So do inspect your wp_bp_compliments table and buddypress activity table.
Thats all the advise I can give here.
I’m done.
So hire someone from sites like freelancer, upwork etc. Bugs like this take less than an hour to fix. So it will cost you around $50.
If you can’t afford to hire someone and not willing to provide any admin credentials to debug this bug, then you should start to learn programming. Thats the only way you have.
Use phpmyadmin to inspect whats wrong.
I was actually looking for assistance with a resolution rather than just a patch but I thank you for your time none the less.
As for affordability, money is no issue so I will follow your recommendation and seek out someone to provide a solution for this issue.
Once again, thank you for you assistance and the plugin you have provided.You are welcome.
- The topic ‘Compliments posting to activity stream’ is closed to new replies.