aboutsummaryrefslogtreecommitdiff
path: root/includes
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
parentb028da9fea70c65ccd52d1d478859739027d756a (diff)
downloadmain-9852b6cd074cceec0d0b549bb6c9bd7fe50c86f2.tar.gz
main-9852b6cd074cceec0d0b549bb6c9bd7fe50c86f2.tar.bz2
main-9852b6cd074cceec0d0b549bb6c9bd7fe50c86f2.zip
Update
Diffstat (limited to 'includes')
-rw-r--r--includes/archive/main.php6
-rw-r--r--includes/blog/data/2020-05-04@something4.json3
-rw-r--r--includes/blog/data/2020-05-04@something4.json.fr.html1
-rw-r--r--includes/blog/home.php10
-rw-r--r--includes/blog/list.php2
-rw-r--r--includes/friends/home.php16
-rw-r--r--includes/header.php45
-rw-r--r--includes/projects/home.php6
-rw-r--r--includes/projects/list.php2
9 files changed, 67 insertions, 24 deletions
diff --git a/includes/archive/main.php b/includes/archive/main.php
index 4bd2cf7..28cb438 100644
--- a/includes/archive/main.php
+++ b/includes/archive/main.php
@@ -1,4 +1,4 @@
-<p>Download the old of the oldest software I made. Some of this software is <u>proprietary</u> and you can't change or distribute it without my consent. Active projects are not listed here and can be downloaded from their respective page.</p>
+<p><?= l("Download the old of the oldest software I made", "Téléchargez les plus vieux des vieux logiciels que j'ai créé") ?>. <?= l("Some of this software is", "Certains de ces logiciels sont") ?> <u><?= l("proprietary", "propriétaires") ?></u> <?= l("and you can't change or distribute it without my consent", "et vous ne pouvez pas les modifier ou les distribuer sans mon accord") ?>. <?= l("Active projects are not listed here and can be downloaded from their respective page", "Les projets en cours de développement ne sont pas listés ici et peuvent être téléchargés sur leur page respective") ?>.</p>
<div class="list-group">
<?php
@@ -10,7 +10,7 @@
$data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/archive/get/" . $file), true);
echo('<a href="/archive/get/'.substr($file, 0, -5).'.zip" class="list-group-item list-group-item-action"><span class="badge bg-secondary rounded-pill">'.$data['date'].'</span> '.$data['title']);
if ($data['unreleased']) {
- echo(' <span class="badge bg-warning">Unreleased</span>');
+ echo(' <span class="badge bg-warning">' . l("Unreleased", "Jamais sorti") . '</span>');
}
echo('</a>');
}
@@ -19,4 +19,4 @@
?>
</div>
<br>
-<small><p class="text-muted">Project start dates are estimated and cannot always be accurate</p></small> \ No newline at end of file
+<small><p class="text-muted"><?= l("Project start dates are estimated and cannot always be accurate", "Les dates de début des projets sont des estimations et ne peuvent pas être toujours précises") ?></p></small> \ No newline at end of file
diff --git a/includes/blog/data/2020-05-04@something4.json b/includes/blog/data/2020-05-04@something4.json
index 51021ea..c8376de 100644
--- a/includes/blog/data/2020-05-04@something4.json
+++ b/includes/blog/data/2020-05-04@something4.json
@@ -1,3 +1,4 @@
{
- "title": "Some article"
+ "title": "Some article",
+ "title.fr": "Un article"
} \ No newline at end of file
diff --git a/includes/blog/data/2020-05-04@something4.json.fr.html b/includes/blog/data/2020-05-04@something4.json.fr.html
new file mode 100644
index 0000000..8bb1663
--- /dev/null
+++ b/includes/blog/data/2020-05-04@something4.json.fr.html
@@ -0,0 +1 @@
+<b>Il s'agit d'un <i>test</i></b><u> ou, <i>en est-il un ?</i></u>... Nous ne saurons jamais si il devait vraiment y avoir du texte ou quelque chose d'autre ici. Nous ne saurons jamais si il devait vraiment y avoir du texte ou quelque chose d'autre ici. Nous ne saurons jamais si il devait vraiment y avoir du texte ou quelque chose d'autre ici. Nous ne saurons jamais si il devait vraiment y avoir du texte ou quelque chose d'autre ici. Nous ne saurons jamais si il devait vraiment y avoir du texte ou quelque chose d'autre ici. Nous ne saurons jamais si il devait vraiment y avoir du texte ou quelque chose d'autre ici. Nous ne saurons jamais si il devait vraiment y avoir du texte ou quelque chose d'autre ici. Nous ne saurons jamais si il devait vraiment y avoir du texte ou quelque chose d'autre ici. Nous ne saurons jamais si il devait vraiment y avoir du texte ou quelque chose d'autre ici. Nous ne saurons jamais si il devait vraiment y avoir du texte ou quelque chose d'autre ici. Nous ne saurons jamais si il devait vraiment y avoir du texte ou quelque chose d'autre ici. \ No newline at end of file
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>
diff --git a/includes/blog/list.php b/includes/blog/list.php
index ba859a2..1c81630 100644
--- a/includes/blog/list.php
+++ b/includes/blog/list.php
@@ -9,7 +9,7 @@
?>
<?php if (strpos($article, "@") !== false && strpos($article, ".html") === false): ?>
<?php $data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/blog/data/" . $article), true); ?>
- <a href="/blog/article-<?= explode(".", $article)[0] ?>" class="list-group-item list-group-item-action"><span class="text-muted"><?= DateTime::createFromFormat('Y-m-d', explode("@", $article)[0])->format("F jS, Y"); ?></span> · <?= $data["title"] ?></a>
+ <a href="/blog/article-<?= explode(".", $article)[0] ?>" class="list-group-item list-group-item-action"><span class="text-muted"><?= strftime(l("%a %b %e, %Y", "%a %e %b %Y"), (int)DateTime::createFromFormat('Y-m-d', explode("@", $article)[0])->format("U")); ?></span> · <?= l($data["title"], $data["title.fr"] ?? $data["title"]) ?></a>
<?php endif;$i++; ?>
<?php endforeach; ?>
</div> \ No newline at end of file
diff --git a/includes/friends/home.php b/includes/friends/home.php
index d23c37a..e549070 100644
--- a/includes/friends/home.php
+++ b/includes/friends/home.php
@@ -4,14 +4,14 @@
<!--suppress CssInvalidPropertyValue -->
<h5 class="card-title" style="font-weight: bold;background: radial-gradient(circle,#dec64c 0%,#d67541 100%);background-clip: text;-webkit-background-clip: text;-webkit-text-fill-color: transparent;">Retsuno</h5>
<h6 class="card-subtitle mb-2 text-muted">&nbsp;</h6>
- <p>We met by chance on Reddit and now we're best friends. Was the first furry I talked to after <i>really</i> joining the fandom (yes, at 1 AM).</p>
+ <p><?= l("We met by chance on Reddit and now we're best friends. Was the first furry I talked to after <i>really</i> joining the fandom (yes, at 1 AM).", "Nous nous sommes rencontrés par hasard sur Reddit et maintenant nous sommes meilleurs amis. Il a été le premier furry auquel j'ai parlé après avoir <i>réellement</i> rejoint le fandom (oui, à 1h du matin)"); ?></p>
</div>
</div>
<div class="card">
<div class="card-body">
<h5 class="card-title">Mylo</h5>
<h6 class="card-subtitle mb-2 text-muted">@FENNECPARTY</h6>
- <p>His photos are great, and the person behind them is awesome.</p>
+ <p><?= l("His photos are great, and the person behind them is awesome.", "Ses photos sont jolies, et la personne derrière est incroyable."); ?></p>
<a href="https://twitter.com/fennecparty" target="_blank" class="btn btn-primary">Twitter</a>
</div>
</div>
@@ -19,7 +19,7 @@
<div class="card-body">
<h5 class="card-title">Fleur</h5>
<h6 class="card-subtitle mb-2 text-muted">@Fleurfurr</h6>
- <p>(Somehow we're friends on Discord, don't remember sending you a request... ^^) His art is good and with little details everywhere!</p>
+ <p><?= l("(Somehow we're friends on Discord, don't remember sending you a request... ^^) His art is good and with little details everywhere!", "(Apparement nous sommes amis sur Discord, je ne me souviens pas t'avoir envoyé de demande... ^^) Son art est beau et avec des petits détails partout !"); ?></p>
<a href="https://twitter.com/Fleurfurr" target="_blank" class="btn btn-primary">Twitter</a>
</div>
</div>
@@ -27,7 +27,7 @@
<div class="card-body">
<h5 class="card-title">Ayann</h5>
<h6 class="card-subtitle mb-2 text-muted">@ayann_fr</h6>
- <p>Helped me keep all this up with mental fuel! Probably won't be there without him.</p>
+ <p><?= l("Helped me keep all this up with mental fuel! Probably won't be there without him.", "M'a aidé à continuer mes efforts avec des messages de soutien ! Je ne serai probablement pas là sans lui."); ?></p>
<a href="https://twitter.com/ayann_fr" target="_blank" class="btn btn-primary">Twitter</a>
</div>
</div>
@@ -37,7 +37,7 @@
<div class="card-body">
<h5 class="card-title">Wishdream</h5>
<h6 class="card-subtitle mb-2 text-muted">@WishdreamStar</h6>
- <p>Probably knows Linux as much as I know it. Very fun and interesting to talk to each other, and also very great art.</p>
+ <p><?= l("Probably knows Linux as much as I know it. Very fun and interesting to talk to each other, and also very great art.", "Connaît probablement Linux autant que je le connais. Il est très amusant et intéressant de discuter ensemble, et aussi son art est joli."); ?></p>
<a href="https://twitter.com/WishdreamStar" target="_blank" class="btn btn-primary">Twitter</a>
</div>
</div>
@@ -45,7 +45,7 @@
<div class="card-body">
<h5 class="card-title">Brabbit</h5>
<h6 class="card-subtitle mb-2 text-muted">@TalkingTadPol</h6>
- <p>We mutually supported each other during hard times without even knowing each other. What an amazing story!</p>
+ <p><?= l("We mutually supported each other during hard times without even knowing each other. What an amazing story!", "On se soutient mutuellement pendant des temps difficiles sans même se connaître. Quelle histoire incroyable !"); ?></p>
<a href="https://twitter.com/TalkingTadPol" target="_blank" class="btn btn-primary">Twitter</a>
</div>
</div>
@@ -53,7 +53,7 @@
<div class="card-body">
<h5 class="card-title">fiddle</h5>
<h6 class="card-subtitle mb-2 text-muted">@fiddleafox</h6>
- <p>We are friends. Or are we? Who knows... We talked about <a href="/creations/kartik">Kartik</a> a while back so maybe yes.</p>
+ <p><?= l("We are friends. Or are we? Who knows... We talked about <a href='/creations/kartik'>Kartik</a> a while back so maybe yes.", "Nous sommes amis. Ou sommes nous amis ? Qui sait... On a discuté de <a href='/creations/kartik'>Kartik</a> il y a quelques temps donc probablement."); ?></p>
<a href="https://twitter.com/TalkingTadPol" target="_blank" class="btn btn-primary">Twitter</a>
</div>
</div>
@@ -61,7 +61,7 @@
<div class="card-body">
<h5 class="card-title">russelbuck</h5>
<h6 class="card-subtitle mb-2 text-muted">@russelbuck</h6>
- <p>Meaningful music that I enjoy listening to. I did a cover of <a href="/creations/gyrate-with-obliqueness">Gyrate with Obliqueness</a> from them.</p>
+ <p><?= l("Meaningful music that I enjoy listening to. I did a cover of <a href='/creations/gyrate-with-obliqueness'>Gyrate with Obliqueness</a> from them.", "Musique censée à laquelle j'adore écouter. J'ai fait une reprise de sa musique <a href='/creations/gyrate-with-obliqueness'>Gyrate with Obliqueness</a>."); ?></p>
<a href="https://twitter.com/russelbuck" target="_blank" class="btn btn-primary">Twitter</a>
</div>
</div>
diff --git a/includes/header.php b/includes/header.php
index ea8fb50..3f16582 100644
--- a/includes/header.php
+++ b/includes/header.php
@@ -2,16 +2,52 @@
$lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);
-function l($en, $fr) {
+function l($en, $fr = null) {
global $lang;
- if (($lang === "fr" && isset($fr)) || isset($_GET['fr'])) {
+ if ((($lang === "fr" && isset($fr)) || (isset($_GET['fr']) && isset($fr) || isset($_COOKIE['fr']))) && !isset($_GET['en']) && !isset($_COOKIE['en']) && isset($fr)) {
+ setlocale(LC_TIME, array('fr_FR.UTF-8','fr_FR@euro','fr_FR','french'));
return $fr;
} else {
return $en;
}
}
+$db = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/telemetry.json"), true);
+
+$ip = md5($_SERVER['REMOTE_ADDR']);
+$day = date('d');
+$month = date('m');
+$year = date('y');
+$url = explode("?", $_SERVER['REQUEST_URI'])[0];
+
+if (!isset($db[$year])) {
+ $db[$year] = [];
+}
+if (!isset($db[$year][$month])) {
+ $db[$year][$month] = [];
+}
+if (!isset($db[$year][$month][$day])) {
+ $db[$year][$month][$day] = [];
+}
+if (!isset($db[$year][$month][$day][$url])) {
+ $db[$year][$month][$day][$url] = [];
+}
+
+if (!in_array($ip, $db[$year][$month][$day][$url])) {
+ array_push($db[$year][$month][$day][$url], $ip);
+}
+
+function credit(string $name, string $description, string $image, bool $backwards) {
+ if ($backwards) {
+ return "<div class='artwork-credits-box--back'><div><h3>{$name}</h3>{$description}</div></div><img class='artwork-credits-image--back' src='{$image}' alt='{$name}'>";
+ } else {
+ return "<img class='artwork-credits-image' src='{$image}' alt='{$name}'><div class='artwork-credits-box'><div><h3>{$name}</h3>{$description}</div></div>";
+ }
+}
+
+file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/telemetry.json", json_encode($db, JSON_PRETTY_PRINT));
+
?>
<!DOCTYPE html>
<html lang="<?= $lang === "fr" ? "fr" : "en" ?>">
@@ -20,6 +56,7 @@ function l($en, $fr) {
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" href="/logo.svg">
<link href="/static/css/darktheme.css" rel="stylesheet">
+ <link href="/static/css/fonts" rel="stylesheet">
<link href="/static/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<title><?php
@@ -30,8 +67,8 @@ function l($en, $fr) {
?><?= l("Minteck's space", "L'espace de Minteck") ?></title>
</head>
<body style="background-size: cover;background-position: center;background-repeat: no-repeat;background-attachment: fixed;">
- <div style="height:24px;background:orange;position:fixed;color:black;text-align:center;z-index:999;top:0;left:0;right:0;">Private beta of Minteck's space. Please report all bugs, issues or design details at <a href="mailto:nekostarfan@gmail.com">nekostarfan@gmail.com</a> or <a href="https://jetbrains.minteck.ro.lt:1024/youtrack/issues/MSS" target="_blank">on Minteck's YouTrack instance</a></div>
- <nav class="navbar fixed-top navbar-expand-lg navbar-light bg-light" style="margin-top:24px;">
+ <!--<div style="height:16px;background:orange;position:fixed;color:black;font-size:12px;font-weight:bold;text-align:center;z-index:999;top:0;left:0;right:0;">Private beta of Minteck's space. Please report all bugs, issues or design details at <a href="mailto:nekostarfan@gmail.com">nekostarfan@gmail.com</a> or <a href="https://jetbrains.minteck.ro.lt:1024/youtrack/issues/MSS" target="_blank">on Minteck's YouTrack instance</a></div>-->
+ <nav style="z-index:99;" class="navbar fixed-top navbar-expand-lg navbar-light bg-light">
<div class="container-fluid">
<a class="navbar-brand" href="/"><img src="/logo.svg" alt="" width="36px"> <span style="vertical-align: middle;"><?= l("Minteck's space", "L'espace de Minteck") ?></span></a>
<button class="navbar-toggler" style="filter:invert(1);" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
diff --git a/includes/projects/home.php b/includes/projects/home.php
index 743adc1..2f11b33 100644
--- a/includes/projects/home.php
+++ b/includes/projects/home.php
@@ -1,5 +1,5 @@
<div class="list-group">
- <a href="/creations/kartik" class="list-group-item list-group-item-action"><img src="<?= trim(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/creations/dev/kartik/icon.txt")) ?>" alt="" width="24px"> Kartik <span class="badge bg-secondary rounded-pill">Development</span></a>
- <a href="/creations/neutron" class="list-group-item list-group-item-action"><img src="<?= trim(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/creations/dev/neutron/icon.txt")) ?>" alt="" width="24px"> Neutron <span class="badge bg-secondary rounded-pill">Development</span></a>
- <a href="/creations/gyrate-with-obliqueness" class="list-group-item list-group-item-action"><img src="/static/genericProjectIcon.png" alt="" width="24px"> Gyrate with Obliqueness <span class="badge bg-secondary rounded-pill">Multimedia</span></a>
+ <a href="/creations/kartik" class="list-group-item list-group-item-action"><img src="<?= trim(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/creations/kartik/icon.txt")) ?>" alt="" width="24px"> Kartik <span class="badge bg-secondary rounded-pill"><?= l("Development", "Programmation") ?></span></a>
+ <a href="/creations/neutron" class="list-group-item list-group-item-action"><img src="<?= trim(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/creations/neutron/icon.txt")) ?>" alt="" width="24px"> Neutron <span class="badge bg-secondary rounded-pill"><?= l("Development", "Programmation") ?></span></a>
+ <a href="/creations/gyrate-with-obliqueness" class="list-group-item list-group-item-action"><img src="/static/genericProjectIcon.png" alt="" width="24px"> Gyrate with Obliqueness <span class="badge bg-secondary rounded-pill"><?= l("Multimedia", "Multimédia") ?></span></a>
</div> \ No newline at end of file
diff --git a/includes/projects/list.php b/includes/projects/list.php
index 00c27d0..136cf56 100644
--- a/includes/projects/list.php
+++ b/includes/projects/list.php
@@ -7,7 +7,7 @@
?>
<?php if (trim($article) !== "." && trim($article) !== ".." && trim($article) !== "dev" && trim($article) !== "video" && is_dir($_SERVER['DOCUMENT_ROOT'] . "/creations/" . $article)): ?>
- <a href="/creations/<?= $article ?>" class="list-group-item list-group-item-action"><img src="<?= trim(file_exists($_SERVER['DOCUMENT_ROOT'] . "/creations/" . $article . "/icon.txt") ? file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/creations/" . $article . "/icon.txt") : "/static/genericProjectIcon.png") ?>" width="24px" alt="">&nbsp;<?= file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/creations/" . $article . "/title.txt") ?><span class="text-muted"> · <?= file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/creations/" . $article . "/description.txt") ?></span></a>
+ <a href="/creations/<?= $article ?>" class="list-group-item list-group-item-action"><img src="<?= trim(file_exists($_SERVER['DOCUMENT_ROOT'] . "/creations/" . $article . "/icon.txt") ? file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/creations/" . $article . "/icon.txt") : "/static/genericProjectIcon.png") ?>" width="24px" alt="">&nbsp;<?= file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/creations/" . $article . "/title.txt") ?><span class="text-muted"> · <?= l(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/creations/" . $article . "/description.txt"), file_exists($_SERVER['DOCUMENT_ROOT'] . "/creations/" . $article . "/description.fr.txt") ? file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/creations/" . $article . "/description.fr.txt") : file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/creations/" . $article . "/description.txt")) ?></span></a>
<?php endif;$i++; ?>
<?php endforeach; ?>
</div> \ No newline at end of file