aboutsummaryrefslogtreecommitdiff
path: root/app/class
diff options
context:
space:
mode:
Diffstat (limited to 'app/class')
-rw-r--r--app/class/art2.php2
-rw-r--r--app/class/modelhome.php2
-rw-r--r--app/class/modelrender.php11
3 files changed, 12 insertions, 3 deletions
diff --git a/app/class/art2.php b/app/class/art2.php
index 6a61687..2029895 100644
--- a/app/class/art2.php
+++ b/app/class/art2.php
@@ -169,6 +169,8 @@ class Art2
return $this->date->format('Y-m-d');
} elseif ($option == 'ptime') {
return $this->date->format('H:i');
+ } elseif ($option = 'dmy') {
+ return $this->date->format('d/m/Y');
}
diff --git a/app/class/modelhome.php b/app/class/modelhome.php
index 5d16062..bb271d6 100644
--- a/app/class/modelhome.php
+++ b/app/class/modelhome.php
@@ -11,7 +11,7 @@ class Modelhome extends Modeldb
{
$opt = new Opt(Art2::classvarlist());
- $opt->setcol(['id', 'tag', 'linkfrom', 'linkto', 'description', 'title', 'datemodif', 'datecreation', 'secure']);
+ $opt->setcol(['id', 'tag', 'linkfrom', 'linkto', 'description', 'title', 'datemodif', 'datecreation', 'date', 'secure']);
$opt->settaglist($table);
$opt->submit();
diff --git a/app/class/modelrender.php b/app/class/modelrender.php
index d2cdbb4..c36417d 100644
--- a/app/class/modelrender.php
+++ b/app/class/modelrender.php
@@ -177,8 +177,8 @@ class Modelrender extends Modelart
public function parser(string $text)
{
- $text = str_replace('<a href="~', '<a class="media" target="_blank" href="' . Model::mediapath(), $text);
- $text = str_replace('<img src="~', '<img class="local" src="' . Model::mediapath(), $text);
+
+ $text = $this->media($text);
$text = $this->headerid($text);
@@ -197,6 +197,13 @@ class Modelrender extends Modelart
return $text;
}
+ public function media(string $text): string
+ {
+ $rend = $this;
+ $text = preg_replace('%(src|target)="((\/?[\w-_]+)+\.[a-z0-9]{1,5})"%', '$1="'.Model::mediapath() . '$2"', $text);
+ return $text;
+ }
+
public function autourl($text)
{