• 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: RSForm Pro! optoins

RSForm Pro! optoins 13 years 8 months ago #11204

  • Kopecek
  • Kopecek's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 1
Examples:
Assuming that you want to create an e-mail form component, and by default, if the user is logged in, to enter it's registration e-mail in the Email field. Here's how to do it:

1. Create a textbox component
2. In the Default Value, type this code:

//<code>
$user = $RSadapter->user();
return $user;
//</code>

This piece of code (including the //<code> tag) loads the user information in the $user variable. Here's what you can use:

* $user = user id -->OK
* $user = the username -->OK
* $user = registration full name FALSE
* $user = registration email -->OK

Help please
The administrator has disabled public write access.

Re:RSForm Pro! optoins 13 years 8 months ago #11269

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

In order to retrieve the email of the logged in user and display it in one of your form's fields please try using the following code:

//<code>
$user =& JFactory::getUser();
return $user->email;
//</code>

In addition to the user email you can also retrieve the user's name, id, or username. You just need to replace email with your desired information, for example:

return $user->id;
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!