Check versions! | |
---|---|
Before we start, check that the version of the module you are about to install is compatible with the PHP-Nuke version of your installation! |
The add-on modules of PHP-Nuke are of various types (see Section 8.3 for some examples), but can be grouped together in 3 different categories:
Modules that do not change the database structure (see Section 26.3.1).
Modules that change the database structure (see Section 26.3.2).
Modules that change both the database structure and the orininal PHP-Nuke files (see Section 26.3.3).
These are the simplest modules to install. Their installation consists only of copying the module's files in the aproppriate folders in PHP-Nuke. There are no changes to the original tables and no new tables involved.
These modules may consist of only a public part, only an administration part , or both. But how tell if a certain module requires a database modification or not? Generally, a module package comes with the following folders:
html html/modules html/admin html/images html/sql |
These modules, although they will not change any original PHP-Nuke files, they will require a change in the PHP-Nuke database. The required change in the database may be of two types:
Some tables are appended to the database, but without changing any of the existing ones.
The original PHP-Nuke tables must be changed.
The installation of these modules consists in the copying of their files into the appropriate folders (see Section 26.3.1 for the details, remember that they don't overwrite or change any original PHP-Nuke file) and the import of a .sql file (using phpMyAdmin, as shown in Section 3.4.2, or the command line as in Section 3.2.4), or the opening of some install.php file through the browser that will make the database changes automatically.
There are module that, in order to function properly, require the addition of functions in the original files of PHP-Nuke. These modules will overwrite mainfile.php, modules.php, or some other file.
Beware of subsequent installations! | |
---|---|
If you install a module that changes PHP-Nuke's original files, you may not be able to conduct the installation of another one that requires changes in those files too! The new module's installation script may not find the expected code to modify, since it will have been changed by the previous one. For example, in PHP-Nuke 6.0 there were two interesting add-on modules, Indy News and Groups, that both required changes to be made in mainfile.php. In order to get them both to work, we had to do the changes in mainfile.php by hand, resulting in a file that contained a mix of modifications by both modules. |
Automatic upgrades may not work any more! | |
---|---|
In case you had to change the original tables of PHP-Nuke (i.e. you had not just to append some new tables to the database, but to change existing ones), then you may find out the next time you want to upgrade, the automatic upgrade scripts that come with each new PHP-Nuke version (see Chapter 4) do not work any more! This is because the scripts will search for the original table structure to upgrade, but will find some new one instead. In this case it is recommended to have a look at the upgrade scripts and do the changes manually, using either a graphical frontend, like phpMyAdmin (Section 3.3) or the MySQL command line (Section 3.2.4). |
The same warning applies to file changes during upgrades: it is best to make the changes in the files by hand, also for those files of the new modules. Such a procedure can be very painful and time-consuming. It is recommended that you use a local test server for all these changes and that you do not upload the modified files, until you have tested them thoroughly and made all backups of the production system. (See Figure 26-2 and Section 7.1, for PHP-Nuke's own backup function, Section 3.3 for phpMyAdmin's functionality, which also includes a very good web interface to database backups and Section 27.16, for home-made scripts that automate the backup work for you).