Skip to:
Content
Pages
Categories
Search
Top
Bottom

How the event is triggered in Achievement Plugin


  • webwarrior.wng
    Participant

    @webwarriorwng

    Hi everyone

    Could you please tell me in detail, how the event is triggered or any achievement is unlocked  in Achievement plugin so that i could customize or add my event as per my need.

    I have inserted my own event name only in event’s list grouped as ‘Others’ (from Database) but i want to know how to trigger my own event.

     

    Thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • It’s pretty simple. If you’ve got the achievement type in the database table (which you do), and you create an achievement using it, you need to call do_action whenever you want that achievement to be triggered:

    do_action( ‘my_event_here’ )


    webwarrior.wng
    Participant

    @webwarriorwng

    Let me show you my Database alter row:

    id60
    categoryCubepoints
    nameon_my_define_pts
    descriptionThe user will unlock on my pre-define points.
    is_group_action0

    So i placed “do_action( ‘on_my_define_pts’ );” in “bp-share-it.php” a file in BuddyShare plugin. So whenever user have rights to Share the post on any social website, the event will be fire and achievement unlocked, but it is not working.

    Tell me if i am wrong or i have to put something more in “achievements-core.php” in between line no. 942  –  1371

     


    webwarrior.wng
    Participant

    @webwarriorwng

    O wow! I have done it so far. Thanks a lot   @Paul Gibbs, it really worked for me. You are a real helpful guy.

    Thanks


    webwarrior.wng
    Participant

    @webwarriorwng

    Worked after I just added in “achievements-core.php” on line no. 942 as:

    function dpa_handle_action_on_my_define_pts() {

    $func_get_args = func_get_args(); dpa_handle_action( ‘on_my_define_pts’, $func_get_args );

    }

     

     

     

    you’re very welcome!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How the event is triggered in Achievement Plugin’ is closed to new replies.
Skip to toolbar