--- /dev/null
+<?
+ function handle_rpc_request($link) {
+
+ $subop = $_GET["subop"];
+
+ if ($subop == "setpref") {
+ if (WEB_DEMO_MODE) {
+ return;
+ }
+
+ print "<rpc-reply>";
+
+ $key = db_escape_string($_GET["key"]);
+ $value = db_escape_string($_GET["value"]);
+
+ set_pref($link, $key, $value);
+
+ print "<param-set key=\"$key\" value=\"$value\"/>";
+
+ print "</rpc-reply>";
+
+ }
+
+ if ($subop == "getLabelCounters") {
+ $aid = $_GET["aid"];
+ print "<rpc-reply>";
+ getLabelCounters($link);
+ if ($aid) {
+ getFeedCounter($link, $aid);
+ }
+ print "</rpc-reply>";
+ }
+
+ if ($subop == "getFeedCounters") {
+ print "<rpc-reply>";
+ getFeedCounters($link);
+ print "</rpc-reply>";
+ }
+
+ if ($subop == "getAllCounters") {
+ print "<rpc-reply>";
+ getAllCounters($link);
+ print "</rpc-reply>";
+ }
+
+ if ($subop == "mark") {
+ $mark = $_GET["mark"];
+ $id = db_escape_string($_GET["id"]);
+
+ if ($mark == "1") {
+ $mark = "true";
+ } else {
+ $mark = "false";
+ }
+
+ // FIXME this needs collision testing
+
+ $result = db_query($link, "UPDATE ttrss_user_entries SET marked = $mark
+ WHERE ref_id = '$id' AND owner_uid = " . $_SESSION["uid"]);
+ }
+
+ if ($subop == "updateFeed") {
+ $feed_id = db_escape_string($_GET["feed"]);
+
+ $result = db_query($link,
+ "SELECT feed_url FROM ttrss_feeds WHERE id = '$feed_id'
+ AND owner_uid = " . $_SESSION["uid"]);
+
+ if (db_num_rows($result) > 0) {
+ $feed_url = db_fetch_result($result, 0, "feed_url");
+ update_rss_feed($link, $feed_url, $feed_id);
+ }
+
+ print "<rpc-reply>";
+ getFeedCounter($link, $feed_id);
+ print "</rpc-reply>";
+
+ return;
+ }
+
+ if ($subop == "forceUpdateAllFeeds" || $subop == "updateAllFeeds") {
+
+ if (ENABLE_UPDATE_DAEMON) {
+
+ if ($subop == "forceUpdateAllFeeds") {
+
+ $result = db_query($link, "SELECT count(id) AS cid FROM
+ ttrss_scheduled_updates WHERE feed_id IS NULL AND
+ owner_uid = " . $_SESSION["uid"]);
+
+ $cid = db_fetch_result($result, 0, "cid");
+
+ if ($cid == 0) {
+
+ db_query($link, "INSERT INTO ttrss_scheduled_updates
+ (owner_uid, feed_id, entered) VALUES
+ (".$_SESSION["uid"].", NULL, NOW())");
+
+ }
+ }
+
+ } else {
+ update_all_feeds($link, $subop == "forceUpdateAllFeeds");
+ }
+
+ $global_unread_caller = sprintf("%d", $_GET["uctr"]);
+ $global_unread = getGlobalUnread($link);
+
+ print "<rpc-reply>";
+
+ if ($global_unread_caller != $global_unread) {
+
+ $omode = $_GET["omode"];
+
+ if (!$omode) $omode = "tflc";
+
+ if (strchr($omode, "l")) getLabelCounters($link);
+ if (strchr($omode, "f")) getFeedCounters($link);
+ if (strchr($omode, "t")) getTagCounters($link);
+ if (strchr($omode, "c")) {
+ if (get_pref($link, 'ENABLE_FEED_CATS')) {
+ getCategoryCounters($link);
+ }
+ }
+ }
+
+ getGlobalCounters($link, $global_unread);
+
+ print "</rpc-reply>";
+
+ }
+
+ /* GET["cmode"] = 0 - mark as read, 1 - as unread, 2 - toggle */
+ if ($subop == "catchupSelected") {
+
+ $ids = split(",", db_escape_string($_GET["ids"]));
+
+ $cmode = sprintf("%d", $_GET["cmode"]);
+
+ foreach ($ids as $id) {
+
+ if ($cmode == 0) {
+ db_query($link, "UPDATE ttrss_user_entries SET
+ unread = false,last_read = NOW()
+ WHERE ref_id = '$id' AND owner_uid = " . $_SESSION["uid"]);
+ } else if ($cmode == 1) {
+ db_query($link, "UPDATE ttrss_user_entries SET
+ unread = true
+ WHERE ref_id = '$id' AND owner_uid = " . $_SESSION["uid"]);
+ } else {
+ db_query($link, "UPDATE ttrss_user_entries SET
+ unread = NOT unread,last_read = NOW()
+ WHERE ref_id = '$id' AND owner_uid = " . $_SESSION["uid"]);
+ }
+ }
+ print "<rpc-reply>";
+ getAllCounters($link);
+ print "</rpc-reply>";
+ }
+
+ if ($subop == "markSelected") {
+
+ $ids = split(",", db_escape_string($_GET["ids"]));
+
+ $cmode = sprintf("%d", $_GET["cmode"]);
+
+ foreach ($ids as $id) {
+
+ if ($cmode == 0) {
+ db_query($link, "UPDATE ttrss_user_entries SET
+ marked = false
+ WHERE ref_id = '$id' AND owner_uid = " . $_SESSION["uid"]);
+ } else if ($cmode == 1) {
+ db_query($link, "UPDATE ttrss_user_entries SET
+ marked = true
+ WHERE ref_id = '$id' AND owner_uid = " . $_SESSION["uid"]);
+ } else {
+ db_query($link, "UPDATE ttrss_user_entries SET
+ marked = NOT marked
+ WHERE ref_id = '$id' AND owner_uid = " . $_SESSION["uid"]);
+ }
+ }
+ print "<rpc-reply>";
+ getAllCounters($link);
+ print "</rpc-reply>";
+ }
+
+ if ($subop == "sanityCheck") {
+ if (sanity_check($link)) {
+ print "<error error-code=\"0\"/>";
+ }
+ }
+
+ if ($subop == "globalPurge") {
+
+ print "<rpc-reply>";
+ global_purge_old_posts($link, true);
+ print "</rpc-reply>";
+
+ }
+ }
+?>
<?
require_once "sessions.php";
+ require_once "backend-rpc.php";
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
if ($op == "rpc") {
-
- $subop = $_GET["subop"];
-
- if ($subop == "setpref") {
- if (WEB_DEMO_MODE) {
- return;
- }
-
- print "<rpc-reply>";
-
- $key = db_escape_string($_GET["key"]);
- $value = db_escape_string($_GET["value"]);
-
- set_pref($link, $key, $value);
-
- print "<param-set key=\"$key\" value=\"$value\"/>";
-
- print "</rpc-reply>";
-
- }
-
- if ($subop == "getLabelCounters") {
- $aid = $_GET["aid"];
- print "<rpc-reply>";
- getLabelCounters($link);
- if ($aid) {
- getFeedCounter($link, $aid);
- }
- print "</rpc-reply>";
- }
-
- if ($subop == "getFeedCounters") {
- print "<rpc-reply>";
- getFeedCounters($link);
- print "</rpc-reply>";
- }
-
- if ($subop == "getAllCounters") {
- print "<rpc-reply>";
- getAllCounters($link);
- print "</rpc-reply>";
- }
-
- if ($subop == "mark") {
- $mark = $_GET["mark"];
- $id = db_escape_string($_GET["id"]);
-
- if ($mark == "1") {
- $mark = "true";
- } else {
- $mark = "false";
- }
-
- // FIXME this needs collision testing
-
- $result = db_query($link, "UPDATE ttrss_user_entries SET marked = $mark
- WHERE ref_id = '$id' AND owner_uid = " . $_SESSION["uid"]);
- }
-
- if ($subop == "updateFeed") {
- $feed_id = db_escape_string($_GET["feed"]);
-
- $result = db_query($link,
- "SELECT feed_url FROM ttrss_feeds WHERE id = '$feed_id'
- AND owner_uid = " . $_SESSION["uid"]);
-
- if (db_num_rows($result) > 0) {
- $feed_url = db_fetch_result($result, 0, "feed_url");
- update_rss_feed($link, $feed_url, $feed_id);
- }
-
- print "<rpc-reply>";
- getFeedCounter($link, $feed_id);
- print "</rpc-reply>";
-
- return;
- }
-
- if ($subop == "forceUpdateAllFeeds" || $subop == "updateAllFeeds") {
-
- if (ENABLE_UPDATE_DAEMON) {
-
- if ($subop == "forceUpdateAllFeeds") {
-
- $result = db_query($link, "SELECT count(id) AS cid FROM
- ttrss_scheduled_updates WHERE feed_id IS NULL AND
- owner_uid = " . $_SESSION["uid"]);
-
- $cid = db_fetch_result($result, 0, "cid");
-
-# print "<rpc-reply>";
-
- if ($cid == 0) {
-
- db_query($link, "INSERT INTO ttrss_scheduled_updates
- (owner_uid, feed_id, entered) VALUES
- (".$_SESSION["uid"].", NULL, NOW())");
-
-// print "<!-- ScheduledOK -->";
-
- } else {
-// print "<!-- RequestAlreadyInQueue -->";
- }
-
-# print "</rpc-reply>";
- }
-
- } else {
- update_all_feeds($link, $subop == "forceUpdateAllFeeds");
- }
-
- $global_unread_caller = sprintf("%d", $_GET["uctr"]);
- $global_unread = getGlobalUnread($link);
-
- print "<rpc-reply>";
-
- if ($global_unread_caller != $global_unread) {
-
- $omode = $_GET["omode"];
-
- if (!$omode) $omode = "tflc";
-
- if (strchr($omode, "l")) getLabelCounters($link);
- if (strchr($omode, "f")) getFeedCounters($link);
- if (strchr($omode, "t")) getTagCounters($link);
- if (strchr($omode, "c")) {
- if (get_pref($link, 'ENABLE_FEED_CATS')) {
- getCategoryCounters($link);
- }
- }
- }
-
- getGlobalCounters($link, $global_unread);
-
- print "</rpc-reply>";
-
- }
-
- /* GET["cmode"] = 0 - mark as read, 1 - as unread, 2 - toggle */
- if ($subop == "catchupSelected") {
-
- $ids = split(",", db_escape_string($_GET["ids"]));
-
- $cmode = sprintf("%d", $_GET["cmode"]);
-
- foreach ($ids as $id) {
-
- if ($cmode == 0) {
- db_query($link, "UPDATE ttrss_user_entries SET
- unread = false,last_read = NOW()
- WHERE ref_id = '$id' AND owner_uid = " . $_SESSION["uid"]);
- } else if ($cmode == 1) {
- db_query($link, "UPDATE ttrss_user_entries SET
- unread = true
- WHERE ref_id = '$id' AND owner_uid = " . $_SESSION["uid"]);
- } else {
- db_query($link, "UPDATE ttrss_user_entries SET
- unread = NOT unread,last_read = NOW()
- WHERE ref_id = '$id' AND owner_uid = " . $_SESSION["uid"]);
- }
- }
- print "<rpc-reply>";
- getAllCounters($link);
- print "</rpc-reply>";
- }
-
- if ($subop == "markSelected") {
-
- $ids = split(",", db_escape_string($_GET["ids"]));
-
- $cmode = sprintf("%d", $_GET["cmode"]);
-
- foreach ($ids as $id) {
-
- if ($cmode == 0) {
- db_query($link, "UPDATE ttrss_user_entries SET
- marked = false
- WHERE ref_id = '$id' AND owner_uid = " . $_SESSION["uid"]);
- } else if ($cmode == 1) {
- db_query($link, "UPDATE ttrss_user_entries SET
- marked = true
- WHERE ref_id = '$id' AND owner_uid = " . $_SESSION["uid"]);
- } else {
- db_query($link, "UPDATE ttrss_user_entries SET
- marked = NOT marked
- WHERE ref_id = '$id' AND owner_uid = " . $_SESSION["uid"]);
- }
- }
- print "<rpc-reply>";
- getAllCounters($link);
- print "</rpc-reply>";
- }
-
- if ($subop == "sanityCheck") {
- if (sanity_check($link)) {
- print "<error error-code=\"0\"/>";
- }
- }
-
- if ($subop == "globalPurge") {
-
- print "<rpc-reply>";
- global_purge_old_posts($link, true);
- print "</rpc-reply>";
-
- }
-
+ handle_rpc_request($link);
}
if ($op == "feeds") {
if (!get_pref($link, 'ENABLE_FEED_CATS')) {
print "<tr class=\"title\">
<td width='5%' align='center'> </td>
- <td width='30%'><a href=\"javascript:updateFeedList('title')\">Title</a></td>
- <td width='30%'><a href=\"javascript:updateFeedList('feed_url')\">Feed</a></td>
- <td width='15%'><a href=\"javascript:updateFeedList('update_interval')\">Update Interval</a></td>
- <td width='15%'><a href=\"javascript:updateFeedList('purge_interval')\">Purge Interval</a></td></tr>";
+ <td width='40%'><a href=\"javascript:updateFeedList('title')\">Title</a></td>
+ <td width='45%'><a href=\"javascript:updateFeedList('feed_url')\">Feed</a></td>
+ <td width='15%' align='right'><a href=\"javascript:updateFeedList('last_updated')\">Updated</a></td>";
}
$lnum = 0;
$edit_title = htmlspecialchars(db_unescape_string($line["title"]));
$edit_link = htmlspecialchars(db_unescape_string($line["feed_url"]));
$edit_cat = htmlspecialchars(db_unescape_string($line["category"]));
-
-// if ($line["update_interval"] == "0") $line["update_interval"] = "Default";
-// if ($line["update_interval"] == "-1") $line["update_interval"] = "Disabled";
-// if ($line["purge_interval"] == "0") $line["purge_interval"] = "Default";
-// if ($line["purge_interval"] < 0) $line["purge_interval"] = "Disabled";
if (!$edit_cat) $edit_cat = "Uncategorized";
+ $last_updated = $line["last_updated"];
+
+ if (get_pref($link, 'HEADLINES_SMART_DATE')) {
+ $last_updated = smart_date_time(strtotime($last_updated));
+ } else {
+ $short_date = get_pref($link, 'SHORT_DATE_FORMAT');
+ $last_updated = date($short_date, strtotime($last_updated));
+ }
+
if (get_pref($link, 'ENABLE_FEED_CATS') && $cur_cat_id != $cat_id) {
$lnum = 0;
print "<tr class=\"title\">
<td width='5%' align='center'> </td>
- <td width='30%'><a href=\"javascript:updateFeedList('title')\">Title</a></td>
- <td width='30%'><a href=\"javascript:updateFeedList('feed_url')\">Feed</a></td>
- <td width='15%'><a href=\"javascript:updateFeedList('update_interval')\">Update Interval</a></td>
- <td width='15%'><a href=\"javascript:updateFeedList('purge_interval')\">Purge Interval</a></td></tr>";
+ <td width='40%'><a href=\"javascript:updateFeedList('title')\">Title</a></td>
+ <td width='45%'><a href=\"javascript:updateFeedList('feed_url')\">Feed</a></td>
+ <td width='15%' align='right'><a href=\"javascript:updateFeedList('last_updated')\">Updated</a></td>";
$cur_cat_id = $cat_id;
}
$edit_cat . "</a></td>";
} */
- print "<td><a href=\"javascript:editFeed($feed_id);\">" .
+/* print "<td><a href=\"javascript:editFeed($feed_id);\">" .
$update_intervals[$line["update_interval"]] . "</a></td>";
print "<td><a href=\"javascript:editFeed($feed_id);\">" .
- $purge_intervals[$line["purge_interval"]] . "</a></td>";
-
+ $purge_intervals[$line["purge_interval"]] . "</a></td>"; */
+
+ print "<td align='right'><a href=\"javascript:editFeed($feed_id);\">" .
+ "$last_updated</a></td>";
+
print "</tr>";
++$lnum;
onclick=\"javascript:categorizeSelectedFeeds()\" value=\"Set category\">";
}
-
- if (get_pref($link, 'ENABLE_PREFS_CATCHUP_UNCATCHUP')) {
- print "
- <input type=\"submit\" class=\"button\"
- onclick=\"javascript:readSelectedFeeds(true)\" value=\"Mark as read\">
- <input type=\"submit\" class=\"button\"
- onclick=\"javascript:readSelectedFeeds(false)\"
- value=\"Mark as unread\"> ";
- }
print "
All feeds: <input type=\"submit\"
if ($subop == "editSave") {
$regexp = db_escape_string($_GET["r"]);
- $descr = db_escape_string($_GET["d"]);
$match = db_escape_string($_GET["m"]);
$filter_id = db_escape_string($_GET["id"]);
$feed_id = db_escape_string($_GET["fid"]);
$result = db_query($link, "UPDATE ttrss_filters SET
reg_exp = '$regexp',
- description = '$descr',
feed_id = $feed_id,
action_id = '$action_id',
filter_type = (SELECT id FROM ttrss_filter_types WHERE
$result = db_query($link, "SELECT
ttrss_filters.id AS id,reg_exp,
- ttrss_filters.description AS description,
ttrss_filter_types.name AS filter_type_name,
ttrss_filter_types.description AS filter_type_descr,
feed_id,
<td width=\"20%\">Filter expression</td>
<td width=\"20%\">Feed</td>
<td width=\"15%\">Match</td>
- <td width=\"15%\">Action</td>
- <td width=\"30%\">Description</td></tr>";
-
+ <td width=\"15%\">Action</td>";
+
$lnum = 0;
while ($line = db_fetch_assoc($result)) {
print "<tr class=\"$class\" $this_row_id>";
$line["regexp"] = htmlspecialchars($line["reg_exp"]);
- $line["description"] = htmlspecialchars($line["description"]);
if (!$line["feed_title"]) $line["feed_title"] = "All feeds";
if (!$edit_filter_id || $subop != "edit") {
- if (!$line["description"]) $line["description"] = "[No description]";
-
print "<td align='center'><input onclick='toggleSelectRow(this);'
type=\"checkbox\" id=\"FICHK-".$line["id"]."\"></td>";
print "<td><a href=\"javascript:editFilter($filter_id);\">" .
$line["action_description"] . "</td>";
-
- print "<td><a href=\"javascript:editFilter($filter_id);\">" .
- $line["description"] . "</td>";
} else if ($filter_id != $edit_filter_id) {
print "<td>".$line["feed_title"]."</td>";
print "<td>".$line["filter_type_descr"]."</td>";
print "<td>".$line["action_description"]."</td>";
- print "<td>".$line["description"]."</td>";
} else {
print "</select></td>";
-
- print "<td><input id=\"iedit_descr\" value=\"".$line["description"].
- "\"></td>";
-
print "</td>";
}
var sqlexp = document.getElementById("ladd_expr");
if (sqlexp.value.length == 0) {
- notify("Missing SQL expression.");
+ alert("Can't add label: missing SQL expression.");
} else {
notify("Adding label...");
var action = document.getElementById("fadd_action");
if (regexp.value.length == 0) {
- notify("Missing filter expression.");
+ alert("Can't add filter: missing filter expression.");
} else {
notify("Adding filter...");
var link = document.getElementById("fadd_link");
if (link.value.length == 0) {
- notify("Missing feed URL.");
+ alert("Can't add feed: missing feed URL.");
} else {
notify("Adding feed...");
var cat = document.getElementById("fadd_cat");
if (cat.value.length == 0) {
- notify("Missing feed category.");
+ alert("Can't add category: no name specified.");
} else {
notify("Adding feed category...");
var sqlexp = document.getElementById("uadd_box");
if (sqlexp.value.length == 0) {
- notify("Missing user login.");
+ alert("Can't add user: no login specified.");
} else {
notify("Adding user...");
}
-function readSelectedFeeds(read) {
+/*function readSelectedFeeds(read) {
if (!xmlhttp_ready(xmlhttp)) {
printLockingError();
} else {
- notify("Please select some feeds first.");
+ alert("No feeds are selected.");
}
-}
+} */
function removeSelectedLabels() {
xmlhttp.send(null);
}
} else {
- notify("Please select some labels first.");
+ alert("No labels are selected.");
}
}
}
} else {
- notify("Please select some labels first.");
+ alert("No users are selected.");
}
}
xmlhttp.send(null);
}
} else {
- notify("Please select some filters first.");
+ alert("No filters are selected.");
}
}
} else {
- notify("Please select some feeds first.");
+ alert("No feeds are selected.");
}
} else {
- notify("Please select some feeds first.");
+ alert("No categories are selected.");
}
}
var regexp = document.getElementById("iedit_regexp").value;
- var descr = document.getElementById("iedit_descr").value;
var match = document.getElementById("iedit_match");
var v_match = match[match.selectedIndex].text;
var action = document.getElementById("iedit_filter_action");
var action_id = action[action.selectedIndex].id;
-// notify("Saving filter " + filter + ": " + regexp + ", " + descr + ", " + match);
-
if (regexp.length == 0) {
- notify("Filter expression cannot be blank.");
+ alert("Can't save filter: match expression is blank.");
return;
}
active_filter = false;
xmlhttp.open("GET", "backend.php?op=pref-filters&subop=editSave&id=" +
- filter + "&r=" + param_escape(regexp) + "&d=" + param_escape(descr) +
- "&m=" + param_escape(v_match) + "&fid=" + param_escape(feed_id) +
- "&aid=" + param_escape(action_id), true);
+ filter + "&r=" + param_escape(regexp) + "&m=" + param_escape(v_match) +
+ "&fid=" + param_escape(feed_id) + "&aid=" + param_escape(action_id), true);
notify("Saving filter...");
var rows = getSelectedLabels();
if (rows.length == 0) {
- notify("No labels are selected.");
+ alert("No labels are selected.");
return;
}
if (rows.length > 1) {
- notify("Please select one label.");
+ alert("Please select only one label.");
return;
}
var rows = getSelectedUsers();
if (rows.length == 0) {
- notify("No users are selected.");
+ alert("No users are selected.");
return;
}
if (rows.length > 1) {
- notify("Please select one user.");
+ alert("Please select only one user.");
return;
}
var rows = getSelectedUsers();
if (rows.length == 0) {
- notify("No users are selected.");
+ alert("No users are selected.");
return;
}
if (rows.length > 1) {
- notify("Please select one user.");
+ alert("Please select only one user.");
return;
}
var rows = getSelectedUsers();
if (rows.length == 0) {
- notify("No users are selected.");
+ alert("No users are selected.");
return;
}
if (rows.length > 1) {
- notify("Please select one user.");
+ alert("Please select only one user.");
return;
}
var rows = getSelectedFeeds();
if (rows.length == 0) {
- notify("No feeds are selected.");
+ alert("No feeds are selected.");
return;
}
-// if (rows.length > 1) {
-// notify("Please select one feed.");
-// return;
-// }
+ if (rows.length > 1) {
+ notify("Please select only one feed.");
+ return;
+ }
// var id = rows[0];
var rows = getSelectedFilters();
if (rows.length == 0) {
- notify("No filters are selected.");
+ alert("No filters are selected.");
return;
}
if (rows.length > 1) {
- notify("Please select one filter.");
+ alert("Please select only one filter.");
return;
}
var rows = getSelectedFeedCats();
if (rows.length == 0) {
- notify("No categories are selected.");
+ alert("No categories are selected.");
return;
}
if (rows.length > 1) {
- notify("Please select one category.");
+ alert("Please select only one category.");
return;
}
var opml_file = document.getElementById("opml_file");
if (opml_file.value.length == 0) {
- notify("Please select OPML file to upload.");
+ alert("No OPML file to upload.");
return false;
} else {
return true;
} else {
- notify("Please select some feeds first.");
+ alert("No feeds are selected.");
}
feed_id integer default null,
filter_type integer not null,
reg_exp varchar(250) not null,
- description varchar(250) not null default '',
action_id integer not null default 1,
index (filter_type),
foreign key (filter_type) references ttrss_filter_types(id) ON DELETE CASCADE,
insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('ENABLE_FEED_ICONS', 1, 'true', 'Enable icons in feedlist',2);
insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('PURGE_OLD_DAYS', 3, '60', 'Purge old posts after this number of days (0 - disables)',1);
insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('UPDATE_POST_ON_CHECKSUM_CHANGE', 1, 'true', 'Update post on checksum change',1);
-insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('ENABLE_PREFS_CATCHUP_UNCATCHUP', 1, 'false', 'Enable catchup/uncatchup buttons in feed editor',2);
insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id,help_text) values('ENABLE_LABELS', 1, 'false', 'Enable labels',3,
'Experimental support for virtual feeds based on user crafted SQL queries. This feature is highly experimental and at this point not user friendly. Use with caution.');
insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id,help_text) values('DEFAULT_ARTICLE_LIMIT', 3, '0', 'Default article limit',2,
'Default limit for articles to display, any custom number you like (0 - disables).');
-insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id,help_text) values('DISPLAY_FEEDLIST_ACTIONS', 1, 'false', 'Display feedlist actions',2,
- 'Display separate dropbox for feedlist actions, if disabled these actions are available in global actions menu.');
-
insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id,help_text) values('ALLOW_DUPLICATE_POSTS', 1, 'true', 'Allow duplicate posts',1,
'This option is useful when you are reading several planet-type aggregators with partially colliding userbase.
When disabled, it forces same posts from different feeds to appear only once.');
feed_id integer references ttrss_feeds(id) on delete cascade default null,
filter_type integer not null references ttrss_filter_types(id),
reg_exp varchar(250) not null,
- description varchar(250) not null default '',
action_id integer not null default 1 references ttrss_filter_actions(id) on delete cascade);
create table ttrss_labels (id serial not null primary key,
insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('ENABLE_FEED_ICONS', 1, 'true', 'Enable icons in feedlist',2);
insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('PURGE_OLD_DAYS', 3, '60', 'Purge old posts after this number of days (0 - disables)',1);
insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('UPDATE_POST_ON_CHECKSUM_CHANGE', 1, 'true', 'Update post on checksum change',1);
-insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('ENABLE_PREFS_CATCHUP_UNCATCHUP', 1, 'false', 'Enable catchup/uncatchup buttons in feed editor',2);
insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id,help_text) values('ENABLE_LABELS', 1, 'false', 'Enable labels',3,
'Experimental support for virtual feeds based on user crafted SQL queries. This feature is highly experimental and at this point not user friendly. Use with caution.');
insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('USE_COMPACT_STYLESHEET', 1, 'false', 'Use compact stylesheet by default',2);
insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id,help_text) values('DEFAULT_ARTICLE_LIMIT', 3, '0', 'Default article limit',2,
'Default limit for articles to display, any custom number you like (0 - disables).');
-
-insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id,help_text) values('DISPLAY_FEEDLIST_ACTIONS', 1, 'false', 'Display feedlist actions',2,
- 'Display separate dropbox for feedlist actions, if disabled these actions are available in global actions menu.');
insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id,help_text) values('ALLOW_DUPLICATE_POSTS', 1, 'true', 'Allow duplicate posts',1,
'This option is useful when you are reading several planet-type aggregators with partially colliding userbase.
alter table ttrss_feeds change rtl_content rtl_content bool not null;
alter table ttrss_feeds alter column rtl_content set default false;
+delete from ttrss_user_prefs where pref_name = 'DISPLAY_FEEDLIST_ACTIONS';
+delete from ttrss_prefs where pref_name = 'DISPLAY_FEEDLIST_ACTIONS';
+
+delete from ttrss_user_prefs where pref_name = 'ENABLE_PREFS_CATCHUP_UNCATCHUP';
+delete from ttrss_prefs where pref_name = 'ENABLE_PREFS_CATCHUP_UNCATCHUP';
+
alter table ttrss_sessions drop column ip_address;
+alter table ttrss_filters drop column description;
+
update ttrss_version set schema_version = 7;
alter table ttrss_sessions drop column ip_address;
+delete from ttrss_user_prefs where pref_name = 'DISPLAY_FEEDLIST_ACTIONS';
+delete from ttrss_prefs where pref_name = 'DISPLAY_FEEDLIST_ACTIONS';
+
+delete from ttrss_user_prefs where pref_name = 'ENABLE_PREFS_CATCHUP_UNCATCHUP';
+delete from ttrss_prefs where pref_name = 'ENABLE_PREFS_CATCHUP_UNCATCHUP';
+
+alter table ttrss_filters drop column description;
+
update ttrss_version set schema_version = 7;
commit;
}
-function allFeedsMenuChange() {
- var chooser = document.getElementById("allFeedsChooser");
-
- var opname = chooser[chooser.selectedIndex].text;
-
- chooser.selectedIndex = 0;
-
- if (opname == "Update") {
- scheduleFeedUpdate(true);
- return;
- }
-
- if (opname == "Mark as read") {
- catchupAllFeeds();
- return;
- }
-
- if (opname == "Show only unread") {
- toggleDispRead();
- return;
- }
-
-}
-
function updateFeedTitle(t) {
active_title_text = t;
updateTitle();
</div>
</td></tr>
<tr><td height="100%" width="100%" valign="top">
-
- <? if (get_pref($link, 'DISPLAY_FEEDLIST_ACTIONS')) { ?>
-
- <iframe frameborder="0"
- src="backend.php?op=error&msg=Loading,%20please wait..."
- id="feeds-frame" name="feeds-frame" class="feedsFrameWithActions"> </iframe>
-
- <div align="center">
-
- <select id="allFeedsChooser" onchange="allFeedsMenuChange()">
- <option selected>All feeds...</option>
- <? if (!ENABLE_UPDATE_DAEMON) { ?>
- <option>Update</option>
- <? } ?>
- <option>Mark as read</option>
- <option>Show only unread</option>
- </select>
-
- </div>
-
- <? } else { ?>
<iframe frameborder="0"
src="backend.php?op=error&msg=Loading,%20please wait..."
id="feeds-frame" name="feeds-frame" class="feedsFrame"> </iframe>
- <? } ?>
-
</td></tr></table>
</td>