Merge branch 'querybyid' into 0.7.x
This commit is contained in:
commit
0bbf56f6dc
@ -4,7 +4,7 @@
|
|||||||
*/
|
*/
|
||||||
require_once INSTALLDIR.'/classes/Memcached_DataObject.php';
|
require_once INSTALLDIR.'/classes/Memcached_DataObject.php';
|
||||||
|
|
||||||
class Fave extends Memcached_DataObject
|
class Fave extends Memcached_DataObject
|
||||||
{
|
{
|
||||||
###START_AUTOCODE
|
###START_AUTOCODE
|
||||||
/* the code below is auto generated do not remove the above tag */
|
/* the code below is auto generated do not remove the above tag */
|
||||||
@ -31,9 +31,58 @@ class Fave extends Memcached_DataObject
|
|||||||
}
|
}
|
||||||
return $fave;
|
return $fave;
|
||||||
}
|
}
|
||||||
|
|
||||||
function &pkeyGet($kv)
|
function &pkeyGet($kv)
|
||||||
{
|
{
|
||||||
return Memcached_DataObject::pkeyGet('Fave', $kv);
|
return Memcached_DataObject::pkeyGet('Fave', $kv);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function stream($user_id, $offset=0, $limit=NOTICES_PER_PAGE)
|
||||||
|
{
|
||||||
|
$ids = Notice::stream(array('Fave', '_streamDirect'),
|
||||||
|
array($user_id),
|
||||||
|
'fave:ids_by_user:'.$user_id,
|
||||||
|
$offset, $limit);
|
||||||
|
return $ids;
|
||||||
|
}
|
||||||
|
|
||||||
|
function _streamDirect($user_id, $offset, $limit, $since_id, $before_id, $since)
|
||||||
|
{
|
||||||
|
$fav = new Fave();
|
||||||
|
|
||||||
|
$fav->user_id = $user_id;
|
||||||
|
|
||||||
|
$fav->selectAdd();
|
||||||
|
$fav->selectAdd('notice_id');
|
||||||
|
|
||||||
|
if ($since_id != 0) {
|
||||||
|
$fav->whereAdd('notice_id > ' . $since_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($before_id != 0) {
|
||||||
|
$fav->whereAdd('notice_id < ' . $before_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!is_null($since)) {
|
||||||
|
$fav->whereAdd('modified > \'' . date('Y-m-d H:i:s', $since) . '\'');
|
||||||
|
}
|
||||||
|
|
||||||
|
// NOTE: we sort by fave time, not by notice time!
|
||||||
|
|
||||||
|
$fav->orderBy('modified DESC');
|
||||||
|
|
||||||
|
if (!is_null($offset)) {
|
||||||
|
$fav->limit($offset, $limit);
|
||||||
|
}
|
||||||
|
|
||||||
|
$ids = array();
|
||||||
|
|
||||||
|
if ($fav->find()) {
|
||||||
|
while ($fav->fetch()) {
|
||||||
|
$ids[] = $fav->notice_id;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $ids;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -299,9 +299,9 @@ class Notice extends Memcached_DataObject
|
|||||||
$group_inbox->notice_id = $this->id;
|
$group_inbox->notice_id = $this->id;
|
||||||
if ($group_inbox->find()) {
|
if ($group_inbox->find()) {
|
||||||
while ($group_inbox->fetch()) {
|
while ($group_inbox->fetch()) {
|
||||||
$cache->delete(common_cache_key('group:notices:'.$group_inbox->group_id));
|
$cache->delete(common_cache_key('user_group:notice_ids:' . $group_inbox->group_id));
|
||||||
if ($blowLast) {
|
if ($blowLast) {
|
||||||
$cache->delete(common_cache_key('group:notices:'.$group_inbox->group_id.';last'));
|
$cache->delete(common_cache_key('user_group:notice_ids:' . $group_inbox->group_id.';last'));
|
||||||
}
|
}
|
||||||
$member = new Group_member();
|
$member = new Group_member();
|
||||||
$member->group_id = $group_inbox->group_id;
|
$member->group_id = $group_inbox->group_id;
|
||||||
@ -328,10 +328,7 @@ class Notice extends Memcached_DataObject
|
|||||||
$tag->notice_id = $this->id;
|
$tag->notice_id = $this->id;
|
||||||
if ($tag->find()) {
|
if ($tag->find()) {
|
||||||
while ($tag->fetch()) {
|
while ($tag->fetch()) {
|
||||||
$cache->delete(common_cache_key('notice_tag:notice_stream:' . $tag->tag));
|
$tag->blowCache($blowLast);
|
||||||
if ($blowLast) {
|
|
||||||
$cache->delete(common_cache_key('notice_tag:notice_stream:' . $tag->tag . ';last'));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$tag->free();
|
$tag->free();
|
||||||
@ -366,10 +363,10 @@ class Notice extends Memcached_DataObject
|
|||||||
{
|
{
|
||||||
if ($this->is_local) {
|
if ($this->is_local) {
|
||||||
$cache = common_memcache();
|
$cache = common_memcache();
|
||||||
if ($cache) {
|
if (!empty($cache)) {
|
||||||
$cache->delete(common_cache_key('profile:notices:'.$this->profile_id));
|
$cache->delete(common_cache_key('profile:notice_ids:'.$this->profile_id));
|
||||||
if ($blowLast) {
|
if ($blowLast) {
|
||||||
$cache->delete(common_cache_key('profile:notices:'.$this->profile_id.';last'));
|
$cache->delete(common_cache_key('profile:notice_ids:'.$this->profile_id.';last'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -383,9 +380,9 @@ class Notice extends Memcached_DataObject
|
|||||||
$reply->notice_id = $this->id;
|
$reply->notice_id = $this->id;
|
||||||
if ($reply->find()) {
|
if ($reply->find()) {
|
||||||
while ($reply->fetch()) {
|
while ($reply->fetch()) {
|
||||||
$cache->delete(common_cache_key('user:replies:'.$reply->profile_id));
|
$cache->delete(common_cache_key('reply:stream:'.$reply->profile_id));
|
||||||
if ($blowLast) {
|
if ($blowLast) {
|
||||||
$cache->delete(common_cache_key('user:replies:'.$reply->profile_id.';last'));
|
$cache->delete(common_cache_key('reply:stream:'.$reply->profile_id.';last'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -415,9 +412,9 @@ class Notice extends Memcached_DataObject
|
|||||||
$fave->notice_id = $this->id;
|
$fave->notice_id = $this->id;
|
||||||
if ($fave->find()) {
|
if ($fave->find()) {
|
||||||
while ($fave->fetch()) {
|
while ($fave->fetch()) {
|
||||||
$cache->delete(common_cache_key('user:faves:'.$fave->user_id));
|
$cache->delete(common_cache_key('fave:ids_by_user:'.$fave->user_id));
|
||||||
if ($blowLast) {
|
if ($blowLast) {
|
||||||
$cache->delete(common_cache_key('user:faves:'.$fave->user_id.';last'));
|
$cache->delete(common_cache_key('fave:ids_by_user:'.$fave->user_id.';last'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -37,21 +37,62 @@ class Notice_tag extends Memcached_DataObject
|
|||||||
###END_AUTOCODE
|
###END_AUTOCODE
|
||||||
|
|
||||||
static function getStream($tag, $offset=0, $limit=20) {
|
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),
|
$ids = Notice::stream(array('Notice_tag', '_streamDirect'),
|
||||||
'notice_tag:notice_stream:' . common_keyize($tag),
|
array($tag),
|
||||||
$offset, $limit);
|
'notice_tag:notice_ids:' . common_keyize($tag),
|
||||||
|
$offset, $limit);
|
||||||
|
|
||||||
|
return Notice::getStreamByIds($ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
function blowCache()
|
function _streamDirect($tag, $offset, $limit, $since_id, $before_id, $since)
|
||||||
|
{
|
||||||
|
$nt = new Notice_tag();
|
||||||
|
|
||||||
|
$nt->tag = $tag;
|
||||||
|
|
||||||
|
$nt->selectAdd();
|
||||||
|
$nt->selectAdd('notice_id');
|
||||||
|
|
||||||
|
if ($since_id != 0) {
|
||||||
|
$nt->whereAdd('notice_id > ' . $since_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($before_id != 0) {
|
||||||
|
$nt->whereAdd('notice_id < ' . $before_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!is_null($since)) {
|
||||||
|
$nt->whereAdd('created > \'' . date('Y-m-d H:i:s', $since) . '\'');
|
||||||
|
}
|
||||||
|
|
||||||
|
$nt->orderBy('notice_id DESC');
|
||||||
|
|
||||||
|
if (!is_null($offset)) {
|
||||||
|
$nt->limit($offset, $limit);
|
||||||
|
}
|
||||||
|
|
||||||
|
$ids = array();
|
||||||
|
|
||||||
|
if ($nt->find()) {
|
||||||
|
while ($nt->fetch()) {
|
||||||
|
$ids[] = $nt->notice_id;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $ids;
|
||||||
|
}
|
||||||
|
|
||||||
|
function blowCache($blowLast=false)
|
||||||
{
|
{
|
||||||
$cache = common_memcache();
|
$cache = common_memcache();
|
||||||
if ($cache) {
|
if ($cache) {
|
||||||
$cache->delete(common_cache_key('notice_tag:notice_stream:' . $this->tag));
|
$idkey = common_cache_key('notice_tag:notice_ids:' . common_keyize($this->tag));
|
||||||
|
$cache->delete($idkey);
|
||||||
|
if ($blowLast) {
|
||||||
|
$cache->delete($idkey.';last');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -155,14 +155,51 @@ class Profile extends Memcached_DataObject
|
|||||||
|
|
||||||
function getNotices($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0)
|
function getNotices($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0)
|
||||||
{
|
{
|
||||||
$qry =
|
// XXX: I'm not sure this is going to be any faster. It probably isn't.
|
||||||
'SELECT * ' .
|
$ids = Notice::stream(array($this, '_streamDirect'),
|
||||||
'FROM notice ' .
|
array(),
|
||||||
'WHERE profile_id = %d ';
|
'profile:notice_ids:' . $this->id,
|
||||||
|
$offset, $limit, $since_id, $before_id);
|
||||||
|
|
||||||
return Notice::getStream(sprintf($qry, $this->id),
|
return Notice::getStreamByIds($ids);
|
||||||
'profile:notices:'.$this->id,
|
}
|
||||||
$offset, $limit, $since_id, $before_id);
|
|
||||||
|
function _streamDirect($offset, $limit, $since_id, $before_id, $since)
|
||||||
|
{
|
||||||
|
$notice = new Notice();
|
||||||
|
|
||||||
|
$notice->profile_id = $this->id;
|
||||||
|
|
||||||
|
$notice->selectAdd();
|
||||||
|
$notice->selectAdd('id');
|
||||||
|
|
||||||
|
if ($since_id != 0) {
|
||||||
|
$notice->whereAdd('id > ' . $since_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($before_id != 0) {
|
||||||
|
$notice->whereAdd('id < ' . $before_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!is_null($since)) {
|
||||||
|
$notice->whereAdd('created > \'' . date('Y-m-d H:i:s', $since) . '\'');
|
||||||
|
}
|
||||||
|
|
||||||
|
$notice->orderBy('id DESC');
|
||||||
|
|
||||||
|
if (!is_null($offset)) {
|
||||||
|
$notice->limit($offset, $limit);
|
||||||
|
}
|
||||||
|
|
||||||
|
$ids = array();
|
||||||
|
|
||||||
|
if ($notice->find()) {
|
||||||
|
while ($notice->fetch()) {
|
||||||
|
$ids[] = $notice->id;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $ids;
|
||||||
}
|
}
|
||||||
|
|
||||||
function isMember($group)
|
function isMember($group)
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*/
|
*/
|
||||||
require_once INSTALLDIR.'/classes/Memcached_DataObject.php';
|
require_once INSTALLDIR.'/classes/Memcached_DataObject.php';
|
||||||
|
|
||||||
class Reply extends Memcached_DataObject
|
class Reply extends Memcached_DataObject
|
||||||
{
|
{
|
||||||
###START_AUTOCODE
|
###START_AUTOCODE
|
||||||
/* the code below is auto generated do not remove the above tag */
|
/* the code below is auto generated do not remove the above tag */
|
||||||
@ -13,7 +13,7 @@ class Reply extends Memcached_DataObject
|
|||||||
public $notice_id; // int(4) primary_key not_null
|
public $notice_id; // int(4) primary_key not_null
|
||||||
public $profile_id; // int(4) primary_key not_null
|
public $profile_id; // int(4) primary_key not_null
|
||||||
public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
|
public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
|
||||||
public $replied_id; // int(4)
|
public $replied_id; // int(4)
|
||||||
|
|
||||||
/* Static get */
|
/* Static get */
|
||||||
function staticGet($k,$v=null)
|
function staticGet($k,$v=null)
|
||||||
@ -21,4 +21,47 @@ class Reply extends Memcached_DataObject
|
|||||||
|
|
||||||
/* the code above is auto generated do not remove the tag below */
|
/* the code above is auto generated do not remove the tag below */
|
||||||
###END_AUTOCODE
|
###END_AUTOCODE
|
||||||
|
|
||||||
|
function stream($user_id, $offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0, $since=null)
|
||||||
|
{
|
||||||
|
$ids = Notice::stream(array('Reply', '_streamDirect'),
|
||||||
|
array($user_id),
|
||||||
|
'reply:stream:' . $user_id,
|
||||||
|
$offset, $limit, $since_id, $before_id, $since);
|
||||||
|
return $ids;
|
||||||
|
}
|
||||||
|
|
||||||
|
function _streamDirect($user_id, $offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0, $since=null)
|
||||||
|
{
|
||||||
|
$reply = new Reply();
|
||||||
|
$reply->profile_id = $user_id;
|
||||||
|
|
||||||
|
if ($since_id != 0) {
|
||||||
|
$reply->whereAdd('notice_id > ' . $since_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($before_id != 0) {
|
||||||
|
$reply->whereAdd('notice_id < ' . $before_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!is_null($since)) {
|
||||||
|
$reply->whereAdd('modified > \'' . date('Y-m-d H:i:s', $since) . '\'');
|
||||||
|
}
|
||||||
|
|
||||||
|
$reply->orderBy('notice_id DESC');
|
||||||
|
|
||||||
|
if (!is_null($offset)) {
|
||||||
|
$reply->limit($offset, $limit);
|
||||||
|
}
|
||||||
|
|
||||||
|
$ids = array();
|
||||||
|
|
||||||
|
if ($reply->find()) {
|
||||||
|
while ($reply->fetch()) {
|
||||||
|
$ids[] = $reply->notice_id;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $ids;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -349,30 +349,31 @@ class User extends Memcached_DataObject
|
|||||||
$cache = common_memcache();
|
$cache = common_memcache();
|
||||||
|
|
||||||
// XXX: Kind of a hack.
|
// XXX: Kind of a hack.
|
||||||
|
|
||||||
if ($cache) {
|
if ($cache) {
|
||||||
// This is the stream of favorite notices, in rev chron
|
// This is the stream of favorite notices, in rev chron
|
||||||
// order. This forces it into cache.
|
// order. This forces it into cache.
|
||||||
$faves = $this->favoriteNotices(0, NOTICE_CACHE_WINDOW);
|
|
||||||
$cnt = 0;
|
$ids = Fave::stream($this->id, 0, NOTICE_CACHE_WINDOW);
|
||||||
while ($faves->fetch()) {
|
|
||||||
if ($faves->id < $notice->id) {
|
// If it's in the list, then it's a fave
|
||||||
// If we passed it, it's not a fave
|
|
||||||
return false;
|
if (in_array($notice->id, $ids)) {
|
||||||
} else if ($faves->id == $notice->id) {
|
return true;
|
||||||
// If it matches a cached notice, then it's a fave
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
$cnt++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we're not past the end of the cache window,
|
// If we're not past the end of the cache window,
|
||||||
// then the cache has all available faves, so this one
|
// then the cache has all available faves, so this one
|
||||||
// is not a fave.
|
// is not a fave.
|
||||||
if ($cnt < NOTICE_CACHE_WINDOW) {
|
|
||||||
|
if (count($ids) < NOTICE_CACHE_WINDOW) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Otherwise, cache doesn't have all faves;
|
// Otherwise, cache doesn't have all faves;
|
||||||
// fall through to the default
|
// fall through to the default
|
||||||
}
|
}
|
||||||
|
|
||||||
$fave = Fave::pkeyGet(array('user_id' => $this->id,
|
$fave = Fave::pkeyGet(array('user_id' => $this->id,
|
||||||
'notice_id' => $notice->id));
|
'notice_id' => $notice->id));
|
||||||
return ((is_null($fave)) ? false : true);
|
return ((is_null($fave)) ? false : true);
|
||||||
@ -401,13 +402,9 @@ class User extends Memcached_DataObject
|
|||||||
|
|
||||||
function getReplies($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0, $since=null)
|
function getReplies($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0, $since=null)
|
||||||
{
|
{
|
||||||
$qry =
|
$ids = Reply::stream($this->id, $offset, $limit, $since_id, $before_id, $since);
|
||||||
'SELECT notice.* ' .
|
common_debug("Ids = " . implode(',', $ids));
|
||||||
'FROM notice JOIN reply ON notice.id = reply.notice_id ' .
|
return Notice::getStreamByIds($ids);
|
||||||
'WHERE reply.profile_id = %d ';
|
|
||||||
return Notice::getStream(sprintf($qry, $this->id),
|
|
||||||
'user:replies:'.$this->id,
|
|
||||||
$offset, $limit, $since_id, $before_id, null, $since);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function getNotices($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0, $since=null)
|
function getNotices($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0, $since=null)
|
||||||
@ -422,13 +419,8 @@ class User extends Memcached_DataObject
|
|||||||
|
|
||||||
function favoriteNotices($offset=0, $limit=NOTICES_PER_PAGE)
|
function favoriteNotices($offset=0, $limit=NOTICES_PER_PAGE)
|
||||||
{
|
{
|
||||||
$qry =
|
$ids = Fave::stream($this->id, $offset, $limit);
|
||||||
'SELECT notice.* ' .
|
return Notice::getStreamByIds($ids);
|
||||||
'FROM notice JOIN fave ON notice.id = fave.notice_id ' .
|
|
||||||
'WHERE fave.user_id = %d ';
|
|
||||||
return Notice::getStream(sprintf($qry, $this->id),
|
|
||||||
'user:faves:'.$this->id,
|
|
||||||
$offset, $limit);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function noticesWithFriends($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0, $since=null)
|
function noticesWithFriends($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0, $since=null)
|
||||||
@ -463,8 +455,8 @@ class User extends Memcached_DataObject
|
|||||||
if ($cache) {
|
if ($cache) {
|
||||||
// Faves don't happen chronologically, so we need to blow
|
// Faves don't happen chronologically, so we need to blow
|
||||||
// ;last cache, too
|
// ;last cache, too
|
||||||
$cache->delete(common_cache_key('user:faves:'.$this->id));
|
$cache->delete(common_cache_key('fave:ids_by_user:'.$this->id));
|
||||||
$cache->delete(common_cache_key('user:faves:'.$this->id).';last');
|
$cache->delete(common_cache_key('fave:ids_by_user:'.$this->id.';last'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,13 +50,50 @@ class User_group extends Memcached_DataObject
|
|||||||
|
|
||||||
function getNotices($offset, $limit)
|
function getNotices($offset, $limit)
|
||||||
{
|
{
|
||||||
$qry =
|
$ids = Notice::stream(array($this, '_streamDirect'),
|
||||||
'SELECT notice.* ' .
|
array(),
|
||||||
'FROM notice JOIN group_inbox ON notice.id = group_inbox.notice_id ' .
|
'user_group:notice_ids:' . $this->id,
|
||||||
'WHERE group_inbox.group_id = %d ';
|
$offset, $limit);
|
||||||
return Notice::getStream(sprintf($qry, $this->id),
|
|
||||||
'group:notices:'.$this->id,
|
return Notice::getStreamByIds($ids);
|
||||||
$offset, $limit);
|
}
|
||||||
|
|
||||||
|
function _streamDirect($offset, $limit, $since_id, $before_id, $since)
|
||||||
|
{
|
||||||
|
$inbox = new Group_inbox();
|
||||||
|
|
||||||
|
$inbox->group_id = $this->id;
|
||||||
|
|
||||||
|
$inbox->selectAdd();
|
||||||
|
$inbox->selectAdd('notice_id');
|
||||||
|
|
||||||
|
if ($since_id != 0) {
|
||||||
|
$inbox->whereAdd('notice_id > ' . $since_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($before_id != 0) {
|
||||||
|
$inbox->whereAdd('notice_id < ' . $before_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!is_null($since)) {
|
||||||
|
$inbox->whereAdd('created > \'' . date('Y-m-d H:i:s', $since) . '\'');
|
||||||
|
}
|
||||||
|
|
||||||
|
$inbox->orderBy('notice_id DESC');
|
||||||
|
|
||||||
|
if (!is_null($offset)) {
|
||||||
|
$inbox->limit($offset, $limit);
|
||||||
|
}
|
||||||
|
|
||||||
|
$ids = array();
|
||||||
|
|
||||||
|
if ($inbox->find()) {
|
||||||
|
while ($inbox->fetch()) {
|
||||||
|
$ids[] = $inbox->notice_id;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $ids;
|
||||||
}
|
}
|
||||||
|
|
||||||
function allowedNickname($nickname)
|
function allowedNickname($nickname)
|
||||||
@ -91,7 +128,7 @@ class User_group extends Memcached_DataObject
|
|||||||
function setOriginal($filename)
|
function setOriginal($filename)
|
||||||
{
|
{
|
||||||
$imagefile = new ImageFile($this->id, Avatar::path($filename));
|
$imagefile = new ImageFile($this->id, Avatar::path($filename));
|
||||||
|
|
||||||
$orig = clone($this);
|
$orig = clone($this);
|
||||||
$this->original_logo = Avatar::url($filename);
|
$this->original_logo = Avatar::url($filename);
|
||||||
$this->homepage_logo = Avatar::url($imagefile->resize(AVATAR_PROFILE_SIZE));
|
$this->homepage_logo = Avatar::url($imagefile->resize(AVATAR_PROFILE_SIZE));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user