mirror of
https://git.tt-rss.org/fox/tt-rss.git
synced 2025-08-19 13:31:12 +02:00
add some initial scoring work
This commit is contained in:
parent
fdb7b03fc0
commit
ff6e357a62
@ -1161,6 +1161,12 @@
|
|||||||
|
|
||||||
// error_reporting (DEFAULT_ERROR_LEVEL);
|
// error_reporting (DEFAULT_ERROR_LEVEL);
|
||||||
|
|
||||||
|
$score = calculate_article_score($article_filters);
|
||||||
|
|
||||||
|
if (defined('DAEMON_EXTENDED_DEBUG') || $_GET['xdebug']) {
|
||||||
|
_debug("update_rss_feed: initial score: $score");
|
||||||
|
}
|
||||||
|
|
||||||
$result = db_query($link,
|
$result = db_query($link,
|
||||||
"SELECT ref_id, int_id FROM ttrss_user_entries WHERE
|
"SELECT ref_id, int_id FROM ttrss_user_entries WHERE
|
||||||
ref_id = '$ref_id' AND owner_uid = '$owner_uid'
|
ref_id = '$ref_id' AND owner_uid = '$owner_uid'
|
||||||
@ -1195,9 +1201,10 @@
|
|||||||
|
|
||||||
$result = db_query($link,
|
$result = db_query($link,
|
||||||
"INSERT INTO ttrss_user_entries
|
"INSERT INTO ttrss_user_entries
|
||||||
(ref_id, owner_uid, feed_id, unread, last_read, marked, published)
|
(ref_id, owner_uid, feed_id, unread, last_read, marked,
|
||||||
|
published, score)
|
||||||
VALUES ('$ref_id', '$owner_uid', '$feed', $unread,
|
VALUES ('$ref_id', '$owner_uid', '$feed', $unread,
|
||||||
$last_read_qpart, $marked, $published)");
|
$last_read_qpart, $marked, $published, '$score')");
|
||||||
|
|
||||||
$result = db_query($link,
|
$result = db_query($link,
|
||||||
"SELECT int_id FROM ttrss_user_entries WHERE
|
"SELECT int_id FROM ttrss_user_entries WHERE
|
||||||
@ -1510,6 +1517,18 @@
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function calculate_article_score($filters) {
|
||||||
|
$score = 0;
|
||||||
|
|
||||||
|
foreach ($filters as $f) {
|
||||||
|
if ($f[0] == "score") {
|
||||||
|
$score += $f[1];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return $score;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function printFeedEntry($feed_id, $class, $feed_title, $unread, $icon_file, $link,
|
function printFeedEntry($feed_id, $class, $feed_title, $unread, $icon_file, $link,
|
||||||
$rtl_content = false, $last_updated = false, $last_error = false) {
|
$rtl_content = false, $last_updated = false, $last_error = false) {
|
||||||
|
|
||||||
@ -3289,7 +3308,7 @@
|
|||||||
$vfeed_query_part
|
$vfeed_query_part
|
||||||
$content_query_part
|
$content_query_part
|
||||||
".SUBSTRING_FOR_DATE."(updated,1,19) as updated_noms,
|
".SUBSTRING_FOR_DATE."(updated,1,19) as updated_noms,
|
||||||
author
|
author,score
|
||||||
FROM
|
FROM
|
||||||
ttrss_entries,ttrss_user_entries,ttrss_feeds
|
ttrss_entries,ttrss_user_entries,ttrss_feeds
|
||||||
WHERE
|
WHERE
|
||||||
@ -4914,6 +4933,10 @@
|
|||||||
100);
|
100);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$score = $line["score"];
|
||||||
|
|
||||||
|
if ($score < 100) $score_pic = "score_low
|
||||||
|
|
||||||
$entry_author = $line["author"];
|
$entry_author = $line["author"];
|
||||||
|
|
||||||
if ($entry_author) {
|
if ($entry_author) {
|
||||||
|
@ -78,7 +78,7 @@
|
|||||||
|
|
||||||
print "<tr><td>".__('Params:')."</td>";
|
print "<tr><td>".__('Params:')."</td>";
|
||||||
|
|
||||||
$param_disabled = ($action_id == 4) ? "" : "disabled";
|
$param_disabled = ($action_id == 4 || $action_id == 6) ? "" : "disabled";
|
||||||
|
|
||||||
print "<td><input $param_disabled class='iedit'
|
print "<td><input $param_disabled class='iedit'
|
||||||
name=\"action_param\" value=\"$action_param\"></td></tr>";
|
name=\"action_param\" value=\"$action_param\"></td></tr>";
|
||||||
@ -236,7 +236,9 @@
|
|||||||
inverse,
|
inverse,
|
||||||
feed_id,
|
feed_id,
|
||||||
ttrss_filter_actions.description AS action_description,
|
ttrss_filter_actions.description AS action_description,
|
||||||
ttrss_feeds.title AS feed_title
|
ttrss_feeds.title AS feed_title,
|
||||||
|
ttrss_filter_actions.name AS action_name,
|
||||||
|
ttrss_filters.action_param AS action_param
|
||||||
FROM
|
FROM
|
||||||
ttrss_filter_types,ttrss_filter_actions,ttrss_filters LEFT JOIN
|
ttrss_filter_types,ttrss_filter_actions,ttrss_filters LEFT JOIN
|
||||||
ttrss_feeds ON (ttrss_filters.feed_id = ttrss_feeds.id)
|
ttrss_feeds ON (ttrss_filters.feed_id = ttrss_feeds.id)
|
||||||
@ -261,8 +263,9 @@
|
|||||||
<td align='center' width=\"5%\"> </td>
|
<td align='center' width=\"5%\"> </td>
|
||||||
<td width=\"20%\"><a href=\"javascript:updateFilterList('reg_exp')\">".__('Filter expression')."</a></td>
|
<td width=\"20%\"><a href=\"javascript:updateFilterList('reg_exp')\">".__('Filter expression')."</a></td>
|
||||||
<td width=\"\"><a href=\"javascript:updateFilterList('feed_title')\">".__('Feed')."</a></td>
|
<td width=\"\"><a href=\"javascript:updateFilterList('feed_title')\">".__('Feed')."</a></td>
|
||||||
<td width=\"15%\"><a href=\"javascript:updateFilterList('filter_type')\">".__('Match')."</a></td>
|
<td width=\"20%\"><a href=\"javascript:updateFilterList('filter_type')\">".__('Match')."</a></td>
|
||||||
<td width=\"15%\"><a href=\"javascript:updateFilterList('action_description')\">".__('Action')."</a></td>";
|
<td width=\"15%\"><a href=\"javascript:updateFilterList('action_description')\">".__('Action')."</a></td>
|
||||||
|
<td width=\"15%\"><a href=\"javascript:updateFilterList('action_param')\">".__('Params')."</a></td>";
|
||||||
|
|
||||||
$lnum = 0;
|
$lnum = 0;
|
||||||
|
|
||||||
@ -324,7 +327,10 @@
|
|||||||
$line["filter_type_descr"] . "$inverse_label</td>";
|
$line["filter_type_descr"] . "$inverse_label</td>";
|
||||||
|
|
||||||
print "<td><a href=\"javascript:editFilter($filter_id);\">" .
|
print "<td><a href=\"javascript:editFilter($filter_id);\">" .
|
||||||
$line["action_description"] . "</td>";
|
$line["action_description"]."</td>";
|
||||||
|
|
||||||
|
print "<td><a href=\"javascript:editFilter($filter_id);\">" .
|
||||||
|
$line["action_param"] . "</td>";
|
||||||
|
|
||||||
print "</tr>";
|
print "</tr>";
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user