Replies
- Ravi on May 12, 2021 at 3:33 pm in reply to: [Resolved] Send email to all featured members when a site wide notice is published #38620
Hello Lefteris,
Thank you for the acknowledgment. I am glad that I could help.
Regards
Ravi Hello Gav,
Thank you for the acknowledgment. The current version of the plugin schema does not allow us to show the Top Rated gallery. In a future update, We will consider this.
Regards
Ravi- Ravi on May 12, 2021 at 6:26 am in reply to: Delete a friend’s post from my timeline/ User face showing when liking a post #38598
Hello Daniel,
Thank you for the details.
1. There is no direct way to implement this with the BuddyBoss Platform. Please contact BuddyBoss they can better guide you with this.
2. Use the following code:
add_action( 'bp_activity_add_user_favorite', 'bpdev_track_user_favorite', 10, 2 ); function bpdev_track_user_favorite( $activity_id, $user_id ) { bp_activity_add_meta( $activity_id, 'favorited_by_user', $user_id ); } add_action( 'bp_activity_remove_user_favorite', 'bpdev_track_user_unfavorite', 10, 2 ); function bpdev_track_user_unfavorite( $activity_id, $user_id ) { bp_activity_delete_meta( $activity_id, 'favorited_by_user', $user_id ); } //show faces, yay! add_action( 'bp_activity_entry_content', 'bpdev_show_who_favorited_activities' ); function bpdev_show_who_favorited_activities() { $output = ''; $favorited_users = bp_activity_get_meta( bp_get_activity_id(), 'favorited_by_user', false ); if ( ! empty( $favorited_users ) ) { foreach ( (array) $favorited_users as $user_id ) { $user_domain = bp_core_get_user_domain( $user_id ); $avatar = bp_core_fetch_avatar( array( 'type' => 'thumb', 'height' => 25, 'width' => 25, 'item_id' => $user_id ) ); $output .= sprintf( '<a href="%s">%s</a>', $user_domain, $avatar ); } } if ( $output ) { echo "<div class='clearfix activity-favorited-by'>{$output}</div>"; } }
Please do let me know if it works or not.
Regards
Ravi Hello Gav,
Thank you for the details. I have added support for showing Top Rated media by total rating count. Please upgrade to latest version and check.
https://buddydev.com/plugins/mediapress-media-rating/
Regards
Ravi- Ravi on May 11, 2021 at 12:17 pm in reply to: Delete a friend’s post from my timeline/ User face showing when liking a post #38576
Hello Daniel,
Thank you for posting.
1. Are you using BuddyPress Or BuddyBoss Platform.
2. Can you link me to the post where we share the code snippet so that I can help you?.Regards
Ravi Hello Gav,
Thank you for posting. Please look at the following resource showing how we calculating top rated medias
https://github.com/mediapress/mpp-media-rating/blob/master/core/mpp-rating-functions.php#L184
We just made a query with avg function to calculate the average rating for individual media.
Do you want to list media order by no. of users rated?. Please let me know.
Regards
Ravi- Ravi on May 11, 2021 at 11:23 am in reply to: [Resolved] MediaPress shortcode parameter to not show empty galleries #38573
Hello Gav,
Thank you for the acknowledgment. I am glad that I could help.
Regards
Ravi - Ravi on May 10, 2021 at 12:30 pm in reply to: [Resolved] MediaPress shortcode parameter to not show empty galleries #38565
Hello Tom,
Thank you for posing. Currently, Gallery shortcode is not supported hiding empty gallery feature. But you can use the following code in Active Child Theme “functions.php” or “bp-cutom.php” file:
add_filter( 'mpp_shortcode_list_gallery_query_args', function ( $args ) { $meta_query = array( array( 'key' => '_mpp_media_count', 'value' => 1, 'compare' => '>=', ), ); if ( isset( $args['meta_key'] ) ) { $meta_query[] = array( 'key' => $args['meta_key'] ); unset( $args['meta_key'] ); } $args['meta_query'] = $meta_query; return $args; } );
It will hide all empty galleries listed using gallery shortcode. Please give it a try and let me know if it works or not.
Regards
Ravi - Ravi on May 10, 2021 at 7:04 am in reply to: [Resolved] Send email to user that has been inactive for 2 months #38562
Hello Lefteris,
Instead of ‘date_recorded < current_date – interval 2 month’ use this ‘date_recorded > current_date – interval 60 day’. Give it a show this way and let me know if it works or not.
Regards
Ravi - Ravi on May 10, 2021 at 6:59 am in reply to: [Resolved] Send email to all featured members when a site wide notice is published #38560
Hello Lefteris,
Thank you for your acknowledgment of the action. Instead of “bp_message_notice_text($notice)” you can use “$subject” for notice subject and “$message” for notice message passed as a parameter in the callback function. Please give it a shot this way. Please let me know if it works or not. If still faces the issue please share code on https://pastebin.com/ so that I can help.
Regards
Ravi- This reply was modified 4 years, 3 months ago by
Ravi.
- This reply was modified 4 years, 3 months ago by