WordPress.org

Ready to get started?Download WordPress

Forums

Achievements for WordPress
[resolved] API (4 posts)

  1. Chris
    Member
    Posted 1 year ago #

    Is there a way to add karma points when processing a custom form??

    Say I have a calculator and if a user uses it they gain karma points, how would I do this if the calculator is custom and part of the theme?

    http://wordpress.org/extend/plugins/achievements/

  2. Paul Gibbs
    BuddyPress Lead Developer
    Plugin Author

    Posted 1 year ago #

    I can show you were to look if you are a PHP developer and know how WordPress plugins are built. Unfortunately, I haven't created any guides yet.

  3. Chris
    Member
    Posted 1 year ago #

    That would be good if you could show me where to look.

  4. Paul Gibbs
    BuddyPress Lead Developer
    Plugin Author

    Posted 1 year ago #

    Take a look at http://svn.wp-plugins.org/achievements/tags/3.3/includes/extensions/inviteanyone.php

    Achievements works on WordPress' actions. So, in your custom form, find or add a call to do_action in the appropriate place, and get the name of that action. You'll need to set this in $this->functions in the constructor.

    Essentially, what you need to do is duplicate that class, and set parameters to suit.
    You'll instantiate your class through a function hooked to dpa_init. e.g.

    function chris_achievements() {
    require( 'your_file.php' );
    }
    add_action( 'dpa_init', 'chris_achievements' );

    Have a go, it's pretty straightforward. If you get stuck, pastebin it, and let me know what the precise difficulty is. Good luck!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.