1
I've googled and searched forums, and I didn't find RSSFit plugin for Classifieds module. So I used plugin for Jobs module (
http://www.jlmzone.com) as a base.
So here it is (copy/paste following code in editor and save it as "rssfit.classifieds.php" then copy file in modules/rss/plugins/).
// $Id: rssfit.pluginsample.php 70 2005-11-09 16:06:22Z tuff $
###############################################################################
## RSSFit - Extendable XML news feed generator ##
## Copyright (c) 2004 - 2005 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 ##
###############################################################################
/*
* Classifieds RSSFit plugin based on Jobs RSSFit plugin by www.jlmzone.com
* Done by Bjuti (http://www.bjuti.info)
*
* About this RSSFit plug-in
* Author: Bjuti (http://www.bjuti.info) based in Jobs plugin by John Mordo
* Requirements (or Tested with):
* Module: Classifeds
* Version: 2.0RC
* Last release date: Jan. 18 2010
* RSSFit verision: 1.2 / 1.5
* XOOPS version: 2.0.13.2 / 2.2.3 / 2.3.2b / 2.4.3
*/
if( !defined('RSSFIT_ROOT_PATH') ){ exit(); }
class RssfitClassifieds{
var $dirname = 'classifieds';
var $modname;
var $grab;
var $module; // optional, see line 74
function RssfitClassifieds(){
}
function loadModule(){
$mod =& $GLOBALS['module_handler']->getByDirname($this->dirname);
if( !$mod || !$mod->getVar('isactive') ){
return false;
}
$this->modname = $mod->getVar('name');
//$this->module =& $mod; // optional, remove this line if there is nothing
// to do with module info when grabbing entries
return $mod;
}
function &grabEntries(&$obj){
global $xoopsDB;
$myts =& MyTextSanitizer::getInstance();
$ret = false;
$i = 0;
// The following example code grabs the latest entries from the module MyLinks
$sql = "SELECT lid, title, status, desctext, date from ".$xoopsDB->prefix("classifieds_listing")." WHERE valid = 'Yes' ORDER BY date DESC";
$result = $xoopsDB->query($sql, $this->grab, 0);
while( $row = $xoopsDB->fetchArray($result) ){
$link = XOOPS_URL.'/modules/'.$this->dirname.'/index.php?pa=viewads&lid='.$row['lid'];
/*
* Required elements of an RSS item
*/
// 1. Title of an item
$ret[$i]['title'] = $row['title'];
// 2. URL of an item
$ret[$i]['link'] = $link;
// 3. Item modification date, must be in Unix time format
$ret[$i]['timestamp'] = $row['date'];
// 4. The item synopsis, or description, whatever
$ret[$i]['description'] = $row['desctext']; // $myts->displayTarea($row['desctext']);
/*
* Optional elements of an RSS item
*/
// 5. The item synopsis, or description, whatever
// $ret[$i]['guid'] = $link;
// 6. A string + domain that identifies a categorization taxonomy
// $ret[$i]['category'] = $this->modname;
// $ret[$i]['domain'] = XOOPS_URL.'/modules/'.$this->dirname.'/';
// 7. extra tags examples
$ret[$i]['extras'] = array();
$i++;
}
return $ret;
}
}
?>
Works for me, let me know does it works for you. Any help is more than welcome :)
P.S. Check out:
Classifieds + Fancyboxand
Classifieds + Meta Description