1
ohwada
RSS Center Module
  • 2006/1/3 14:57

  • ohwada

  • Just popping in

  • Posts: 28

  • Since: 2003/11/15


* Module Outline *
This module collects RDF/RSS/ATOM feeds from the registered sites, and stores in a database.
This module searchs feeds in database, and carries out the search results in RDF/RSS/ATOM form.

This module becomes independent from the RDF/RSS/ATOM function of WebLinks module,
and enhances more powerful.

This module aims the platform of RDF/RSS/ATOM feeds.
As an example of application, like a headline module, like the Web Servicehttp://sf.livedoor.com/.

Now, it is the beta version.
From now on, the specification and implementation may change sharply.
Even if some problems come out, only those who can do somehow personally need to use.
Welcome the proposal of specification or the example of application, a bug report, a bug solution, and your hack, etc.

Demo is here

Download is here


* Main Function *
1. Site Registration
Enter A site name, site URL, URL of RDF/RSS/ATOM, cash time, etc.

2. RDF/RSS/ATOM Auto Discovery
If a site corresponds to "RDF/RSS/ATOM Auto Discovery",
when you register the URL of a site,
this module will detect automatically the URL of RDF/RSS/ATOM, and register it.

3. Blacklist
If you register Blog Search Sites, such ashttp://sf.livedoor.com/,
this module may collect feeds which you dont desire.
If you register the URL of undesirable site into a blacklist,
this module will stop to collect feeds from this site.

4. How to collect RDF/RSS/ATOM feeds
This module supports three methods.

4.1 Someone accesses by WEB browser.
When someone accesses a simple headline page or block.
this module collects automatically RDF/RSS/ATOM feeds.
This module collects feeds form the only sites to show in the simple headline.
A timeout may be carried out, if there are many sites to show in the simple headline.

4.2 An administrator collects manually.
This module supports "archive management" in admin page.

4.3 Automatically in the command line mode.
Look "setup of a command line".

5. XML Parser of RDF/RSS/ATOM feed
5.1 Character Code
This module can correspond to many character codes.
However, if there is no specification of a character code in XML format,
or XML use character code which PHP multi-byte function does not support,
this module may not parse it correctly.
Since PHP XML parser function support only US-ASCII or UTF-8,
this module converts another character code to UTF-8, and parses it.

5.2 Parser Selection
According to XML form as RDF or RSS or ATOM,
this module will select XML parser automatically.
Furthermore, this module support two or more parser,
you can select a favorite parser.
this module support the XOOPS core's RSS parser and this module's original parser.
The original parser can parse many items than XOOPS parser.

6. Show of RDF/RSS/ATOM feeds
(1) allow to use HTML tags, or not
You can choice to use HTML tags, or not, in Title and Content.
If you choise use HTML tags and Content contains Java Script,
this module may sanitaize JS, and JS will become invalid.

7. Processing of a deficient RDF/RSS/ATOM feeds
(1) no title
If feed have no tile,
this module substituted by "---", and show it

(2) no date
If feed have no date, this feed may be shown always in the tail end.
This module substitute by present time, and store it to database.

(3) future date
If feed have future date, this feed may be shown always in top line.
This module show feeds except more than 3 days future.

8. Server environment
(1) This module corresponds to PHP allow_url_fopen is off.

9. Import from other Module
9.1 XoopsHeadline Module
This module can import the data from XoopsHeadline Module,
such as headline table.

9.2 WebLinks Module
This module can import the data from WebLinks Module,
such as link table, feed table, and blacklist.
A present, there is no cooperation function with RSSC and WebLinks.
You MUST continue to use WebLinks RSS/ATOM function.

10. Module Duplicate
This module can be duplicated only by copying.
It is the same function as TinyD module, etc.
Currently prepared module name are "rssc" and "rssc0" .
When you want touse another name,
please create necessary files in sql, templates, and images directory.

2
Seafar
Re: RSS Center Module
  • 2006/2/28 17:00

  • Seafar

  • Just popping in

  • Posts: 4

  • Since: 2005/9/3 0


Hello Ohwada,

This module, RSS Center, is quite nice and better than XHLD.

If it doesn't stripe the HTML tag, for example, enabled to display photo pictures, I guess it'll be great and of much commercial value. This could be a module relative to individule showrooms inside a B2B portal.

http://www.made-in-china.com
http://www.alibaba.com

I.e.,

thesite.com/(xoops0)
thesite.com/company-name-1 (xoops1/modules/smartsection for example RSS)
thesite.com/company-name-2(xoops2/modules/smartsection for example RSS)
thesite.com/company-name-3(xoops3/modules/smartsection for example RSS)
.......
thesite.com/company-name-to-the-limite-number-of-disc-space

All above RSS/ATOMs are syndicated to thesite.com/modules/rssc and stored into the database.

This is a portal aggregator of business site that I am thinking of.

Anyway, displaying photos is entirely important for it.

Please contact me if you get any idea. Thank you.

3
gestroud
Re: RSS Center Module
  • 2006/3/2 8:13

  • gestroud

  • Home away from home

  • Posts: 1538

  • Since: 2004/12/22


Having problems installing this module on some sites. Getting the following error message:

Notice [PHP]: Only variables should be assigned by reference in file modules/rssc0/class/rssc_db_base.php line 172

I tried to get some answers on the developer's site, but there's some strange stuff going on there and no one is getting any help. Here is the file in question. I'm trying to see the error, but I can't find it to save my life.

Would someone help us figure it out, please?

<?php
// $Id: rssc_db_base.php,v 1.1.1.1 2006/01/03 05:06:02 ohwada Exp $

// 2006-01-20 K.OHWADA
// small change

//=========================================================
// Rss Center Module
// 2006-01-01 K.OHWADA
//=========================================================

// === class begin ===
if( !class_exists('rssc_db_base') ) 
{

//=========================================================
// class rssc_db_base
//=========================================================
class rssc_db_base extends rssc_error
{
// class instance
    
var $_db;

// override
    
var $_table;
    var 
$_id_name;
    var 
$_class_name;

// debug
    
var $_flag_debug_print_sql 0;
    var 
$_debug_max_sql 1000;

// define by rssc_error
//    var $_flag_debug_print_log   = 0;
//    var $_flag_debug_print_error = 0;

//---------------------------------------------------------
// constructor
//---------------------------------------------------------
function rssc_db_base($dirname$handler_name)
{
// check dirname
    
if ( empty($dirname) )
    {
        
$error 'System Error: dirname is empty: '.$handler_name;

        if ( 
function_exists('xoops_error') )
        {
            
xoops_error$error );
        }
        else
        {
            echo 
$error;
        }
    }

    
$this->rssc_error();

// class instance
    
$this->_db =& Database::getInstance();
}

//---------------------------------------------------------
// public
//---------------------------------------------------------
function &create($isNew true)
{
    
$config = new $this->_class_name();

    if (
$isNew
    {
        
$config->setNew();
    }

    return 
$config;
}

function 
delete(&$obj$force=false)
{
    if ( !
$this->_check_class($obj) )
    {
        
$this->_set_errors('table delete: not match class');
        return 
false;
    }

    
$id  $obj->getVar($this->_id_name);
    
$sql "DELETE FROM ".$this->_table." WHERE ".$this->_id_name." = ".$id;

    if ( !
$result $this->_query($sql00$force) ) 
    {    return 
false;    }

    return 
true;
}

function &
get($id)
{
    
$id intval($id);

    if (
$id <= 0)
    {
        
$this->_set_errors('table get: id must be above zero');
        return 
false;
    }

    
$sql "SELECT * FROM ".$this->_table." WHERE ".$this->_id_name." = ".$id;

    if ( !
$result $this->_query($sql) ) 
    {    return 
false;    }

    
$numrows $this->_db->getRowsNum($result);
    if (
$numrows != 1)  return false;

    
$obj $this->create();
    
$obj->assignVars($this->_db->fetchArray($result));

    return 
$obj;
}

function &
getObjects($criteria null)
{
    
$ret = array();
    
$limit $start 0;

    
$sql 'SELECT * FROM '.$this->_table;

    if (isset(
$criteria) && is_subclass_of($criteria'criteriaelement')) 
    {
        
$sql .= ' '.$criteria->renderWhere();

        
$sort $criteria->getSort();

        if (
$sort)
        {
            
$sql .= ' ORDER BY '.$sort;
        }
        else
        {
            
$sql .= ' ORDER BY '.$this->_id_name.' '.$criteria->getOrder();
        }

        
$limit $criteria->getLimit();
        
$start $criteria->getStart();
    }
    else
    {
        
$sql .= ' ORDER BY '.$this->_id_name;
    }

    if ( !
$result $this->_query($sql$limit$start) ) 
    {    return 
false;    }

    while ( 
$row $this->_db->fetchArray($result) ) 
    {
        
$obj $this->create();
        
$obj->assignVars($row);
        
$ret[] =& $obj;
        unset(
$obj);
    }

    return 
$ret;
}

function 
getCount($criteria null)
{
    
$sql 'SELECT COUNT(*) FROM '.$this->_table;

    if (isset(
$criteria) && is_subclass_of($criteria'criteriaelement')) 
    {
        
$sql .= ' '.$criteria->renderWhere();
    }

    if ( !
$result =& $this->_query($sql) ) 
    {
        return 
0;
    }

    list(
$count) = $this->_db->fetchRow($result);
    return 
$count;
}

function &
getObjectsBySql($sql$limit=0$start=0)
{
    if ( !
$result $this->_query($sql$limit$start) ) 
    {    return 
false;    }

    
$ret = array();

    while (
$myrow $this->_db->fetchArray($result)) 
    {
        
$obj $this->create();
        
$obj->assignVars($myrow);
        
$ret[] =& $obj;
        unset(
$obj);
    }

    return 
$ret;
}

function 
getCountBySql($sql)
{
    if ( !
$result =& $this->_query($sql) ) 
    {
        return 
0;
    }

    list(
$count) = $this->_db->fetchRow($result);
    return 
$count;
}

//---------------------------------------------------------
// set & get parameter
//---------------------------------------------------------
function set_flag_print_sql($value)
{
    
$this->_flag_print_sql intval($value);
}

function 
set_table()
{
    return 
$this->_table;
}

//---------------------------------------------------------
// database handler
//---------------------------------------------------------
function _query($sql$limit=0$offset=0$force=false)
{
    if ( 
$force )
    {
        
$result $this->_db->queryF($sql$limit$offset);
    }
    else
    {
        
$result $this->_db->query($sql$limit$offset);
    }

    
$this->_print_sql($sql);

    if ( !
$result 
    {
        
$this->_set_db_error($sql);
        return 
false;
    }

    return 
$result;
}

function 
_queryF($sql$limit=0$offset=0)
{
    
$result $this->_db->queryF($sql$limit$offset);

    
$this->_print_sql($sql);

    if ( !
$result 
    {
        
$this->_set_db_error($sql);
        return 
false;
    }

    return 
$result;
}

function 
_quote($text)
{
    return 
$this->_db->quoteString($text);
}

//---------------------------------------------------------
// funcuton
//---------------------------------------------------------
function _check_class( &$obj )
{
    if (
strtolower(get_class($obj)) == $this->_class_name
    {
        return 
true;
    }

    return 
false;
}

//---------------------------------------------------------
// error
//---------------------------------------------------------
function _set_db_error($sql='')
{
    
$err1 $this->_db->error();
    
$this->_set_errors$err1 );

    if (
$sql)
    {
        
$err2 $this->_shorten_text($sql$this->_debug_max_sql);
        
$this->_set_errors$err2 );
    }
}

function 
_print_sql($sql)
{
    if ( !
$this->_flag_debug_print_sql )  return;
    if ( empty(
$sql) )  return;

    
$sql $this->_shorten_text($sql$this->_debug_max_sql);
    
$sql htmlSpecialChars($sql);
    echo 
"sql: $sql <br />n";
}

//---------------------------------------------------------
// multi byte
//---------------------------------------------------------
function _shorten_text($text$max=100)
{
    if ( 
strlen($text) > $max)
    {
        if (
function_exists('mb_strcut'))
        {
            
$text mb_strcut$text0$max )." ...";
        }
        else
        {
            
$text substr$text0$max )." ...";
        }
    } 

    return 
$text;
}

// --- class end ---
}

// === class end ===
}

?>

4
Seafar
Re: RSS Center Module
  • 2006/3/4 15:53

  • Seafar

  • Just popping in

  • Posts: 4

  • Since: 2005/9/3 0


Hello gestroud,

The code designer rationally hold no responsibility to answer any question 'cause they might be busy, somthing like this.

If you don't wanna see the debug message, just turn back to your admin panel


{module)system > General Settings [Edit] > Debug mode


then turn the debug mod to "off", instead of of "PHP Debug"

5
Anonymous
Re: RSS Center Module
  • 2006/3/4 16:06

  • Anonymous

  • Posts: 0

  • Since:


is a great module

thanks for it

6
gestroud
Re: RSS Center Module
  • 2006/3/6 15:06

  • gestroud

  • Home away from home

  • Posts: 1538

  • Since: 2004/12/22


Quote:

Seafar wrote:
then turn the debug mod to "off", instead of of "PHP Debug"


Ummm, I know how to turn debug off. My problem is that the config.ini won't initialize after install. And this guy hasn't answered his own forum in over a month. But thanks anyway. Have a nice day.

Login

Who's Online

152 user(s) are online (105 user(s) are browsing Support Forums)


Members: 0


Guests: 152


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits