本文整理汇总了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');
}
示例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);
}