print T_js_decl("You can't clear this type of feed.");
print T_js_decl("Erase all non-starred articles in %s?");
print T_js_decl("Mark all articles as read?");
+print T_js_decl("Rescore articles in selected feeds?");
+print T_js_decl("Rescoring selected feeds...");
+print T_js_decl("Rescore articles in all feeds? This operation may take a lot of time.");
+print T_js_decl("Rescoring feeds...");
+#print T_js_decl(
+#print T_js_decl(
+#print T_js_decl(
+#print T_js_decl(
+#print T_js_decl(
+#print T_js_decl(
+#print T_js_decl(
+#print T_js_decl(
+#print T_js_decl(
+#print T_js_decl(
#print T_js_decl(
#print T_js_decl(
#print T_js_decl(
#print T_js_decl(
#print T_js_decl(
#print T_js_decl(
-
?>
}
+ if ($subop == "rescoreAll") {
+
+ $result = db_query($link,
+ "SELECT id FROM ttrss_feeds WHERE owner_uid = " . $_SESSION['uid']);
+
+ while ($feed_line = db_fetch_assoc($result)) {
+
+ $id = $feed_line["id"];
+
+ $filters = load_filters($link, $id, $_SESSION["uid"], 6);
+
+ $tmp_result = db_query($link, "SELECT title, content, link, ref_id FROM
+ ttrss_user_entries, ttrss_entries
+ WHERE ref_id = id AND feed_id = '$id' AND
+ owner_uid = " .$_SESSION['uid']."
+ ");
+
+ $scores = array();
+
+ while ($line = db_fetch_assoc($tmp_result)) {
+
+ $article_filters = get_article_filters($filters, $line['title'],
+ $line['content'], $line['link']);
+
+ $new_score = calculate_article_score($article_filters);
+
+ if (!$scores[$new_score]) $scores[$new_score] = array();
+
+ array_push($scores[$new_score], $line['ref_id']);
+ }
+
+ foreach (array_keys($scores) as $s) {
+ if ($s > 1000) {
+ db_query($link, "UPDATE ttrss_user_entries SET score = '$s',
+ marked = true WHERE
+ ref_id IN (" . join(',', $scores[$s]) . ")");
+ } else {
+ db_query($link, "UPDATE ttrss_user_entries SET score = '$s' WHERE
+ ref_id IN (" . join(',', $scores[$s]) . ")");
+ }
+ }
+ }
+
+ print __("All done.");
+
+ }
+
if ($subop == "add") {
if (!WEB_DEMO_MODE) {
id=\"create_filter_btn\"
value=\"".__('Create filter')."\">";
+ print " ";
+
+ print "<input type=\"submit\"
+ class=\"button\"
+ onclick=\"rescore_all_feeds()\"
+ value=\"".__('Rescore articles')."\">";
+
$result = db_query($link, "SELECT
ttrss_filters.id AS id,reg_exp,
ttrss_filter_types.name AS filter_type_name,
var ok = confirm(__("Rescore articles in selected feeds?"));
if (ok) {
- notify_progress("Rescoring selected labels...");
+ notify_progress("Rescoring selected feeds...");
xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=rescore&quiet=1&ids="+
param_escape(sel_rows.toString()), true);
return false;
}
+function rescore_all_feeds() {
+ var ok = confirm(__("Rescore all articles? This operation may take a lot of time."));
+
+ if (ok) {
+ notify_progress("Rescoring feeds...");
+
+ xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=rescoreAll&quiet=1", true);
+ xmlhttp.onreadystatechange=notify_callback;
+ xmlhttp.send(null);
+ }
+
+
+}