Jump to content
  • 0

Question

Posted
<?php

$content = file_get_contents('http://forum.rajagame.com/syndication.php?fid=12&limit=1');

if($content) {

    $i = 0;

    $xml = new SimpleXmlElement($content);

    $newsAmount = (int)5;

}

?>

<?php if(isset($xml) && isset($xml->channel)): ?>

    <?php foreach($xml->channel->item as $rssItem): ?>

        <?php $i++; if($i <= $newsAmount): ?>

        <div style="padding-left: 20px;">

            <span><a href="<?php echo $rssItem->link ?>"><?php echo $rssItem->title ?></a></span>

            <p>

                <?php echo $rssItem->description ?>

                <?php echo date('M j, Y', strtotime($rssItem->pubDate)) ?>

            </p>

            <br />

        </div>

        <?php endif ?>

    <?php endforeach ?>

<?php endif ?>

 

I don't know why but it seems MyBB RSS Syndication is a bit different than general rss because if I am using http://www.gmanetwork.com/news/rss/news it does work, do I must change script or what?

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...