mirror of
https://git.tt-rss.org/fox/tt-rss.git
synced 2025-10-13 03:51:01 +02:00
add plugins/scored_oldest_first
This commit is contained in:
parent
bc0d50e892
commit
c82457e534
35
plugins/scored_oldest_first/init.php
Normal file
35
plugins/scored_oldest_first/init.php
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
<?php
|
||||||
|
class Scored_Oldest_First extends Plugin {
|
||||||
|
|
||||||
|
function init($host) {
|
||||||
|
$host->add_hook($host::HOOK_HEADLINES_CUSTOM_SORT_MAP, $this);
|
||||||
|
$host->add_hook($host::HOOK_HEADLINES_CUSTOM_SORT_OVERRIDE, $this);
|
||||||
|
}
|
||||||
|
|
||||||
|
function hook_headlines_custom_sort_map() {
|
||||||
|
return [
|
||||||
|
"dates_reverse_scored" => "Oldest first (legacy)"
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
function hook_headlines_custom_sort_override($order) {
|
||||||
|
if ($order == "dates_reverse_scored") {
|
||||||
|
return [ "score DESC, updated", true ];
|
||||||
|
} else {
|
||||||
|
return [ "", false ];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function about() {
|
||||||
|
return array(1.0,
|
||||||
|
"Consider article score while sorting by oldest first",
|
||||||
|
"fox",
|
||||||
|
false,
|
||||||
|
"");
|
||||||
|
}
|
||||||
|
|
||||||
|
function api_version() {
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user