Revamped layout, Added lang selection, Added auto lang detection, Removed trash, Other minor improvements

Update .htaccess, body-1.php, and 50 more files...
This commit is contained in:
2023-06-01 17:20:44 +02:00
parent 6e9bf25866
commit 6fb621e550
52 changed files with 1047 additions and 654 deletions

View File

@@ -1,8 +0,0 @@
<?php
// Making sure the file is included and not accessed directly.
if(basename(__FILE__) == basename($_SERVER["SCRIPT_FILENAME"])) {
header('HTTP/1.1 403 Forbidden');
die();
}
?>
<table class="container-root"><tr><td>

View File

@@ -1,8 +0,0 @@
<?php
// Making sure the file is included and not accessed directly.
if(basename(__FILE__) == basename($_SERVER["SCRIPT_FILENAME"])) {
header('HTTP/1.1 403 Forbidden');
die();
}
?>
</td><td class="w-full h-full"><table class="w-full h-full"><tr><td>

View File

@@ -1,8 +0,0 @@
<?php
// Making sure the file is included and not accessed directly.
if(basename(__FILE__) == basename($_SERVER["SCRIPT_FILENAME"])) {
header('HTTP/1.1 403 Forbidden');
die();
}
?>
</td></tr><tr class="h-full"><td class="h-full"><div class="fluid-container">

View File

@@ -1,8 +0,0 @@
<?php
// Making sure the file is included and not accessed directly.
if(basename(__FILE__) == basename($_SERVER["SCRIPT_FILENAME"])) {
header('HTTP/1.1 403 Forbidden');
die();
}
?>
</div></td></tr></table></td></tr><tr><td colspan="2">

View File

@@ -1,8 +0,0 @@
<?php
// Making sure the file is included and not accessed directly.
if(basename(__FILE__) == basename($_SERVER["SCRIPT_FILENAME"])) {
header('HTTP/1.1 403 Forbidden');
die();
}
?>
</td></tr></table>

View File

@@ -1,6 +1,6 @@
<?php
// Making sure the file is included and not accessed directly.
if (basename(__FILE__) == basename($_SERVER["SCRIPT_FILENAME"])) {
if(basename(__FILE__) == basename($_SERVER["SCRIPT_FILENAME"])) {
header('HTTP/1.1 403 Forbidden');
die();
}
@@ -18,6 +18,6 @@ include_once 'commons/langs.php';
</p>
<a href="<?php print(l10n_url_abs('/')); ?>">
<img id="logo-footer" src="/resources/NibblePoker/images/logos/v2_full_unshaded_original.svg"
alt="<?php echo(localize("footer.alt.logo")); ?>" draggable="false">
alt="<?php echo(localize("footer.alt.logo")); ?>" draggable="false">
</a>
</footer>

View File

@@ -5,10 +5,10 @@ if(basename(__FILE__) == basename($_SERVER["SCRIPT_FILENAME"])) {
die();
}
?>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
<meta name="viewport" content="width=device-width" />
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport"/>
<meta name="viewport" content="width=device-width"/>
<!--<meta content="cache, store" http-equiv="Cache-Control">
<meta content="cache, store" http-equiv="Pragma">
<meta content="3600" http-equiv="Expires">-->
@@ -22,9 +22,9 @@ if($enable_waffle_iron) {
//echo("<link rel=\"stylesheet\" href=\"/resources/NibblePoker/css/waffle-day.min.css\">");
}
if($enable_code_highlight) {
echo('<link href="/resources/HighlightJS/11.6.0/styles/atom-one-dark.min.css" rel="stylesheet" />');
echo('<link href="/resources/HighlightJS/11.6.0/styles/atom-one-dark.min.css" rel="stylesheet"/>');
}
if($enable_glider) {
echo('<link href="/resources/GliderJs/1.7.6/glider.min.css" rel="stylesheet" />');
echo('<link href="/resources/GliderJs/1.7.6/glider.min.css" rel="stylesheet"/>');
}
?>

View File

@@ -0,0 +1,26 @@
<?php
// Making sure the file is included and not accessed directly.
if(basename(__FILE__) == basename($_SERVER["SCRIPT_FILENAME"])) {
header('HTTP/1.1 403 Forbidden');
die();
}
?>
<details id="lang-selector" class="border p-mxs px-s bkgd-blank-dark r-m">
<summary>
<i class="fad fa-language"></i>
<span class="mobile-hide t-w-500">&nbsp;<?php print(localize("lang.menu.title")); ?></span>
&nbsp;<i class="fa fa-angle-down"></i>
</summary>
<div class="p-xs border bkgd-surround r-m t-w-500">
<a href="<?php echo(l10n_url_switch('en')); ?>" class="bland-link">
<p class="mb-s px-xxs"><?php print(localize("lang.english")); ?></p>
</a>
<a href="<?php echo(l10n_url_switch('fr')); ?>" class="bland-link">
<p class="my-s px-xxs"><?php print(localize("lang.french")); ?></p>
</a>
<hr class="subtle m-0">
<a href="<?php echo(l10n_url_switch(NULL)); ?>" class="bland-link">
<p class="mt-xs px-xxs"><?php print(localize("lang.automatic")); ?></p>
</a>
</div>
</details>

View File

@@ -1,63 +1,64 @@
<?php
// Making sure the file is included and not accessed directly.
if (basename(__FILE__) == basename($_SERVER["SCRIPT_FILENAME"])) {
if(basename(__FILE__) == basename($_SERVER["SCRIPT_FILENAME"])) {
header('HTTP/1.1 403 Forbidden');
die();
}
include_once 'commons/langs.php';
if(!isset($SIDEBAR_ID)) {
$SIDEBAR_ID = 'default';
if(!isset($SIDEBAR_IDS)) {
$SIDEBAR_IDS = [];
}
function printSidebarEntry($url, $title, $icon) {
echo('<a class="bland-link" href="' . $url . '"><p class="t-size-18 t-w-500 py-xs sidebar-entry">');
function printSidebarEntry($url, $title, $icon, $activeId) {
global $SIDEBAR_IDS;
echo('<a class="' . (in_array($activeId, $SIDEBAR_IDS) ? 'text-link' : 'bland-link') . '" href="' . $url . '">');
echo('<p class="t-size-18 t-w-500 py-xs sidebar-entry">');
echo('<i class="' . $icon . ' pr-xs t-size-12 t-half-muted"></i><span class="t-size-12">' . $title . '</span></p></a>');
}
?>
<nav id="sidebar" class="sidebar p-m pt-l">
<!-- TODO: Active link, and set it from content for projects -->
<a href="<?php print(l10n_url_abs('/')); ?>" class="no-select">
<img id="logo-sidebar" src="/resources/NibblePoker/images/logos/v2_full_unshaded_original.svg"
alt="<?php echo(localize("sidebar.alt.logo")); ?>" draggable="false">
alt="<?php echo(localize("sidebar.alt.logo")); ?>" draggable="false">
</a>
<p class="quantum t-logo-text mb-s mt-xs t-muted ucase">
N<span class="t-super-muted">ibble</span>P<span class="t-super-muted">oker</span>
</p>
<hr class="subtle">
<?php
printSidebarEntry(l10n_url_abs('/'), localize("sidebar.text.home"), "fad fa-home");
printSidebarEntry(l10n_url_abs('/'), localize("sidebar.text.home"), "fad fa-home", "home");
?>
<hr class="subtle">
<?php
printSidebarEntry(l10n_url_abs('/content/'), localize("sidebar.text.projects"), "fad fa-briefcase");
printSidebarEntry(l10n_url_abs('/content/'), localize("sidebar.text.projects"), "fad fa-briefcase", "content");
?>
<div class="ml-m">
<?php
printSidebarEntry(l10n_url_abs('/content/?tags=application'), localize("sidebar.text.applications"),"fad fa-browser");
printSidebarEntry(l10n_url_abs('/content/?tags=library'), localize("sidebar.text.libraries"), "fad fa-puzzle-piece");
printSidebarEntry(l10n_url_abs('/content/?tags=electronic'), localize("sidebar.text.electronics"), "fad fa-microchip");
?>
</div>
<hr class="subtle">
<?php
printSidebarEntry(l10n_url_abs('/tools/'), localize("sidebar.text.tools"), "fad fa-tools");
?>
<hr class="subtle">
<?php
printSidebarEntry(l10n_url_abs('/links/'), localize("sidebar.text.links"), "fad fa-link");
?>
<div class="ml-m">
<?php
printSidebarEntry("https://files.nibblepoker.lu/", localize("sidebar.text.downloads"),"fad fa-download");
printSidebarEntry("https://git.nibblepoker.lu/", localize("sidebar.text.gitea"), "fad fa-code");
printSidebarEntry(l10n_url_abs('/content/?tags=application'), localize("sidebar.text.applications"), "fad fa-browser", "application");
printSidebarEntry(l10n_url_abs('/content/?tags=library'), localize("sidebar.text.libraries"), "fad fa-puzzle-piece", "library");
printSidebarEntry(l10n_url_abs('/content/?tags=electronic'), localize("sidebar.text.electronics"), "fad fa-microchip", "electronic");
?>
</div>
<hr class="subtle">
<?php
printSidebarEntry(l10n_url_abs('/about/'), localize("sidebar.text.about"), "fad fa-user");
printSidebarEntry(l10n_url_abs('/contact/'), localize("sidebar.text.contact"),"fad fa-mailbox");
printSidebarEntry(l10n_url_abs('/tools/'), localize("sidebar.text.tools"), "fad fa-tools", "tools");
?>
<hr class="subtle">
<?php
printSidebarEntry(l10n_url_abs('/links/'), localize("sidebar.text.links"), "fad fa-link", "links");
?>
<div class="ml-m">
<?php
printSidebarEntry("https://files.nibblepoker.lu/", localize("sidebar.text.downloads"), "fad fa-download", "");
printSidebarEntry("https://git.nibblepoker.lu/", localize("sidebar.text.gitea"), "fad fa-code", "");
?>
</div>
<hr class="subtle">
<?php
printSidebarEntry(l10n_url_abs('/about/'), localize("sidebar.text.about"), "fad fa-user", "about");
printSidebarEntry(l10n_url_abs('/contact/'), localize("sidebar.text.contact"), "fad fa-mailbox", "contact");
?>
</nav>

View File

@@ -33,7 +33,7 @@ function getMainHeader(string $text, ?string $iconId = null, ?string $rightText
$htmlCode .= $text;
if(!is_null($rightText)) {
$htmlCode .= '<span class="ml-auto ' . ($chungusMode ? "t-size-12 mr-xs" : "t-size-10 t-muted") . '">' . $rightText . '</span>';
$htmlCode .= '<span class="ml-auto mobile-hide ' . ($chungusMode ? "t-size-12 mr-xs" : "t-size-10 t-muted") . '">' . $rightText . '</span>';
}
$htmlCode .= '</h' . $hLevel . '></div>';