1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 13:25:54 +00:00

use constants in get_pref()/set_pref()

This commit is contained in:
Andrew Dolgov
2021-02-25 14:49:58 +03:00
parent 5aa05c90e1
commit c96172fa04
18 changed files with 71 additions and 65 deletions

View File

@@ -21,8 +21,8 @@ class Digest
while ($line = $res->fetch()) {
if (get_pref('DIGEST_ENABLE', $line['id'])) {
$preferred_ts = strtotime(get_pref('DIGEST_PREFERRED_TIME', $line['id']));
if (get_pref(Prefs::DIGEST_ENABLE, $line['id'])) {
$preferred_ts = strtotime(get_pref(Prefs::DIGEST_PREFERRED_TIME, $line['id']));
// try to send digests within 2 hours of preferred time
if ($preferred_ts && time() >= $preferred_ts &&
@@ -31,7 +31,7 @@ class Digest
Debug::log("Sending digest for UID:" . $line['id'] . " - " . $line["email"]);
$do_catchup = get_pref('DIGEST_CATCHUP', $line['id']);
$do_catchup = get_pref(Prefs::DIGEST_CATCHUP, $line['id']);
global $tz_offset;
@@ -86,7 +86,7 @@ class Digest
$tpl->readTemplateFromFile("digest_template_html.txt");
$tpl_t->readTemplateFromFile("digest_template.txt");
$user_tz_string = get_pref('USER_TIMEZONE', $user_id);
$user_tz_string = get_pref(Prefs::USER_TIMEZONE, $user_id);
$local_ts = TimeHelper::convert_timestamp(time(), 'UTC', $user_tz_string);
$tpl->setVariable('CUR_DATE', date('Y/m/d', $local_ts));
@@ -152,7 +152,7 @@ class Digest
$updated = TimeHelper::make_local_datetime($line['last_updated'], false,
$user_id);
if (get_pref('ENABLE_FEED_CATS', $user_id)) {
if (get_pref(Prefs::ENABLE_FEED_CATS, $user_id)) {
$line['feed_title'] = $line['cat_title'] . " / " . $line['feed_title'];
}