Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)

  • oriadam
    Participant

    @oriadam

    Hi @riente,
    I read your blog post twice but couldn’t get it…
    Did you edit the original BP code?
    Perhaps latest BP update changed the location of the function you edited.

    My code looks something like that:

    <?php
    require('wp-load.php');
    require_once('wp-includes/user.php');
    require_once('wp-includes/pluggable.php');
    require_once('wp-content/plugins/buddypress/bp-core/bp-core-loader.php');
    
    $from_id=get_current_user_id();
    if (empty($from_id)) exit; // do nothing if there's no current user
    ///////// ...some boring code here... ////////
    $sum=10; // for example
    $to_user_link = bp_core_get_userlink($to_id);
    $from_user_link = bp_core_get_userlink($from_id);
    
    $note_to="You got $sum points from $from_user_link"; // <--- notification to be sent to payee
    $note_from="You sent $sum points to $to_user_link";  // <--- notification to be sent to payer
    
    /********** Now how do I send the above notifications to the relevant users $from_id and $to_id? ********/
    bp_core_add_notification( $item_id, $to, $component_name, $component_action, $secondary_item_id);
    

    Thank you!


    oriadam
    Participant

    @oriadam

    Me too.
    Found this which promises a lot but I couldn’t get it.
    It seemed that he edited a code BP function, which was re/moved in last update…

Viewing 2 replies - 1 through 2 (of 2 total)
Skip to toolbar