Some fixes & add metakeys!

This commit is contained in:
themohooks 2024-07-07 08:05:44 +03:00
parent e683084adb
commit 262a6ef34f
8 changed files with 29 additions and 3 deletions

View file

View file

@ -15,6 +15,7 @@ class MainController
public static function i() public static function i()
{ {
Page::set('Main'); Page::set('Main');
} }
public static function logout() public static function logout()

View file

@ -45,7 +45,6 @@ class Router
} }
public static function route($route, $path_to_include) public static function route($route, $path_to_include)
{ {
// Определение корневой директории
$root = $_SERVER['DOCUMENT_ROOT']; $root = $_SERVER['DOCUMENT_ROOT'];
// Обработка случая, когда маршрут - 404 // Обработка случая, когда маршрут - 404

View file

@ -2,6 +2,8 @@ ngallery:
root: root:
title: "NativeGallery" title: "NativeGallery"
logo: "/static/img/logosmall.png" logo: "/static/img/logosmall.png"
description: ""
keywords: ""
maintenance: false maintenance: false
debug: true debug: true
botkey: '' botkey: ''

View file

@ -68,7 +68,7 @@ if (NGALLERY['root']['title'] != null) {
</div> </div>
</li> </li>
<?php <?php
if (Auth::userid() < 0) { ?> if (Auth::userid() <= 0) { ?>
<li class="mm-pad-right"><a href="/login" class="mm-item"><span class="mm-icon"><i class="fas fa-xs fa-address-card"></i></span><span class="mm-label">Войти</span></a></li> <li class="mm-pad-right"><a href="/login" class="mm-item"><span class="mm-icon"><i class="fas fa-xs fa-address-card"></i></span><span class="mm-label">Войти</span></a></li>
<li><a href="/register" class="mm-item"><span class="mm-icon"><i class="fas fa-xs fa-user"></i></span><span class="mm-label">Регистрация</span></a></li> <li><a href="/register" class="mm-item"><span class="mm-icon"><i class="fas fa-xs fa-user"></i></span><span class="mm-label">Регистрация</span></a></li>
<?php } else { ?> <?php } else { ?>

View file

@ -1,3 +1,9 @@
<?php
use App\Services\{Router, Auth};
if (Auth::userid() > 0) {
Router::redirect('/');
}
?>
<!DOCTYPE html> <!DOCTYPE html>
<html lang="ru"> <html lang="ru">

View file

@ -14,7 +14,12 @@ $photouser = new \App\Models\User($photo->i('user_id'));
<head> <head>
<?php include($_SERVER['DOCUMENT_ROOT'] . '/views/components/LoadHead.php'); ?> <?php include($_SERVER['DOCUMENT_ROOT'] . '/views/components/LoadHead.php'); ?>
<meta http-equiv="content-type" content="text/html;charset=UTF-8">
<meta name="description" content="<?=NGALLERY['root']['description']?>">
<meta name="keywords" content="<?=NGALLERY['root']['keywords']?>">
<meta property="og:title" content="<?=$photo->i('title')?> — Фото">
<link rel="alternate" hreflang="x-default" href="<?=$_SERVER['REQUEST_URI']?>">
<meta property="og:image" content="<?=$photo->i('photourl')?>">
</head> </head>

View file

@ -1,3 +1,9 @@
<?php
use App\Services\{Router, Auth};
if (Auth::userid() > 0) {
Router::redirect('/');
}
?>
<html lang="ru"> <html lang="ru">
@ -14,6 +20,8 @@
<?php include($_SERVER['DOCUMENT_ROOT'] . '/views/components/Navbar.php'); ?> <?php include($_SERVER['DOCUMENT_ROOT'] . '/views/components/Navbar.php'); ?>
<tr> <tr>
<td class="main"> <td class="main">
<?php
if (NGALLERY['root']['registration']['access']['public'] === true) { ?>
<center> <center>
<h1>Регистрация</h1> <h1>Регистрация</h1>
<div class="mf-center-block"> <div class="mf-center-block">
@ -80,6 +88,11 @@
}); });
</script> </script>
</center> </center>
<?php } else { ?>
<center>
<h1>К сожалению, регистрация на сервере <?=$title?> запрещена.</h1>
</center?
<?php } ?>
</td> </td>
</tr> </tr>
<tr> <tr>