2024-07-04 12:08:17 +03:00
|
|
|
<?php
|
|
|
|
namespace App\Controllers;
|
|
|
|
|
|
|
|
use \App\Services\{Router, Auth, DB, Json};
|
|
|
|
use \App\Controllers\ExceptionRegister;
|
|
|
|
use \App\Core\Page;
|
|
|
|
|
|
|
|
class MainController
|
|
|
|
{
|
2024-07-05 07:26:39 +03:00
|
|
|
public static function t()
|
2024-07-04 12:08:17 +03:00
|
|
|
{
|
2024-07-05 07:26:39 +03:00
|
|
|
Page::set('t');
|
2024-07-04 12:08:17 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
public static function i()
|
|
|
|
{
|
|
|
|
Page::set('Main');
|
2024-07-07 08:05:44 +03:00
|
|
|
|
2024-07-08 21:31:59 +03:00
|
|
|
}
|
|
|
|
public static function about()
|
|
|
|
{
|
|
|
|
Page::set('About');
|
|
|
|
|
2024-07-18 14:24:19 +03:00
|
|
|
}
|
|
|
|
public static function rules()
|
|
|
|
{
|
2024-07-19 11:11:06 +03:00
|
|
|
$_GLOBAL['rules'] = '/config/rules.html';
|
|
|
|
$_GLOBAL['title'] = 'Правила сайта';
|
|
|
|
Page::set('Rules');
|
|
|
|
}
|
|
|
|
public static function publicationRules()
|
|
|
|
{
|
|
|
|
$_GLOBAL['rules'] = '/config/publicationRules.html';
|
|
|
|
$_GLOBAL['title'] = 'Правила отбора фотографий';
|
|
|
|
Page::set('Rules');
|
|
|
|
}
|
|
|
|
public static function photoRules()
|
|
|
|
{
|
|
|
|
$_GLOBAL['rules'] = '/config/photoRules.html';
|
|
|
|
$_GLOBAL['title'] = 'Правила подписи фотографий';
|
|
|
|
Page::set('Rules');
|
|
|
|
}
|
|
|
|
public static function videoRules()
|
|
|
|
{
|
|
|
|
$_GLOBAL['rules'] = '/config/videoRules.html';
|
|
|
|
$_GLOBAL['title'] = 'Правила видеотеки';
|
2024-07-18 14:24:19 +03:00
|
|
|
Page::set('Rules');
|
2024-07-18 21:05:00 +03:00
|
|
|
}
|
|
|
|
public static function update()
|
|
|
|
{
|
|
|
|
Page::set('Update');
|
|
|
|
|
2024-07-19 01:13:24 +03:00
|
|
|
}
|
|
|
|
public static function top30()
|
|
|
|
{
|
|
|
|
Page::set('Top30');
|
|
|
|
|
2024-07-19 01:53:43 +03:00
|
|
|
}
|
|
|
|
public static function favauthors()
|
|
|
|
{
|
|
|
|
Page::set('FavAuthors');
|
|
|
|
|
2024-07-04 12:08:17 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
public static function logout()
|
|
|
|
{
|
2024-07-10 12:46:47 +03:00
|
|
|
DB::query('DELETE FROM login_tokens WHERE token=:userid', array(':userid'=>$_COOKIE['NGALLERYSESS']));
|
2024-07-04 12:08:17 +03:00
|
|
|
setcookie('NGALLERYSERVICE', '', 1);
|
|
|
|
setcookie('NGALLERYSESS', '', 1);
|
|
|
|
setcookie('NGALLERYSESS_', '', 1);
|
|
|
|
setcookie('NGALLERYID', '', 1);
|
|
|
|
header('Location: /');
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|