当前位置: 首页>>代码示例>>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;未经允许,请勿转载。