/
phprus
/
git.tt-rss.org_fox_ttrss-random-order
Обзор
Документация
Войти
/
phprus
/
git.tt-rss.org_fox_ttrss-random-order
Код
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
init.php
35 строк
624 B
Andrew Dolgov
initial for random_order
06 май 2023, 14:09
Не верифицирован
06 май 2023, 14:09
505c815
Код
Авторство
О чём код?
<?php class Random_Order 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 [ "random_order" => "Random" ]; } function hook_headlines_custom_sort_override($order) { if ($order == "random_order") { return [ "RANDOM()", false ]; } else { return [ "", false ]; } } function about() { return array(null, "Return headlines in random order", "fox", false, ""); } function api_version() { return 2; } }