WHERE orig_feed_id = '$id') = 0 AND
id = '$id' AND owner_uid = ".$_SESSION["uid"]);
- $rc = $this->dbh->affected_rows($result);
+ $this->dbh->affected_rows($result);
}
}
$mark = "false";
}
- $result = $this->dbh->query("UPDATE ttrss_user_entries SET marked = $mark,
+ $this->dbh->query("UPDATE ttrss_user_entries SET marked = $mark,
last_marked = NOW()
WHERE ref_id = '$id' AND owner_uid = " . $_SESSION["uid"]);
function delete() {
$ids = $this->dbh->escape_string($_REQUEST["ids"]);
- $result = $this->dbh->query("DELETE FROM ttrss_user_entries
- WHERE ref_id IN ($ids) AND owner_uid = " . $_SESSION["uid"]);
+ $this->dbh->query("DELETE FROM ttrss_user_entries
+ WHERE ref_id IN ($ids) AND owner_uid = " . $_SESSION["uid"]);
purge_orphans();
function publ() {
$pub = $_REQUEST["pub"];
$id = $this->dbh->escape_string($_REQUEST["id"]);
- $note = trim(strip_tags($this->dbh->escape_string($_REQUEST["note"])));
if ($pub == "1") {
$pub = "true";
$pub = "false";
}
- $result = $this->dbh->query("UPDATE ttrss_user_entries SET
+ $this->dbh->query("UPDATE ttrss_user_entries SET
published = $pub, last_published = NOW()
WHERE ref_id = '$id' AND owner_uid = " . $_SESSION["uid"]);
}
function updateFeedBrowser() {
+ if (defined('_DISABLE_FEED_BROWSER') && _DISABLE_FEED_BROWSER) return;
+
$search = $this->dbh->escape_string($_REQUEST["search"]);
$limit = $this->dbh->escape_string($_REQUEST["limit"]);
$mode = (int) $this->dbh->escape_string($_REQUEST["mode"]);
print_feed_cat_select("cat_id", $id, '');
}
- // Silent
- function clearArticleKeys() {
- $this->dbh->query("UPDATE ttrss_user_entries SET uuid = '' WHERE
- owner_uid = " . $_SESSION["uid"]);
-
- return;
- }
-
function setpanelmode() {
$wide = (int) $_REQUEST["wide"];
print json_encode(array("wide" => $wide));
}
- function updaterandomfeed() {
+ static function updaterandomfeed_real($dbh) {
+
// Test if the feed need a update (update interval exceded).
if (DB_TYPE == "pgsql") {
$update_limit_qpart = "AND ((
$random_qpart = sql_random_function();
+ // we could be invoked from public.php with no active session
+ if ($_SESSION["uid"]) {
+ $owner_check_qpart = "AND ttrss_feeds.owner_uid = '".$_SESSION["uid"]."'";
+ } else {
+ $owner_check_qpart = "";
+ }
+
// We search for feed needing update.
- $result = $this->dbh->query("SELECT ttrss_feeds.feed_url,ttrss_feeds.id
+ $result = $dbh->query("SELECT ttrss_feeds.feed_url,ttrss_feeds.id
FROM
ttrss_feeds, ttrss_users, ttrss_user_prefs
WHERE
ttrss_feeds.owner_uid = ttrss_users.id
AND ttrss_users.id = ttrss_user_prefs.owner_uid
AND ttrss_user_prefs.pref_name = 'DEFAULT_UPDATE_INTERVAL'
- AND ttrss_feeds.owner_uid = ".$_SESSION["uid"]."
- $update_limit_qpart $updstart_thresh_qpart
+ $owner_check_qpart
+ $update_limit_qpart
+ $updstart_thresh_qpart
ORDER BY $random_qpart LIMIT 30");
$feed_id = -1;
$tstart = time();
- while ($line = $this->dbh->fetch_assoc($result)) {
+ while ($line = $dbh->fetch_assoc($result)) {
$feed_id = $line["id"];
if (time() - $tstart < ini_get("max_execution_time") * 0.7) {
}
+ function updaterandomfeed() {
+ RPC::updaterandomfeed_real($this->dbh);
+ }
+
private function markArticlesById($ids, $cmode) {
$tmp_ids = array();
$p = new Publisher(PUBSUBHUBBUB_HUB);
- $pubsub_result = $p->publish_update($rss_link);
+ /* $pubsub_result = */ $p->publish_update($rss_link);
}
}