mirror of
https://git.tt-rss.org/fox/tt-rss.git
synced 2025-08-06 22:27:42 +02:00
Merge branch 'feature/orm-and-misc' into 'master'
Use ORM in more places, deprecate const SUBSTRING_FOR_DATE, some minor fixes See merge request tt-rss/tt-rss!135
This commit is contained in:
commit
eab69f8796
@ -310,7 +310,7 @@ class API extends Handler {
|
|||||||
->select_many('e.id', 'e.guid', 'e.title', 'e.link', 'e.author', 'e.content', 'e.lang', 'e.comments',
|
->select_many('e.id', 'e.guid', 'e.title', 'e.link', 'e.author', 'e.content', 'e.lang', 'e.comments',
|
||||||
'ue.feed_id', 'ue.int_id', 'ue.marked', 'ue.unread', 'ue.published', 'ue.score', 'ue.note')
|
'ue.feed_id', 'ue.int_id', 'ue.marked', 'ue.unread', 'ue.published', 'ue.score', 'ue.note')
|
||||||
->select_many_expr([
|
->select_many_expr([
|
||||||
'updated' => SUBSTRING_FOR_DATE.'(updated,1,16)',
|
'updated' => 'SUBSTRING_FOR_DATE(updated,1,16)',
|
||||||
'feed_title' => '(SELECT title FROM ttrss_feeds WHERE id = ue.feed_id)',
|
'feed_title' => '(SELECT title FROM ttrss_feeds WHERE id = ue.feed_id)',
|
||||||
'site_url' => '(SELECT site_url FROM ttrss_feeds WHERE id = ue.feed_id)',
|
'site_url' => '(SELECT site_url FROM ttrss_feeds WHERE id = ue.feed_id)',
|
||||||
'hide_images' => '(SELECT hide_images FROM ttrss_feeds WHERE id = feed_id)',
|
'hide_images' => '(SELECT hide_images FROM ttrss_feeds WHERE id = feed_id)',
|
||||||
@ -619,7 +619,7 @@ class API extends Handler {
|
|||||||
/* API only: -3 (Feeds::CATEGORY_ALL_EXCEPT_VIRTUAL) All feeds, excluding virtual feeds (e.g. Labels and such) */
|
/* API only: -3 (Feeds::CATEGORY_ALL_EXCEPT_VIRTUAL) All feeds, excluding virtual feeds (e.g. Labels and such) */
|
||||||
$feeds_obj = ORM::for_table('ttrss_feeds')
|
$feeds_obj = ORM::for_table('ttrss_feeds')
|
||||||
->select_many('id', 'feed_url', 'cat_id', 'title', 'order_id', 'last_error', 'update_interval')
|
->select_many('id', 'feed_url', 'cat_id', 'title', 'order_id', 'last_error', 'update_interval')
|
||||||
->select_expr(SUBSTRING_FOR_DATE.'(last_updated,1,19)', 'last_updated')
|
->select_expr('SUBSTRING_FOR_DATE(last_updated,1,19)', 'last_updated')
|
||||||
->where('owner_uid', $_SESSION['uid'])
|
->where('owner_uid', $_SESSION['uid'])
|
||||||
->order_by_asc('order_id')
|
->order_by_asc('order_id')
|
||||||
->order_by_asc('title');
|
->order_by_asc('title');
|
||||||
@ -670,7 +670,7 @@ class API extends Handler {
|
|||||||
|
|
||||||
$feed = ORM::for_table('ttrss_feeds')
|
$feed = ORM::for_table('ttrss_feeds')
|
||||||
->select_many('id', 'cache_images')
|
->select_many('id', 'cache_images')
|
||||||
->select_expr(SUBSTRING_FOR_DATE.'(last_updated,1,19)', 'last_updated')
|
->select_expr('SUBSTRING_FOR_DATE(last_updated,1,19)', 'last_updated')
|
||||||
->find_one($feed_id);
|
->find_one($feed_id);
|
||||||
|
|
||||||
if ($feed) {
|
if ($feed) {
|
||||||
|
@ -147,63 +147,34 @@ class Counters {
|
|||||||
private static function get_feeds(?array $feed_ids = null): array {
|
private static function get_feeds(?array $feed_ids = null): array {
|
||||||
$ret = [];
|
$ret = [];
|
||||||
|
|
||||||
$pdo = Db::pdo();
|
if (is_array($feed_ids) && count($feed_ids) === 0)
|
||||||
|
return $ret;
|
||||||
|
|
||||||
if (is_array($feed_ids)) {
|
$feeds = ORM::for_table('ttrss_feeds')
|
||||||
if (count($feed_ids) == 0)
|
->table_alias('f')
|
||||||
return [];
|
->select_many('f.id', 'f.title', 'f.last_error')
|
||||||
|
->select_many_expr([
|
||||||
|
'count' => 'SUM(CASE WHEN ue.unread THEN 1 ELSE 0 END)',
|
||||||
|
'count_marked' => 'SUM(CASE WHEN ue.marked THEN 1 ELSE 0 END)',
|
||||||
|
'last_updated' => 'SUBSTRING_FOR_DATE(f.last_updated,1,19)',
|
||||||
|
])
|
||||||
|
->join('ttrss_user_entries', [ 'ue.feed_id', '=', 'f.id'], 'ue')
|
||||||
|
->where('ue.owner_uid', $_SESSION['uid'])
|
||||||
|
->group_by('f.id');
|
||||||
|
|
||||||
$feed_ids_qmarks = arr_qmarks($feed_ids);
|
if (is_array($feed_ids))
|
||||||
|
$feeds->where_in('f.id', $feed_ids);
|
||||||
|
|
||||||
$sth = $pdo->prepare("SELECT f.id,
|
foreach ($feeds->find_many() as $feed) {
|
||||||
f.title,
|
$ret[] = [
|
||||||
".SUBSTRING_FOR_DATE."(f.last_updated,1,19) AS last_updated,
|
'id' => $feed->id,
|
||||||
f.last_error,
|
'title' => truncate_string($feed->title, 30),
|
||||||
SUM(CASE WHEN unread THEN 1 ELSE 0 END) AS count,
|
'error' => $feed->last_error,
|
||||||
SUM(CASE WHEN marked THEN 1 ELSE 0 END) AS count_marked
|
'updated' => TimeHelper::make_local_datetime($feed->last_updated),
|
||||||
FROM ttrss_feeds f, ttrss_user_entries ue
|
'counter' => (int) $feed->count,
|
||||||
WHERE f.id = ue.feed_id AND ue.owner_uid = ? AND f.id IN ($feed_ids_qmarks)
|
'markedcounter' => (int) $feed->count_marked,
|
||||||
GROUP BY f.id");
|
'ts' => Feeds::_has_icon($feed->id) ? (int) filemtime(Feeds::_get_icon_file($feed->id)) : 0,
|
||||||
|
|
||||||
$sth->execute([$_SESSION['uid'], ...$feed_ids]);
|
|
||||||
} else {
|
|
||||||
$sth = $pdo->prepare("SELECT f.id,
|
|
||||||
f.title,
|
|
||||||
".SUBSTRING_FOR_DATE."(f.last_updated,1,19) AS last_updated,
|
|
||||||
f.last_error,
|
|
||||||
SUM(CASE WHEN unread THEN 1 ELSE 0 END) AS count,
|
|
||||||
SUM(CASE WHEN marked THEN 1 ELSE 0 END) AS count_marked
|
|
||||||
FROM ttrss_feeds f, ttrss_user_entries ue
|
|
||||||
WHERE f.id = ue.feed_id AND ue.owner_uid = :uid
|
|
||||||
GROUP BY f.id");
|
|
||||||
|
|
||||||
$sth->execute(["uid" => $_SESSION['uid']]);
|
|
||||||
}
|
|
||||||
|
|
||||||
while ($line = $sth->fetch()) {
|
|
||||||
|
|
||||||
$id = $line["id"];
|
|
||||||
$last_updated = TimeHelper::make_local_datetime($line['last_updated']);
|
|
||||||
|
|
||||||
if (Feeds::_has_icon($id)) {
|
|
||||||
$ts = filemtime(Feeds::_get_icon_file($id));
|
|
||||||
} else {
|
|
||||||
$ts = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
$cv = [
|
|
||||||
"id" => $id,
|
|
||||||
"updated" => $last_updated,
|
|
||||||
"counter" => (int) $line["count"],
|
|
||||||
"markedcounter" => (int) $line["count_marked"],
|
|
||||||
"ts" => (int) $ts
|
|
||||||
];
|
];
|
||||||
|
|
||||||
$cv["error"] = $line["last_error"];
|
|
||||||
$cv["title"] = truncate_string($line["title"], 30);
|
|
||||||
|
|
||||||
array_push($ret, $cv);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $ret;
|
return $ret;
|
||||||
|
@ -110,7 +110,7 @@ class Digest
|
|||||||
link,
|
link,
|
||||||
score,
|
score,
|
||||||
content,
|
content,
|
||||||
".SUBSTRING_FOR_DATE."(last_updated,1,19) AS last_updated
|
SUBSTRING_FOR_DATE(last_updated,1,19) AS last_updated
|
||||||
FROM
|
FROM
|
||||||
ttrss_user_entries,ttrss_entries,ttrss_feeds
|
ttrss_user_entries,ttrss_entries,ttrss_feeds
|
||||||
LEFT JOIN
|
LEFT JOIN
|
||||||
|
@ -400,8 +400,8 @@ class Feeds extends Handler_Protected {
|
|||||||
|
|
||||||
$reply['content'] .= "<p><span class=\"text-muted\">";
|
$reply['content'] .= "<p><span class=\"text-muted\">";
|
||||||
|
|
||||||
$sth = $this->pdo->prepare("SELECT " . SUBSTRING_FOR_DATE . "(MAX(last_updated), 1, 19) AS last_updated FROM ttrss_feeds
|
$sth = $this->pdo->prepare("SELECT SUBSTRING_FOR_DATE(MAX(last_updated), 1, 19) AS last_updated
|
||||||
WHERE owner_uid = ?");
|
FROM ttrss_feeds WHERE owner_uid = ?");
|
||||||
$sth->execute([$_SESSION['uid']]);
|
$sth->execute([$_SESSION['uid']]);
|
||||||
$row = $sth->fetch();
|
$row = $sth->fetch();
|
||||||
|
|
||||||
@ -2239,7 +2239,7 @@ class Feeds extends Handler_Protected {
|
|||||||
$orig_ts = strtotime(substr($k, 1));
|
$orig_ts = strtotime(substr($k, 1));
|
||||||
$k = date("Y-m-d", TimeHelper::convert_timestamp($orig_ts, $user_tz_string, 'UTC'));
|
$k = date("Y-m-d", TimeHelper::convert_timestamp($orig_ts, $user_tz_string, 'UTC'));
|
||||||
|
|
||||||
array_push($query_keywords, "(".SUBSTRING_FOR_DATE."(updated,1,LENGTH(".$pdo->quote($k).")) $not = ".$pdo->quote($k).")");
|
array_push($query_keywords, "(SUBSTRING_FOR_DATE(updated,1,LENGTH(".$pdo->quote($k).")) $not = ".$pdo->quote($k).")");
|
||||||
} else {
|
} else {
|
||||||
// treat as leftover text
|
// treat as leftover text
|
||||||
|
|
||||||
|
@ -74,7 +74,7 @@ class Pref_Feeds extends Handler_Protected {
|
|||||||
$feeds_obj = ORM::for_table('ttrss_feeds')
|
$feeds_obj = ORM::for_table('ttrss_feeds')
|
||||||
->table_alias('f')
|
->table_alias('f')
|
||||||
->select_many('id', 'title', 'last_error', 'update_interval')
|
->select_many('id', 'title', 'last_error', 'update_interval')
|
||||||
->select_expr(SUBSTRING_FOR_DATE.'(last_updated,1,19)', 'last_updated')
|
->select_expr('SUBSTRING_FOR_DATE(last_updated,1,19)', 'last_updated')
|
||||||
->left_outer_join('ttrss_user_entries', [ 'ue.feed_id', '=', 'f.id'], 'ue')
|
->left_outer_join('ttrss_user_entries', [ 'ue.feed_id', '=', 'f.id'], 'ue')
|
||||||
->select_expr('COUNT(ue.int_id) AS num_articles')
|
->select_expr('COUNT(ue.int_id) AS num_articles')
|
||||||
->where(['cat_id' => $cat_id, 'owner_uid' => $_SESSION['uid']])
|
->where(['cat_id' => $cat_id, 'owner_uid' => $_SESSION['uid']])
|
||||||
@ -261,7 +261,7 @@ class Pref_Feeds extends Handler_Protected {
|
|||||||
$feeds_obj = ORM::for_table('ttrss_feeds')
|
$feeds_obj = ORM::for_table('ttrss_feeds')
|
||||||
->table_alias('f')
|
->table_alias('f')
|
||||||
->select_many('id', 'title', 'last_error', 'update_interval')
|
->select_many('id', 'title', 'last_error', 'update_interval')
|
||||||
->select_expr(SUBSTRING_FOR_DATE.'(last_updated,1,19)', 'last_updated')
|
->select_expr('SUBSTRING_FOR_DATE(last_updated,1,19)', 'last_updated')
|
||||||
->left_outer_join('ttrss_user_entries', [ 'ue.feed_id', '=', 'f.id'], 'ue')
|
->left_outer_join('ttrss_user_entries', [ 'ue.feed_id', '=', 'f.id'], 'ue')
|
||||||
->select_expr('COUNT(ue.int_id) AS num_articles')
|
->select_expr('COUNT(ue.int_id) AS num_articles')
|
||||||
->where('owner_uid', $_SESSION['uid'])
|
->where('owner_uid', $_SESSION['uid'])
|
||||||
@ -305,7 +305,7 @@ class Pref_Feeds extends Handler_Protected {
|
|||||||
$feeds_obj = ORM::for_table('ttrss_feeds')
|
$feeds_obj = ORM::for_table('ttrss_feeds')
|
||||||
->table_alias('f')
|
->table_alias('f')
|
||||||
->select_many('id', 'title', 'last_error', 'update_interval')
|
->select_many('id', 'title', 'last_error', 'update_interval')
|
||||||
->select_expr(SUBSTRING_FOR_DATE.'(last_updated,1,19)', 'last_updated')
|
->select_expr('SUBSTRING_FOR_DATE(last_updated,1,19)', 'last_updated')
|
||||||
->left_outer_join('ttrss_user_entries', [ 'ue.feed_id', '=', 'f.id'], 'ue')
|
->left_outer_join('ttrss_user_entries', [ 'ue.feed_id', '=', 'f.id'], 'ue')
|
||||||
->select_expr('COUNT(ue.int_id) AS num_articles')
|
->select_expr('COUNT(ue.int_id) AS num_articles')
|
||||||
->where('owner_uid', $_SESSION['uid'])
|
->where('owner_uid', $_SESSION['uid'])
|
||||||
|
@ -6,7 +6,7 @@ class Pref_Users extends Handler_Administrative {
|
|||||||
|
|
||||||
function edit(): void {
|
function edit(): void {
|
||||||
$user = ORM::for_table('ttrss_users')
|
$user = ORM::for_table('ttrss_users')
|
||||||
->select_expr("id,login,access_level,email,full_name,otp_enabled")
|
->select_many('id', 'login', 'access_level', 'email', 'full_name', 'otp_enabled')
|
||||||
->find_one((int)$_REQUEST["id"])
|
->find_one((int)$_REQUEST["id"])
|
||||||
->as_array();
|
->as_array();
|
||||||
|
|
||||||
@ -23,30 +23,25 @@ class Pref_Users extends Handler_Administrative {
|
|||||||
function userdetails(): void {
|
function userdetails(): void {
|
||||||
$id = (int) clean($_REQUEST["id"]);
|
$id = (int) clean($_REQUEST["id"]);
|
||||||
|
|
||||||
$sth = $this->pdo->prepare("SELECT login,
|
$user = ORM::for_table('ttrss_users')
|
||||||
".SUBSTRING_FOR_DATE."(last_login,1,16) AS last_login,
|
->table_alias('u')
|
||||||
access_level,
|
->select_many('u.login', 'u.access_level')
|
||||||
(SELECT COUNT(int_id) FROM ttrss_user_entries
|
->select_many_expr([
|
||||||
WHERE owner_uid = id) AS stored_articles,
|
'created' => 'SUBSTRING_FOR_DATE(u.created,1,16)',
|
||||||
".SUBSTRING_FOR_DATE."(created,1,16) AS created
|
'last_login' => 'SUBSTRING_FOR_DATE(u.last_login,1,16)',
|
||||||
FROM ttrss_users
|
'stored_articles' => '(SELECT COUNT(ue.int_id) FROM ttrss_user_entries ue WHERE ue.owner_uid = u.id)',
|
||||||
WHERE id = ?");
|
])
|
||||||
$sth->execute([$id]);
|
->find_one($id);
|
||||||
|
|
||||||
if ($row = $sth->fetch()) {
|
if ($user) {
|
||||||
|
$created = TimeHelper::make_local_datetime($user->created);
|
||||||
|
$last_login = TimeHelper::make_local_datetime($user->last_login);
|
||||||
|
|
||||||
$last_login = TimeHelper::make_local_datetime($row['last_login']);
|
$user_owned_feeds = ORM::for_table('ttrss_feeds')
|
||||||
|
->select_many('id', 'title', 'site_url')
|
||||||
$created = TimeHelper::make_local_datetime($row['created']);
|
->where('owner_uid', $id)
|
||||||
|
->order_by_expr('LOWER(title)')
|
||||||
$stored_articles = $row["stored_articles"];
|
->find_many();
|
||||||
|
|
||||||
$sth = $this->pdo->prepare("SELECT COUNT(id) as num_feeds FROM ttrss_feeds
|
|
||||||
WHERE owner_uid = ?");
|
|
||||||
$sth->execute([$id]);
|
|
||||||
$row = $sth->fetch();
|
|
||||||
|
|
||||||
$num_feeds = $row["num_feeds"];
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
@ -62,31 +57,25 @@ class Pref_Users extends Handler_Administrative {
|
|||||||
|
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<label><?= __('Subscribed feeds') ?>:</label>
|
<label><?= __('Subscribed feeds') ?>:</label>
|
||||||
<?= $num_feeds ?>
|
<?= count($user_owned_feeds) ?>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<label><?= __('Stored articles') ?>:</label>
|
<label><?= __('Stored articles') ?>:</label>
|
||||||
<?= $stored_articles ?>
|
<?= $user->stored_articles ?>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
<?php
|
|
||||||
$sth = $this->pdo->prepare("SELECT id,title,site_url FROM ttrss_feeds
|
|
||||||
WHERE owner_uid = ? ORDER BY title");
|
|
||||||
$sth->execute([$id]);
|
|
||||||
?>
|
|
||||||
|
|
||||||
<ul class="panel panel-scrollable list list-unstyled">
|
<ul class="panel panel-scrollable list list-unstyled">
|
||||||
<?php while ($row = $sth->fetch()) { ?>
|
<?php foreach ($user_owned_feeds as $feed) { ?>
|
||||||
<li>
|
<li>
|
||||||
<?php
|
<?php
|
||||||
$icon_url = Feeds::_get_icon_url($row['id'], 'images/blank_icon.gif');
|
$icon_url = Feeds::_get_icon_url($feed->id, 'images/blank_icon.gif');
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<img class="icon" src="<?= htmlspecialchars($icon_url) ?>">
|
<img class="icon" src="<?= htmlspecialchars($icon_url) ?>">
|
||||||
|
|
||||||
<a target="_blank" href="<?= htmlspecialchars($row["site_url"]) ?>">
|
<a target="_blank" href="<?= htmlspecialchars($feed->site_url) ?>">
|
||||||
<?= htmlspecialchars($row["title"]) ?>
|
<?= htmlspecialchars($feed->title) ?>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
@ -134,14 +123,9 @@ class Pref_Users extends Handler_Administrative {
|
|||||||
|
|
||||||
foreach ($ids as $id) {
|
foreach ($ids as $id) {
|
||||||
if ($id != $_SESSION["uid"] && $id != 1) {
|
if ($id != $_SESSION["uid"] && $id != 1) {
|
||||||
$sth = $this->pdo->prepare("DELETE FROM ttrss_tags WHERE owner_uid = ?");
|
ORM::for_table('ttrss_tags')->where('owner_uid', $id)->delete_many();
|
||||||
$sth->execute([$id]);
|
ORM::for_table('ttrss_feeds')->where('owner_uid', $id)->delete_many();
|
||||||
|
ORM::for_table('ttrss_users')->where('id', $id)->delete_many();
|
||||||
$sth = $this->pdo->prepare("DELETE FROM ttrss_feeds WHERE owner_uid = ?");
|
|
||||||
$sth->execute([$id]);
|
|
||||||
|
|
||||||
$sth = $this->pdo->prepare("DELETE FROM ttrss_users WHERE id = ?");
|
|
||||||
$sth->execute([$id]);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -344,11 +344,13 @@ class RSSUtils {
|
|||||||
$cache = DiskCache::instance('feeds');
|
$cache = DiskCache::instance('feeds');
|
||||||
|
|
||||||
$feed_obj = ORM::for_table('ttrss_feeds')
|
$feed_obj = ORM::for_table('ttrss_feeds')
|
||||||
->select_expr("ttrss_feeds.*,
|
->select('ttrss_feeds.*')
|
||||||
".SUBSTRING_FOR_DATE."(last_unconditional, 1, 19) AS last_unconditional,
|
->select_many_expr([
|
||||||
(favicon_is_custom IS NOT TRUE AND
|
'last_unconditional' => 'SUBSTRING_FOR_DATE(last_unconditional, 1, 19)',
|
||||||
(favicon_last_checked IS NULL OR favicon_last_checked < NOW() - INTERVAL '12 hour')) AS favicon_needs_check")
|
'favicon_needs_check' => "(favicon_is_custom IS NOT TRUE AND
|
||||||
->find_one($feed);
|
(favicon_last_checked IS NULL OR favicon_last_checked < NOW() - INTERVAL '12 hour'))",
|
||||||
|
])
|
||||||
|
->find_one($feed);
|
||||||
|
|
||||||
if ($feed_obj) {
|
if ($feed_obj) {
|
||||||
$feed_obj->last_update_started = Db::NOW();
|
$feed_obj->last_update_started = Db::NOW();
|
||||||
@ -677,7 +679,7 @@ class RSSUtils {
|
|||||||
|
|
||||||
$items = $rss->get_items();
|
$items = $rss->get_items();
|
||||||
|
|
||||||
if (!is_array($items)) {
|
if (count($items) === 0) {
|
||||||
Debug::log("no articles found.", Debug::LOG_VERBOSE);
|
Debug::log("no articles found.", Debug::LOG_VERBOSE);
|
||||||
|
|
||||||
$feed_obj->set([
|
$feed_obj->set([
|
||||||
|
@ -11,11 +11,8 @@
|
|||||||
if (function_exists("mb_internal_encoding")) mb_internal_encoding("UTF-8");
|
if (function_exists("mb_internal_encoding")) mb_internal_encoding("UTF-8");
|
||||||
|
|
||||||
date_default_timezone_set('UTC');
|
date_default_timezone_set('UTC');
|
||||||
if (defined('E_DEPRECATED')) {
|
|
||||||
error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);
|
error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);
|
||||||
} else {
|
|
||||||
error_reporting(E_ALL & ~E_NOTICE);
|
|
||||||
}
|
|
||||||
|
|
||||||
ini_set('display_errors', "false");
|
ini_set('display_errors', "false");
|
||||||
ini_set('display_startup_errors', "false");
|
ini_set('display_startup_errors', "false");
|
||||||
@ -26,7 +23,8 @@
|
|||||||
|
|
||||||
require_once "autoload.php";
|
require_once "autoload.php";
|
||||||
|
|
||||||
define('SUBSTRING_FOR_DATE', 'SUBSTRING_FOR_DATE');
|
/** @deprecated use the 'SUBSTRING_FOR_DATE' string directly */
|
||||||
|
const SUBSTRING_FOR_DATE = 'SUBSTRING_FOR_DATE';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated by Prefs::get()
|
* @deprecated by Prefs::get()
|
||||||
|
@ -123,7 +123,7 @@ class Share extends Plugin {
|
|||||||
$pdo = Db::pdo();
|
$pdo = Db::pdo();
|
||||||
|
|
||||||
$sth = $pdo->prepare("SELECT id,title,link,content,feed_id,comments,int_id,lang,
|
$sth = $pdo->prepare("SELECT id,title,link,content,feed_id,comments,int_id,lang,
|
||||||
".SUBSTRING_FOR_DATE."(updated,1,16) as updated,
|
SUBSTRING_FOR_DATE(updated,1,16) as updated,
|
||||||
(SELECT site_url FROM ttrss_feeds WHERE id = feed_id) as site_url,
|
(SELECT site_url FROM ttrss_feeds WHERE id = feed_id) as site_url,
|
||||||
(SELECT title FROM ttrss_feeds WHERE id = feed_id) as feed_title,
|
(SELECT title FROM ttrss_feeds WHERE id = feed_id) as feed_title,
|
||||||
(SELECT hide_images FROM ttrss_feeds WHERE id = feed_id) as hide_images,
|
(SELECT hide_images FROM ttrss_feeds WHERE id = feed_id) as hide_images,
|
||||||
|
Loading…
Reference in New Issue
Block a user