• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Problems using Community Builder script

Problems using Community Builder script 13 years 1 month ago #13042

  • CHCG
  • CHCG's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 19
  • Thank you received: 1
I am building a form in which I want the user contact info to be imported from Community Builder. For this I have copied (and modified - see below) the script found in the FAQ section into the "default value" field:
$my = & JFactory::getUser();
$db = JFactory::getDBO(); $myid = $my->id;
if ($myid > 0)
{
$db->setQuery("SELECT `firstname` FROM `jos_comprofiler` WHERE `user_id`='".$myid."' LIMIT 1");
$result = $db->loadResult();
}
return $result;

...and modified the database-prefix with the correct one for my site. Still, in the form the script code appears instead of the user's "First Name".

What am I doing wrong? Can anyone advise?

Thank you very much in advance!
Last Edit: 13 years 1 month ago by CHCG. Reason: wrong code
The administrator has disabled public write access.

Re:Problems using Community Builder script 12 years 10 months ago #13988

  • azurelink
  • azurelink's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 30
  • Thank you received: 3
CHCG wrote:
I am building a form in which I want the user contact info to be imported from Community Builder. For this I have copied (and modified - see below) the script found in the FAQ section into the "default value" field:
$my = & JFactory::getUser();
$db = JFactory::getDBO(); $myid = $my->id;
if ($myid > 0)
{
$db->setQuery("SELECT `firstname` FROM `jos_comprofiler` WHERE `user_id`='".$myid."' LIMIT 1");
$result = $db->loadResult();
}
return $result;

...and modified the database-prefix with the correct one for my site. Still, in the form the script code appears instead of the user's "First Name".

What am I doing wrong? Can anyone advise?

Thank you very much in advance!

Hi CHCG,

Did you ever get this working? If so, could you please post it here so we can all benefit from your experience? I also need to build this same functionality into my site.

Thanks very much,
azurelink
The administrator has disabled public write access.

Re:Problems using Community Builder script 12 years 10 months ago #14039

  • andreic
  • andreic's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 722
  • Thank you received: 59
Hello,

If you are using the code in the default value property of your field please make sure to contain it between the //<code> //</code> tags, for example:
//<code>
$my = & JFactory::getUser();
$db = JFactory::getDBO(); $myid = $my->id;
if ($myid > 0)
{
$db->setQuery("SELECT `firstname` FROM `jos_comprofiler` WHERE `user_id`='".$myid."' LIMIT 1");
$result = $db->loadResult();
}
return $result;
//</code>
Please note: my help is not official customer support. To receive your support, submit a ticket by clicking here
Regards,
RSJoomla! Development Team
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!