本文整理匯總了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);
}