What am I missing in this hook?

Discussion in 'Customization & add-ons' started by hallandnash, Jun 23, 2010.

  1. hallandnash

    hallandnash New Member

    Joined:
    Jun 23, 2010
    Messages:
    1
    I'm trying to update another DB on a different server when a subscription is updated, but I can't see what I'm missing here.

    I've added this to site.inc.php
    Code:
    setup_plugin_hook('subscription_updated', 'updateap');
    
    function updateap($member_id, $oldmember,$newmember){
     global $db;
     print "inupdate";
      $u = $db->get_user($member_id);
      //get_url($url, $post, $add_referrer)
      get_url("http://www.myurl.com/test.php");
      print_r($u);
      die;
        }
    
    Stress that this is test code (which is why there is a print and die in there), but the test.php file will write info to a text file and so far nothing is happening.

    If I change the member data here:
    /amember/admin/users.php?action=edit_payment&payment_id=####&member_id=###

    The call never seems to be made .. what am I missing?
  2. skippybosco

    skippybosco CGI-Central Partner Staff Member

    Joined:
    Aug 22, 2006
    Messages:
    2,526
  3. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,274
    Hi,
    subscription_updated call will be executed onyl for active users(when profile is changed)
    Also are you sure that curl is working on your install. when you use get_url outside of the hook, are you able to load above url?

Share This Page