• 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: Use Joomla Variables in the forms (login-name)

Use Joomla Variables in the forms (login-name) 15 years 10 months ago #7505

I have a form which is only available for registered users.

To give the user more comfort I would like to use the Joomla Variables such as Username and Name and set those values as default in some fields. Can anyone tell me if this is possible and how I can do that?
The administrator has disabled public write access.

Re:Use Joomla Variables in the forms (login-name) 15 years 10 months ago #7506

  • octavian
  • octavian's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 783
  • Thank you received: 110
You can use this code in the Default Value of Textboxes, Textarea, Hidden fields and more:
//<code>
$user =& JFactory::getUser();
return $user->email;
//</code>

The //<code> tags are mandatory.
You'll have to look in the jos_users table to see what info you can grab (name, username, email, id etc).
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.

Re:Use Joomla Variables in the forms (login-name) 15 years 8 months ago #8329

  • monashgk
  • monashgk's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 8
I want to do the same thing but with CB fields...after a long search I've come up empty. Any help would be great!
The administrator has disabled public write access.

Re:Use Joomla Variables in the forms (login-name) 15 years 7 months ago #8369

  • alexp
  • alexp's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 2253
  • Thank you received: 180
Hello,

There are some similar posts regarding this on the forum. However here it is the code:
//<code>
global $my;
$myid = $my->id;
if ($myid > 0)
return @mysql_result(mysql_query("SELECT `firstname` FROM `jos_comprofiler` WHERE `user_id`='".$myid."' LIMIT 1"),0);
//</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!