You are missing our premiere tool bar navigation system! Register and use it for FREE!

•  Home •  Downloads •  Gallery •  Your Account •  Forums • 
Readme First
- Readme First! -

Read and follow the rules, otherwise your posts will be closed
· Home
· Buy a Theme
· Advertising
· AvantGo
· Bookmarks
· Columbia
· Community
· Donations
· Downloads
· Feedback
· Forums
· Private Messages
· Search
· Statistics
· Stories Archive
· Submit News
· Surveys
· Theme Gallery
· Top
· Topics
· Your Account
Who's Online
There are currently, 351 guest(s) and 0 member(s) that are online.

You are Anonymous user. You can register for free by clicking here
Creating fully compatible modules: the rules to follow

21.2. Creating fully compatible modules: the rules to follow

For people who have a base knowledge of the PHP language it is very simple to construct a module. Generally to create a PHP-Nuke module means:

  • To create PHP files for the users, ie the public part of the site

  • To create an administrator interface

  • To verify that everything we have created is in keeping with the PHP-Nuke development rules.

But what about the development rules?

It is a good idea to stop on this point before continuing on to the programming part.

  1. Rule: the modules must be included in the folder modules/namemodule in the public part and the folder admin/modules in the administration part

  2. Rule: the main file of the module included in modules/nameofmodule must be called index.php

  3. Rule: the tables in the php syntax are indicated by prefix. For example Nuke pages will be indicated with "$prefix."_pages, where $prefix takes the value from the config.php file which is nuke by default.

  4. Rule: the location of the images or links must start from the root of your html directory and not from the folder modules/nameofmodule because the files contained in it are included in a file placed in html's root directory that's called modules.php

  5. Rule: to manage the multilanguage function in an optimal way we have to create some text abstractions that we will insert in the files by making a folder called "language" inside the folder of the module. Everything will then be automatically recalled. For example, if we need to create a module that we call Topolino (the Italian name of Mickey Mouse) we must give the possibility to those who use the Italian interface to read "Topolino" and to those who use the English one to read "Mickey Mouse" ; -).

How do we do it?

First of all we create the folder "language" inside the folder modules/topolino We insert in this folder two php files that we will call lang-italian.php and lang-english.php We create an abstraction for topolino, in the lang-italian.php it will be:

define("_TOPO", "Topolino");

And in English it will be:

define("_TOPO", "Mickey Mouse");

In this way inserting in the module the abstraction "_TOPO" this will be automatically replaced by Topolino in the Italian interface and by Mickey Mouse in the English interface.

Web site engine's code is Copyright © 2002 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 0.139 Seconds - 330 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded ( ::