Is there a hook for non-active user profile updates?

Discussion in 'Customization & add-ons' started by appthemes, Jan 5, 2011.

  1. appthemes

    appthemes New Member

    Joined:
    Dec 23, 2009
    Messages:
    9
    Hello,

    I have aMember integrated with vBulletin (plugin and custom code) and am automatically creating vBulletin accounts for aMember affiliate sign ups.

    This is working great but here's my problem. Anytime an affiliate updates their aMember profile, it doesn't get updated in vBulletin.

    I figured out this is because affiliates in aMember are not "active" (paid customers) so the subscription_updated hook is not firing.

    Is there another hook that I can use instead? Basically one that fires whenever any user profile is updated?
  2. appthemes

    appthemes New Member

    Joined:
    Dec 23, 2009
    Messages:
    9
    Well, I figured out a hack that works. A simple one character addition to the update_user function (mysql.inc.php) did the trick.

    OLD
    Code:
    if (array_sum((array)$oldmember['data']['status']) > 0) // only if has subscriptions
                plugin_subscription_updated($member_id, $oldmember, $v);
    NEW
    Code:
    if (array_sum((array)$oldmember['data']['status']) >= 0) // only if has subscriptions
                plugin_subscription_updated($member_id, $oldmember, $v);
    Basically added the equals sign which says update any users (affiliates in my case) instead of just "active". This allows any plugin to use the subscription_updated hook to update all users across other dbs.

    Security issue? I don't believe so unless you're using a plugin you don't trust or something.

    Feature Suggestion
    It would be great to see this as an option in the next aMember release so we can have the choice.


    ~David

Share This Page