Topic: How to display RSS Feeds on the homepage

Hi

i'm looking for a way to display RSS Feeds on my forum homepage (i'm using punbb+miniportal).

RSS are generated by Dokuwiki (every day) Dokuwiki is istalled on the same server, but under a separated subdir, and is not integrated with the punbb forum.

Im' actually using a javascript to get wiki rss on the homepage (rss2js), but its just too slow..

Wonder if a bit of php code could help to solve my issue (i'm not much familiar with it)

Thanks

Copyright it's a  died culture. Be alive with the copyleft attitude

Re: How to display RSS Feeds on the homepage

here the mod i used..
http://www.punres.org/viewtopic.php?pid=15865#p15865
next here is the code that i used to pull it on my frontpage.
http://bunpai.com is my rss feed site!


<?php
$newsid = '4'; // Forum id to fetch the news from ( only supports 1 forum id )
$newsdisplay = '5'; // Number of news to display.

?>

<?php
require_once PUN_ROOT.'include/parser.php';

?>




<?
$result = $db->query('SELECT t.id, t.subject, t.num_replies, t.last_post, t.last_post_id, t.last_poster, t.num_views, t.forum_id, p.poster, p.poster_id, p.message, p.hide_smilies, p.posted, g.g_title, f.forum_name FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'posts AS p ON p.topic_id=t.id AND p.posted=t.posted INNER JOIN '.$db->prefix.'users AS u ON u.id=p.poster_id LEFT JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id WHERE t.forum_id='.$newsid.' AND t.moved_to IS NULL AND f.redirect_url IS NULL ORDER BY t.posted DESC LIMIT '.$newsdisplay) or error('Unable to fetch announcements', __FILE__, __LINE__, $db->error());

if ($db->num_rows($result))
                    {
                            while($cur_post = $db->fetch_assoc($result))
                            {
                                    $cur_post['message'] = parse_message($cur_post['message'], $cur_post['hide_smilies']);
?>
<div class="block">
<?
echo "\t\t\t\t\t\t\t".' <h2><span>'.pun_htmlspecialchars($cur_post['subject']).'</span></h2>'."\n";
?>
<div class="box">
                <div class="inbox">
                    <p>

<ul>

<?php echo $cur_post['message']."\n" ?><br />


<?
echo "\t\t\t\t\t\t\t".'<a style="text-decoration: none" href="viewtopic.php?id='.$cur_post['id'].'" class="username">'.pun_htmlspecialchars($lang_portal['Visit_Topic']).'</a>'."\n";
?>





</ul>
</p>
      </div>
            </div>
        </div>

<?
}
 }
else
{

 }    
?>

</p>
My stuff or my style might sux, but atleast I'm willing to help when I can.
Don't be stupid and help ! We are the stupid one's !!!

3 (edited by giacus 2007-04-22 17:35)

Re: How to display RSS Feeds on the homepage

Hi quaker, thanks a lot. That's very interesting, but is not exactly what I need.

I already have the xml file updated by dokuwiki on the root directory of my website. The code i'm looking for should open the rss file and read the news, then pull into the index page without post in any forum. Also the cronjob is not needed, since it should be updated anytime the page is being loaded into the browser.
(not sure if is possible, but is what I was looking for - sorry for my bad eng.)

Copyright it's a  died culture. Be alive with the copyleft attitude

Re: How to display RSS Feeds on the homepage

Moved to integration.

Can you use a PHP-based feed parser like SimplePie?

Looking for a certain modification for your forum? Please take a look here before posting.

Re: How to display RSS Feeds on the homepage

Well, SimplePie seems much better for my needs.
Im looking at SimplePie Compatibility Test and requirements right now,  to verify if I can run it under TxD (where my forum is hosted).
Not sure if I have enough permissions to install it. I'll try. Thanks.

Copyright it's a  died culture. Be alive with the copyleft attitude

6

Re: How to display RSS Feeds on the homepage

Everything looked perfect on the install, with the tests being passed.
Now that I have set up the newsfeeds, they are not pulling through.

When I click on the "cronjob" test link in the newsfeed admin page, I get this mesage :-

Fatal error: Call to undefined function: iconv() in /home/virtual/site133/fst/var/www/html/lmforum/plugins/fa_cron.php on line 50

Line 50 of fa_cron.php is

$username = iconv( $feed->get_encoding(), $lang_common['lang_encoding'], $username );

Any ideas ?

Landen Meadows Residents Forum - http://www.landenmeadows.net

Re: How to display RSS Feeds on the homepage

It work for me, using RSS 2.0, punbb 1.2.14.
I'd try with a different RSS type to be sure about it.

Copyright it's a  died culture. Be alive with the copyleft attitude

Re: How to display RSS Feeds on the homepage

gaiscus, do u got a link?

Q

My stuff or my style might sux, but atleast I'm willing to help when I can.
Don't be stupid and help ! We are the stupid one's !!!

Re: How to display RSS Feeds on the homepage

quaker, I'm actually playng with it on my Linux box, locally,  on a backup copy of my forum and wiki.
However, I already checked the requirements on TxD and it can run the mod .
I'll install it after I tested it for a bit of time, to be sure there are no issues.

Copyright it's a  died culture. Be alive with the copyleft attitude

10

Re: How to display RSS Feeds on the homepage

this mod feed aggagator is built off of simplepie. but ur host must have cron or crontab. check ur hosting plan in order to run this mod.

q

My stuff or my style might sux, but atleast I'm willing to help when I can.
Don't be stupid and help ! We are the stupid one's !!!