• 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: Autpopulate from Joomla users

Autpopulate from Joomla users 12 years 7 months ago #19133

  • paypal14
  • paypal14's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 21
I saw the scripting for this process if using CB - is it possible from the standard Joomla users database? The current site I'm working on doesn't need anything like CB.
The administrator has disabled public write access.

Re: Autpopulate from Joomla users 12 years 3 months ago #21182

  • danpoole
  • danpoole's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 4
  • Thank you received: 1
I use this and it works for me
//<code>
$my = & JFactory::getUser();
$db = JFactory::getDBO();
if ($my->get('id'))
{
     $db->setQuery("SELECT name FROM #__users WHERE id = '".$my->get('id')."' LIMIT 1");
     return $db->loadResult();
}
//</code>
The administrator has disabled public write access.

Re: Autpopulate from Joomla users 12 years 3 months ago #21183

  • octavian
  • octavian's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 783
  • Thank you received: 110
You can always use the shorter version:
//<code>
$user = JFactory::getUser();
return $user->get('name');
//</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!