aboutsummaryrefslogtreecommitdiff
path: root/index.php
diff options
context:
space:
mode:
Diffstat (limited to 'index.php')
-rw-r--r--index.php13
1 files changed, 12 insertions, 1 deletions
diff --git a/index.php b/index.php
index cb35385..a153354 100644
--- a/index.php
+++ b/index.php
@@ -1,6 +1,7 @@
<?php
require_once $_SERVER['DOCUMENT_ROOT'] . "/private/session.php";
+global $_FRENCH;
/** @var string $_FULLNAME
* @var string $_USER
@@ -167,7 +168,17 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/private/session.php";
</script>
<br>
<?php foreach (array_reverse(scandir($_SERVER["DOCUMENT_ROOT"] . "/private/news")) as $article): if (str_ends_with($article, ".json")): ?>
- <?php $data = json_decode(file_get_contents($_SERVER["DOCUMENT_ROOT"] . "/private/news/" . $article), true); $html = file_get_contents($_SERVER["DOCUMENT_ROOT"] . "/private/news/" . substr($article, 0, -5) . ".html"); $summary = trim(explode("<!---->", $html)[0]); $full = trim($html); ?>
+ <?php $data = json_decode(file_get_contents($_SERVER["DOCUMENT_ROOT"] . "/private/news/" . $article), true);
+
+ if (!$_FRENCH && file_exists($_SERVER["DOCUMENT_ROOT"] . "/private/news/" . substr($article, 0, -5) . ".en.html")) {
+ $html = file_get_contents($_SERVER["DOCUMENT_ROOT"] . "/private/news/" . substr($article, 0, -5) . ".en.html");
+ } else {
+ $html = file_get_contents($_SERVER["DOCUMENT_ROOT"] . "/private/news/" . substr($article, 0, -5) . ".html");
+ }
+
+ $summary = trim(explode("<!---->", $html)[0]);
+ $full = trim($html);
+ ?>
<?php if ($data["limited"] === null || in_array($_USER, $data["limited"])): ?>
<div class="jumbotron">
<h5><?= $data["date"][l("fr","en")] ?></h5>