FIX: Микроразметка

+ исправлена ошибка при редактирование участника персоналом
This commit is contained in:
Evg 2022-09-03 22:04:09 +03:00
parent 11ec68882c
commit 22707c38b9
6 changed files with 25 additions and 18 deletions

View file

@ -93,7 +93,8 @@ class PostController extends Controller
}
$m = [
'date' => $content['post_date'],
'published_time' => $content['post_date'],
'type' => 'article',
'og' => true,
'imgurl' => $content_img,
'url' => url('post', ['id' => $content['post_id'], 'slug' => $content['post_slug']]),

View file

@ -20,9 +20,14 @@ class Meta
$output .= '<meta name="description" content="' . $description . '">';
if (!empty($m['date'])) {
$output .= '<meta property="og:type" content="article" />'
. '<meta property="article:published_time" content="' . $m['date'] . '" />';
if (!empty($m['published_time'])) {
$output .= '<meta property="article:published_time" content="' . $m['published_time'] . '" />';
}
if (!empty($m['type'])) {
$output .= '<meta property="og:type" content="' . $m['type'] . '" />';
} else {
$output .= '<meta property="og:type" content="website" />';
}
if (!empty($m)) {

View file

@ -6,7 +6,8 @@ use Hleb\Constructor\Handlers\Request;
use App\Controllers\Controller;
use App\Models\User\{SettingModel, BadgeModel};
use Modules\Admin\App\Models\{BanUserModel, UserModel};
use Validation, Meta, Html;
use App\Validate\Validator;
use Meta, Html;
class Users extends Controller
{
@ -116,10 +117,10 @@ class Users extends Controller
$redirect = url('admin.user.edit', ['id' => $user['id']]);
Validation::length($data['login'], 3, 11, 'login', $redirect);
Validator::length($data['login'], 3, 11, 'login', $redirect);
if ($data['email']) {
Validation::email(Request::getPost('email'), $redirect);
Validator::email(Request::getPost('email'), $redirect);
}
SettingModel::edit(

View file

@ -2,7 +2,7 @@
<?php foreach ($data['items'] as $item) : ?>
<?php if ($item['item_published'] == 1) : ?>
<li itemscope itemprop="itemListElement" itemtype="https://schema.org/Organization">
<li itemscope itemprop="itemListElement" itemtype="https://schema.org/WebSite">
<a target="_blank" class="item_cleek" rel="nofollow noreferrer ugc" data-id="<?= $item['item_id']; ?>" href="<?= $item['item_url']; ?>">
<h3 class="title" itemprop="name"><?= $item['item_title']; ?>
<?php $date = date_diff(new DateTime(), new DateTime($item['item_date']))->days; ?>

View file

@ -1,7 +1,7 @@
<?php $item = $data['item']; ?>
<div id="contentWrapper">
<main>
<h1 class="m0"><?= $item['item_title']; ?>
<main itemscope itemtype="https://schema.org/WebSite">
<h1 itemprop="name" class="m0"><?= $item['item_title']; ?>
<?php if (UserData::checkAdmin()) : ?>
<a class="text-sm ml5" href="<?= url('content.edit', ['type' => 'item', 'id' => $item['item_id']]); ?>">
<svg class="icons">

View file

@ -1,6 +1,6 @@
</div>
<footer class="footer box-shadow-top" itemtype="http://schema.org/WPFooter">
<footer class="footer box-shadow-top" itemscope itemtype="http://schema.org/WPFooter">
<?php $type = $data['type'] ?? false; ?>
<?php if (UserData::getUserScroll() == false || $type != 'main') : ?>
<div class="wrap">
@ -21,18 +21,18 @@
</div>
<div class="flex right mb5">
<ul class="mb-none">
<li><a href="<?= url('blogs.all'); ?>"><?= __('app.blogs'); ?></a></li>
<li><a href="<?= url('topics.all'); ?>"><?= __('app.topics'); ?></a></li>
<li><a href="<?= url('web'); ?>"><?= __('app.catalog'); ?></a></li>
<li><a itemprop="url" href="<?= url('blogs.all'); ?>"><?= __('app.blogs'); ?></a></li>
<li><a itemprop="url" href="<?= url('topics.all'); ?>"><?= __('app.topics'); ?></a></li>
<li><a itemprop="url" href="<?= url('web'); ?>"><?= __('app.catalog'); ?></a></li>
</ul>
<ul class="mb-none">
<li><a href="<?= url('users.all'); ?>"><?= __('app.users'); ?></a></li>
<li><a href="<?= url('answers'); ?>"><?= __('app.answers'); ?></a></li>
<li><a href="<?= url('comments'); ?>"><?= __('app.comments'); ?></a></li>
<li><a itemprop="url" href="<?= url('users.all'); ?>"><?= __('app.users'); ?></a></li>
<li><a itemprop="url" href="<?= url('answers'); ?>"><?= __('app.answers'); ?></a></li>
<li><a itemprop="url" href="<?= url('comments'); ?>"><?= __('app.comments'); ?></a></li>
</ul>
<ul>
<?php foreach (config('facets.page') as $page) : ?>
<li><a href="<?= url('facet.article', ['facet_slug' => 'info', 'slug' => $page]); ?>"><?= __('app.' . $page); ?></a></li>
<li><a itemprop="url" href="<?= url('facet.article', ['facet_slug' => 'info', 'slug' => $page]); ?>"><?= __('app.' . $page); ?></a></li>
<?php endforeach; ?>
</ul>
</div>