1
0
Fork 0
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
604 B
PHP

<?php
use Kirby\Http\Url;
use Kirby\Toolkit\F;
Kirby::plugin('lukasbestle/qdated', [
'tags' => [
'qdated' => [
'html' => function($tag) {
$qdated = qdated();
return '<a href="mailto:' . $qdated . '">' . $qdated . '</a>';
}
]
]
]);
/**
* Returns the current qdated address
* If qdated is not available, returns null
*
* @return string
*/
function qdated() {
$path = $_SERVER['HOME'] . DS . '.qdated-current';
if(!is_file($path)) return null;
return 'dated-' . trim(F::read($path)) . '@' . Url::host();
}