Xoops XMLine
What is XMLine
XMLine is a XOOP2.0+ module for fetching, parsing and displaying XML feeds.
It could be considered as an improved XoopsHeadline module.
Features:
- Supported feeds: RSSs, ATOM
- Fetching methods: CURL, fsockopen, fopen.
- Multi-category
- Multi-language encoding conversion
- User Customable fetching/submit
- Table-free templates
- Unlimited blocks.
- Automatic update using cron job
1. Install
Install the "XMLine" module as usual.
2. How to use it
Server status:
Detect and help configure your sites.
- XML extension: you must have the XML extension installed.
- Fetch techniques: "CURL extension", "fsockopen function", "allow_url_fopen", you must have at least one available in order to use the Digest module.
- Encoding conversion: "Iconv", "Xconv", you need at least one to fetch webpages that use other charset than your default charset.
- Update API: you can update your Digest content automatically by calling this file externally, for instance, using cron job.
Add/edit sites:
Add or edit websites that you would fetch contents. Brief guide:
- Title: abbreviation of the site
- RSS: the URL of the feed to be fetched/parsed
- URL: the URL of the site
- Order: for display order
- Online: 1 - public; 0 - hide
- Maximum items: max items to be fetched
- Charset of XML encoding: "null" for forcing no encoding conversion; leaving blank if feed has specified charset; otherwise, specify it
- Intermediate charset: a stupid but must-do manner for converting S/UTF-8/T Chinese.
- Update time: the time interval that allows for new content fetch
3. Case study
Reading Xoops Official RSS.
- RSS: http://www.xoops.org/backend.php
- Title: XOOPS
- URL:
- Description:
- Order: 1
- Online: 1
- Maximum items: 20
- Charset of XML encoding:
- Intermediate charset:
- Update time: 30
4. Tips
Update XML feed content automatically by using cron job
- the API file: XOOPS_ROOT_PATH/cache/xmline/xmline.php. The file is created during installation, you may re-create whenever it is deleted.
- add cronjob: the command to run: YourPhpPath XOOPS_ROOT_PATH/cache/xmline/xmline.php
- if you do not have cron, let someone else help update your XMLine using his cron: (http://)YourXoopsURL/cache/xmline/xmline.php
- At least, you can use pseudo-cron: put the link (http://)YourXoopsURL/cache/xmline/xmline.php to some page of your site, such as the include/common.php
Adding on-fly custom blocks to display feeds from a site
With XMLine, you can add blocks on-fly as following.
- Enter 'Administration Menu'=>"block admin"=>"Add new block"
- In the "Add a new block":
- Block Type: choose anyone as you prefer
- Weight: input any valid value as you prefer
- Visible: select any one as you prefer
- Visible in: set any one as you prefer
- Title: input any valid text as you prefer
- Content:
===========================================================================
include_once(XOOPS_ROOT_PATH . '/modules/xmline/blocks/xmline_blocks.php');
$options = "1|5|100";
b_xmline_custom($options);
===========================================================================
//$options = "digest_id|Items|description length (0 for no limit)"
- Content Type: MUSTBE "PHP Script"
- Cache lifetime: choose any one as you prefer
- Preview, Submit: press any one as you prefer, BE SURE press at least one time "submit" before leaving block admin
5. Contact
Xoops China: http://xoops.org.cn
D.J. [email protected]
|