FIX: Доступ к Посту по ссылке
См. https://libarea.ru/post/1541/add-dostup-po-ssylke
This commit is contained in:
parent
b94879f6bb
commit
8844eca665
|
@ -44,4 +44,20 @@ class CommentController extends Controller
|
|||
]
|
||||
);
|
||||
}
|
||||
|
||||
// On the home page
|
||||
// На главной странице
|
||||
public function lastComment()
|
||||
{
|
||||
$comments = CommentModel::getComments(1, 5, 'all');
|
||||
|
||||
$result = [];
|
||||
foreach ($comments as $ind => $row) {
|
||||
$row['content'] = fragment($row['comment_content'], 98);
|
||||
$row['date'] = Html::langDate($row['comment_date']);
|
||||
$result[$ind] = $row;
|
||||
}
|
||||
|
||||
return json_encode($result, JSON_PRETTY_PRINT);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,6 +11,11 @@ use Hleb\Constructor\Handlers\Request; ?>
|
|||
<?php endif; ?>
|
||||
|
||||
<?php $post_url = post_slug($post['post_id'], $post['post_slug']); ?>
|
||||
|
||||
<?php if ($post['post_hidden'] == 1) : ?>
|
||||
<?php if ($post['post_user_id'] != UserData::getUserId() && !UserData::checkAdmin()) continue; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="box shadow-bottom article_<?= $post['post_id']; ?>">
|
||||
|
||||
<div class="flex justify-between">
|
||||
|
|
Loading…
Reference in a new issue