9.1. Directory structure

The html folder of PHP-Nuke contains the following directories and files (Figure 9-1):

Figure 9-1. PHP-Nuke directory structure.

PHP-Nuke 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/.

robots.txt:

Contains instructions for search engines. PHP-Nuke's default robots.txt file contains the following:

User-agent: *
Disallow: admin.php
Disallow: /admin/
Disallow: /images/
Disallow: /includes/
Disallow: /themes/
Disallow: /blocks/
Disallow: /modules/
Disallow: /language/

This means that if a search engine visits the site, it should not index the folders mentioned. You can also insert other instructions in the robots.txt file, for example disallow a certain search engine:

User-agent: ArchitextSpider
Disallow: /

In this example, we forbid Excite's spider from indexing the site. However, our instructions will have no effect on a spider that does not honour the robots.txt file. Some aggressive spiders are known for being notorious and not obeying to our instructions in robots.txt. You could try to redirect them to an error page through a test on their IP address, User-agent string or some other criterium using mod_rewrite (see Section 25.2). Please note that the User-agent string can be easily faked.

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...

includes:

Here 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, see also Section 21.9.1).

  • meta.php : contains 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.

db:

Starting from version 6.5, PHP-Nuke uses a new SQL abstraction layer, that of the phpBB forum (see the section “Using the SQL Abstraction Layer” in the ADDONS-MODULES file that comes with the standard PHP-Nuke package). The layer functions are the same as the ones of sql_layer.php, but more extended. Now you can program your modules (Chapter 21) using either the “old” sql_layer.php (which will continue to be supported in the future for backward compatibility), or the functions found in the files of the DB folder.

docs:

Contains this book. Right, this is not only an official HOWTO of the Linux Documentation Project, but also the official PHP-Nuke guide!

language:

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

CautionAttention!
 

The translation of the modules must be inserted in the appropriate folders (modules/language) 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 (see Chapter 4).