From 0b21ac3dd79d2bf39341a4f0ff3566def8282eae Mon Sep 17 00:00:00 2001 From: "matthew.gregg" Date: Sun, 22 Jun 2008 23:08:37 -0400 Subject: First pass at replies support http://laconi.ca/PITS/00080 Doesn't handle a reply to a user that has never updated. darcs-hash:20080623030837-982e4-532ccd8899fd8be00575f8840da0defb44cd56f8.gz --- classes/User.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'classes/User.php') diff --git a/classes/User.php b/classes/User.php index 370dad82f..b22e486f3 100644 --- a/classes/User.php +++ b/classes/User.php @@ -94,4 +94,18 @@ class User extends DB_DataObject $merged = array_merge($blacklist, common_config('nickname', 'blacklist')); return !in_array($nickname, $merged); } + + function getCurrentNotice() { + $notice = DB_DataObject::factory('notice'); + $profile = $this->getProfile(); + $notice->profile_id = $profile->id; + $notice->limit(1); + $notice->orderBy('created DESC'); + if ($notice->find()) { + $notice->fetch(); + return $notice; + } + return NULL; + } + } -- cgit v1.2.3-54-g00ecf