
Thank you
Btw heres the rssfit plugin for publisher module
https://xoops.org/modules/newbb/viewtopic.php?topic_id=72485
/*
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.
*/
/**
* @copyright The XUUPS Project http://sourceforge.net/projects/xuups/
* @license http://www.fsf.org/copyleft/gpl.html GNU public license
* @package Publisher
* @subpackage Action
* @since 1.0
* @author trabis
* @author The SmartFactory
* @version $Id: backend.php 0 2009-06-11 18:47:04Z trabis $
*/
include_once dirname(__FILE__) . '/header.php';
error_reporting(0);
$GLOBALS['xoopsLogger']->activated = false;
include_once XOOPS_ROOT_PATH . '/class/template.php';
if (function_exists('mb_http_output')) {
mb_http_output('pass');
}
$categoryid = isset($_GET['categoryid']) ? $_GET['categoryid'] : -1;
if ($categoryid != -1) {
$categoryObj = $publisher->getHandler('category')->get($categoryid);
}
header('Content-Type:text/xml; charset=' . _CHARSET);
$tpl = new XoopsTpl();
$tpl->xoops_setCaching(2);
$tpl->xoops_setCacheTime(0);
$myts = MyTextSanitizer::getInstance();
if (!$tpl->is_cached('db:publisher_rss.html')) {
$channel_category = $publisher->getModule()->name();
// Check if ML Hack is installed, and if yes, parse the $content in formatForML
if (method_exists($myts, 'formatForML')) {
$xoopsConfig['sitename'] = $myts->formatForML($xoopsConfig['sitename']);
$xoopsConfig['slogan'] = $myts->formatForML($xoopsConfig['slogan']);
$channel_category = $myts->formatForML($channel_category);
}
$tpl->assign('channel_charset', _CHARSET);
$tpl->assign('channel_title', htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES));
$tpl->assign('channel_link', PUBLISHER_URL);
$tpl->assign('channel_desc', htmlspecialchars($xoopsConfig['slogan'], ENT_QUOTES));
$tpl->assign('channel_lastbuild', formatTimestamp(time(), 'rss'));
$tpl->assign('channel_webmaster', $xoopsConfig['adminmail']);
$tpl->assign('channel_editor', $xoopsConfig['adminmail']);
if ($categoryid != -1) {
$channel_category .= " > " . $categoryObj->name();
}
$tpl->assign('channel_category', htmlspecialchars($channel_category));
$tpl->assign('channel_generator', $publisher->getModule()->name());
$tpl->assign('channel_language', _LANGCODE);
$tpl->assign('image_url', XOOPS_URL . '/images/logo.gif');
$dimention = getimagesize(XOOPS_ROOT_PATH . '/images/logo.gif');
if (empty($dimention[0])) {
$width = 140;
$height = 140;
} else {
$width = ($dimention[0] > 140) ? 140 : $dimention[0];
$dimention[1] = $dimention[1] * $width / $dimention[0];
$height = ($dimention[1] > 140) ? $dimention[1] * $dimention[0] / 140 : $dimention[1];
}
$tpl->assign('image_width', $width);
$tpl->assign('image_height', $height);
$sarray = $publisher->getHandler('item')->getAllPublished(10, 0, $categoryid);
if (is_array($sarray)) {
$count = $sarray;
foreach ($sarray as $item) {
$tpl->append('items',
array('title' => htmlspecialchars($item->title(), ENT_QUOTES),
'link' => $item->getItemUrl(),
'guid' => $item->getItemUrl(),
'pubdate' => formatTimestamp($item->getVar('datesub'), 'rss'),
'description' => htmlspecialchars($item->getBlockSummary(300, true), ENT_QUOTES)));
}
}
}
$tpl->display('db:publisher_rss.html');
?>
Import Failed
We couldn't find a feed using the URL you provided.
###############################################################################
## Copyright (C) 2009 Dylian Melgert ##
## ##
## 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 3 of the License, or ##
## (at your option) any later version. ##
## ##
## 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, see .##
###############################################################################
$replacements = array(
"à" => "a'",
"á" => "a'",
"è" => "e'",
"é" => "e'",
"ì" => "i'",
"ò" => "o'",
"ù" => "u'",
"ú" => "u'",
"[img align=left]" => "[IMG]",
"[img align=right]" => "[IMG]",
"[/img]" => "[IMG]",
" " => " ",
);
$post_id = intval($_GET['id']);
$sql = "SELECT * FROM ".$GLOBALS['xoopsDB']->prefix("bb_posts")." WHERE post_id = $post_id";
$result = $GLOBALS['xoopsDB']->queryF($sql);
$row = $GLOBALS['xoopsDB']->fetchArray($result);
$subject = strtr(strip_tags($row["subject"]), $replacements);
$uid = strtr(strip_tags($row["uid"]), $replacements);
$sql = "SELECT * FROM ".$GLOBALS['xoopsDB']->prefix("users")." WHERE uid = $uid";
$result = $GLOBALS['xoopsDB']->queryF($sql);
$row = $GLOBALS['xoopsDB']->fetchArray($result);
$username = strtr(strip_tags($row["uname"]), $replacements);
$sql = "SELECT * FROM ".$GLOBALS['xoopsDB']->prefix("bb_posts_text")." WHERE post_id = $post_id";
$result = $GLOBALS['xoopsDB']->queryF($sql);
$row = $GLOBALS['xoopsDB']->fetchArray($result);
$content = strtr(strip_tags($row["post_text"]), $replacements);
$xoBile_text = new HAW_text("$subject:", HAW_TEXTFORMAT_BOLD);
$xoBile_text->set_br(1);
$xoBile_page->add_text($xoBile_text);
$xoBile_page->renderXoCode($content);
$xoBile_text->set_br(1);
$xoBile_page->renderXoCode("- by $username");
$xoBile_page->backURL = "index.php?mod=newbb";
?>