Joomla 2.5 contact in a module

asked Feb 12, 2013 in Website Builder by jomnew (2,180 points)
Hi there
I want to add a Joomla 2.5 contact in a module. I tried assigning a contact group to a menu before and it works. But I don’t know how to assign it in a module. Can anyone please help me do this?
Thanks and regards

1 Answer

0 like 0 dislike
answered Feb 12, 2013 by FixHost (12,380 points)
You can write a custom PHP module, something like this
This is just a start to selects the name and the location  from the user with an ID = 3.
defined('_JEXEC') or die;

$db = JFactory::getDBO();
$db->setQuery('SELECT user_name, location FROM #__user_info WHERE id = 3');
$contact = $db->loadObject();

$html = '<p>UserName: ' . $contact->user_name . '</p>' .
        '<p>Country: ' . $contact->Location . '</p>';

echo $html;