Page 1 of 1

Question

Posted: 16 Nov 2016, 14:56
by KUHG73KouW3F6lk4
Because i not know how to write extension to mark as read all messages with zero score. I did small adjustment to simplify removal garbage articles when property "never delete unread" is set.

in file functions2.php

Code: Select all

 
 if ($limit > 0) {
   $limit_query_part = "LIMIT " . $limit;
   }

+if ($view_mode == "zero_score") {
+   $view_query_part = " score = 0 AND ";
+   }


in file index.php

Code: Select all

                        <option value="has_note"><?php echo __('With Note') ?></option>
+                        <option value="zero_score"><?php echo __('Zero Score') ?></option>


PS : Sorry . Forgot to ask question.
How can i create plug-in which delete automatically all articles with 0 score after 1 day or week ? May be i asking stupid question but i am not a programmer . May be somebody can help me from what to start.

Re: Question

Posted: 16 Nov 2016, 16:25
by JustAMacUser
Your approach seems unnecessarily complicated. Just use filters to adjust scoring and one, final filter at the end to mark as read if the score is zero. No code hacks, etc. needed.

(If you delete articles that are still in a feed, they might show up again later.)

Re: Question

Posted: 16 Nov 2016, 16:50
by fox
yeah ui bloat for no good reason

>How can i create plug-in which delete automatically all articles with 0 score after 1 day or week ?

you can use housekeeping hook

>(If you delete articles that are still in a feed, they might show up again later.)

also this

Re: Question

Posted: 17 Nov 2016, 12:04
by KUHG73KouW3F6lk4
JustAMacUser wrote:Your approach seems unnecessarily complicated. Just use filters to adjust scoring and one, final filter at the end to mark as read if the score is zero. No code hacks, etc. needed.

(If you delete articles that are still in a feed, they might show up again later.)


I looked in GUI and not found any possibility to create filter by score. It is possible to match only by Article Tags, Author, Content, Link, Title but not by score. Your idea much better than my but i completely not know how to implement it. I found in sources place where implemented filters in /include/rssfuncs.php but i not completely understand some expressions in source code because lack of knowledge.

fox wrote:you can use housekeeping hook


Can you please give me small example of housekeeping hook usage ? I am not a programmer and i am not get what you mean by words "housekeeping hook" and where to find it. But i think it will be good for me to learn something new.

Re: Question

Posted: 17 Nov 2016, 12:19
by fox
yeah i guess we can't filter by score, interesting

filter system is pluggable so this might be possible to implement

>Can you please give me small example of housekeeping hook usage ? I am not a programmer and i am not get what you mean by words "housekeeping hook" and where to find it. But i think it will be good for me to learn something new.

this reads as "please write this plugin for me" which is unfortunately not something i'm up to

there's plenty of examples in plugins bundled with tt-rss and in the examples repository on the gitlab