2023-10-31 18:52:33 +01:00
|
|
|
<?php namespace Filters;
|
|
|
|
|
|
|
|
require_once("../vendor/autoload.php");
|
|
|
|
|
2023-11-01 11:20:52 +01:00
|
|
|
function timediffmin() {
|
|
|
|
return new \Twig\TwigFilter('timediffmin', function ($ago, $now) {
|
|
|
|
return round((strtotime($now) - strtotime($ago)) / 60);
|
2023-10-31 18:52:33 +01:00
|
|
|
});
|
2023-10-31 22:15:05 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
function isof() {
|
|
|
|
return new \Twig\TwigFilter('isof', function ($online, $total) {
|
|
|
|
if($online == $total) return "all";
|
|
|
|
elseif($online == 0) return "none";
|
|
|
|
else return "some";
|
|
|
|
});
|
2023-10-31 18:52:33 +01:00
|
|
|
}
|