BuddyDev

Search

Replies

  • Participant
    Level: Enlightened
    Posts: 71

    Thank you so much @Ravi , your help has been magnificent!!

    Could you just check what i did from point of view of syntax? https://pastebin.com/EfASFZNa

    Your code works perfectly fine. Just hade to change date_recorded < current_date - interval 2 month for getting all users who haven’t logged in for the last 2 months.

    Is the `if ( empty( $user_ids ) ) {
    return;
    } correct or should i just make anif ( ! empty( $user_ids ) )in theforeach ( $user_ids as $user_id )` loop?

    Thank you again for you time. I am grateful for your support.

  • Participant
    Level: Enlightened
    Posts: 71

    Thank you @Ravi for your help 🙂

    I wll test that.

    Do you know maybe how can i get the text of the message?
    I have tried some testing with different variations like

     global $messages_template;
    echo '' . bp_message_notice_text($messages_template->thread->message) . '';

    or

    global $notice;
     echo '' . bp_get_message_notice_text( $notice->message ) . '';

    but i get Warning: Creating default object from empty value.

  • Participant
    Level: Enlightened
    Posts: 71

    thank you @Tosin for your info. But this plugin is not actually what i am looking for.But i will have a look on it.

    @Brajesh could you please take a look on the query below and give me a hint what am i doing wrong :

    
     // Get the contributors and administrators who haven't logged in for 60 days
        $args = array( 
        'role__in' => array( 'contributor', 'administrator' ),
    	'meta_key'     => 'last_activity', // this is a meta_key storing the last time the user was logged in by buddypress in 'Y-m-d H:i:s' format
    	'meta_query' => array( 
            array(
                'key' => 'last_activity',
                'value' => date('Y-m-d H:i:s', strtotime( "-60 days" )), // what am i doing wrong? 
                'compare' => '<',
                'type' => 'DATE' // Let WordPress know we're working with date
                )
            )
        );
    
        $remind_users = new WP_User_Query( $args ); 
    

    I am trying to get the inactive users for the last 60 days, but for some reason it doesn’t give me the correct result. Any help please? @Ravi

  • Participant
    Level: Enlightened
    Posts: 71

    Thank you so much Ravi for your help.

    It works perfect.

  • Participant
    Level: Enlightened
    Posts: 71

    Hello Ravi,

    May i ask another modification on this.
    If the current_user is not a bp_featured_member , return no results at all.

    Thank you for your time

  • Participant
    Level: Enlightened
    Posts: 71

    Hello @Brajesh and thank you very much for your help.

    After some digging that i have done, i have created a small plugin to do the work.
    I am just stucked in some points and not sure how to proceed.

    I would like to share what i did, since i sincerely believe that you have a good community + a very supportive forum and i like sharing.

    Please have a short look on it and let me know if you have any suggestions-corrections .
    https://pastebin.com/Unz9kXYi

    (I have made it as a plugin so that if i want to disalbe the emails, to just disable the plugin.)

  • Participant
    Level: Enlightened
    Posts: 71

    Thank you Ravi for all the info and your help.

  • Participant
    Level: Enlightened
    Posts: 71

    Yes Ravi.This worked perfect 🙂 thank you for your help.

    Just another very quick general BP question. What would be the correct hook to send a one time confirmation email to the user when his account passed the authentication process(upon registration we send an email with a link, the user authenticate his account and then he can login). Would it be bp_core_activated_user or bp_core_signup_useror something else? We need to send the one time email after the user authenticated (no need to necessary login).

    Thank you for your time

  • Participant
    Level: Enlightened
    Posts: 71

    Thank you very much for your help Ravi.

    But this didn’t work. It didn’t excluded the current user from results.
    Any ideas? 🙂

  • Participant
    Level: Enlightened
    Posts: 71

    *Note: The current user may be or may not be a featured member, he sould always be exluded from the returned $args