本文整理汇总了PHP中Notice::getStream方法的典型用法代码示例。如果您正苦于以下问题:PHP Notice::getStream方法的具体用法?PHP Notice::getStream怎么用?PHP Notice::getStream使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Notice
的用法示例。
在下文中一共展示了Notice::getStream方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getStream
static function getStream($tag, $offset = 0, $limit = 20)
{
$qry = 'SELECT notice.* ' . 'FROM notice JOIN notice_tag ON notice.id = notice_tag.notice_id ' . "WHERE notice_tag.tag = '%s' ";
return Notice::getStream(sprintf($qry, $tag), 'notice_tag:notice_stream:' . common_keyize($tag), $offset, $limit);
}
示例2: getNotices
function getNotices($offset = 0, $limit = NOTICES_PER_PAGE, $since_id = 0, $before_id = 0)
{
$qry = 'SELECT * ' . 'FROM notice ' . 'WHERE profile_id = %d ';
return Notice::getStream(sprintf($qry, $this->id), 'profile:notices:' . $this->id, $offset, $limit, $since_id, $before_id);
}
示例3: publicStream
function publicStream($offset = 0, $limit = 20, $since_id = 0, $before_id = 0, $since = null)
{
$parts = array();
$qry = 'SELECT * FROM notice ';
if (common_config('public', 'localonly')) {
$parts[] = 'is_local = 1';
} else {
# -1 == blacklisted
$parts[] = 'is_local != -1';
}
if ($parts) {
$qry .= ' WHERE ' . implode(' AND ', $parts);
}
return Notice::getStream($qry, 'public', $offset, $limit, $since_id, $before_id, null, $since);
}
示例4: getNotices
function getNotices($offset, $limit)
{
$qry = 'SELECT notice.* ' . 'FROM notice JOIN group_inbox ON notice.id = group_inbox.notice_id ' . 'WHERE group_inbox.group_id = %d ';
return Notice::getStream(sprintf($qry, $this->id), 'group:notices:' . $this->id, $offset, $limit);
}
示例5: noticesWithFriends
function noticesWithFriends($offset = 0, $limit = NOTICES_PER_PAGE, $since_id = 0, $before_id = 0, $since = null)
{
$enabled = common_config('inboxes', 'enabled');
# Complicated code, depending on whether we support inboxes yet
# XXX: make this go away when inboxes become mandatory
if ($enabled === false || $enabled == 'transitional' && $this->inboxed == 0) {
$qry = 'SELECT notice.* ' . 'FROM notice JOIN subscription ON notice.profile_id = subscription.subscribed ' . 'WHERE subscription.subscriber = %d ';
$order = null;
} else {
if ($enabled === true || $enabled == 'transitional' && $this->inboxed == 1) {
$qry = 'SELECT notice.* ' . 'FROM notice JOIN notice_inbox ON notice.id = notice_inbox.notice_id ' . 'WHERE notice_inbox.user_id = %d ';
# NOTE: we override ORDER
$order = null;
}
}
return Notice::getStream(sprintf($qry, $this->id), 'user:notices_with_friends:' . $this->id, $offset, $limit, $since_id, $before_id, $order, $since);
}