Architecture and structure

PHP-Nuke: Management and Programming
Prev |  | Next

# Chapter 6. Architecture and structure

The structure of PHP-Nuke is organized in to modules, all the files are managed by other files that are located in the PHP-Nuke root directory and include, according to the parameters passed to them, the intended module.

These tasks are carried out from only 3 pages:

- index.php : In order to display the main page

- modules.php : In order to include the internal modules.

- admin.php : In order to include the administration interface.

It's not possible to call a module by calling a direct path to it. This is so in order to make installation easier, render the graphics management more independent (otherwise we would have to change the path of the images each time we position ourselves in an internal directory), have only a few files in the root directory and render the system more secure.

Everything is being called, as I said, through parameters (strings) passed to the "modules.php" file which specify which files are to be included. If for example we want to call the Topics module, the string to be passed should be http://www.yoursite.com/modules.php?name=Topics

The command that is sent this way is "includes in the page created by modules.php the output of the file index.php that is found in the folder modules/Topics/".

The other files present in the PHP-Nuke root directory are:

- auth.php: Manages authentication through the cookies.

- mainfile.php: Contains all the necessary functions for the management of PHP-Nuke

- header.php: manages the variables that are related to the header (inclusion of metatags, Javascript...)

- footer.php: variables related to the footer.

- backend.php: manages the output of the news that can be captured from other sites

- ultramode.txt: ditto

- robots.txt: contains instructions for the search engines informing them which folders not to index

# Directory structure

Admin:

  Contains 4 subdirectories (links, language, case, modules) that manage the various administration modules. The folder that accommodates the operating files is modules/admin/ .

Blocks:

  Contains all the block files for all of our available blocks.

Images:

  Contains all the images relating to PHP-Nuke, for example in the folder "topics" we will find archived the images of the topics that will appear in the news, in "banners" all banners in rotation etc...

In includes

  are all the files that are necessary to particular management situations, these files do not work independently but are included in other files, mainly in mainfile.php and header.php. The files are:

- counter.php : serves to identify the users based on the operating system used, the browser, the page of origin, date of the visit...

- javascript.php : includes all necessary Javascript (if you need particular Javascript code, include it in this file).

- meta.php : manages the keywords to pass to the search engines and other parameters of the header. It is an optimal system for learning how to create keywords and position the site with a good ranking in the search engines.

- my_header.php : manages the disclaimer message in the homepage.

- sql_layer.php : serves to manage the database abstraction layer. Transforms SQL instructions to the language of the chosen database. Remember that PHP-Nuke can manage various databases.

Language:

  contains translation files for the basic PHP-Nuke module. The language file naming convention is lang-english.php.

Attention!
The translation of the modules must be inserted in the appropriate folders (modules/languange) and not appended to these files, as it was done till now.

Modules:

  The modules of PHP-Nuke comprise all the functionality that one can add to it.. In the Modules folder we insert the folders of every new module.

Themes:

  Here we add the graphical interfaces known as "Themes", every folder has the name of the corresponding theme and contains a main file called theme.php and all other support files.

Upgrades:

  contains only the files that serve to upgrade the system from a previous version to a newer one..

Prev | Home | Next
How to install PHP-Nuke through PHPMyadmin |  | Main page management