Replies
- Tosin on August 2, 2024 at 9:55 am in reply to: [Resolved] Buddypress member type – hide member type nav tab in directory #52915
Kindly ignore this as I found solution in member types pro plugin
- Tosin on August 1, 2024 at 1:29 pm in reply to: [Resolved] Buddypress member types pro visibility issue #52912
The main reason why I want the restricted profile fields in another profile field group is because of user experience with logged in users who are editing profile fields.
1. conditional visibility feature does not work for users who are editing profile fields so all restricted profile fields are visible to users which is a poor user experience.
2. Separating the restricted field into another field group would be a better experience since logged in users first need to save their chosen member type option in the primary field group before they can save the corresponding restricted profile field in the custom profile field group.
- Tosin on August 1, 2024 at 12:53 pm in reply to: [Resolved] Buddypress member types pro visibility issue #52911
The member type field is located in the primary field group while the restricted profile fields are located in another custom profile field group.
- Tosin on August 1, 2024 at 12:13 pm in reply to: [Resolved] Buddypress member types pro visibility issue #52910This reply has been marked as private.
- Tosin on June 27, 2024 at 12:17 pm in reply to: [Resolved] Buddyblog duplicate posting prevention #52775
Hi Brajesh
Please dont forget about this awesome request
Thanks
- Tosin on May 3, 2024 at 10:42 am in reply to: [Resolved] Buddyblog duplicate posting prevention #52459
Hello Brajesh
Sorry for the delayed feedback
1. We can check for the posts of the current loggedin users
2. We can can scope it to only selected post types. (admins should be able to select the post types the scope should be applicable to)Thanks
- Tosin on February 26, 2024 at 3:18 pm in reply to: Buddyblog limit submissions addon suggestion #51802
Hello Ravi,
I finally think this code work can you review it
add_filter( 'bblpro_user_can_create_post', function ( $can, $user_id, $post_type ) { // Not user's profile, return without modification if ( ! bp_is_my_profile() ) { return $can; } if ( 'post' === $post_type ) { $posts_limit = 5; // Adjust the daily limit as needed $today = date( 'Y-m-d' ); // Get today's date $args = array( 'numberposts' => -1, 'post_type' => $post_type, 'fields' => 'ids', 'author' => $user_id, 'date_query' => array( array( 'after' => $today . ' 00:00:00', 'before' => $today . ' 23:59:59', 'inclusive' => true, ), ), ); $posts_count = get_posts( $args ); if ( ! empty( $posts_count ) && count( $posts_count ) >= $posts_limit ) { $can = false; // User has reached the daily limit } } return $can; }, 15, 3 );
- Tosin on February 26, 2024 at 2:33 pm in reply to: Buddyblog limit submissions addon suggestion #51801
this is a rough work
add_filter( 'bblpro_user_can_create_post', function ( $can, $user_id, $post_type ) { // Check if it's a post creation attempt and the user is logged in. if ( 'post' !== $post_type || ! is_user_logged_in() ) { return $can; } // Get the posts limit. $posts_limit = 1; // Get the last post creation timestamp for the user. $last_post_time = get_user_meta( $user_id, 'last_post_time', true ); // If the last post time is not set or it's been more than 24 hours, reset the counter. if ( empty( $last_post_time ) || strtotime( $last_post_time ) < strtotime( '-1 day' ) ) { // Reset post count. update_user_meta( $user_id, 'post_count', 0 ); update_user_meta( $user_id, 'last_post_time', current_time( 'mysql' ) ); } // Get the current post count for the user. $post_count = get_user_meta( $user_id, 'post_count', true ); if ( $post_count >= $posts_limit ) { $can = false; // User has exceeded the daily limit. } else { // Increment the post count and update the last post time. $post_count++; update_user_meta( $user_id, 'post_count', $post_count ); update_user_meta( $user_id, 'last_post_time', current_time( 'mysql' ) ); } return $can; }, 15, 3 );
The problem is how to not restrict old users who have already published old posts over the post limit. I would have preferred the limit to start afresh for old users
- Tosin on February 26, 2024 at 2:24 pm in reply to: Buddyblog limit submissions addon suggestion #51800
Hello Ravi
I would prefer to limit post creation to 10 per day for all users
Maybe a buddyblog integration with this plugin can help https://wordpress.org/plugins/user-posts-limit/
- Tosin on February 23, 2024 at 3:36 pm in reply to: Buddyblog Pro – add/remove visibility option #51766
Ok Thanks for the detailed explanation, now I understand better