post manipulation when opening a post in a new tab

Development-related discussion, including bundled plugins
helt
Bear Rating Trainee
Bear Rating Trainee
Posts: 5
Joined: 12 Sep 2012, 12:24

post manipulation when opening a post in a new tab

Postby helt » 12 Sep 2012, 12:57

Hi,

im working on a small patch to change to "open article in new tab" behaviour a bit. but some code compliance questions remain.
This way i want to prevent those articles to be purged. (and in the end, have sth like crowd-sourced interest in articles)

will a user-interaction-triggered manipulation of an articles score break anything in ttrss?
will a score > 0 prevent purging?

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

Re: post manipulation when opening a post in a new tab

Postby fox » 12 Sep 2012, 13:09

will a user-interaction-triggered manipulation of an articles score break anything in ttrss?


I have no idea what this means.

will a score > 0 prevent purging?


No.

helt
Bear Rating Trainee
Bear Rating Trainee
Posts: 5
Joined: 12 Sep 2012, 12:24

Re: post manipulation when opening a post in a new tab

Postby helt » 12 Sep 2012, 13:42

ok. i dug a bit into the sql-tables... will changing the score of a row in ttrss_user_entries have any sideeffects? (i want to do a +1 on score each time the article gets opened)

ok. so ill update functions.php to prevent purging of highly ranked articles (in my fork of ttrss)

Code: Select all

   function purge_feed($link, $feed_id, $purge_interval, $debug = false) {
....
         $result = db_query($link, "DELETE FROM ttrss_user_entries
            USING ttrss_user_entries, ttrss_entries
            WHERE ttrss_entries.id = ref_id AND
            marked = false AND

            score < 10 AND

            feed_id = '$feed_id' AND
            $query_limit
            ttrss_entries.date_updated < DATE_SUB(NOW(), INTERVAL $purge_interval DAY)");
...
}


any comments on doing it like that? im new to php, so dont hesitate to tell me ;)

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

Re: post manipulation when opening a post in a new tab

Postby fox » 12 Sep 2012, 18:27

Yeah, this should work.


Return to “Development”

Who is online

Users browsing this forum: No registered users and 2 guests