Support

  1. viryagroup
  2. Presales Question
  3. Friday, March 27 2015, 12:33 PM
Hi guys,
After the success of this on a project we were considering using this component again for another one. In this project things are going to be a bit more complicated - we have a variety of user groups for a site e.g.

Sponsor USA
Sponsor UK
Sponsor Australia

This needs to be calculated based on the value of two fields - one being their chosen group type (e.g. Sponsor, Staff) and the second being their country they are based in.

As I understand conditions in easy profile are only available for one field - rather than a combination of values - is this correct? Would we be able to work around this with a custom Joomla plugin triggering onAfterSave - or is this something where we'd be better to find another more suitable component?

Kind Regards,
George
admin Accepted Answer
Admin
Hi,
you can develop a simple plugin based on our skeleton plugin to do this (you can download at the end of doc page). docs at https://www.easy-profile.com/docs/44-triggers.html

- Download, install, and enable it
- Go into /plugins/jsn/skeleton/skeleton.php
- delete example functions: triggerFieldAvatarUpdate, triggerProfileUpdate
- add function like this:
triggerProfileUpdate($user,&$data,$changed,$isNew){ 
require_once(JPATH_SITE.'/components/com_jsn/helpers/helper.php');
if($data['field_to_check']==some_value && $data['field_to_check2']==some_other_value)
{
$usergroup_id=10; // replace with id of your group
JsnHelper::addUserToGroup($user,$usergroup_id);
}
else
{
$usergroup_id=10; // replace with id of your group
JsnHelper::removeUserFromGroup($user,$usergroup_id);
}
....
}
  1. more than a month ago
  2. Presales Question
  3. # 1
  • 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.

Request Support

Support is currently Offline

Support Availability

Working days: Monday to Friday. The support staff is not available on weekends; in the most of cases tickets will not be answered during that time.

Reply time: Depending on the complexity of your support issue it's usually between a few minutes and 24 hours for paid members and about one week for free members. When we expect longer delays we will notify you.

Guidelines

Before you post: read the documentation and search the forums for an answer to your question.

When you post: include Site Details if you request a support (you can use the form below the reply in Site Details tab).

Auto Solved Question: If after a week the author of the post does not reply to a request by moderator, the question will be marked as resolved.

Language: only English

Search Users

Easy Profile® is not affiliated with or endorsed by Open Source Matters or the Joomla Project. Joomla is Free Software released under the GNU/GPL License.