Xoops module development Quick Start Chinese translation (1)

Source: Internet
Author: User
Since I have been studying the xoops module for the past two days, I found this good module development quick start.
After reading it, I came to the development module with great interest, but encountered some problems during the development process.
I think it's too fast to learn. Therefore, the translation is here.
====================
Author: surance Yin
Email: Suranceyin@yahoo.com.cn
Home: http://www.fltek.com.cn
========================

Create a simple module

index

  1. basic content of the module
  2. Create a list
  3. Create a MySQL table
  4. use forms and databases
  5. display database data

This Quick Start teaches you how to create a simple module .

Step 1: Download the blank module on the right. .


tutorial module
tutorial

The basic content of the module.

Open the blank module and you will see 2 Items PHP File, Images Folder, which contains an image-this is the beginning of a module. Use one PHP Open Editor Xoops_version.php. You can use the image Dreamweaver The WYSIWYG editor can also be used. PHP designer Or Maguma Open Studio ( All are free of charge ).


// Quick Start module
// kaotik published

$ Modversion ['name'] = "tutorial ";
$ Modversion ['version'] = 1.00;
$ Modversion ['description'] = "this is a tutorial module to teach how to build a simple module ";
$ Modversion ['author'] = "kaotik ";
$ Modversion ['credits '] = "kaotik ";
$ Modversion ['help'] = "";
$ Modversion ['license '] = "GPL see license ";
$ Modversion ['official '] = 0;
$ Modversion ['image'] = "images/tutorial.png ";
$ Modversion ['dirname'] = "tutorial ";

// Admin
$ Modversion ['hasadmin'] = 0;

// Menu
$ Modversion ['hasmain'] = 1;
?>

Okay. Let's take a look at the aboveCode.

<? PHP
// Tutorial Module
// Created by kaotik

The starting point of PHP is described here.

$ Modversion ['name'] = "tutorial ";
$ Modversion ['version'] = 1.00;
$ Modversion ['description'] = "this is a tutorial module to teach how to build a simple module ";

The meaning of these three rows is obvious. The name, version, and description of the module.

$ Modversion ['author'] = "kaotik ";
$ Modversion ['credits '] = "kaotik ";
$ Modversion ['help'] = "";

. Author and credits a are also easy to understand. Help (if used, of course, this module does not need to be used) should point to a file, suchLp.htmlOrHelp. php

$ modversion ['license '] =" GPL see license ";
$ modversion ['official '] = 0;
$ modversion ['image'] =" images/tutorial.png ";
$ modversion ['dirname'] =" tutorial ";

LicenseThis is the license that this module complies with. Remember, GPL indicates your module's number of GPL protocols. Click here to learn more. Official indicates whether this is an official module. In most cases, set it to 0. Image indicates the identifier of this module on the background management page.

// Admin
$ Modversion ['hasadmin'] = 0;

// Menu
$ Modversion ['hasmain'] = 1;
?>

hasadmin = 0 indicates that this module does not have background management. If you need to display the module in the main menu, set hasmain to 1, otherwise it will not be displayed in the main menu. If both hasadmin and hasmain are set to 0, it will also be displayed in the "module" menu of system management to uninstall this module.

next

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.