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:
  1. Supported feeds: RSSs, ATOM
  2. Fetching methods: CURL, fsockopen, fopen.
  3. Multi-category
  4. Multi-language encoding conversion
  5. User Customable fetching/submit
  6. Table-free templates
  7. Unlimited blocks.
  8. 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

  1. the API file: XOOPS_ROOT_PATH/cache/xmline/xmline.php. The file is created during installation, you may re-create whenever it is deleted.
  2. add cronjob: the command to run: YourPhpPath XOOPS_ROOT_PATH/cache/xmline/xmline.php
  3. if you do not have cron, let someone else help update your XMLine using his cron: (http://)YourXoopsURL/cache/xmline/xmline.php
  4. 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.
  1. Enter 'Administration Menu'=>"block admin"=>"Add new block"
  2. In the "Add a new block":
    1. Block Type: choose anyone as you prefer
    2. Weight: input any valid value as you prefer
    3. Visible: select any one as you prefer
    4. Visible in: set any one as you prefer
    5. Title: input any valid text as you prefer
    6. 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)"
    7. Content Type: MUSTBE "PHP Script"
    8. Cache lifetime: choose any one as you prefer
    9. 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]