當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Stream::getMainPageStream方法代碼示例

本文整理匯總了PHP中Stream::getMainPageStream方法的典型用法代碼示例。如果您正苦於以下問題:PHP Stream::getMainPageStream方法的具體用法?PHP Stream::getMainPageStream怎麽用?PHP Stream::getMainPageStream使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Stream的用法示例。


在下文中一共展示了Stream::getMainPageStream方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: activities

 function activities()
 {
     $stream = new Stream();
     $stream->getMainPageStream(50);
     $this->set('stream', $stream);
     $this->set('page_title', 'Latest activities - SlideWiki');
     $this->set('page_keywords', 'SlideWiki, activities, presentations');
 }
開發者ID:TBoonX,項目名稱:SlideWiki,代碼行數:8,代碼來源:StaticController.php

示例2: activities

 function activities()
 {
     $feed_type = $_GET['output'];
     if (!isset($feed_type)) {
         $feed_type = "RSS1.0";
     }
     //define channel
     $rss = new UniversalFeedCreator();
     $rss->useCached();
     $title = "SlideWiki -- Latest activities";
     $description = "list of latest activities on SlideWiki";
     $link = "http://slidewiki.org/";
     $syndicationURL = "http://slidewiki.aksw.org/feed/activities";
     $rss->title = $title;
     $rss->description = $description;
     $rss->link = $link;
     $rss->syndicationURL = $syndicationURL;
     $stream = new Stream();
     $stream->getMainPageStream(20);
     //channel items/entries
     foreach ($stream->activities as $i => $s) {
         switch ($s->type) {
             case 'created_deck':
                 $s->type = 'created deck';
                 break;
             case 'translated_deck_from':
                 $s->type = 'translated deck';
                 break;
             case 'commented_deck_revision':
                 $s->type = 'commented deck';
                 break;
             case 'followed_deck':
                 $s->type = 'started following deck';
                 break;
             case 'translated_deck':
                 $s->type = 'translated deck';
                 break;
             case 'created_deck_revision':
                 $s->type = 'created deck revision';
                 break;
         }
         $item = new FeedItem();
         $item->title = 'Activity ' . ($i + 1);
         $item->link = "http://slidewiki.org/?url=main/deck_stream&deck=" . $s->object->id;
         $item->description = '<a href="http://slidewiki.org/user/' . $s->subject->id . '">' . $s->subject->username . '</a> ' . $s->type . ' <a href="http://slidewiki.org/deck/' . $s->object->id . '_' . $s->object->slug_title . '">' . $s->object->title . '</a>';
         $item->source = "http://slidewiki.org/";
         $item->date = $s->timestamp;
         $item->author = '';
         $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);
 }
開發者ID:TBoonX,項目名稱:SlideWiki,代碼行數:54,代碼來源:FeedController.php


注:本文中的Stream::getMainPageStream方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。