8 isset(
$user) or require
$_SERVER[
'DOCUMENT_ROOT'] .
'/page/404.php';
10 if (Wrong\Start\Env::$e->HTTP_HOST !=
'wrong-mvc.com') {
11 exit(
'<script>location.href="//wrong-mvc.com/comments";</script>');
15 <div
class=
"modal fade" id=
"<?= $basename ?>" tabindex=
"-1" data-backdrop=
"static" data-keyboard=
"false">
16 <div
class=
"modal-dialog modal-xl modal-dialog-centered modal-dialog-scrollable w-100 mw-100 h-100 p-0 m-0 position-fixed" style=
"max-width: 100%;max-height:100%;" role=
"document">
17 <div
class=
"modal-content w-100 h-100 rounded-0 border-0">
18 <div
class=
"border-0 modal-header position-absolute rounded-0 w-100 pb-0" style=
"z-index:1;">
19 <button title=
"Закрыть" type=
"button" class=
"close" data-dismiss=
"modal" aria-label=
"Close">
20 <span aria-hidden=
"true">×</span>
23 <div
class=
"modal-body p-0 <?= $user->id ? 'pt-5' : '' ?>"></div>
27 $(
'#<?= $basename ?> .modal-body').load(
'/comments #content', () => {
28 AnyComment = window.AnyComment || [];
29 AnyComment.Comments = [];
30 AnyComment.Comments.push({
31 "root":
"anycomment-app",
36 "add_comment":
"Добавить сообщение..."
39 "title":
"Отзывы о системе Wrong MVC",
40 "author":
"Wrong MVC",
41 "page_url":
"https://wrong-mvc.com/comments"
43 var s = document.createElement(
"script");
44 s.type =
"text/javascript";
46 s.src =
"https://widget.anycomment.io/comment/embed.js";
47 var sa = document.getElementsByTagName(
"script")[0];
48 sa.parentNode.insertBefore(s, s.nextSibling);
50 <?php
if (
$user->access()->action(45)) : ?>
55 $(
'#new-comments').
remove();
60 $(document).off(
'click',
'#comments button[class^="Button__StyledButton"]');
61 $(document).on(
'click',
'#comments button[class^="Button__StyledButton"]',
function(e) {
62 window.localStorage.commented = 1;
65 $(
'.toast').toast(
'hide');
66 $(
'#comments').on(
'hidden.bs.modal', () => {
67 if (!window.localStorage.commented) {
69 [
'Постой!',
'Погоди!',
'Не уходи!',
'Куда же ты?'][Math.floor(Math.random() * 4)],
70 [
'Может',
'Давай',
'Возможно'][Math.floor(Math.random() * 3)],
71 [
'вернешься',
'передумаешь',
'надумаешь'][Math.floor(Math.random() * 3)],
73 [
'скажешь',
'напишешь',
'выскажешь',
'расскажешь'][Math.floor(Math.random() * 4)],
74 [
'чего',
'что'][Math.floor(Math.random() * 2)],
75 [
'нить?',
'нибудь?',
'либо?'][Math.floor(Math.random() * 3)],
76 [
'А?',
'Пожалуйста!',
'Прошу тебя!',
'Вернись пожалуйста!'][Math.floor(Math.random() * 4)]
81 typeof ym ===
'function' && ym(92932927,
'reachGoal',
'comments');
setcookie('FROM_UID', $uid, [ 'expires'=> time()+31536000, 'path'=> '/', 'domain'=> $_SERVER['HTTP_HOST'], 'secure'=> Wrong\Start\Env::$e->IS_SECURE, 'httponly'=> false, 'samesite'=> Wrong\Start\Env::$e->IS_SECURE ? 'None' :'Lax']) or setcookie('FROM_UID' $_SERVER['HTTP_HOST']
if(($dbh=Connect::getInstance(true) ->dbh) && $dbh->query("SHOW TABLES") ->fetchAll() && $dbh->query("SELECT COUNT(*) FROM `users`") ->fetchColumn()) if(!empty($_POST)) exit