1. hatye
  2. General
  3. Tuesday, March 10 2015, 10:40 PM
Hi,
I would like to use some of the information in the user registry in other extensions (e.g. RS Form Pro!). The default user registry are missing some information that I need in order to get RS Form Pro! work as wanted.

I use the following to get information from the user registry when it comes to default values:

[CODE]
{source}
<?php $user =& JFactory::getUser(); echo $user->name; ?>
{/source}
[/CODE]

The problem is regarding the fields that I create using Easy Profile. They are shown in the user registry so I think it works, but I can not get this information using the source code shown over. Does anyone got a clue on what to do to be able to reuse the information entered in the Easy Profile-generated fields? :)
hatye Accepted Answer
Content Protected
  1. more than a month ago
  2. General
  3. # 1
admin Accepted Answer
Admin
  1. more than a month ago
  2. General
  3. # 2
hatye Accepted Answer
Content Protected
  1. more than a month ago
  2. General
  3. # 3
admin Accepted Answer
Admin
Hi,
you need to include our api, so
require_once(JPATH_SITE.'/components/com_jsn/helpers/helper.php');
$user=new JsnUser();
echo $user->isOnline();
  1. more than a month ago
  2. General
  3. # 4
hatye Accepted Answer
Content Protected
  1. more than a month ago
  2. General
  3. # 5
hatye Accepted Answer
Hi again,

Everythin work nice until now. Suddendly I get the following error code in the ext box where the user fields are inserted as the default value:

<br /><b>Warning</b>: Missing argument 1 for JsnUser::__construct(), called in /home/nidopxze/public_html/plugins/system/sourcerer/helper.php(548) : runtime-created function on line 8 and defined in <b>/home/nidopxze/public_html/components/com_jsn/helpers/helper.php</b> on line <b>441</b><br />002

The last digit 002 is what the script should show.

What's wrong and how can I fix this message? It is appearing on all user fields!
  1. more than a month ago
  2. General
  3. # 6
admin Accepted Answer
Admin
Hi,
sorry but "sourcerer" is not our plugin.
  1. more than a month ago
  2. General
  3. # 7
hatye Accepted Answer
Content Protected
  1. more than a month ago
  2. General
  3. # 8
admin Accepted Answer
Admin
Hi,
I have tried on simple article and works with our custom fields.

tested with this code
{source}
<?php require_once(JPATH_SITE.'/components/com_jsn/helpers/helper.php');
$user=new JsnUser();
echo $user->my_custom_field; ?>
{/source}


the problem is not caused by Easy Profile, Sourcerer or RSForm, but the combination of these 3.

Try to use this sintax
{source}
<?php require_once(JPATH_SITE.'/components/com_jsn/helpers/helper.php');
$user=JsnHelper::getUser();
echo $user->my_custom_field; ?>
{/source}
  1. more than a month ago
  2. General
  3. # 9
admin Accepted Answer
Admin
We will update our docs, JsnHelper::getUser(); improves performance and probably avoids these problems, this function has been added recently.
  1. more than a month ago
  2. General
  3. # 10
hatye Accepted Answer
Content Protected
  1. more than a month ago
  2. General
  3. # 11
  • 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.