New
PeoplePress is here. Community building for WordPress, reimagined. Fast, modern, and built for the communities you've always wanted to run.
See it live

BuddyDev

Search

Replies

  • Keymaster
    (BuddyDev Team)
    Posts: 25513
    Brajesh Singh on in reply to: [Resolved] paiement with featured Member #18822

    Please add it at the bottom of the code

    
    
    /**
     * Get time interval when a user is marked featured via payment.
     *
     * @param int $user_id use id.
     *
     * @return int
     */
    function bpfm_paypal_get_role_based_interval( $user_id ) {
    
    	$default = 10; // 10 days by default?
    
    	$user = get_user_by( 'id', $user_id );
    	if ( empty( $user ) ) {
    		return $default * DAY_IN_SECONDS;
    	}
    
    	$user_roles = $user->roles;
    
    	if ( empty( $user_roles ) ) {
    		return $default * DAY_IN_SECONDS;
    	}
    
    	// Map role to days.
    	$map = array(
    		'administrator' => 60, // 60 days
    		'editor'        => 40,
    		'author'        => 30,
    		'contributor'   => 20,
    		'subscriber'    => 5,
    	);
    
    	$allowed_days = 0; // 0 days.
    
    	// calculate the max allowed days.
    	foreach ( $user_roles as $role ) {
    		if ( isset( $map[ $role ] ) && $map[ $role ] > $allowed_days ) {
    			$allowed_days = $map[ $role ];
    		}
    	}
    
    	// if no user role has mapped value.
    	if ( ! $allowed_days ) {
    		$allowed_days = $default;
    	}
    
    	return $allowed_days * DAY_IN_SECONDS;
    }
    

    Now look for this line(I(t is your code)

    
    update_user_meta( $custom[3], '_paid_featured', 1 );
    

    Just after that line, please add another line

    
    
    update_user_meta( $custom[3], '_bpfm_featured_expiry_time', time() + bpfm_paypal_get_role_based_interval( $custom[3] ) );
    
    

    That will do it.
    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25513

    Hi Dale,
    Thank you for some great suggestions.

    1. Could you please record the username of the person making the report. – It is already recorded. We record the user’s ID which can be used to retrieve any information about the user.

    2. Option for recording reason:- It’s a great suggestion and I will have it in the next update. Should the checkbox override the default setting for notification?

    3. Notices by BuddyPress private Message:- The private message needs sender to be a user. It also needs receiver to be a user. Also, the users need to be able to access their profile. It won’t work with us.

    The problem:-
    a. A reporter can be a non logged user(if enabled)
    b. A user may be blocked from accessing their own profile/logging to the site based on moderation setting.

    Since the BuddyPress work flow is incomplete without email(registration activation, password retrieval and almost all other thing), we believe email is good enough and adding a private message will be burden.

    If it is highly critical requirement, please get in touch via our custom project request page and we can create a custom addon.

    4. It would be great if when a report is made if additional users could be notified of the report
    It already does. All admins get notified of the report(if you have more than one admin). I am adding the option to specify extra emails in next update(also option to control if all admins should get the notifications).

    5. Automator plugin:- It is very new and not generally available. We will see where it goes by early next year and then plan accordingly.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25513

    Hi Dai,

    I am not sure of the question. The plugin sends notification to the author of the post when anyone comments on their blog post.

    Can you please tell me what are you looking for. If you are looking to notify user when someone replies their comment, there seems to be a plugin available for that
    https://wordpress.org/plugins/comment-reply-email-notification/

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25513
    Brajesh Singh on in reply to: Buddypress Speed Problem #18809

    Hi Kerem,
    I won’t suggest going for temporary fixes.

    Query monitor only logs query for the current page. When you run the test you should audit your webserver log as well as your database server log for possible causes and try to fix them.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25513

    No problem. Marking resolved.

  • Keymaster
    (BuddyDev Team)
    Posts: 25513
    Brajesh Singh on in reply to: [Resolved] Media Upload Email Notification for admin #18807
    This reply has been marked as private.
  • Keymaster
    (BuddyDev Team)
    Posts: 25513

    Hi Mark,
    The plugin is not designed with that and It will need a lot of modification.

    I am sorry but I am unable to add it to the plugin as it will not be a backward compatible change.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25513
    Brajesh Singh on in reply to: Buddypress SEO #18804

    Hi Kerem,
    You can use the wp_heade hook for generating the meta.
    https://codex.wordpress.org/Plugin_API/Action_Reference/wp_head

    You can put the code in bp-custom.php or functions.php in your theme.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25513
    Brajesh Singh on in reply to: [Resolved] paiement with featured Member #18803

    Hi Herve,
    Thank you for confirming that my update was working.

    I have checked and the 404 is not due to my code. You should check and see if you have the page on the site.

    Also, what is the second desire? using member type for time?

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25513
    Brajesh Singh on in reply to: Add username to notifications #18802

    Hi Mark,
    Thank you for posting.
    Which notifications you want to add the username too? There are two many notifications and the user is not always part of the context.

    Please let me know. It’s weekend, so will be assisting on/after Monday based on your reply.

    Regards
    Brajesh