예제 #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);
 }
예제 #2
0
파일: view.php 프로젝트: TBoonX/SlideWiki
}
?>
</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 -->
			<h2>Featured presentations <a target="_blank" href = "feed/decks/featured" title="Feed"><img src="static/img/feed.gif" alt="feed"></a></h2>
			<ul id="featured" class="deckOverviewList">
			</ul>		
			<a href = "search/order/featured" class="btn">Show more...</a>
			<!--h2>Popular presentations <a target="_blank" href = "feed/decks/popular" title="Feed"><img src="static/img/feed.gif" alt="feed"></a></h2>
			<ul id="popular" class="deckOverviewList">
			Will be available soon...