summaryrefslogtreecommitdiff
path: root/classes/Digest.php
diff options
context:
space:
mode:
Diffstat (limited to 'classes/Digest.php')
-rw-r--r--classes/Digest.php11
1 files changed, 6 insertions, 5 deletions
diff --git a/classes/Digest.php b/classes/Digest.php
index 27009530f..6005f5fe4 100644
--- a/classes/Digest.php
+++ b/classes/Digest.php
@@ -17,7 +17,7 @@ class Digest
$pdo = Db::pdo();
- $res = $pdo->query("SELECT id,email FROM ttrss_users
+ $res = $pdo->query("SELECT id, login, email FROM ttrss_users
WHERE email != '' AND (last_digest_sent IS NULL OR $interval_qpart)");
while ($line = $res->fetch()) {
@@ -92,7 +92,8 @@ class Digest
$tpl->readTemplateFromFile("digest_template_html.txt");
$tpl_t->readTemplateFromFile("digest_template.txt");
- $user_tz_string = get_pref(Prefs::USER_TIMEZONE, $user_id);
+ $user_tz_string = Prefs::get(Prefs::USER_TIMEZONE, $user_id);
+ $min_score = Prefs::get(Prefs::DIGEST_MIN_SCORE, $user_id);
if ($user_tz_string == 'Automatic')
$user_tz_string = 'GMT';
@@ -136,10 +137,10 @@ class Digest
AND $interval_qpart
AND ttrss_user_entries.owner_uid = :user_id
AND unread = true
- AND score >= 0
+ AND score >= :min_score
ORDER BY ttrss_feed_categories.title, ttrss_feeds.title, score DESC, date_updated DESC
LIMIT " . (int)$limit);
- $sth->execute([':user_id' => $user_id]);
+ $sth->execute([':user_id' => $user_id, ':min_score' => $min_score]);
$headlines_count = 0;
$headlines = array();
@@ -191,7 +192,7 @@ class Digest
$tpl_t->addBlock('article');
- if ($headlines[$i]['feed_title'] != $headlines[$i + 1]['feed_title']) {
+ if (!isset($headlines[$i + 1]) || $headlines[$i]['feed_title'] != $headlines[$i + 1]['feed_title']) {
$tpl->addBlock('feed');
$tpl_t->addBlock('feed');
}