Web Hosting Geeks | Web Hosting Experts
Need help? Call us 1(866)TOP-HOST

14655 reviews 1734 hosting providers

Questions & Answers

Joomla 2.5 contact in a module

Feb 12, 2013 by jomnew
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 votes
Feb 12, 2013 by FixHost
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.
<?php
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;
?>