Initial commit
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
<?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();
|
||||
}
|
||||
Reference in New Issue
Block a user