From a8a36677748b304faf20742598b90f3d9634f393 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 8 Sep 2008 14:16:24 -0400 Subject: initial non-Ajax version of favorites darcs-hash:20080908181624-84dde-8200e1d91eb5f560ef0f296c9e1c56f93ef1b0c5.gz --- classes/User.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'classes/User.php') diff --git a/classes/User.php b/classes/User.php index 99ae40baf..62f077739 100644 --- a/classes/User.php +++ b/classes/User.php @@ -43,6 +43,7 @@ class User extends DB_DataObject public $email; // varchar(255) unique_key public $incomingemail; // varchar(255) unique_key public $emailnotifysub; // tinyint(1) default_1 + public $emailnotifyfav; // tinyint(1) default_1 public $emailmicroid; // tinyint(1) default_1 public $language; // varchar(50) public $timezone; // varchar(50) @@ -275,4 +276,18 @@ class User extends DB_DataObject } } } + + function hasFave($notice) { + $fave = new Fave(); + $fave->user_id = $this->id; + $fave->notice_id = $notice->id; + if ($fave->find()) { + $result = true; + } else { + $result = false; + } + $fave->free(); + unset($fave); + return $result; + } } -- cgit v1.2.3-54-g00ecf