split scored_oldest_first into a separate repo

This commit is contained in:
Andrew Dolgov 2021-03-05 09:52:45 +03:00
parent e8e6329040
commit 198c9b4069
1 changed files with 0 additions and 35 deletions

View File

@ -1,35 +0,0 @@
<?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 (with score)"
];
}
function hook_headlines_custom_sort_override($order) {
if ($order == "dates_reverse_scored") {
return [ "score DESC, updated", true ];
} else {
return [ "", false ];
}
}
function about() {
return array(null,
"Consider article score while sorting by oldest first",
"fox",
false,
"");
}
function api_version() {
return 2;
}
}