Tag: Joomla Extension

This article will explain how to create a mambot on Joomla 1.0.x (Plugins from Joomla 1.5). It is recommended to have knowledge of PHP and HTML to read this article.

What is a Mambots?

Mambots are the applications that intercept the contents (documents or items of components) before being published and displayed by the system, and add or alter information dynamically, thus completing the total content that will be delivered the end user’s browser. The Mambots can be called by special commands, or can be displayed by default for certain content / components.

Mambots are located in the directory /mambots. As the components and modules can be installed/uninstalled, configured and published from the backend of Joomla.

Triggers:

At present there are 5 factors (documented) to trigger a Mambots:

onPrepareContent

onSearch

onInitEditor

onGetEditorContents

onEditorArea

Each event require a numer and parameters.

Example of a Mambot:

As modules, Mambots are composed of two core files. One is the .xml file that gives the configuration for the installation, and the other is .php file that allows us to codify what the mambots will do. Al the mambot files should start with “mos”.

Modules are small programs that can be inserted anywhere in a site that uses Joomla.

Depending on the template (the part that handles the entire display) can be placed anywhere dynamically configuring it on the backend.

The function of the modules is basically display information in a small box, for example, could be used to show user data, date and time, temperature of a place in particular, etc. You can also use a module to link it to component and use it as a submenu.

Needed Files

You need 2 files to create a module: One is the XML file that is used for installing and configuring the module in Joomla. The other is the PHP file itself, which perform the task of displaying data on the site. Is necessary to respect the nomenclature putting “mod_” to the name of the module. This is important in order to install it on the Joomla´s backend.

We are currently working on the development of an open source extension for Joomla 1.5 which will add online booking functionalities to any portal implemented on the mentioned CMS.

With this tool the customers of any companies in the sectors of hotels, restaurants, car rental agencies and all those who offer the booking of any good or service for a fixed period will be able to make reservations via the Internet by defining the type of product to purchase and the date of start and end of the reserve. The system will also give the chance to make the payment through Internet.

Companies who use this package may acquire a strong presence on Internet, extending the range of benefits provided to its customers and improve its image by presenting it as active and modern.

This article will explain how to develop customized components for Joomla in the 1.0.x version, showing the files and basic steps, as well as some useful methods such as access to the database, paged results, etc. It is recommended to have knowledge of PHP and HTML to read this article.

Directory structure

Joomla has a directory structure divided into 2 big groups. Administrator, where are all the files needed for the backend to work and the various directories that are located in the root directory.

The directories of interest are the components, both within the administrator directory, as in the root directory, since here is where the files for each component are, which in turn are in sub-directories as follows, com_componentName, example com_users.

If we want to see the files corresponding to the users component, must look at

Administrator/components/com_users (backend)

Components/com_users (frontend)

Another important is the includes directory, since within it we find files that have classes that are going to be used in the component, for example to connect the database (database.php), to manage user data, paging, etc (joomla.php).

The components are stored in the database, more precisely in the jos_components table.

Files that make up a component

A component to be installed must be compressed in a zip file, with the following format com_ComponentName.zip example com_users.zip.

This file must have at least 8 files that are going to be described in brief:

We are pleased to announce that we have completed the requirements phase of JReserv project. Here are the features that we will implement in the first version.

Management:

Resources Management

Packages Management

Prices and Availabilities Management

Clients Managements

Agents Managements

Configuration Managements

Services that would be offered to visitors:

Resources Catalog and Packages

Online Booking

1 Resources Management:

The system will allow the management of resources, allowing to Create, Read, Update y Delete (CRUD) them. The system must store relevant information about it including: title, description and images.

Also should allow to classify the resources in a flexible manner in order to be suitable for any business allowing the proper adaptation of the tool to any environment. A resource would be associated to a bookable category which will be associated with one or more than one category. At the same time, a category can be classified in other parents categories. For example, for a resource of a hotel called “101 room” could be associated to a bookable category called “Double Room”, which may be associated with the following categories “Caesar Hotel” to define that it belong to this hotel. At the same, this hotel may be associated with “Santa Fe” to identify to which city belongs.The category “Caesar Hotel” may be a children of another category called “Emperors Chain” to identify which chain owns the hotel while “Santa Fe” is the children of “Argentina” to determine to which country it belongs. As you can see this is very flexible and could be adapted to any business.

A bookable category may be associated to one or more addons. These addons can be purchased at the same time of the booking. For example, by booking a “Double Room” we would be able to add to our order a “Dinner Menu”. It is possible that the addons impact on the price of the reservation.

Picture 1: Entities associated with resources

Bookable categories and categories would also have associated properties that represents its characteristics. Having this information in a separate entity will allow to perform searches of resources and categories which have these characteristics in common. As an example, the resource “Double Room” could have assigned properties “Jacuzzi”, “Private Bath”, “Air Conditioning”. Then if you’re interested in making a reservation for a room with Jacuzzi you could make a filtering to obtain a list of all the rooms that have those features and then choose between them.