forked from GNUsocial/gnu-social
twiddle a few bits to make replies work correctly
darcs-hash:20080707054358-84dde-916977a2af4f792e0dc9e02a9f5344ec60911319.gz
This commit is contained in:
@@ -137,4 +137,19 @@ class Profile extends DB_DataObject
|
||||
function getBestName() {
|
||||
return ($this->fullname) ? $this->fullname : $this->nickname;
|
||||
}
|
||||
|
||||
# Get latest notice on or before date; default now
|
||||
function getCurrentNotice($dt=NULL) {
|
||||
$notice = new Notice();
|
||||
$notice->profile_id = $this->id;
|
||||
if ($dt) {
|
||||
$notice->whereAdd('created < "' . $dt . '"');
|
||||
}
|
||||
$notice->orderBy('created DESC');
|
||||
$notice->limit(1);
|
||||
if ($notice->find(true)) {
|
||||
return $notice;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user