The process is very fast and easy and if you follow the guidelines below you will get the hang of it very quickly.
The features:In this module we will use the table jos_users to retrieve the id, name and username of the registered users.
In the module parameters we will be able to control the user data we want to display.
The file structure
Create the file structure that you see below, using your favorite file editor.
Tip: I am using a great free text / code editor called HTML-Kit. You can download it for free here.
This is the most basic file structure for a database driven module.
Now let's populate our files.
1. Open the file mod_userdata.xml and insert this code
This is the typical structure of a module xml file for Joomla 1.7.
2. Open the file mod_userdata.php and insert this code
3. Now let's move on to the file helper.php. This is the file that retrieves the data from the MySQL table.
Open the file helper.php and insert this code
In this file, we firstly request the id, name and username from the table jos_users where the users are not blocked (block=0). Then we order the results by id and finally we limit the results to the limit that is defined in the module backend parameters. Let's move on to our template file.
4. Our template file is responsible for displaying the results.
Open the file tmpl/default.php and insert this code
5. Open the file index.html as well as the file tmpl/index.html and insert this code
This will prevent unauthorized directory browsing.
Now we are ready to pack our files and install the new module.