Commit 374f9fce authored by Sebastian Reichel's avatar Sebastian Reichel

Imported Upstream version 1.7.1+dfsg

parent 30e64c99
......@@ -48,7 +48,7 @@
session_id($_REQUEST["sid"]);
}
session_start();
@session_start();
if (!init_connection($link)) return;
......
......@@ -21,13 +21,13 @@
<div class="rss">
<img class="feedicon" src="images/feed-icon-64x64.png" alt="feed icon"/>
<img class="feedicon" src="images/pub_set.svg" style="width : 64px; height : 64px;"
alt="feed icon"/>
<h1><xsl:value-of select="atom:title"/></h1>
<p class="description">This feed has been exported from
<a target="_new" class="extlink" href="http://tt-rss.org">Tiny Tiny RSS</a>.
You need a news reader software to subscribe to it.
It contains the following items:</p>
<xsl:for-each select="atom:entry">
......
......@@ -47,7 +47,7 @@
startup_gettext();
$script_started = getmicrotime();
$script_started = microtime(true);
$link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
......
......@@ -42,7 +42,7 @@ div.cdmHeader img, div.cdmFooter img {
margin : 0px 2px 0px 2px;
}
div.cdmContent {
div.cdmContent, div.cdmContentInner * {
font-weight : normal;
}
......@@ -96,3 +96,7 @@ div.cdmFeedTitle {
background-repeat : repeat-x;
}
div.articleNote {
border-style : dashed none dashed none;
}
This diff is collapsed.
......@@ -23,16 +23,10 @@ class Backend extends Handler {
$imap = get_hotkeys_map($this->link);
$omap = array();
// :(
$tinycharmap = array(
"(9)" => "{TAB}",
"(191)" => "?");
foreach ($imap[1] as $sequence => $action) {
if (!isset($omap[$action])) {
$omap[$action] = isset($tinycharmap[$sequence]) ? $tinycharmap[$sequence] :
$sequence;
}
if (!isset($omap[$action])) $omap[$action] = array();
array_push($omap[$action], $sequence);
}
print "<ul class='helpKbList' id='helpKbList'>";
......@@ -44,18 +38,21 @@ class Backend extends Handler {
print "<li><h3>" . $section . "</h3></li>";
foreach ($hotkeys as $action => $description) {
if (strpos($omap[$action], "|") !== FALSE) {
$omap[$action] = substr($omap[$action],
strpos($omap[$action], "|")+1,
strlen($omap[$action]));
}
print "<li>";
print "<span class='hksequence'>" . $omap[$action] . "</span>";
print $description;
print "</li>";
}
foreach ($omap[$action] as $sequence) {
if (strpos($sequence, "|") !== FALSE) {
$sequence = substr($sequence,
strpos($sequence, "|")+1,
strlen($sequence));
}
print "<li>";
print "<span class='hksequence'>$sequence</span>";
print $description;
print "</li>";
}
}
}
print "</ul>";
......
This diff is collapsed.
......@@ -7,6 +7,7 @@ class PluginHost {
private $commands = array();
private $storage = array();
private $owner_uid;
private $debug;
const HOOK_ARTICLE_BUTTON = 1;
const HOOK_ARTICLE_FILTER = 2;
......@@ -17,6 +18,9 @@ class PluginHost {
const HOOK_UPDATE_TASK = 7;
const HOOK_AUTH_USER = 8;
const HOOK_HOTKEY_MAP = 9;
const HOOK_RENDER_ARTICLE = 10;
const HOOK_RENDER_ARTICLE_CDM = 11;
const HOOK_FEED_FETCHED = 12;
const KIND_ALL = 1;
const KIND_SYSTEM = 2;
......@@ -287,5 +291,13 @@ class PluginHost {
$_SESSION["plugin_storage"] = $this->storage;
}
}
function set_debug($debug) {
$this->debug = $debug;
}
function get_debug() {
return $this->debug;
}
}
?>
......@@ -38,7 +38,7 @@ class Pref_Feeds extends Handler_Protected {
$items = array();
$result = db_query($this->link, "SELECT id, title, collapsed FROM ttrss_feed_categories
$result = db_query($this->link, "SELECT id, title FROM ttrss_feed_categories
WHERE owner_uid = " . $_SESSION["uid"] . " AND parent_cat = '$cat_id' ORDER BY order_id, title");
while ($line = db_fetch_assoc($result)) {
......@@ -49,7 +49,6 @@ class Pref_Feeds extends Handler_Protected {
$cat['name'] = $line['title'];
$cat['items'] = array();
$cat['checkbox'] = false;
$cat['hidden'] = sql_bool_to_bool($line['collapsed']);
$cat['type'] = 'category';
$cat['unread'] = 0;
$cat['child_unread'] = 0;
......@@ -107,8 +106,7 @@ class Pref_Feeds extends Handler_Protected {
if ($_REQUEST['mode'] == 2) {
if ($enable_cats) {
$cat_hidden = get_pref($this->link, "_COLLAPSED_SPECIAL");
$cat = $this->feedlist_init_cat(-1, $cat_hidden);
$cat = $this->feedlist_init_cat(-1);
} else {
$cat['items'] = array();
}
......@@ -129,8 +127,7 @@ class Pref_Feeds extends Handler_Protected {
if (db_num_rows($result) > 0) {
if (get_pref($this->link, 'ENABLE_FEED_CATS')) {
$cat_hidden = get_pref($this->link, "_COLLAPSED_LABELS");
$cat = $this->feedlist_init_cat(-2, $cat_hidden);
$cat = $this->feedlist_init_cat(-2);
} else {
$cat['items'] = array();
}
......@@ -138,9 +135,8 @@ class Pref_Feeds extends Handler_Protected {
while ($line = db_fetch_assoc($result)) {
$label_id = -$line['id'] - 11;
$count = getFeedUnread($this->link, $label_id);
$feed = $this->feedlist_init_feed($label_id, false, $count);
$feed = $this->feedlist_init_feed($label_id, false, 0);
$feed['fg_color'] = $line['fg_color'];
$feed['bg_color'] = $line['bg_color'];
......@@ -160,7 +156,7 @@ class Pref_Feeds extends Handler_Protected {
$show_empty_cats = $_REQUEST['mode'] != 2 && !$search &&
get_pref($this->link, '_PREFS_SHOW_EMPTY_CATS');
$result = db_query($this->link, "SELECT id, title, collapsed FROM ttrss_feed_categories
$result = db_query($this->link, "SELECT id, title FROM ttrss_feed_categories
WHERE owner_uid = " . $_SESSION["uid"] . " AND parent_cat IS NULL ORDER BY order_id, title");
while ($line = db_fetch_assoc($result)) {
......@@ -170,7 +166,6 @@ class Pref_Feeds extends Handler_Protected {
$cat['name'] = $line['title'];
$cat['items'] = array();
$cat['checkbox'] = false;
$cat['hidden'] = sql_bool_to_bool($line['collapsed']);
$cat['type'] = 'category';
$cat['unread'] = 0;
$cat['child_unread'] = 0;
......@@ -192,7 +187,6 @@ class Pref_Feeds extends Handler_Protected {
$cat['bare_id'] = 0;
$cat['name'] = __("Uncategorized");
$cat['items'] = array();
$cat['hidden'] = get_pref($this->link, "_COLLAPSED_UNCAT");
$cat['type'] = 'category';
$cat['checkbox'] = false;
$cat['unread'] = 0;
......@@ -443,6 +437,8 @@ class Pref_Feeds extends Handler_Protected {
}
function uploadicon() {
header("Content-type: text/html");
$icon_file = $_FILES['icon_file']['tmp_name'];
$feed_id = db_escape_string($_REQUEST["feed_id"]);
......@@ -592,17 +588,6 @@ class Pref_Feeds extends Handler_Protected {
print "<input dojoType=\"dijit.form.CheckBox\" type=\"checkbox\" name=\"private\" id=\"private\"
$checked>&nbsp;<label for=\"private\">".__('Hide from Popular feeds')."</label>";
$rtl_content = sql_bool_to_bool(db_fetch_result($result, 0, "rtl_content"));
if ($rtl_content) {
$checked = "checked=\"1\"";
} else {
$checked = "";
}
print "<hr/><input dojoType=\"dijit.form.CheckBox\" type=\"checkbox\" id=\"rtl_content\" name=\"rtl_content\"
$checked>&nbsp;<label for=\"rtl_content\">".__('Right-to-left content')."</label>";
$include_in_digest = sql_bool_to_bool(db_fetch_result($result, 0, "include_in_digest"));
if ($include_in_digest) {
......@@ -654,18 +639,6 @@ class Pref_Feeds extends Handler_Protected {
name=\"mark_unread_on_update\"
$checked>&nbsp;<label for=\"mark_unread_on_update\">".__('Mark updated articles as unread')."</label>";
$update_on_checksum_change = sql_bool_to_bool(db_fetch_result($result, 0, "update_on_checksum_change"));
if ($update_on_checksum_change) {
$checked = "checked";
} else {
$checked = "";
}
print "<hr/><input dojoType=\"dijit.form.CheckBox\" type=\"checkbox\" id=\"update_on_checksum_change\"
name=\"update_on_checksum_change\"
$checked>&nbsp;<label for=\"update_on_checksum_change\">".__('Mark posts as updated on content change')."</label>";
print "</div>";
/* Icon */
......@@ -819,11 +792,6 @@ class Pref_Feeds extends Handler_Protected {
print "&nbsp;"; $this->batch_edit_cbox("private", "private_l");
print "<br/><input disabled=\"1\" type=\"checkbox\" id=\"rtl_content\" name=\"rtl_content\"
dojoType=\"dijit.form.CheckBox\">&nbsp;<label class='insensitive' id=\"rtl_content_l\" for=\"rtl_content\">".__('Right-to-left content')."</label>";
print "&nbsp;"; $this->batch_edit_cbox("rtl_content", "rtl_content_l");
print "<br/><input disabled=\"1\" type=\"checkbox\" id=\"include_in_digest\"
name=\"include_in_digest\"
dojoType=\"dijit.form.CheckBox\">&nbsp;<label id=\"include_in_digest_l\" class='insensitive' for=\"include_in_digest\">".__('Include in e-mail digest')."</label>";
......@@ -850,12 +818,6 @@ class Pref_Feeds extends Handler_Protected {
print "&nbsp;"; $this->batch_edit_cbox("mark_unread_on_update", "mark_unread_on_update_l");
print "<br/><input disabled=\"1\" type=\"checkbox\" id=\"update_on_checksum_change\"
name=\"update_on_checksum_change\"
dojoType=\"dijit.form.CheckBox\">&nbsp;<label id=\"update_on_checksum_change_l\" class='insensitive' for=\"update_on_checksum_change\">".__('Mark posts as updated on content change')."</label>";
print "&nbsp;"; $this->batch_edit_cbox("update_on_checksum_change", "update_on_checksum_change_l");
print "</div>";
print "<div class='dlgButtons'>
......@@ -890,7 +852,6 @@ class Pref_Feeds extends Handler_Protected {
$auth_login = db_escape_string(trim($_POST["auth_login"]));
$auth_pass = db_escape_string(trim($_POST["auth_pass"]));
$private = checkbox_to_sql_bool(db_escape_string($_POST["private"]));
$rtl_content = checkbox_to_sql_bool(db_escape_string($_POST["rtl_content"]));
$include_in_digest = checkbox_to_sql_bool(
db_escape_string($_POST["include_in_digest"]));
$cache_images = checkbox_to_sql_bool(
......@@ -904,9 +865,6 @@ class Pref_Feeds extends Handler_Protected {
$mark_unread_on_update = checkbox_to_sql_bool(
db_escape_string($_POST["mark_unread_on_update"]));
$update_on_checksum_change = checkbox_to_sql_bool(
db_escape_string($_POST["update_on_checksum_change"]));
if (get_pref($this->link, 'ENABLE_FEED_CATS')) {
if ($cat_id && $cat_id != 0) {
$category_qpart = "cat_id = '$cat_id',";
......@@ -930,13 +888,11 @@ class Pref_Feeds extends Handler_Protected {
auth_login = '$auth_login',
auth_pass = '$auth_pass',
private = $private,
rtl_content = $rtl_content,
cache_images = $cache_images,
cache_content = $cache_content,
include_in_digest = $include_in_digest,
always_display_enclosures = $always_display_enclosures,
mark_unread_on_update = $mark_unread_on_update,
update_on_checksum_change = $update_on_checksum_change
mark_unread_on_update = $mark_unread_on_update
WHERE id = '$feed_id' AND owner_uid = " . $_SESSION["uid"]);
} else {
......@@ -995,10 +951,6 @@ class Pref_Feeds extends Handler_Protected {
$qpart = "mark_unread_on_update = $mark_unread_on_update";
break;
case "update_on_checksum_change":
$qpart = "update_on_checksum_change = $update_on_checksum_change";
break;
case "cache_images":
$qpart = "cache_images = $cache_images";
break;
......@@ -1007,10 +959,6 @@ class Pref_Feeds extends Handler_Protected {
$qpart = "cache_content = $cache_content";
break;
case "rtl_content":
$qpart = "rtl_content = $rtl_content";
break;
case "cat_id":
$qpart = $category_qpart_nocomma;
break;
......@@ -1462,7 +1410,7 @@ class Pref_Feeds extends Handler_Protected {
print "</div>"; #container
}
private function feedlist_init_cat($cat_id, $hidden = false) {
private function feedlist_init_cat($cat_id) {
$obj = array();
$cat_id = (int) $cat_id;
......@@ -1477,7 +1425,6 @@ class Pref_Feeds extends Handler_Protected {
$obj['name'] = getCategoryTitle($this->link, $cat_id);
$obj['type'] = 'category';
$obj['unread'] = (int) $cat_unread;
$obj['hidden'] = $hidden;
$obj['bare_id'] = $cat_id;
return $obj;
......
......@@ -677,8 +677,10 @@ class Pref_Prefs extends Handler_Protected {
print "<td>" . htmlspecialchars($about[2]) . "</td>";
if (count($tmppluginhost->get_all($plugin)) > 0) {
print "<td><a href='#' onclick=\"clearPluginData('$name')\"
class='visibleLink'>".__("Clear data")."</a></td>";
if (in_array($name, $system_enabled)) {
print "<td><a href='#' onclick=\"clearPluginData('$name')\"
class='visibleLink'>".__("Clear data")."</a></td>";
}
}
print "</tr>";
......@@ -727,7 +729,9 @@ class Pref_Prefs extends Handler_Protected {
print "<td>" . htmlspecialchars($about[2]) . "</td>";
if (count($tmppluginhost->get_all($plugin)) > 0) {
print "<td><a href='#' onclick=\"clearPluginData('$name')\" class='visibleLink'>".__("Clear data")."</a></td>";
if (in_array($name, $system_enabled) || in_array($name, $user_enabled)) {
print "<td><a href='#' onclick=\"clearPluginData('$name')\" class='visibleLink'>".__("Clear data")."</a></td>";
}
}
print "</tr>";
......@@ -820,7 +824,10 @@ class Pref_Prefs extends Handler_Protected {
}
function setplugins() {
$plugins = join(",", $_REQUEST["plugins"]);
if (is_array($_REQUEST["plugins"]))
$plugins = join(",", $_REQUEST["plugins"]);
else
$plugins = "";
set_pref($this->link, "_ENABLED_PLUGINS", $plugins);
}
......
......@@ -667,7 +667,8 @@ class RPC extends Handler_Protected {
function setpanelmode() {
$wide = (int) $_REQUEST["wide"];
$_SESSION["widescreen"] = $wide;
setcookie("ttrss_widescreen", $wide,
time() + SESSION_COOKIE_LIFETIME);
print json_encode(array("wide" => $wide));
}
......
<?php
class SanitizeDummy extends SimplePie_Sanitize {
function sanitize($data, $type, $base) {
return $data;
}
}
?>
......@@ -60,11 +60,11 @@
if (!$is_cat) {
$table = "ttrss_counters_cache";
if ($feed_id > 0) {
/* if ($feed_id > 0) {
$tmp_result = db_query($link, "SELECT owner_uid FROM ttrss_feeds
WHERE id = '$feed_id'");
$owner_uid = db_fetch_result($tmp_result, 0, "owner_uid");
}
} */
} else {
$table = "ttrss_cat_counters_cache";
}
......@@ -96,11 +96,11 @@
if (!is_numeric($feed_id)) return;
if (!$is_cat && $feed_id > 0) {
/* if (!$is_cat && $feed_id > 0) {
$tmp_result = db_query($link, "SELECT owner_uid FROM ttrss_feeds
WHERE id = '$feed_id'");
$owner_uid = db_fetch_result($tmp_result, 0, "owner_uid");
}
} */
$prev_unread = ccache_find($link, $feed_id, $owner_uid, $is_cat, true);
......
......@@ -7,6 +7,41 @@
$_SESSION["prefs_cache"] = array();
}
function cache_prefs($link) {
$profile = false;
$user_id = $_SESSION["uid"];
@$profile = $_SESSION["profile"];
if ($profile) {
$profile_qpart = "profile = '$profile' AND";
} else {
$profile_qpart = "profile IS NULL AND";
}
if (get_schema_version($link) < 63) $profile_qpart = "";
$result = db_query($link, "SELECT
value,ttrss_prefs_types.type_name as type_name,ttrss_prefs.pref_name AS pref_name
FROM
ttrss_user_prefs,ttrss_prefs,ttrss_prefs_types
WHERE
$profile_qpart
ttrss_prefs.pref_name NOT LIKE '_MOBILE%' AND
ttrss_prefs_types.id = type_id AND
owner_uid = '$user_id' AND
ttrss_user_prefs.pref_name = ttrss_prefs.pref_name");
while ($line = db_fetch_assoc($result)) {
if ($user_id == $_SESSION["uid"]) {
$pref_name = $line["pref_name"];
$_SESSION["prefs_cache"][$pref_name]["type"] = $line["type_name"];
$_SESSION["prefs_cache"][$pref_name]["value"] = $line["value"];
}
}
}
function get_pref($link, $pref_name, $user_id = false, $die_on_error = false) {
$pref_name = db_escape_string($pref_name);
......
......@@ -52,10 +52,6 @@ function db_escape_string($s, $strip_tags = true) {
}
function db_query($link, $query, $die_on_error = true) {
//if ($_REQUEST["qlog"])
// error_log($_SESSION["uid"] . ":" . $_REQUEST["op"] . "/" . $_REQUEST["method"] .
// " $query\n", 3, "/tmp/ttrss-query.log");
if (DB_TYPE == "pgsql") {
$result = pg_query($link, $query);
if (!$result) {
......
This diff is collapsed.
......@@ -158,6 +158,38 @@
// Send feed digests by email if needed.
send_headlines_digests($link, $debug);
// Purge feeds with stale data OR not being updated for a while to keep DB size down
if ($debug) _debug("Purging inactive feeds...");
if (DB_TYPE == "pgsql") {
$interval_qpart = "NOW() - INTERVAL '1 month'";
} else {
$interval_qpart = "DATE_SUB(NOW(), INTERVAL 1 MONTH)";
}
$result = db_query($link, "SELECT id, feed_url FROM ttrss_feeds WHERE
(SELECT MAX(updated) FROM ttrss_entries, ttrss_user_entries WHERE
ttrss_entries.id = ref_id AND
ttrss_user_entries.feed_id = ttrss_feeds.id) < $interval_qpart OR
last_updated < $interval_qpart");
$feeds_purged = 0;
$articles_removed = 0;
while ($line = db_fetch_assoc($result)) {
$articles_removed += purge_feed($link, $line["id"], 0, false);
db_query($link, "UPDATE ttrss_feeds SET last_updated = NOW() WHERE
id = " . $line["id"]);
++$feeds_purged;
}
if ($debug && $articles_removed > 0)
_debug(sprintf("Purged %d feeds (%d articles).", $feeds_purged,
$articles_removed));
} // function update_daemon_common
// ignore_daemon is not used
......@@ -174,7 +206,7 @@
$result = db_query($link, "SELECT id,update_interval,auth_login,
feed_url,auth_pass,cache_images,last_updated,
mark_unread_on_update, owner_uid, update_on_checksum_change,
mark_unread_on_update, owner_uid,
pubsub_state
FROM ttrss_feeds WHERE id = '$feed'");
......@@ -189,8 +221,6 @@
$owner_uid = db_fetch_result($result, 0, "owner_uid");
$mark_unread_on_update = sql_bool_to_bool(db_fetch_result($result,
0, "mark_unread_on_update"));
$update_on_checksum_change = sql_bool_to_bool(db_fetch_result($result,
0, "update_on_checksum_change"));
$pubsub_state = db_fetch_result($result, 0, "pubsub_state");
db_query($link, "UPDATE ttrss_feeds SET last_update_started = NOW()
......@@ -204,15 +234,14 @@
$feed = db_escape_string($feed);
if ($auth_login && $auth_pass ){
/* if ($auth_login && $auth_pass ){
$url_parts = array();
preg_match("/(^[^:]*):\/\/(.*)/", $fetch_url, $url_parts);
if ($url_parts[1] && $url_parts[2]) {
$fetch_url = $url_parts[1] . "://$auth_login:$auth_pass@" . $url_parts[2];
}
}
} */
if ($override_url)
$fetch_url = $override_url;
......@@ -231,12 +260,46 @@
mkdir($simplepie_cache_dir);
}
$feed_data = fetch_file_contents($fetch_url, false,
$auth_login, $auth_pass, false, $no_cache ? 15 : 45);
if (!$feed_data) {
global $fetch_last_error;
if ($debug_enabled) {
_debug("update_rss_feed: unable to fetch: $fetch_last_error");
}
db_query($link,
"UPDATE ttrss_feeds SET last_error = '$fetch_last_error',
last_updated = NOW() WHERE id = '$feed'");
return;
}
$pluginhost = new PluginHost($link);
$pluginhost->set_debug($debug_enabled);
$user_plugins = get_pref($link, "_ENABLED_PLUGINS", $owner_uid);
$pluginhost->load(PLUGINS, $pluginhost::KIND_ALL);
$pluginhost->load($user_plugins, $pluginhost::KIND_USER, $owner_uid);
$pluginhost->load_data();
foreach ($pluginhost->get_hooks($pluginhost::HOOK_FEED_FETCHED) as $plugin) {
$feed_data = $plugin->hook_feed_fetched($feed_data);
}
if ($debug_enabled) {
_debug("update_rss_feed: fetch done, parsing...");
}
$rss = new SimplePie();
$rss->set_useragent(SELF_USER_AGENT);
$rss->set_timeout($no_cache ? 15 : 60);
$rss->set_feed_url($fetch_url);
$rss->set_sanitize_class("SanitizeDummy");
// simplepie ignores the above and creates default sanitizer anyway,
// so let's override it...
$rss->sanitize = new SanitizeDummy();
$rss->set_output_encoding('UTF-8');
$rss->force_feed(true);
$rss->set_raw_data($feed_data);
if ($debug_enabled) {
_debug("feed update interval (sec): " .
......@@ -250,27 +313,15 @@
$rss->set_cache_duration($cache_age);
}
$rss->init();
@$rss->init();
// print_r($rss);
if ($debug_enabled) {
_debug("update_rss_feed: fetch done, parsing...");
}
$feed = db_escape_string($feed);
if (!$rss->error()) {
// We use local pluginhost here because we need to load different per-user feed plugins
$user_plugins = get_pref($link, "_ENABLED_PLUGINS", $owner_uid);
$pluginhost = new PluginHost($link);
$pluginhost->load(PLUGINS, $pluginhost::KIND_ALL);
$pluginhost->load($user_plugins, $pluginhost::KIND_USER, $owner_uid);
$pluginhost->load_data();
$pluginhost->run_hooks($pluginhost::HOOK_FEED_PARSED, "hook_feed_parsed", $rss);
if ($debug_enabled) {
......@@ -394,7 +445,7 @@
}
foreach ($items as $item) {
if ($_REQUEST['xdebug'] == 2) {
if ($_REQUEST['xdebug'] == 3) {
print_r($item);
}
......@@ -429,7 +480,7 @@
$entry_title = $item->get_title();
$entry_link = rewrite_relative_url($site_url, htmlspecialchars_decode($item->get_link()));
$entry_link = rewrite_relative_url($site_url, $item->get_link());
if ($debug_enabled) {
_debug("update_rss_feed: title $entry_title");
......@@ -507,7 +558,7 @@
}
if ($debug_enabled) {
_debug("update_rss_feed: done collecting data [TITLE:$entry_title]");
_debug("update_rss_feed: done collecting data.");
}
// TODO: less memory-hungry implementation
......@@ -516,24 +567,47 @@
_debug("update_rss_feed: applying plugin filters..");
}
// FIXME not sure if owner_uid is a good idea here, we may have a base entry without user entry (?)
$result = db_query($link, "SELECT plugin_data,title,content,link,tag_cache,author FROM ttrss_entries, ttrss_user_entries
WHERE ref_id = id AND guid = '".db_escape_string($entry_guid)."' AND owner_uid = $owner_uid");
if (db_num_rows($result) != 0) {
$entry_plugin_data = db_fetch_result($result, 0, "plugin_data");
$stored_article = array("title" => db_fetch_result($result, 0, "title"),
"content" => db_fetch_result($result, 0, "content"),
"link" => db_fetch_result($result, 0, "link"),
"tags" => explode(",", db_fetch_result($result, 0, "tag_cache")),
"author" => db_fetch_result($result, 0, "author"));
} else {
$entry_plugin_data = "";
$stored_article = array();
}
$article = array("owner_uid" => $owner_uid, // read only
"guid" => $entry_guid,
"guid" => $entry_guid, // read only
"title" => $entry_title,
"content" => $entry_content,
"link" => $entry_link,
"tags" => $entry_tags,
"author" => $entry_author);
"plugin_data" => $entry_plugin_data,
"author" => $entry_author,
"stored" => $stored_article);
foreach ($pluginhost->get_hooks($pluginhost::HOOK_ARTICLE_FILTER) as $plugin) {
$article = $plugin->hook_article_filter($article);
}
$entry_tags = $article["tags"];
$entry_guid = db_escape_string($article["guid"]);
$entry_guid = db_escape_string($entry_guid);
$entry_content = db_escape_string($article["content"], false);
$entry_title = db_escape_string($article["title"]);
$entry_author = db_escape_string($article["author"]);
$entry_link = db_escape_string($article["link"]);
$entry_plugin_data = db_escape_string($article["plugin_data"]);
if ($debug_enabled) {
_debug("update_rss_feed: plugin data: $entry_plugin_data");
}
if ($cache_images && is_writable(CACHE_DIR . '/images'))
$entry_content = cache_images($entry_content, $site_url, $debug_enabled);
......@@ -567,6 +641,7 @@
date_entered,
comments,
num_comments,
plugin_data,
author)
VALUES
('$entry_title',
......@@ -581,6 +656,7 @@
NOW(),
'$entry_comments',
'$num_comments',
'$entry_plugin_data',
'$entry_author')");
$article_labels = array();
......@@ -602,7 +678,7 @@
// now it should exist, if not - bad luck then
$result = db_query($link, "SELECT
id,content_hash,no_orig_date,title,