2021-08-28 23:05:54 +02:00
|
|
|
|
<?php if (!empty($data['answers'])) { ?>
|
2021-08-25 17:20:18 +02:00
|
|
|
|
<div class="white-box p15">
|
|
|
|
|
<h2 class="lowercase m0 size-21">
|
2021-08-30 08:23:31 +02:00
|
|
|
|
<?= $data['post']['post_answers_count'] + $data['post']['post_comments_count'] ?>
|
2021-08-28 23:05:54 +02:00
|
|
|
|
<?= $data['post']['num_comments'] ?>
|
2021-08-25 17:20:18 +02:00
|
|
|
|
</h2>
|
2021-08-26 22:36:37 +02:00
|
|
|
|
<div class="border-bottom mt5 mb10"></div>
|
2021-08-25 17:20:18 +02:00
|
|
|
|
<?php $n = 0;
|
2021-08-28 23:05:54 +02:00
|
|
|
|
foreach ($data['answers'] as $answer) {
|
2021-08-25 17:20:18 +02:00
|
|
|
|
$n++; ?>
|
|
|
|
|
|
|
|
|
|
<div class="block-answer">
|
|
|
|
|
<?php if ($answer['answer_is_deleted'] == 0) { ?>
|
|
|
|
|
<?php if ($n != 1) { ?><div class="line mt10 mb10"></div><?php } ?>
|
|
|
|
|
<ol class="p0 m0 list-none">
|
|
|
|
|
<li class="answers_subtree" id="answer_<?= $answer['answer_id']; ?>">
|
|
|
|
|
<div class="container">
|
|
|
|
|
<div class="answ-telo">
|
|
|
|
|
<div class="flex size-13">
|
|
|
|
|
<a class="gray-light" href="/u/<?= $answer['user_login']; ?>">
|
|
|
|
|
<?= user_avatar_img($answer['user_avatar'], 'small', $answer['user_login'], 'ava'); ?>
|
|
|
|
|
<span class="mr5 ml5">
|
|
|
|
|
<?= $answer['user_login']; ?>
|
|
|
|
|
</span>
|
|
|
|
|
</a>
|
|
|
|
|
<span class="mr5 ml5 gray-light lowercase">
|
|
|
|
|
<?= $answer['answer_date']; ?>
|
|
|
|
|
</span>
|
|
|
|
|
<?php if (empty($answer['edit'])) { ?>
|
2021-08-31 16:31:44 +02:00
|
|
|
|
<span class="mr5 ml10 gray-light">
|
2021-08-25 17:20:18 +02:00
|
|
|
|
(<?= lang('ed'); ?>.)
|
|
|
|
|
</span>
|
|
|
|
|
<?php } ?>
|
2021-08-28 23:05:54 +02:00
|
|
|
|
<?php if ($data['post']['post_user_id'] == $answer['answer_user_id']) { ?>
|
2021-08-31 16:31:44 +02:00
|
|
|
|
<span class="red mr5 ml0">↯</span>
|
2021-08-01 20:43:50 +02:00
|
|
|
|
<?php } ?>
|
2021-08-31 16:31:44 +02:00
|
|
|
|
<a rel="nofollow" class="gray-light mr5 ml10" href="<?= post_url($data['post']); ?>#answer_<?= $answer['answer_id']; ?>">#</a>
|
|
|
|
|
<?= content_ip($answer['answer_ip'], $uid); ?>
|
2021-08-25 17:20:18 +02:00
|
|
|
|
</div>
|
2021-08-28 23:05:54 +02:00
|
|
|
|
<div class="mt0 mr0 mb5 ml0 size-15">
|
2021-08-25 17:20:18 +02:00
|
|
|
|
<?= $answer['answer_content'] ?>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="flex size-13">
|
|
|
|
|
<?= votes($uid['user_id'], $answer, 'answer'); ?>
|
|
|
|
|
|
2021-08-28 23:05:54 +02:00
|
|
|
|
<?php if ($data['post']['post_closed'] == 0) { ?>
|
|
|
|
|
<?php if ($data['post']['post_is_deleted'] == 0 || $uid['user_trust_level'] == 5) { ?>
|
2021-08-31 16:31:44 +02:00
|
|
|
|
<a data-post_id="<?= $data['post']['post_id']; ?>" data-answer_id="<?= $answer['answer_id']; ?>" class="add-comment gray mr5 ml5"><?= lang('Reply'); ?></a>
|
2021-08-25 17:20:18 +02:00
|
|
|
|
<?php } ?>
|
|
|
|
|
<?php } ?>
|
|
|
|
|
|
|
|
|
|
<?php if ($uid['user_id'] == $answer['answer_user_id'] || $uid['user_trust_level'] == 5) { ?>
|
|
|
|
|
<?php if ($answer['answer_after'] == 0 || $uid['user_trust_level'] == 5) { ?>
|
2021-08-31 16:31:44 +02:00
|
|
|
|
<a class="editansw gray mr10 ml10" href="/answer/edit/<?= $answer['answer_id']; ?>"> <?= lang('Edit'); ?>
|
|
|
|
|
</a>
|
2021-08-25 17:20:18 +02:00
|
|
|
|
<?php } ?>
|
|
|
|
|
<?php } ?>
|
|
|
|
|
|
|
|
|
|
<?php if ($uid['user_id']) { ?>
|
|
|
|
|
<a class="add-favorite mr5 ml5 gray" data-id="<?= $answer['answer_id']; ?>" data-type="answer">
|
|
|
|
|
<?php if ($answer['favorite_user_id']) { ?>
|
|
|
|
|
<?= lang('remove-favorites'); ?>
|
|
|
|
|
<?php } else { ?>
|
|
|
|
|
<?= lang('add-favorites'); ?>
|
|
|
|
|
<?php } ?>
|
|
|
|
|
</a>
|
|
|
|
|
<?php } ?>
|
|
|
|
|
|
|
|
|
|
<?php if ($uid['user_trust_level'] == 5) { ?>
|
2021-08-31 16:31:44 +02:00
|
|
|
|
<a data-type="answer" data-id="<?= $answer['answer_id']; ?>" class="type-action gray ml10">
|
|
|
|
|
<?= lang('Remove'); ?>
|
|
|
|
|
</a>
|
2021-08-25 17:20:18 +02:00
|
|
|
|
<?php } ?>
|
|
|
|
|
<?php if ($uid['user_id'] != $answer['answer_user_id'] && $uid['user_trust_level'] > 0) { ?>
|
2021-08-31 16:31:44 +02:00
|
|
|
|
<a data-post_id="<?= $data['post']['post_id']; ?>" data-type="answer" data-content_id="<?= $answer['answer_id']; ?>" class="msg-flag gray ml15">
|
|
|
|
|
<?= lang('Report'); ?>
|
|
|
|
|
</a>
|
2021-08-25 17:20:18 +02:00
|
|
|
|
<?php } ?>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div id="answer_addentry<?= $answer['answer_id']; ?>" class="reply"></div>
|
|
|
|
|
|
|
|
|
|
</li>
|
|
|
|
|
</ol>
|
|
|
|
|
|
|
|
|
|
<?php } else { ?>
|
|
|
|
|
|
|
|
|
|
<?php if ($uid['user_trust_level'] == 5) { ?>
|
2021-09-03 13:56:40 +02:00
|
|
|
|
<ol class="bg-red-300 size-13 pr5 list-none">
|
2021-08-25 17:20:18 +02:00
|
|
|
|
<li class="comments_subtree" id="comment_<?= $answer['answer_id']; ?>">
|
|
|
|
|
<span class="comm-deletes nick">
|
|
|
|
|
<?= $answer['answer_content']; ?>
|
|
|
|
|
<?= lang('Answer'); ?> — <?= $answer['user_login']; ?>
|
|
|
|
|
<a data-type="answer" data-id="<?= $answer['answer_id']; ?>" class="type-action right">
|
|
|
|
|
<span><?= lang('Recover'); ?></span>
|
|
|
|
|
</a>
|
|
|
|
|
</span>
|
|
|
|
|
</li>
|
|
|
|
|
</ol>
|
|
|
|
|
<?php } else { ?>
|
|
|
|
|
<div class="gray m5 p5 size-13">
|
|
|
|
|
<span class="answ-deletes">~ <?= lang('Comment deleted'); ?></span>
|
2021-08-01 20:43:50 +02:00
|
|
|
|
</div>
|
2021-08-25 17:20:18 +02:00
|
|
|
|
<?php } ?>
|
2021-08-01 20:43:50 +02:00
|
|
|
|
|
2021-08-25 17:20:18 +02:00
|
|
|
|
<?php } ?>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<?php foreach ($answer['comm'] as $comment) { ?>
|
|
|
|
|
<?php if ($comment['comment_is_deleted'] == 0) { ?>
|
|
|
|
|
<ol class="pl15 list-none<?php if ($comment['comment_comment_id'] > 0) { ?> ml30<?php } ?>">
|
|
|
|
|
<li class="comment_subtree" id="comment_<?= $comment['comment_id']; ?>">
|
|
|
|
|
<div class="p5">
|
|
|
|
|
<div class="max-width size-15">
|
|
|
|
|
<div class="size-13 flex">
|
|
|
|
|
<a class="gray-light" href="/u/<?= $comment['user_login']; ?>">
|
|
|
|
|
<?= user_avatar_img($comment['user_avatar'], 'small', $comment['user_login'], 'ava'); ?>
|
|
|
|
|
<span class="mr5 ml5">
|
|
|
|
|
<?= $comment['user_login']; ?>
|
|
|
|
|
</span>
|
|
|
|
|
</a>
|
|
|
|
|
<span class="mr5 ml5 gray-light lowercase">
|
|
|
|
|
<?= lang_date($comment['comment_date']); ?>
|
|
|
|
|
</span>
|
2021-08-28 23:05:54 +02:00
|
|
|
|
<?php if ($data['post']['post_user_id'] == $comment['comment_user_id']) { ?>
|
2021-08-31 16:31:44 +02:00
|
|
|
|
<span class="red mr10 ml10">↯</span>
|
2021-08-01 20:43:50 +02:00
|
|
|
|
<?php } ?>
|
2021-08-25 17:20:18 +02:00
|
|
|
|
<?php if ($comment['comment_comment_id'] > 0) { ?>
|
2021-08-31 16:31:44 +02:00
|
|
|
|
<a class="gray-light mr10 ml10" rel="nofollow" href="<?= post_url($data['post']); ?>#comment_<?= $comment['comment_comment_id']; ?>">↑</a>
|
2021-08-25 17:20:18 +02:00
|
|
|
|
<?php } else { ?>
|
2021-08-31 16:31:44 +02:00
|
|
|
|
<a class="gray-light mr10 ml10" rel="nofollow" href="<?= post_url($data['post']); ?>#answer_<?= $comment['comment_answer_id']; ?>">↑</a>
|
2021-08-25 17:20:18 +02:00
|
|
|
|
<?php } ?>
|
2021-08-31 16:31:44 +02:00
|
|
|
|
<a class="gray-light mr5 ml10" rel="nofollow" href="<?= post_url($data['post']); ?>#comment_<?= $comment['comment_id']; ?>">#</a>
|
|
|
|
|
<?= content_ip($comment['comment_ip'], $uid); ?>
|
2021-08-25 17:20:18 +02:00
|
|
|
|
</div>
|
|
|
|
|
<div class="comm-telo-body size-15 mt5 mb5">
|
|
|
|
|
<?= lori\Content::text($comment['comment_content'], 'line'); ?>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="size-13 flex">
|
|
|
|
|
<?= votes($uid['user_id'], $comment, 'comment'); ?>
|
|
|
|
|
|
2021-08-28 23:05:54 +02:00
|
|
|
|
<?php if ($data['post']['post_closed'] == 0) { ?>
|
|
|
|
|
<?php if ($data['post']['post_is_deleted'] == 0 || $uid['user_trust_level'] == 5) { ?>
|
2021-08-31 16:31:44 +02:00
|
|
|
|
<a data-post_id="<?= $data['post']['post_id']; ?>" data-answer_id="<?= $answer['answer_id']; ?>" data-comment_id="<?= $comment['comment_id']; ?>" class="add-comment-re gray mr5 ml5">
|
|
|
|
|
<?= lang('Reply'); ?>
|
|
|
|
|
</a>
|
2021-08-25 17:20:18 +02:00
|
|
|
|
<?php } ?>
|
|
|
|
|
<?php } ?>
|
2021-09-01 21:09:47 +02:00
|
|
|
|
|
2021-08-25 17:20:18 +02:00
|
|
|
|
<?php if (accessСheck($comment, 'comment', $uid, 1, 30) === true) { ?>
|
2021-09-01 21:09:47 +02:00
|
|
|
|
<a data-post_id="<?= $data['post']['post_id']; ?>" data-comment_id="<?= $comment['comment_id']; ?>" class="editcomm gray mr10 ml10">
|
|
|
|
|
<?= lang('Edit'); ?>
|
|
|
|
|
</a>
|
|
|
|
|
<a data-type="comment" data-id="<?= $comment['comment_id']; ?>" class="type-action gray mr5 ml5">
|
|
|
|
|
<?= lang('Remove'); ?>
|
|
|
|
|
</a>
|
2021-08-25 17:20:18 +02:00
|
|
|
|
<?php } ?>
|
|
|
|
|
<?php if ($uid['user_id'] != $comment['comment_user_id'] && $uid['user_trust_level'] > 0) { ?>
|
2021-09-01 21:09:47 +02:00
|
|
|
|
<a data-post_id="<?= $data['post']['post_id']; ?>" data-type="comment" data-content_id="<?= $comment['comment_id']; ?>" class="msg-flag gray ml15">
|
|
|
|
|
<?= lang('Report'); ?>
|
|
|
|
|
</a>
|
2021-08-25 17:20:18 +02:00
|
|
|
|
<?php } ?>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div id="comment_addentry<?= $comment['comment_id']; ?>" class="reply"></div>
|
|
|
|
|
</li>
|
|
|
|
|
</ol>
|
|
|
|
|
|
|
|
|
|
<?php } else { ?>
|
|
|
|
|
<?php if (accessСheck($comment, 'comment', $uid, 1, 30) === true) { ?>
|
2021-09-03 13:56:40 +02:00
|
|
|
|
<ol class="bg-red-300 size-13 list-none max-width size-15<?php if ($comment['comment_comment_id'] > 0) { ?> ml30<?php } ?>">
|
2021-08-25 17:20:18 +02:00
|
|
|
|
<li class="pr5" id="comment_<?= $comment['comment_id']; ?>">
|
|
|
|
|
<span class="comm-deletes gray">
|
|
|
|
|
<?= lori\Content::text($comment['comment_content'], 'line'); ?>
|
|
|
|
|
— <?= $comment['user_login']; ?>
|
|
|
|
|
<a data-type="comment" data-id="<?= $comment['comment_id']; ?>" class="type-action right size-13">
|
|
|
|
|
<?= lang('Recover'); ?>
|
|
|
|
|
</a>
|
|
|
|
|
</span>
|
|
|
|
|
</li>
|
|
|
|
|
</ol>
|
|
|
|
|
<?php } ?>
|
2021-05-04 23:07:59 +02:00
|
|
|
|
<?php } ?>
|
2021-08-25 17:20:18 +02:00
|
|
|
|
<?php } ?>
|
|
|
|
|
|
2021-05-04 23:07:59 +02:00
|
|
|
|
<?php } ?>
|
2021-08-25 17:20:18 +02:00
|
|
|
|
</div>
|
|
|
|
|
<?php } else { ?>
|
2021-08-28 23:05:54 +02:00
|
|
|
|
<?php if ($data['post']['post_closed'] != 1) { ?>
|
2021-08-25 17:20:18 +02:00
|
|
|
|
<?= no_content('There are no comments'); ?>
|
|
|
|
|
<?php } ?>
|
2021-05-04 23:07:59 +02:00
|
|
|
|
<?php } ?>
|