Getting ready

Create the necessary directories

Create the directory that’ll hold the module’s name. This directory will contain, at least:

  • The module’s information file (xoops_version.php)
  • The module’s logo, unless it’s in an images subfolder

Unless you’re creating a module without a menu (like, for instance, a block), this directory will contain the file index.php, and this file will be invoked with a link in the Main Menu.

The subdirectories

They’re all optional, except /language, and act to serve the needs of the module. admin: used if you create a module that needs to be managed blocks: used if you create blocks; you hold here the files that manage those blocks, and you need to associate these files with template/blocks cache: for the files created/updated by your module (that need to be CHMODed) class: if you create any classes images: for your images include: for whatever files including functions you might have language: it’s mandatory to have at least the subdirectory /english sql: if your module uses a database, you put here the script to install/uninstall the module templates: if your module or your blocks use templates In those directories that you’ll use and that don’t contain an index.php file (such as images, class, sql...) you need to include a file index.html containing this single instruction:


Create your file xoops_version.php

// Name of the module 
$modversion['name'] = _MI_MYMODULE_NAME; 

// Version of the module $modversion['version'] = 1.0;

// Brief description of the module $modversion['description'] = _MI_MYMODULE_DESC;

// Author $modversion['author'] = "Author";

// Credits $modversion['credits'] = "Credits";

// If you have a help file $modversion['help'] = " mymodule.html";

// License $modversion['license'] = "GPL see LICENSE";

// If it’s an official module $modversion['official'] = 1;

// Path and name of the module’s logo $modversion['image'] = "images/mymodule_slogo.png";

// Name of the directory that holds the module $modversion['dirname'] = " mymodule ";

Create your logo

  • It’s advisable to use the name mymodule_slogo
  • Use preferently the PNG format (if it’s not possible, use GIF or JPG)

Create your language files

  • modinfo.php
  • main.php

Create your file mysql.sql

This is the script that contains the tables for your module, usually just the structure. Please notice that the tables’ names should NOT include the prefix XOOPS. A module to build upon In this same document you’ll find an empty module to download. It contains the directories and some of the base files, so you can begin easily the creation of your own module; it also contains a blank module logo for you to fill. And if this module has not much of a use, at least you can install it and uninstall it. Cool, huh?

The file index.php

The queries

The templates

= The blocks

=

The forms

= Language files

=

Administration

= The search function

=

Comments

Category: Not Completed Category: Getting Started <[Languages |Module Control Panel Support]>

Last modified on 2010/11/28 by Anonymous
Comments
The comments are owned by the poster. We aren't responsible for their content.