User Account Via Submit Field

More
1 year 2 months ago #83449 by krae
Replied by krae on topic User Account Via Submit Field
I apologize, I should have explained a little more.

The email I need to display is that of the article author from their user account. I imagine I can get it using SQL, but I'm wondering if there is a simpler way.

Thank you

Please Log in or Create an account to join the conversation.

More
1 year 2 months ago #83451 by krae
Replied by krae on topic User Account Via Submit Field
Update in case anyone needs it in the future. I added the following to a module and displayed it in a Flexi field

<?php
// no direct access
defined('_JEXEC') or die('Go Away');

//Grab the user ID of the author from the content component
$cdd_article =& JTable::getInstance('content');
$cdd_article->load(JRequest::getInt('id'));
$cdd_authorid = $cdd_article->created_by;

//Grab the contact associated with the above user ID
$db =& JFactory::getDBO(); //Establish DB Link
$query = "SELECT * FROM #__users WHERE id = " . $cdd_authorid ;
$db->setQuery($query); //Execute query. Should return 1 row
$cdd_contact = $db->loadAssoc(); //Load results as associative array


$cdd_email = $cdd_contact;

echo $cdd_email;

?>

reference: forum.joomla.org/viewtopic.php?t=445653

Please Log in or Create an account to join the conversation.

More
1 year 2 months ago #83452 by micker
in you template you can use some php code

$user = JFactory::getUser($item->created_by);
$email = $user->get('email');//user email
echo $email;

its done

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

Please Log in or Create an account to join the conversation.

More
1 year 2 months ago #83453 by krae
Replied by krae on topic User Account Via Submit Field
I figured there had to be an easier way. As always, thank you for your help!

Please Log in or Create an account to join the conversation.

More
1 year 2 months ago #83458 by micker
with pleasure

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.278 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline