1. sultaninen
  2. General
  3. Friday, August 15 2014, 08:58 AM
Hi
We have a large user base with custom fields set up with JSN easyprofile. e.g. there is a custom field zip, city and country. We have set those as custom fields, as we wanted to retrieve the entire user base as reports (XSL/CSV) from one single database table. However, as we are integrating JSN easyprofile with other extensions (event booking) we would like to synchronise those fields with the core fields of the the joomla user table (which is basically "address", "zip", "city", "country", "phone";). Is it possible to sync some custom fields with the core fields of joomla user profile?

Thanks for any help
Bernhard
admin Accepted Answer
Admin
Yes I think this is possible.
You can use our triggers to sync table with new data on user update profile or registration. try to read here https://www.easy-profile.com/docs/44-triggers.html

You can do something like this:
- Download, install, and enable our Skeleton plugin
- Go on file /plugins/jsn/skeleton/skeleton.php
- delete examples functions triggerFieldAvatarUpdate and triggerProfileUpdate
- write a function like this:
triggerProfileUpdate($user,&$data,$changed,$isNew){

$db=JFactory::getDbo();
$query="UPDATE #__users SET city = ".$db->quote($data['field_alias_of_city'])." WHERE id=".$user->id;
$db->setQuery($query);
$db->execute();

}


NOTE: this code is not tested and not supported and require minimum PHP knowledge
  1. more than a month ago
  2. General
  3. # 1
sultaninen Accepted Answer
Pro
Thanks a lot for the ultra-fast reply... Now, I need to know where I can download the skeleton plugin. Do you know where I can find it on the website?

Thanks
Bernhard
  1. more than a month ago
  2. General
  3. # 2
admin Accepted Answer
Admin
Hi,
you can download skeleton plugin at the end of documentation page at https://www.easy-profile.com/docs/44-triggers.html
  1. more than a month ago
  2. General
  3. # 3
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.
Sorry, the discussion is currently locked. You will not be able to post a reply at the moment.