XOOPS WhatsNew Module

Plugin Specification

Principle

I adopte the same structure as XOOPS search method.

In XOOPS search,
a file name and a function name are specified in xoops_version.php,
like as follows.
$modversion['hasSearch'] = 1;
$modversion['search']['file'] = "include/search.inc.php";
$modversion['search']['func'] = "news_search";

In this module,
the file name and the function name are are fixed.

Placement

The file of plugin is placed in the following.
A module's is used when there are in both.

(1) Each modules
MODULE_DIRECTORY/include/

(2) WhatsNew
whatsnew/plugins/MODULE_DIRECTORY_NAME/

You can place twe or more plugins in one module.
Refer to the plugin management.


Plugin main unit

File name and funciton name

A file name is "dada.inc.php".
A function name is directory name (module name) + "_new" like as "news_new".

Calling form

funtion_name ( $limit, $offset )
$limit : upper limit of articles
$offset : offset of article by time

Return Value

array[serinal_number][item]

Explanation of items

Item Meaning WhatsNew Block RSS/RDF ATOM
title title * * *
link URL * * *
time time * * *
modified modified time - - * (note 1)
issued issued time - - * (note 1)
created created time - - - (note 1)
description description (note 2) o o o
cat_name category name o - -
cat_link category's URL o - -
uid user ID o - * (note 3)
hits number of hitsr o - -
replies number of replies o - -
image image URL o (note 4) - -
width image width o (note 4) - -
height image height o (note 4) - -
id aricle number - - * (note 5)
pda URL for PDA (note 6) - - -
* : indispensable o: option - : unnecesary

note 1:

There are four items of time.
All item are unix time. Ignore 2003 yers problem.

"time" is indispensable.
"modified" and "issued" are option for ATOM.

ATOM require "updated modified "and "published issued " tag .
When they are not set up, this program substitute "time".
"created" is option in ATOM.
tag name are chaged in ATOM spec 1.0.

note 2:

the plugin can use HTML tag in "description".
the pluin set up a whole HTML sentence after rendering or a plane text.

In What's New Block.
this program display as it is, or display after strip HTML tag,
when "description" is less than "Max chars of summary" of config,
this program display summary after strip HTML tag and shorten it ,
when it is more than "Max chars of summary" .

In RSS,
a summary is displayed.

In ATOM.
A whole sentence is displayed in content tag.
a summary is displayed in summary tag.

note 3:

In What's New Block.,
this program get a login name from "uid",
and display it as user.

In ATOM, the author name in name tag is indispensable.
This program a login name as an author name.

In ATOM, the author's URL in url tag and the author's email in email tag are option.
This program does not use them as a privacy policy.

This option is desirable to use only the module which specifies the writer name.

note 4:

the plugin setup the thumbnail image in "image".

this program will resize and display image,
if it is more than "Width of site logo" and "Height of site logo" of config.
this program will display as "Width" and "Height" of config,
if "width" and "height" are not set up.

note 5:

In ATOM, the unique number in id tag is indispensable.
This program generate the unique number from a module number and "id".
When "id" is not set up,
This program substitute a temporary number.

note 6:

In whatnew/pda.php, there is "what's new" for PDA with simple style.
This module displays "pda" in the URL if there is "pda", this displays "link" if not being.
print.php of the module is often substituted for "pda".


Plugin managemnet unit

If you place twe or more plugins in one module,
you should place file which shows the information when the administrator can select plugins.

File name and funciton name

A file name is "version.php".
A function name is directory name (module name) + "_new_version" like as "newbb_new_version".

Calling form

funtion_name ()
The argument is unnecessary.

Return Value

array[serinal_number][item]

Explanation of items

Item Meaning
version version of module or plugin
file file name of plugin
description description of plugin


$Id: plugin_spec.html,v 1.4 2006/06/29 02:47:02 ohwada Exp $
Back to index