Example #1
0
 function decks()
 {
     $criteria = $_GET['show'];
     if (!isset($criteria)) {
         die("error in receiving feed criteria!");
     }
     $feed_type = $_GET['output'];
     if (!isset($feed_type)) {
         $feed_type = "RSS1.0";
     }
     $deckList = new DeckList();
     switch ($criteria) {
         case "new":
             $title = "SlideWiki -- New Presentations";
             $description = "list of new presentations";
             $link = "http://slidewiki.org/search/order/date";
             $syndicationURL = "http://slidewiki.org/feed/decks/new";
             $decks = $deckList->getAllDecks(15);
             break;
         case "popular":
             $title = "SlideWiki -- Popular Presentations";
             $description = "list of popular presentations";
             $link = "http://slidewiki.org/search/order/popularity";
             $syndicationURL = "http://slidewiki.org/feed/decks/popular";
             $decks = $deckList->getAllPopular(15);
             break;
         case "featured":
             $title = "SlideWiki -- Featured Presentations";
             $description = "list of featured presentations";
             $link = "http://slidewiki.org/search/order/featured";
             $syndicationURL = "http://slidewiki.org/feed/decks/featured";
             $decks = $deckList->getAllFeatured(15);
             break;
     }
     //define channel
     $rss = new UniversalFeedCreator();
     $rss->useCached();
     $rss->title = $title;
     $rss->description = $description;
     $rss->link = $link;
     $rss->syndicationURL = $syndicationURL;
     //channel items/entries
     foreach ($decks as $deck) {
         $item = new FeedItem();
         $item->title = $deck->title;
         $item->link = "http://slidewiki.org/deck/" . $deck->id . '_' . $deck->slug_title;
         $item->description = $deck->abstract;
         $item->source = "http://slidewiki.org/";
         $item->date = strtotime($deck->revisionTime);
         $item->author = $deck->owner->username;
         $rss->addItem($item);
     }
     //Valid parameters are RSS0.91, RSS1.0, RSS2.0, PIE0.1 (deprecated),
     // MBOX, OPML, ATOM, ATOM1.0, ATOM0.3, HTML, JS
     $rss->outputFeed($feed_type);
 }
Example #2
0
        echo $published_on . ': <b><a href="' . $link . '">' . $title . '</a></b><br/>';
        if ($counter == 3) {
            break;
        }
        //echo '<p>'.$description.'</p>';
    }
    echo '<div class="newsfeedshowmore"> <a class="btn mini" href="http://blog.aksw.org/category/projects/SlideWiki">Show more...</a></div>';
}
?>
</div>

</header> <!-- /.hero-unit (teaser) -->
<section class="content row">
<?php 
if ($static) {
    $deckList = new DeckList();
    $decks = $deckList->getAllFeatured(30);
    echo '<h2>Featured presentations <a target="_blank" href = "feed/decks/featured" title="Feed"><img src="static/img/feed.gif" alt="feed"></a></h2>';
    foreach ($decks as $d) {
        echo "<h4><a href='deck/" . $d->id . '_' . $d->slug_title . "'>" . $d->title . "</a></h4><br/>";
        echo $d->abstract . "<br/>";
    }
    $decks = $deckList->getAllDecks(30, true);
    echo '<h2>New presentations <a target="_blank" href = "feed/decks/new" title="Feed"><img src="static/img/feed.gif" alt="feed"></a></h2>';
    foreach ($decks as $d) {
        echo "<h4><a href='deck/" . $d->id . '_' . $d->slug_title . "'>" . $d->title . "</a></h4><br/>";
        echo $d->abstract . "<br/>";
    }
} else {
    ?>
		<div class="span6"> <!-- featured and popular presentations -->