aboutsummaryrefslogtreecommitdiff
path: root/includes/blog/home.php
diff options
context:
space:
mode:
authorMinteck <46352972+Minteck@users.noreply.github.com>2021-08-01 22:28:15 +0200
committerMinteck <46352972+Minteck@users.noreply.github.com>2021-08-01 22:28:15 +0200
commit9852b6cd074cceec0d0b549bb6c9bd7fe50c86f2 (patch)
tree22d9b851864f9370282f21d10113afd5d565e4cf /includes/blog/home.php
parentb028da9fea70c65ccd52d1d478859739027d756a (diff)
downloadmain-9852b6cd074cceec0d0b549bb6c9bd7fe50c86f2.tar.gz
main-9852b6cd074cceec0d0b549bb6c9bd7fe50c86f2.tar.bz2
main-9852b6cd074cceec0d0b549bb6c9bd7fe50c86f2.zip
Update
Diffstat (limited to 'includes/blog/home.php')
-rw-r--r--includes/blog/home.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/includes/blog/home.php b/includes/blog/home.php
index a515c14..49817e8 100644
--- a/includes/blog/home.php
+++ b/includes/blog/home.php
@@ -10,13 +10,17 @@
<?php if ($i <= 3 && strpos($article, "@") !== false && strpos($article, ".html") === false): ?>
<?php
$data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/blog/data/" . $article), true);
- $data['html'] = file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/blog/data/" . $article . ".html");
+ if (l("a", "b") === "b" && file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/blog/data/" . $article . ".fr.html")) {
+ $data['html'] = file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/blog/data/" . $article . ".fr.html");
+ } else {
+ $data['html'] = file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/blog/data/" . $article . ".html");
+ }
?>
<div class="card">
<div class="card-body">
- <h5 class="card-title"><?= $data["title"] ?></h5>
+ <h5 class="card-title"><?= l($data["title"], $data["title.fr"] ?? $data["title"]) ?></h5>
<p class="card-text"><?= strlen(strip_tags($data["html"])) > 150 ? substr(strip_tags($data["html"]), 0, 150) . "..." : strip_tags($data["html"]) ?></p>
- <p class="card-text"><small class="text-muted"><?= l("Published", "PubliƩ") ?> <?= DateTime::createFromFormat('Y-m-d', explode("@", $article)[0])->format("F jS, Y"); ?></small></p>
+ <p class="card-text"><small class="text-muted"><?= l("Published", "PubliƩ") ?> <?= strftime(l("%a %b %e, %Y", "%a %e %b %Y"), (int)DateTime::createFromFormat('Y-m-d', explode("@", $article)[0])->format("U")); ?></small></p>
<a href="/blog/article-<?= explode(".", $article)[0] ?>" class="card-link"><?= l("Read more...", "Lire plus...") ?></a>
</div>
</div>