summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
Diffstat (limited to 'classes')
-rw-r--r--classes/Fave.php11
-rw-r--r--classes/User.php15
-rw-r--r--classes/stoica.ini1
3 files changed, 27 insertions, 0 deletions
diff --git a/classes/Fave.php b/classes/Fave.php
index bbd72ca0b..572dc232e 100644
--- a/classes/Fave.php
+++ b/classes/Fave.php
@@ -19,4 +19,15 @@ class Fave extends DB_DataObject
/* the code above is auto generated do not remove the tag below */
###END_AUTOCODE
+
+ static function addNew($user, $notice) {
+ $fave = new Fave();
+ $fave->user_id = $user->id;
+ $fave->notice_id = $notice->id;
+ if (!$fave->insert()) {
+ common_log_db_error($fave, 'INSERT', __FILE__);
+ return false;
+ }
+ return $fave;
+ }
}
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;
+ }
}
diff --git a/classes/stoica.ini b/classes/stoica.ini
index 329c5b1e7..90d83abc8 100644
--- a/classes/stoica.ini
+++ b/classes/stoica.ini
@@ -252,6 +252,7 @@ password = 2
email = 2
incomingemail = 2
emailnotifysub = 17
+emailnotifyfav = 17
emailmicroid = 17
language = 2
timezone = 2