Triggers
For developers are available some trigger launched on update or create profile.
the trigger are available for System or Jsn Plugins:
- triggerProfileUpdate($user,$data,$changed,$isNew)
- triggerField**FIELDALIAS**Update($user,$data,$changed,$isNew)
** in name of function you must replace char '-' of alias with '_'
Legend:
$user is JsnUser Object (see http://docs.easy-profile.com/index.php/article/jsnuser-object)
$data is array of posted data
$changed is array of changed field
$isNew is a flag indicating if user is new or existing
Examples
triggerFieldAvatarUpdate($user,&$data,$changed,$isNew){
echo $user->avatar; //Old avatar path
echo $data['avatar']; //New avatar path
}
same to:
triggerProfileUpdate($user,&$data,$changed,$isNew){
if(in_array('avatar',$changed)){
echo $user->avatar; //Old avatar path
echo $data['avatar']; //New avatar path
}
}
Code
Plugin Skeleton