1
I've tried, but failed. Maybe there is another way, but this is my working solution:
In modules/publisher/include/common.php add this at the bottom:
// Creating the item handler object
$publisher_item_handler =& xoops_getmodulehandler('item', PUBLISHER_DIRNAME);
// Creating the category handler object
$publisher_category_handler =& xoops_getmodulehandler('category', PUBLISHER_DIRNAME);
^ Taken from smartsectionm so the plugin is the same, just replaced smartsection with publisher:
// $Id: rssfit.publisher.php 244 2006-07-20 08:41:42Z tuff $
###############################################################################
## RSSFit - Extendable XML news feed generator ##
## Copyright (c) 2004 - 2006 NS Tai (aka tuff) ##
## ##
###############################################################################
## XOOPS - PHP Content Management System ##
## Copyright (c) 2000 XOOPS.org ##
## ##
###############################################################################
## This program is free software; you can redistribute it and/or modify ##
## it under the terms of the GNU General Public License as published by ##
## the Free Software Foundation; either version 2 of the License, or ##
## (at your option) any later version. ##
## ##
## You may not change or alter any portion of this comment or credits ##
## of supporting developers from this source code or any supporting ##
## source code which is considered copyrighted (c) material of the ##
## original comment or credit authors. ##
## ##
## This program is distributed in the hope that it will be useful, ##
## but WITHOUT ANY WARRANTY; without even the implied warranty of ##
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ##
## GNU General Public License for more details. ##
## ##
## You should have received a copy of the GNU General Public License ##
## along with this program; if not, write to the Free Software ##
## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ##
###############################################################################
/*
* About this RSSFit plug-in
* Author: tuff
* Requirements (Tested with):
* Module: publisher
* Version: 1.0.4 Beta 2 / 1.1 Beta 1 / 1.05 Beta 1
* RSSFit verision: 1.2 / 1.5
* XOOPS version: 2.0.13.2 / 2.2.3
*/
if( !defined('RSSFIT_ROOT_PATH') ){ exit(); }
class Rssfitpublisher{
var $dirname = 'publisher';
var $modname;
var $grab;
function RssfitPublisher(){
}
function loadModule(){
$mod =& $GLOBALS['module_handler']->getByDirname($this->dirname);
if( !$mod || !$mod->getVar('isactive') ){
return false;
}
$this->modname = $mod->getVar('name');
return $mod;
}
function &grabEntries(&$obj){
$ret = false;
include XOOPS_ROOT_PATH."/modules/publisher/include/plugin.tag.php";
$items = $item_handler->getAllPublished($this->grab, 0);
if( false != $items && count($items) > 0 ){
for( $i=0; $i<count($items); $i++ ){
$ret[$i]['link'] = $ret[$i]['guid'] = $items[$i]->getItemUrl();
$ret[$i]['title'] = $items[$i]->getVar('title', 'n');
$ret[$i]['timestamp'] = $items[$i]->getVar('datesub');
$ret[$i]['description'] = $items[$i]->getVar('summary');
$ret[$i]['category'] = $this->modname;
$ret[$i]['domain'] = XOOPS_URL.'/modules/'.$this->dirname.'/';
}
}
return $ret;
}
}
?>
and save it as/in modules/rss/plugins/rssfit.publisher.php