How to credit

Discussion in 'aMember Pro v.4' started by fmagusto, May 16, 2013.

  1. fmagusto

    fmagusto Guest

    Hi,

    For the plugin credit
    how to add credit for a user ?


    require_once 'path/to/amember/bootstrap.php';
    // no comment
    Am_Di::getInstance()->plugins_misc->loadGet('credits')->debit(120);
    // with comment
    Am_Di::getInstance()->plugins_misc->loadGet('credits')->debit(120, "Used 120 credits");
    // debit 120 credits from user# 1234
    Am_Di::getInstance()->plugins_misc->loadGet('credits')->debit(120, "Used 120 credits", 1234);
    // balance - get current number of credits
    Am_Di::getInstance()->plugins_misc->loadGet('credits')->balance();
  2. fmagusto

    fmagusto Guest

  3. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    Am_Di::getInstance()->plugins_misc->loadGet('credits')->credit('Number of credits', 'Comment', 'user_id');

Share This Page