diff --git a/app/Controllers/Api/Register.php b/app/Controllers/Api/Register.php index 95afa22..1eb0bf0 100644 --- a/app/Controllers/Api/Register.php +++ b/app/Controllers/Api/Register.php @@ -98,7 +98,7 @@ class Register ) ); - DB::query('INSERT INTO users VALUES (\'0\', :username, :email, :password, :photourl, 5, :online, :content)', array(':username' => ltrim($username), ':password' => password_hash(ltrim($password), PASSWORD_BCRYPT), ':photourl'=>'/static/img/avatar.png', ':email' => $email, ':content' => $content, ':online'=>time())); + DB::query('INSERT INTO users VALUES (\'0\', :username, :email, :password, :photourl, 5, 0, :online, :content)', array(':username' => ltrim($username), ':password' => password_hash(ltrim($password), PASSWORD_BCRYPT), ':photourl'=>'/static/img/avatar.png', ':email' => $email, ':content' => $content, ':online'=>time())); $cstrong = True; $token = GenerateRandomStr::gen_uuid(); $user_id = DB::query('SELECT id FROM users WHERE username=:username', array(':username' => $username))[0]['id']; diff --git a/app/Controllers/MainController.php b/app/Controllers/MainController.php index 361a3d5..4e955d5 100644 --- a/app/Controllers/MainController.php +++ b/app/Controllers/MainController.php @@ -16,6 +16,11 @@ class MainController { Page::set('Main'); + } + public static function about() + { + Page::set('About'); + } public static function logout() diff --git a/app/Core/Routes.php b/app/Core/Routes.php index dfdffb7..29c9286 100644 --- a/app/Core/Routes.php +++ b/app/Core/Routes.php @@ -19,6 +19,7 @@ class Routes Router::get('/author/$id', 'ProfileController@i'); Router::post('/api/login', 'ApiController@login'); Router::post('/api/register', 'ApiController@register'); + Router::get('/about', 'MainController@about'); @@ -34,6 +35,7 @@ class Routes Router::post('/api/photo/getcomments/$id', 'ApiController@photocommentload'); Router::get('/api/photo/vote', 'ApiController@photovote'); Router::get('/api/photo/comment/rate', 'ApiController@photocommentvote'); + Router::get('/logout', 'MainController@logout'); Router::get('/404', 'ExceptionRegister@notfound'); } else { Router::redirect('/login?return='.$_SERVER['HTTP_REFERER']); diff --git a/index.php b/index.php index f05e0b7..d9f7cb5 100644 --- a/index.php +++ b/index.php @@ -26,11 +26,10 @@ class App Page::set('Errors/ServerDown'); } } catch (PDOException $ex) { - echo $ex; - Page::set('Errors/DB_42000'); + echo '
Произошла ошибка MySQL'.nl2br($ex).'
'; + } catch (Exception $ex) { - echo $ex; - Page::set('Errors/DB_42000'); + echo '
Произошла скриптовая ошибка PHP'.nl2br($ex).'
'; } } else { Page::set('Errors/Problems'); diff --git a/static/img/220.ico b/static/img/220.ico new file mode 100644 index 0000000..af5f2ca Binary files /dev/null and b/static/img/220.ico differ diff --git a/static/img/go-home.png b/static/img/go-home.png new file mode 100644 index 0000000..e3dbcb2 Binary files /dev/null and b/static/img/go-home.png differ diff --git a/views/pages/About.php b/views/pages/About.php new file mode 100644 index 0000000..180cced --- /dev/null +++ b/views/pages/About.php @@ -0,0 +1,56 @@ + + + + + + + + + + + + +
+ + + + + + + + +
+

О сервере

+

+ +
+

Общая информация

+
    +
  • Зарегистрировано пользователей:
  • +
  • Опубликовано фотографий:
  • +
+
+
+

Администраторы

+ +
+
+ +
+ + + + + \ No newline at end of file diff --git a/views/pages/Errors/DB_42000.php b/views/pages/Errors/DB_42000.php index 1335799..62751b3 100644 --- a/views/pages/Errors/DB_42000.php +++ b/views/pages/Errors/DB_42000.php @@ -1,44 +1,3 @@ - - - - Resource Busy - - -
- Database Error -

Service Unavailable

- Server can't proccess your request at this moment. Please try again later. Sorry for that. -
- - - - - diff --git a/views/pages/Photo.php b/views/pages/Photo.php index 7f03856..e93dd1c 100644 --- a/views/pages/Photo.php +++ b/views/pages/Photo.php @@ -293,7 +293,7 @@ marker.bindPopup("Выбранная точка").openPopup(); - +

Изображение не найдено

@@ -303,9 +303,11 @@ marker.bindPopup("Выбранная точка").openPopup();
+ +