• 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: Community Builder AutoFill form of logged in user

Community Builder AutoFill form of logged in user 13 years 8 months ago #14507

  • paulo55
  • paulo55's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 9
Hi great extension,

Is there a simple way to autofill some of the Community Builder profile fields into a created RSForm pro form when the user is logged in and uses the form?

Pd
The administrator has disabled public write access.

Re: Community Builder AutoFill form of logged in user 13 years 8 months ago #14512

Paulo55,

Here's a link that might help...

www.rsjoomla.com/support/documentation/v...mmunity-builder.html
The administrator has disabled public write access.

Re: Community Builder AutoFill form of logged in user 13 years 8 months ago #14515

  • paulo55
  • paulo55's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 9
Thank you, i did not search in that bit, 2 pairs of eyes always better than 1,

pd
The administrator has disabled public write access.

Re: Community Builder AutoFill form of logged in user 13 years 8 months ago #14551

  • paulo55
  • paulo55's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 9
Got another point here,

Autofill is working yes on the fields, but I cannot get the email cb field to autofill,

Have you got this working?

Paul
Last Edit: 13 years 8 months ago by paulo55.
The administrator has disabled public write access.

Re: Community Builder AutoFill form of logged in user 13 years 3 months ago #16268

I am having the issue using the code on the recomended page above:

I have added:

//<code>
$my = & JFactory::getUser();
$db = JFactory::getDBO();
if ($my->get('id'))
{
$db->setQuery("SELECT `firstname` FROM `#__comprofiler` WHERE `user_id`='".$my->get('id')."' LIMIT 1");
return $db->loadResult();
}
//</code>

I changed `#__comprofiler` to `jos_comprofiler`, as i think thats what i am supposed to do. But i just get a blank field when the form loads. Doesn't load the Firstname from the CB database.


any ideas?

to the "Default value" of the created text field
The administrator has disabled public write access.

Re: Community Builder AutoFill form of logged in user 13 years 1 week ago #17265

  • rsn
  • rsn's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 1
Here is working version:
//<code>
 
$my = & JFactory::getUser();
$db = JFactory::getDBO();
if ($my->get('id')) {
$db->setQuery("SELECT phone FROM jos_comprofiler WHERE user_id=".$my->id." LIMIT 1");
return $db->loadResult();}
 
//</code>
The administrator has disabled public write access.

Re: Community Builder AutoFill form of logged in user 12 years 10 months ago #17878

  • sushi100
  • sushi100's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 10
  • Thank you received: 1
Hello,
it works on Joomla 2.5 and the newest Community Builder with:

//<code>

$my = & JFactory::getUser();
$db = JFactory::getDBO();
if ($my->get('id')) {
$db->setQuery("SELECT cb_phone FROM jos_comprofiler WHERE user_id=".$my->id." LIMIT 1");
return $db->loadResult();}

//</code>
The administrator has disabled public write access.
The following user(s) said Thank You: JosBlo

Re: Community Builder AutoFill form of logged in user 12 years 6 months ago #19557

Hello,

i have installed Joomla 1.5.26 an CB 1.8.1

The auto fill work great with this code:
//<code>
$my = & JFactory::getUser();
$db = JFactory::getDBO();
if ($my->get('id'))
{
     $db->setQuery("SELECT `firstname` FROM `#__comprofiler` WHERE `user_id`='".$my->get('id')."' LIMIT 1");
     return $db->loadResult();
}
//</code>

BUT: if I want to display the email field, it is blank when the form load.
I changed 'firstname' to 'email' and '#__comprofiler' to '#__users' (because I saw that the email address is in the table 'jos_users').

Can anyone help me please?
The administrator has disabled public write access.

Re: Community Builder AutoFill form of logged in user 12 years 6 months ago #19558

I've found the solution:
//<code>
$my = & JFactory::getUser();
$db = JFactory::getDBO();
if ($my->get('id'))
{
     $db->setQuery("SELECT `email` FROM `#__users` WHERE `id`='".$my->get('id')."' LIMIT 1");
     return $db->loadResult();
}
//</code>
With this code, the email address will be shown! :)
The administrator has disabled public write access.

Re: Community Builder AutoFill form of logged in user 12 years 1 month ago #22457

  • RPPEO
  • RPPEO's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 68
  • Thank you received: 6
:blush: Sorry to ask but where would these lines get added?
I'm having similar issues.

Cheers.
The administrator has disabled public write access.

Community Builder AutoFill form of logged in user 12 years 2 weeks ago #22747

I would also like to be able to autofill from CB into a form. Do i need to use mappings or scripts. Thanks
The administrator has disabled public write access.

Re: Community Builder AutoFill form of logged in user 11 years 11 months ago #23175

Hi, I woul like similar code.. just for show a user name LOGGED...
This way could showm a user name and other fields...

//<code>
$my = & JFactory::getUser();
if ($my->get('name'))
{
echo $my;
}
//</code>
The administrator has disabled public write access.

Re: Community Builder AutoFill form of logged in user 11 years 11 months ago #23220

  • octavian
  • octavian's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 783
  • Thank you received: 110
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!