return $url_path;
}
+ function clear_feed_articles($link, $id) {
+ $result = db_query($link, "DELETE FROM ttrss_user_entries
+ WHERE feed_id = '$id' AND marked = false");
+
+ $result = db_query($link, "DELETE FROM ttrss_entries WHERE
+ (SELECT COUNT(int_id) FROM ttrss_user_entries WHERE ref_id = id) = 0");
+ }
+
?>
print T_js_decl("Please wait...");
print T_js_decl("Publish article");
print T_js_decl("Unpublish article");
-#print T_js_decl(
-#print T_js_decl(
+print T_js_decl("You can't clear this type of feed.");
+print T_js_decl("Remove all (except starred) stored articles for %s?");
#print T_js_decl(
#print T_js_decl(
#print T_js_decl(
}
}
+ if ($subop == "clear") {
+ $id = db_escape_string($_GET["id"]);
+ clear_feed_articles($link, $id);
+ }
+
if ($subop == "add") {
if (!WEB_DEMO_MODE) {
return;
}
+
+ if (opid == "qmcClearFeed") {
+ var actid = getActiveFeedId();
+
+ if (!actid) {
+ alert(__("Please select some feed first."));
+ return;
+ }
+
+ if (activeFeedIsCat() || actid < 0) {
+ alert(__("You can't clear this type of feed."));
+ return;
+ }
+
+ var fn = getFeedName(actid);
+
+ var pr = __("Remove all (except starred) stored articles for %s?").replace("%s", fn);
+
+ if (confirm(pr)) {
+ clearFeedArticles(actid);
+ }
+
+ return;
+ }
+
if (opid == "qmcUpdateFeeds") {
scheduleFeedUpdate(true);
return;
return false;
}
+function clearFeedArticles(feed_id) {
+
+ notify_progress("Clearing feed...");
+
+ var query = "backend.php?op=pref-feeds&quiet=1&subop=clear&id=" + feed_id;
+
+ new Ajax.Request(query, {
+ onComplete: function(transport) {
+ dlg_frefresh_callback(transport, feed_id);
+ } });
+
+ return false;
+}
+
function updateFeedTitle(t) {
active_title_text = t;
<option style="color : #5050aa" disabled><?php echo __('Feed actions:') ?></option>
<option value="qmcAddFeed"><?php echo __(' Subscribe to feed') ?></option>
<option value="qmcEditFeed"><?php echo __(' Edit this feed') ?></option>
+ <option value="qmcClearFeed"><?php echo __(' Clear articles') ?></option>
<option value="qmcRemoveFeed"><?php echo __(' Unsubscribe') ?></option>
<!-- <option>Edit this feed</option> -->
<option disabled>--------</option>