Question

Development-related discussion, including bundled plugins
KUHG73KouW3F6lk4
Bear Rating Trainee
Bear Rating Trainee
Posts: 2
Joined: 16 Nov 2016, 14:48

Question

Postby KUHG73KouW3F6lk4 » 16 Nov 2016, 14:56

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.

JustAMacUser
Bear Rating Overlord
Bear Rating Overlord
Posts: 373
Joined: 20 Aug 2013, 23:13

Re: Question

Postby JustAMacUser » 16 Nov 2016, 16:25

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.)

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: Question

Postby fox » 16 Nov 2016, 16:50

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

KUHG73KouW3F6lk4
Bear Rating Trainee
Bear Rating Trainee
Posts: 2
Joined: 16 Nov 2016, 14:48

Re: Question

Postby KUHG73KouW3F6lk4 » 17 Nov 2016, 12:04

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.

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: Question

Postby fox » 17 Nov 2016, 12:19

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


Return to “Development”

Who is online

Users browsing this forum: No registered users and 1 guest