Update qdated for server migration

This commit is contained in:
2020-06-21 13:14:34 +02:00
parent bdab17ffcd
commit 1cbcaf48bd
3 changed files with 6 additions and 5 deletions
+4 -3
View File
@@ -7,7 +7,7 @@ Kirby::plugin('lukasbestle/qdated', [
'tags' => [
'qdated' => [
'html' => function($tag) {
$qdated = qdated();
$qdated = qdated($tag->qdated);
return '<a href="mailto:' . $qdated . '">' . $qdated . '</a>';
}
]
@@ -18,10 +18,11 @@ Kirby::plugin('lukasbestle/qdated', [
* Returns the current qdated address
* If qdated is not available, returns null
*
* @param string $destination
* @return string
*/
function qdated() {
$path = $_SERVER['HOME'] . DS . '.qdated-current';
function qdated(string $destination) {
$path = $_SERVER['HOME'] . '/.config/qdated/' . $destination . '/current';
if(!is_file($path)) return null;
return 'dated-' . trim(F::read($path)) . '@' . Url::host();