1 Replies - 1318 Views - Last Post: 22 February 2011 - 03:23 AM

#1 cyberscribe  Icon User is offline

  • humble.genius
  • member icon

Reputation: 10
  • View blog
  • Posts: 1,062
  • Joined: 05-May 02

DIC RSS Reader

Posted 08 March 2005 - 11:14 PM

Description: Download magpie, then include this file to display DIC forum feeds. See the css example for styling the feed to match your site.Simple PHP script to display DIC forum feeds on your site. Requires Magpie RSS from http://magpie.sourceforge.net/
php script:

<?PHP
require_once 'rss_fetch.inc' //requires magpie from magpierss.sourceforge.net
$uri = 'http://www.dreamincode.net/rss/forums.php';
if($rss = fetch_rss( $uri )) {
    foreach ($rss->items as $item) {
        $url = $item['link'];
        $title = htmlspecialchars($item['title']);
        $description = htmlspecialchars($item['description']);
        $date = $item['pubdate'];
        if(!$date) {
            $date = $item['dc']['date'];
        }
        print '<p>';
        print '<div class="rss_title">'."n";
        if($date) {
            print '<span class="rss_date">'."n";
            print $date;
            print '</span>';
        }
        print '<a href="'.$url.'">'.$title.'</a>'."n";
        print '</div>';
        print "nn";
        print '<div class="rss_description">'."n";
        print $description;
        print '</div>';
        print '</p>';
        print "nn";
    }
}
?>

sample css:

.rss_title {
    font-family: Verdana, Arial, Helvetica, sans-serif
    size: 14px;
    font-weight: bold;
}
.rss_title a:link, .rss_title a:active, .rss_title a:visited {
    color: #000000;
}
.rss_title a:hover {
    color: #E98D04;
    text-decoration: none;
}
.rss_date {
    text-style: italic;
}
.rss_description {
    font-family: Verdana, Arial, Helvetica, sans-serif
    font-size: 10px;
    margin-left: 12px;
}

see it in action:

http://www.dotgeek.net/dic.php


Is This A Good Question/Topic? 0
  • +

Replies To: DIC RSS Reader

#2 vigoloubev  Icon User is offline

  • New D.I.C Head

Reputation: 3
  • View blog
  • Posts: 16
  • Joined: 17-February 11

Re: DIC RSS Reader

Posted 22 February 2011 - 03:23 AM

using print do more overhead than echo
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1