}
function redirect() {
+ $id = $_REQUEST['id'];
+
$sth = $this->pdo->prepare("SELECT link FROM ttrss_entries, ttrss_user_entries
WHERE id = ? AND id = ref_id AND owner_uid = ?
LIMIT 1");
unset($line["tag_cache"]);
$line["content"] = sanitize($line["content"],
- sql_bool_to_bool($line['hide_images']),
+ $line['hide_images'],
$owner_uid, $line["site_url"], false, $line["id"]);
foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_RENDER_ARTICLE) as $p) {
if (!$zoom_mode) {
$rv['content'] .= Article::format_article_enclosures($id,
- sql_bool_to_bool($line["always_display_enclosures"]),
+ $line["always_display_enclosures"],
$line["content"],
- sql_bool_to_bool($line["hide_images"]));
+ $line["hide_images"]);
}
$rv['content'] .= "</div>";
if ($row = $sth->fetch()) {
$last_updated = strtotime($row["last_updated"]);
- $cache_images = sql_bool_to_bool($row["cache_images"]);
+ $cache_images = $row["cache_images"];
if (!$cache_images && time() - $last_updated > 120) {
RSSUtils::update_rss_feed($feed, true);
$class = "";
- if (sql_bool_to_bool($line["unread"])) {
+ if ($line["unread"]) {
$class .= " Unread";
++$num_unread;
}
- if (sql_bool_to_bool($line["marked"])) {
+ if ($line["marked"]) {
$marked_pic = "<img
src=\"images/mark_set.png\"
class=\"markedPic\" alt=\"Unstar article\"
onclick='toggleMark($id)'>";
}
- if (sql_bool_to_bool($line["published"])) {
+ if ($line["published"]) {
$published_pic = "<img src=\"images/pub_set.png\"
class=\"pubPic\"
alt=\"Unpublish article\" onclick='togglePub($id)'>";
$tags = false;
$line["content"] = sanitize($line["content"],
- sql_bool_to_bool($line['hide_images']), false, $entry_site_url, $highlight_words, $line["id"]);
+ $line['hide_images'], false, $entry_site_url, $highlight_words, $line["id"]);
foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_RENDER_ARTICLE_CDM) as $p) {
$line = $p->hook_render_article_cdm($line);
$tmp_content .= "<div class=\"cdmIntermediate\">";
- $always_display_enclosures = sql_bool_to_bool($line["always_display_enclosures"]);
+ $always_display_enclosures = $line["always_display_enclosures"];
$tmp_content .= Article::format_article_enclosures($id, $always_display_enclosures, $line["content"], sql_bool_to_bool($line["hide_images"]));
$tmp_content .= "</div>"; // cdmIntermediate
if (!$limit) $limit = 60;
$date_sort_field = "date_entered DESC, updated DESC";
- $date_check_field = "date_entered";
if ($feed == -2 && !$is_cat) {
$date_sort_field = "last_published DESC";
- $date_check_field = "last_published";
} else if ($feed == -1 && !$is_cat) {
$date_sort_field = "last_marked DESC";
- $date_check_field = "last_marked";
}
switch ($order) {
function rss() {
$feed = $_REQUEST["id"];
$key = $_REQUEST["key"];
- $is_cat = sql_bool_to_bool($_REQUEST["is_cat"]);
+ $is_cat = $_REQUEST["is_cat"];
$limit = (int)$_REQUEST["limit"];
$offset = (int)$_REQUEST["offset"];
$start_ts = $_REQUEST["ts"];
$format = $_REQUEST['format'];
- $orig_guid = sql_bool_to_bool($_REQUEST["orig_guid"]);
+ $orig_guid = $_REQUEST["orig_guid"];
if (!$format) $format = 'atom';
$sth->execute([$owner_uid]);
while ($line = $sth->fetch()) {
- foreach (array('enabled', 'match_any_rule', 'inverse') as $b) {
- $line[$b] = sql_bool_to_bool($line[$b]);
- }
-
$line["rules"] = array();
$line["actions"] = array();
unset($tmp_line["id"]);
unset($tmp_line["filter_id"]);
- $cat_filter = sql_bool_to_bool($tmp_line["cat_filter"]);
+ $cat_filter = $tmp_line["cat_filter"];
if (!$tmp_line["match_on"]) {
if ($cat_filter && $tmp_line["cat_id"] || $tmp_line["feed_id"]) {
unset($tmp_line["match_on"]);
}
- $tmp_line["cat_filter"] = sql_bool_to_bool($tmp_line["cat_filter"]);
- $tmp_line["inverse"] = sql_bool_to_bool($tmp_line["inverse"]);
-
unset($tmp_line["feed_id"]);
unset($tmp_line["cat_id"]);
print '<div dojoType="dijit.layout.TabContainer" style="height : 450px">
<div dojoType="dijit.layout.ContentPane" title="'.__('General').'">';
- $auth_pass_encrypted = sql_bool_to_bool($row["auth_pass_encrypted"]);
+ $auth_pass_encrypted = $row["auth_pass_encrypted"];
$title = htmlspecialchars($row["title"]);
//print "<div class=\"dlgSec\">".__("Options")."</div>";
print "<div class=\"dlgSecSimple\">";
- $private = sql_bool_to_bool($row["private"]);
+ $private = $row["private"];
if ($private) {
$checked = "checked=\"1\"";
print "<input dojoType=\"dijit.form.CheckBox\" type=\"checkbox\" name=\"private\" id=\"private\"
$checked> <label for=\"private\">".__('Hide from Popular feeds')."</label>";
- $include_in_digest = sql_bool_to_bool($row["include_in_digest"]);
+ $include_in_digest = $row["include_in_digest"];
if ($include_in_digest) {
$checked = "checked=\"1\"";
$checked> <label for=\"include_in_digest\">".__('Include in e-mail digest')."</label>";
- $always_display_enclosures = sql_bool_to_bool($row["always_display_enclosures"]);
+ $always_display_enclosures = $row["always_display_enclosures"];
if ($always_display_enclosures) {
$checked = "checked";
name=\"always_display_enclosures\"
$checked> <label for=\"always_display_enclosures\">".__('Always display image attachments')."</label>";
- $hide_images = sql_bool_to_bool($row["hide_images"]);
+ $hide_images = $row["hide_images"];
if ($hide_images) {
$checked = "checked=\"1\"";
$checked> <label for=\"hide_images\">".
__('Do not embed images')."</label>";
- $cache_images = sql_bool_to_bool($row["cache_images"]);
+ $cache_images = $row["cache_images"];
if ($cache_images) {
$checked = "checked=\"1\"";
$checked> <label for=\"cache_images\">".
__('Cache media')."</label>";
- $mark_unread_on_update = sql_bool_to_bool($row["mark_unread_on_update"]);
+ $mark_unread_on_update = $row["mark_unread_on_update"];
if ($mark_unread_on_update) {
$checked = "checked";
$email = htmlspecialchars($row["email"]);
$full_name = htmlspecialchars($row["full_name"]);
- $otp_enabled = sql_bool_to_bool($row["otp_enabled"]);
+ $otp_enabled = $row["otp_enabled"];
print "<tr><td width=\"40%\">".__('Full name')."</td>";
print "<td class=\"prefValue\"><input dojoType=\"dijit.form.ValidationTextBox\" name=\"full_name\" required=\"1\"
$base32 = new Base32();
$login = $row["login"];
- $otp_enabled = sql_bool_to_bool($row["otp_enabled"]);
+ $otp_enabled = $row["otp_enabled"];
if (!$otp_enabled) {
$secret = $base32->encode(sha1($row["salt"]));
$owner_uid = $row["owner_uid"];
- $auth_pass_encrypted = sql_bool_to_bool($row["auth_pass_encrypted"]);
+ $auth_pass_encrypted = $row["auth_pass_encrypted"];
$auth_login = $row["auth_login"];
$auth_pass = $row["auth_pass"];
if ($row = $sth->fetch()) {
$owner_uid = $row["owner_uid"];
- $mark_unread_on_update = sql_bool_to_bool($row["mark_unread_on_update"]);
- $auth_pass_encrypted = sql_bool_to_bool($row["auth_pass_encrypted"]);
+ $mark_unread_on_update = $row["mark_unread_on_update"];
+ $auth_pass_encrypted = $row["auth_pass_encrypted"];
$sth = $pdo->prepare("UPDATE ttrss_feeds SET last_update_started = NOW()
WHERE id = ?");
$stored_last_modified = $row["last_modified"];
$last_unconditional = $row["last_unconditional"];
- $cache_images = sql_bool_to_bool($row["cache_images"]);
+ $cache_images = $row["cache_images"];
$fetch_url = $row["feed_url"];
$feed_language = mb_strtolower($row["feed_language"]);
if (!$feed_language) $feed_language = 'english';
$sth->execute([$feed]);
if ($row = $sth->fetch()) {
- $favicon_needs_check = sql_bool_to_bool($row["favicon_needs_check"]);
+ $favicon_needs_check = $row["favicon_needs_check"];
$favicon_avg_color = $row["favicon_avg_color"];
$owner_uid = $row["owner_uid"];
} else {
$entry_current_hash,
$date_feed_processed,
$entry_comments,
- $num_comments,
+ (int)$num_comments,
$entry_plugin_data,
$entry_language,
$entry_author]);
WHERE id = ?");
$sth->execute([$entry_title, $entry_content, $entry_current_hash, $entry_timestamp_fmt,
- $num_comments, $entry_plugin_data, $entry_author, $entry_language, $ref_id]);
+ (int)$num_comments, $entry_plugin_data, $entry_author, $entry_language, $ref_id]);
// update aux data
$sth = $pdo->prepare("UPDATE ttrss_user_entries