DEV: Показ удаленных пространств в панели администратора

This commit is contained in:
Evg 2021-07-30 13:37:17 +03:00
parent acf739aaa8
commit 10c18a00ec
29 changed files with 288 additions and 192 deletions

View file

@ -36,7 +36,8 @@ class AuthController extends \MainController
// Проверяем код
$invate = UserModel::InvitationAvailable($code);
if (!$invate) {
if (!$invate)
{
Base::addMsg(lang('The code is incorrect'), 'error');
redirect('/');
}
@ -276,8 +277,8 @@ class AuthController extends \MainController
if (empty($result)) {
AuthModel::insertToken($data);
}
// Если есть, то обновление
else {
else
{ // Если есть, то обновление
AuthModel::updateToken($data, $user_id);
}
@ -317,20 +318,23 @@ class AuthController extends \MainController
}
}
if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
if (!filter_var($email, FILTER_VALIDATE_EMAIL))
{
Base::addMsg(lang('Invalid') . ' email', 'error');
redirect('/recover');
}
$uInfo = UserModel::userInfo($email);
if (empty($uInfo['email'])) {
if (empty($uInfo['email']))
{
Base::addMsg(lang('There is no such e-mail on the site'), 'error');
redirect('/recover');
}
// Проверка на заблокированный аккаунт
if ($uInfo['ban_list'] == 1) {
if ($uInfo['ban_list'] == 1)
{
Base::addMsg(lang('Your account is under review'), 'error');
redirect('/recover');
}
@ -356,7 +360,8 @@ class AuthController extends \MainController
// Проверяем код
$user_id = UserModel::getPasswordActivate($code);
if (!$user_id) {
if (!$user_id)
{
Base::addMsg(lang('code-incorrect'), 'error');
redirect('/recover');
}
@ -384,7 +389,8 @@ class AuthController extends \MainController
// Проверяем код
$avtivate_email = UserModel::getEmailActivate($code);
if (!$avtivate_email) {
if (!$avtivate_email)
{
Base::addMsg(lang('code-used'), 'error');
redirect('/');
}

View file

@ -451,7 +451,6 @@ class UserController extends \MainController
}
// + Повторная отправка
$add_time = date('Y-m-d H:i:s');
$invitation_code = Base::randomString('crypto', 25);
$add_ip = Request::getRemoteAddress();

View file

@ -63,14 +63,6 @@ function user_avatar_img($file, $size='small', $alt, $style)
return $img;
}
// The cover of the post
function post_cover_img($file, $alt, $style)
{
$src = '/uploads/posts/cover/' . $file;
$img = '<img class="'.$style.'" src="'.$src.'" alt="'.$alt.'">';
return $img;
}
// User's Cover art
function user_cover_url($file)
@ -78,6 +70,27 @@ function user_cover_url($file)
return '/uploads/users/cover/' . $file;
}
// User's Cover art or thumbnails
function post_img($file, $alt, $style, $type, $attributes = '')
{
$src = '/uploads/posts/cover/' . $file;
if ($type == 'thumbnails')
{
$src = '/uploads/posts/thumbnails/' . $file;
}
if ($attributes)
{
$attributes = 'layer-src="'.$src.'"';
}
$img = '<img class="'.$style.'" '.$attributes.' src="'.$src.'" alt="'.$alt.'">';
return $img;
}
// Favicon
function favicon_img($link_id, $alt)
{

View file

@ -79,7 +79,7 @@ class FeedModel extends \MainModel
rel.*,
votes_post_item_id, votes_post_user_id,
id, login, avatar,
space_id, space_slug, space_name
space_id, space_slug, space_name, space_color
FROM posts
LEFT JOIN

View file

@ -78,7 +78,7 @@ class HomeModel extends \MainModel
rel.*,
votes_post_item_id, votes_post_user_id,
id, login, avatar,
space_id, space_slug, space_name
space_id, space_slug, space_name, space_color
FROM posts
LEFT JOIN

View file

@ -51,20 +51,31 @@ class SpaceModel extends \MainModel
// Для форм добавления и изменения поста
public static function getSpaceSelect($user_id, $trust_level)
{
$spaces = self::getSubscription($user_id);
$result = Array();
foreach ($spaces as $ind => $row)
{
$result[$ind] = $row['signed_space_id'];
}
$sql = "SELECT
space_id,
space_name,
space_user_id,
space_permit_users
FROM space
WHERE space_permit_users = 0 or space_user_id = :user_id ORDER BY space_id DESC";
if ($trust_level == 5) {
WHERE space_id IN(".implode(',', $result).") AND
space_permit_users = 0 or space_user_id = :user_id AND space_is_delete != 1
ORDER BY space_id DESC";
if ($trust_level == 5)
{
$sql = "SELECT
space_id,
space_name,
space_user_id
FROM space";
FROM space WHERE space_is_delete != 1";
}
return DB::run($sql, ['user_id' => $user_id])->fetchAll(PDO::FETCH_ASSOC);
@ -123,6 +134,25 @@ class SpaceModel extends \MainModel
return DB::run($sql, ['user_id' => $user_id])->fetchAll(PDO::FETCH_ASSOC);
}
// Пространства все / подписан
public static function getSubscription($user_id)
{
$sql = "SELECT
space_id,
space_slug,
space_name,
space_img,
space_user_id,
space_is_delete,
signed_space_id,
signed_user_id
FROM space
LEFT JOIN space_signed ON signed_space_id = space_id AND signed_user_id = :user_id
WHERE space_is_delete != 1 AND signed_user_id = :user_id";
return DB::run($sql, ['user_id' => $user_id])->fetchAll(PDO::FETCH_ASSOC);
}
// Количество читающих
public static function numSpaceSubscribers($space_id)
{

View file

@ -186,12 +186,12 @@ class Controller extends \MainController
$page = $page == 0 ? 1 : $page;
$limit = 25;
$pagesCount = SpaceModel::getSpacesAllCount();
$spaces = SpaceModel::getSpacesAll($page, $limit, $uid['id'], 'all');
$pagesCount = Model::getSpacesCount($sheet);
$spaces = Model::getSpaces($page, $limit, $sheet);
$data = [
'meta_title' => lang('Spaces'),
'sheet' => 'spaces',
'sheet' => $sheet == 'ban' ? 'banspaces' : 'allspaces',
'pagesCount' => ceil($pagesCount / $limit),
'pNum' => $page,
];

View file

@ -12,7 +12,8 @@ class Model extends \MainModel
public static function getUsersListForAdmin($page, $limit, $sheet)
{
$string = "WHERE ban_list > 0";
if ($sheet == 'all') {
if ($sheet == 'all')
{
$string = "";
}
@ -39,9 +40,11 @@ class Model extends \MainModel
public static function getUsersListForAdminCount($sheet)
{
$string = "WHERE ban_list > 0";
if ($sheet == 'all') {
if ($sheet == 'all')
{
$string = "";
}
}
$sql = "SELECT id FROM users $string";
return DB::run($sql)->rowCount();
@ -355,7 +358,8 @@ class Model extends \MainModel
public static function getAuditsAll($page, $limit, $sheet)
{
$sort = "audit_read_flag = 0";
if ($sheet == 'approved') {
if ($sheet == 'approved')
{
$sort = "audit_read_flag = 1";
}
@ -375,7 +379,8 @@ class Model extends \MainModel
public static function getAuditsAllCount($sheet)
{
$sort = "audit_read_flag = 0";
if ($sheet == 'approved') {
if ($sheet == 'approved')
{
$sort = "audit_read_flag = 1";
}
@ -405,4 +410,51 @@ class Model extends \MainModel
return DB::run($sql, ['id' => $id]);
}
// Пространства открытые / забаненные
public static function getSpaces($page, $limit, $sort)
{
$signet = "space_is_delete = 0";
if ($sort == 'ban')
{
$signet = "space_is_delete = 1";
}
$start = ($page-1) * $limit;
$sql = "SELECT
space_id,
space_name,
space_description,
space_slug,
space_img,
space_date,
space_type,
space_user_id,
space_is_delete,
id,
login,
avatar
FROM space
LEFT JOIN users ON id = space_user_id
WHERE $signet
ORDER BY space_id DESC LIMIT $start, $limit";
return DB::run($sql)->fetchAll(PDO::FETCH_ASSOC);
}
// Количество
public static function getSpacesCount($sort)
{
$signet = "space_is_delete = 0";
if ($sort == 'ban')
{
$signet = "space_is_delete = 1";
}
$sql = "SELECT space_id, space_is_delete FROM space WHERE $signet";
return DB::run($sql)->rowCount();
}
}

View file

@ -21,7 +21,7 @@
<span class="middle"><?= lang('Audit'); ?></span>
</a>
</li>
<li class="nav<?php if ($data['sheet'] == 'spaces') { ?> active<?php } ?>">
<li class="nav<?php if ($data['sheet'] == 'allspaces' || $data['sheet'] == 'banspaces') { ?> active<?php } ?>">
<a class="light-gray" title="<?= lang('Spaces'); ?>" href="/admin/spaces">
<i class="light-icon-infinity middle"></i>
<span class="middle"><?= lang('Spaces'); ?></span>

View file

@ -2,6 +2,7 @@
<div class="wrap">
<main class="admin">
<div class="white-box">
<div class="inner-padding">
<?= breadcrumb('/admin', lang('Admin'), null, null, $data['meta_title']); ?>
<h3><?= lang('All'); ?></h3>
@ -15,7 +16,7 @@
</ul>
<hr>
<div class="boxline">
<label for="name">ОС:</label>
<label for="name">PC:</label>
<?= php_uname('s'); ?> <?php echo php_uname('r'); ?>
</div>
<div class="boxline">

View file

@ -8,6 +8,28 @@
</a>
<?= breadcrumb('/admin', lang('Admin'), null, null, $data['meta_title']); ?>
<ul class="nav-tabs">
<?php if($data['sheet'] == 'allspaces') { ?>
<li class="active">
<span><?= lang('All'); ?></span>
</li>
<li>
<a href="/admin/spaces/ban">
<span><?= lang('Banned'); ?></span>
</a>
</li>
<?php } elseif($data['sheet'] == 'banspaces') { ?>
<li>
<a href="/admin/spaces">
<span><?= lang('All'); ?></span>
</a>
</li>
<li class="active">
<span><?= lang('Banned'); ?></span>
</li>
<?php } ?>
</ul>
<div class="space">
<?php if (!empty($spaces)) { ?>

View file

@ -87,7 +87,7 @@ img {
img.ava-94 {
width: 94px;
margin-top: 5px;
margin-top: 8px;
}
img.ava { width: 18px; }
@ -95,7 +95,7 @@ img.ava-24 { width: 24px; }
img.ava-54 { width: 54px; }
img.ava-64 { width: 64px; }
.indent { margin: 0 3px; }
.indent { margin: 0 5px; }
.indent-big { margin: 0 0 0 15px; }
.vertical-ind { margin: 15px 0; }
.max-width { max-width: 780px; }
@ -114,10 +114,10 @@ img.ava-64 { width: 64px; }
.flex { display: flex; }
.justify-content-between { justify-content: space-between; }
.align-items-center { align-items: center; }
.italic { font-style: italic; }
.translation,
.trust-level {
font-style: italic;
background-color: #f5efe3;
color: #47340c;
padding: 2px 4px;
@ -182,20 +182,9 @@ main.w-100 {
h1 {
font-weight: 400;
font-size: 1.2rem;
}
h1.domain {
font-weight: 400;
font-size: 1.2rem;
margin: 5px 0;
}
h1.topics {
font-weight: 400;
font-size: 1.2rem;
margin: 0;
}
code {
color: #9b4f5e;
background-color: #f5f2f0;
@ -455,7 +444,7 @@ textarea:focus {
flex-basis: 100%;
}
/* Authorization form*/
/* Authorization form */
.login-nav {
width: 100%;
margin-bottom: 20px;
@ -575,7 +564,6 @@ textarea:focus {
color: #919191;
text-transform: lowercase;
margin: 5px 0 0 0;
font-size: 13px;
}
.no-content {
@ -709,6 +697,13 @@ img.img-post,
margin-top: 5px;
}
.post-space-color {
width: 8px;
height: 8px;
display: inline-block;
margin-right: 3px;
}
.inner-padding img:hover,
.post-img a:hover > img,
.thumb.no-mob:hover {
@ -722,12 +717,6 @@ img.img-post,
margin: 10px 0;
}
.post_url_detal {
margin: 0 0 20px 0;
display: block;
font-style: italic;
}
.telo-detail-post.dell {
background-color: rgb(246, 196, 184);
padding-left: 10px;
@ -738,10 +727,6 @@ img.img-post,
padding: 15px;
}
.telo-detail-post .title {
padding: 0;
}
.post-full-footer {
border-bottom: 1px solid #ddd;
overflow: hidden;
@ -770,12 +755,9 @@ img.img-post,
}
.title {
margin: 3px 0 0 0;
font-size: 21px;
padding: 0 15px;
margin-right: 4px;
font-weight: 500;
color: #333;
color: #111;
}
.post-telo .title:hover {
@ -918,6 +900,10 @@ ol.dell.answer-telo {
list-style: none;
}
.answers_subtree img {
max-width: 98%;
}
.delleted {
background-color: rgb(246, 196, 184);
}
@ -1043,7 +1029,7 @@ ol.comment-telo {
.answer-telo .voters,
.comm-telo .voters {
margin: 0 10px 0 0;
margin: 0 5px 0 0;
}
.voters .up-id {
@ -1078,10 +1064,6 @@ ol.comment-telo {
padding-top: 5px;
}
.domain-telo {
margin: 0 0 25px 0;
}
.favicon {
margin: 0 5px 0 0;
width: 16px;
@ -1194,18 +1176,12 @@ ul.breadcrumb {
text-transform: uppercase;
}
.box-flex {
box-sizing: border-box;
display: flex;
}
/* Topic */
a.tags {
position: relative;
display: inline-block;
height: 30px;
padding: 0 12px;
font-size: 13px;
line-height: 30px;
vertical-align: top;
border-radius: 10em;
@ -1393,7 +1369,6 @@ i.light-icon-brand-github:hover {
color: var(--tertiary);
display: block;
padding: 1px 9px 1px 6px;
font-size: 13px;
font-weight: 500;
}
@ -1403,10 +1378,6 @@ i.light-icon-brand-github:hover {
text-decoration: none;
}
.tel-topics {
font-size: 13px;
}
.topic-list {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(48%, 1fr));

View file

@ -2,32 +2,27 @@
<?php foreach ($posts as $post) { ?>
<div class="post-telo white-box">
<div class="post-header small">
<div class="post-header small flex">
<a class="gray" href="/u/<?= $post['login']; ?>">
<?= user_avatar_img($post['avatar'], 'small', $post['login'], 'ava'); ?>
<span class="indent"></span>
<?= $post['login']; ?>
</a>
<span class="indent"></span>
<a class="gray" href="/s/<?= $post['space_slug']; ?>" title="<?= $post['space_name']; ?>">
<?= $post['space_name']; ?>
</a>
<span class="indent gray">
<span class="gray lowercase">
<?= $post['post_date'] ?>
</span>
</div>
<?php if($post['post_thumb_img']) { ?>
<a title="<?= $post['post_title']; ?>" href="/post/<?= $post['post_id']; ?>/<?= $post['post_slug']; ?>">
<img class="thumb no-mob" alt="<?= $post['post_title']; ?>" src="/uploads/posts/thumbnails/<?= $post['post_thumb_img']; ?>">
<a title="<?= $post['post_title']; ?>" href="/post/<?= $post['post_id']; ?>/<?= $post['post_slug']; ?>">
<?= post_img($post['post_thumb_img'], $post['post_title'], 'thumb no-mob', 'thumbnails'); ?>
</a>
<?php } ?>
<div class="post-body">
<a href="/post/<?= $post['post_id']; ?>/<?= $post['post_slug']; ?>">
<h2 class="title"><?= $post['post_title']; ?>
<h2 class="title indent-big"><?= $post['post_title']; ?>
<?php if ($post['post_is_deleted'] == 1) { ?>
<i class="light-icon-trash red"></i>
<?php } ?>
@ -44,25 +39,30 @@
<i class="light-icon-language green"></i>
<?php } ?>
<?php if($post['post_translation'] == 1) { ?>
<span class="translation small lowercase"><?= lang('Translation'); ?></span>
<span class="translation small italic lowercase"><?= lang('Translation'); ?></span>
<?php } ?>
<?php if($post['post_tl'] > 0) { ?>
<span class="trust-level small">tl<?= $post['post_tl']; ?></span>
<span class="trust-level italic small">tl<?= $post['post_tl']; ?></span>
<?php } ?>
<?php if($post['post_merged_id'] > 0) { ?>
<i class="light-icon-arrow-forward-up red"></i>
<?php } ?>
</h2>
</a>
<?php if($post['post_url_domain']) { ?>
<a class="gray small indent-big" href="/domain/<?= $post['post_url_domain']; ?>">
<i class="light-icon-link middle"></i> <?= $post['post_url_domain']; ?>
</a>
<?php } ?>
<?= html_topic($post['topic_list'], 'gray small indent-big'); ?>
<div class="flex indent-big">
<a class="gray small" href="/s/<?= $post['space_slug']; ?>" title="<?= $post['space_name']; ?>">
<span class="post-space-color" style="background-color: <?= $post['space_color']; ?>;"></span>
<?= $post['space_name']; ?>
</a>
<span class="indent-big"></span>
<?= html_topic($post['topic_list'], 'gray small'); ?>
<?php if($post['post_url_domain']) { ?>
<span class="indent"></span>
<a class="gray small" href="/domain/<?= $post['post_url_domain']; ?>">
<i class="light-icon-link small middle"></i> <?= $post['post_url_domain']; ?>
</a>
<?php } ?>
</div>
<div class="post-details">
<div class="show_add_<?= $post['post_id']; ?>">
<div data-post_id="<?= $post['post_id']; ?>" class="showpost">
@ -75,14 +75,13 @@
<?php if($post['post_content_img']) { ?>
<div class="post-img">
<a title="<?= $post['post_title']; ?>" href="/post/<?= $post['post_id']; ?>/<?= $post['post_slug']; ?>">
<?= post_cover_img($post['post_content_img'], $post['post_title'], 'img-post'); ?>
<?= post_img($post['post_content_img'], $post['post_title'], 'img-post', 'cover'); ?>
</a>
</div>
<?php } ?>
<div class="post-footer lowercase">
<?= votes($uid['id'], $post, 'post'); ?>
<?php if($post['post_answers_count'] !=0) { ?>
<a class="right gray" href="/post/<?= $post['post_id']; ?>/<?= $post['post_slug']; ?>">
<?php if($post['post_type'] ==0) { ?>

View file

@ -4,19 +4,21 @@
<div class="white-box">
<div class="inner-padding">
<h1><?= $data['h1']; ?></h1>
<br>
<div class="telo">
<?php if (!empty($answers)) { ?>
<?php foreach ($answers as $answer) { ?>
<?php if($answer['answer_is_deleted'] == 0) { ?>
<div class="answ-telo_bottom">
<div class="answ-header small">
<div class="flex small">
<?= user_avatar_img($answer['avatar'], 'small', $answer['login'], 'ava'); ?>
<a class="date" href="/u/<?= $answer['login']; ?>">
<span class="indent"></span>
<a class="gray" href="/u/<?= $answer['login']; ?>">
<?= $answer['login']; ?>
</a>
<span class="date"><?= $answer['date']; ?></span>
<span class="indent"></span>
<span class="gray lowercase"><?= $answer['date']; ?></span>
<span class="indent"> &#183; </span>
<a href="/post/<?= $answer['post_id']; ?>/<?= $answer['post_slug']; ?>#answer_<?= $answer['answer_id']; ?>">
<?= $answer['post_title']; ?>
@ -27,7 +29,7 @@
<?= $answer['answer_content']; ?>
</div>
<div class="post-full-footer date">
<div class="post-full-footer gray">
+ <?= $answer['answer_votes']; ?>
</div>
</div>

View file

@ -12,13 +12,13 @@
<?php if($comment['comment_is_deleted'] == 0) { ?>
<div class="comm-telo_bottom">
<div class="small">
<a class="indent" href="/u/<?= $comment['login']; ?>">
<a class="gray" href="/u/<?= $comment['login']; ?>">
<?= user_avatar_img($comment['avatar'], 'small', $comment['login'], 'ava'); ?>
<span class="indent"></span>
<?= $comment['login']; ?>
</a>
<span class="indent"><?= $comment['date']; ?></span>
<span class="indent"></span>
<span class="gray lowercase"><?= $comment['date']; ?></span>
<span class="indent"> &#183; </span>
<a href="/post/<?= $comment['post_id']; ?>/<?= $comment['post_slug']; ?>#comment_<?= $comment['comment_id']; ?>">

View file

@ -76,44 +76,44 @@
<span class="st"></span>
<a class="dr-menu" href="/u/<?= $uid['login']; ?>">
<i class="light-icon-user middle"></i>
<span class="middle"><?= lang('Profile'); ?></span>
<span class="middle small"><?= lang('Profile'); ?></span>
</a>
<a class="dr-menu" href="/u/<?= $uid['login']; ?>/setting">
<i class="light-icon-settings middle"></i>
<span class="middle"><?= lang('Settings'); ?></span>
<span class="middle small"><?= lang('Settings'); ?></span>
</a>
<a class="dr-menu" href="/u/<?= $uid['login']; ?>/drafts">
<i class="light-icon-note middle"></i>
<span class="middle"><?= lang('Drafts'); ?></span>
<span class="middle small"><?= lang('Drafts'); ?></span>
</a>
<a class="dr-menu" href="/u/<?= $uid['login']; ?>/notifications">
<i class="light-icon-notification middle"></i>
<?= lang('Notifications'); ?></span>
<span class="middle small"><?= lang('Notifications'); ?></span>
</a>
<a class="dr-menu" href="/u/<?= $uid['login']; ?>/messages">
<i class="light-icon-mail middle"></i>
<span class="middle"><?= lang('Messages-m'); ?></span>
<span class="middle small"><?= lang('Messages-m'); ?></span>
</a>
<a class="dr-menu" href="/u/<?= $uid['login']; ?>/favorite">
<i class="light-icon-bookmark middle"></i>
<span class="middle"><?= lang('Favorites'); ?></span>
<span class="middle small"><?= lang('Favorites'); ?></span>
</a>
<?php if($uid['trust_level'] > 1) { ?>
<a class="dr-menu" href="/u/<?= $uid['login']; ?>/invitation">
<i class="light-icon-wind middle"></i>
<span class="middle"><?= lang('Invites'); ?></span>
<span class="middle small"><?= lang('Invites'); ?></span>
</a>
<?php } ?>
<?php if($uid['trust_level'] == 5) { ?>
<a class="dr-menu" href="/admin" target="_black">
<i class="light-icon-key middle"></i>
<span class="middle"><?= lang('Admin'); ?></span>
<span class="middle small"><?= lang('Admin'); ?></span>
</a>
<?php } ?>
<hr>
<a class="dr-menu" href="/logout" class="logout" title="<?= lang('Sign out'); ?>">
<i class="light-icon-logout middle"></i>
<span class="middle"><?= lang('Sign out'); ?></span>
<span class="middle small"><?= lang('Sign out'); ?></span>
</a>
</div>
</div>

View file

@ -41,7 +41,7 @@
<?= $val['message']; ?>
<div class="date">
<div class="small gray">
<?= $val['add_time']; ?>
<?php if ($val['receipt'] AND $val['uid'] == $uid['id']) { ?>

View file

@ -10,12 +10,12 @@
<?php foreach ($data['messages'] as $msg) { ?>
<div class="msg-telo<?php if (!$msg['unread'] > 0) { ?> active<?php } ?>">
<?php if($msg['sender_uid'] == $uid['id']) { ?>
<div class="small">
<?= lang('You'); ?> | <?= $msg['update_time']; ?>
</div>
<?php } else { ?>
<div class="small">
<div class="small flex">
<?php if($msg['sender_uid'] == $uid['id']) { ?>
<?= lang('You'); ?>
<span class="indent"></span>
<?= $msg['update_time']; ?>
<?php } else { ?>
<?= lang('From'); ?>
<span class="indent"></span>
<?= user_avatar_img($msg['msg_user']['avatar'], 'small', $msg['msg_user']['login'], 'ava'); ?>
@ -23,15 +23,17 @@
<a href="/u/<?= $msg['msg_user']['login']; ?>">
<?= $msg['msg_user']['login']; ?>
</a>
<span class="date"><?= $msg['update_time']; ?></span>
</div>
<?php } ?>
<span class="indent-big"></span>
<span class="gray lowercase">
<?= $msg['update_time']; ?>
</span>
<?php } ?>
</div>
<div class="message one">
<?= $msg['message']['message']; ?>
</div>
<a class="lowercase" href="/messages/read/<?= $msg['id']; ?>">
<a class="lowercase small right" href="/messages/read/<?= $msg['id']; ?>">
<?php if ($msg['unread']) { ?>
<?= lang('There are'); ?> <?= $msg['count']; ?> <?= $msg['unread_num']; ?>
<?php } else { ?>

View file

@ -84,16 +84,11 @@
</div>
<div class="boxline">
<label class="form-label" for="post_content"><?= lang('Topics'); ?></label>
<select name="post_topics[]" multiple="multiple" id='selTopics'>
<?php foreach ($post_topics as $topic) { ?>
<option selected value="<?= $topic['topic_id']; ?>"><?= $topic['topic_title']; ?></option>
<?php } ?>
</select>
<select name="post_topics[]" multiple="multiple" id='selTopics'></select>
</div>
<div class="boxline">
<label class="form-label" for="post_content"><?= lang('Related'); ?></label>
<select name="post_related[]" multiple="multiple" id='selLinked'>
</select>
<select name="post_related[]" multiple="multiple" id='selLinked'></select>
<script nonce="<?= $_SERVER['nonce']; ?>">
$(document).ready(function(){
$("#selTopics").select2({

View file

@ -10,7 +10,7 @@
<li class="answers_subtree" id="answer_<?= $answer['answer_id']; ?>">
<div class="container">
<div class="answ-telo">
<div class="small">
<div class="flex small">
<a class="gray" href="/u/<?= $answer['login']; ?>">
<?= user_avatar_img($answer['avatar'], 'small', $answer['login'], 'ava'); ?>
<span class="indent">
@ -18,7 +18,7 @@
</span>
</a>
<span class="indent gray">
<span class="indent gray lowercase">
<?= $answer['answer_date']; ?>
</span>
<?php if (empty($answer['edit'])) { ?>
@ -44,7 +44,7 @@
<?= $answer['answer_content'] ?>
</div>
</div>
<div class="comm-footer small">
<div class="comm-footer flex small">
<?= votes($uid['id'], $answer, 'answer'); ?>
<?php if($post['post_closed'] == 0) { ?>
@ -120,7 +120,7 @@
<li class="comment_subtree" id="comment_<?= $comment['comment_id']; ?>">
<div class="container">
<div class="comm-telo">
<div class="small">
<div class="small flex">
<a class="gray" href="/u/<?= $comment['login']; ?>">
<?= user_avatar_img($comment['avatar'], 'small', $comment['login'], 'ava'); ?>
<span class="indent">
@ -128,7 +128,7 @@
</span>
</a>
<span class="indent gray">
<span class="indent gray lowercase">
<?= lang_date($comment['comment_date']); ?>
</span>
<?php if ($post['post_user_id'] == $comment['comment_user_id']) { ?>

View file

@ -27,7 +27,8 @@
<?php if($post['post_content_img']) { ?>
<div class="img-post-edit">
<?= post_cover_img($post['post_content_img'], $post['post_title'], 'img-post'); ?>
<?= post_img($post['post_content_img'], $post['post_title'], 'img-post' , 'cover'); ?>
<input type="hidden" name="content_img" value="<?= $post['post_content_img']; ?>">
<a class="img-remove" href="/post/img/<?= $post['post_id']; ?>/remove">
@ -37,7 +38,7 @@
<?php } ?>
<?php if($post['post_thumb_img']) { ?>
<img class="thumb" alt="<?= $post['post_title']; ?>" src="/uploads/posts/thumbnails/<?= $post['post_thumb_img']; ?>">
<?= post_img($post['post_thumb_img'], $post['post_title'], 'thumb' , 'thumbnails'); ?>
<?php } ?>
<div class="boxline post">

View file

@ -30,23 +30,23 @@
<i class="light-icon-language green"></i>
<?php } ?>
<?php if($post['post_translation'] == 1) { ?>
<span class="translation small lowercase"><?= lang('Translation'); ?></span>
<span class="translation small italic lowercase"><?= lang('Translation'); ?></span>
<?php } ?>
<?php if($post['post_tl'] > 0) { ?>
<span class="trust-level small">tl<?= $post['post_tl']; ?></span>
<span class="trust-level italic small">tl<?= $post['post_tl']; ?></span>
<?php } ?>
<?php if($post['post_merged_id'] > 0) { ?>
<i class="light-icon-arrow-forward-up red"></i>
<?php } ?>
</h1>
<div class="small lowercase">
<div class="small lowercase flex">
<a class="gray" href="/u/<?= $post['login']; ?>">
<?= user_avatar_img($post['avatar'], 'small', $post['login'], 'ava'); ?>
<span class="indent">
<?= $post['login']; ?>
</span>
</a>
<span class="indent gray">
<span class="gray">
<?= $post['post_date_lang']; ?>
<?php if($post['modified']) { ?>
(<?= lang('ed'); ?>)
@ -54,27 +54,25 @@
</span>
<?php if ($uid['id']) { ?>
<?php if($uid['login'] == $post['login'] || $uid['trust_level'] == 5) { ?>
<span class="indent">
<span class="indent"></span>
<span class="indent">&#183;</span>
<a class="gray" href="/post/edit/<?= $post['post_id']; ?>">
<i class="light-icon-edit middle"></i>
<?= lang('Remove'); ?>
</a>
</span>
<?php } ?>
<?php if($uid['login'] == $post['login']) { ?>
<?php if($post['post_draft'] == 0) { ?>
<span class="indent">&#183;</span>
<?php if($post['my_post'] == $post['post_id']) { ?>
<span class="mu_post gray">+ <?= lang('in-the-profile'); ?></span>
<span class="indent"> &#183; </span>
<?php } else { ?>
<a class="user-mypost indent gray" data-opt="1" data-post="<?= $post['post_id']; ?>">
<a class="user-mypost gray" data-opt="1" data-post="<?= $post['post_id']; ?>">
<span class="mu_post"><?= lang('in-the-profile'); ?></span>
<span class="indent"> &#183; </span>
</a>
<?php } ?>
<?php } ?>
<?php } ?>
<span class="add-favorite indent gray" data-id="<?= $post['post_id']; ?>" data-type="post">
<span class="add-favorite gray" data-id="<?= $post['post_id']; ?>" data-type="post">
<span class="indent">&#183;</span>
<?php if ($post['favorite_post']){ ?>
<?= lang('remove-favorites'); ?>
<?php } else { ?>
@ -84,7 +82,7 @@
<?php if($uid['trust_level'] ==5) { ?>
<span class="indent"> &#183; </span>
<span id="cm_dell" class="cm_add_link indent">
<span id="cm_dell" class="cm_add_link">
<a data-type="post" data-id="<?= $post['post_id']; ?>" class="type-action gray">
<?php if($post['post_is_deleted'] == 1) { ?>
<?= lang('Recover'); ?>
@ -93,7 +91,10 @@
<?php } ?>
</a>
</span>
<small> &#183; <?= $post['post_hits_count']; ?></small>
<span class="small">
<span class="indent"> &#183; </span>
<?= $post['post_hits_count']; ?>
</span>
<?php } ?>
<?php } ?>
@ -103,7 +104,7 @@
<div class="post">
<?php if($post['post_thumb_img']) { ?>
<img class="thumb" alt="<?= $post['post_title']; ?>" src="/uploads/posts/thumbnails/<?= $post['post_thumb_img']; ?>">
<?= post_img($post['post_thumb_img'], $post['post_title'], 'thumb', 'thumbnails'); ?>
<?php } ?>
<?= $post['post_content']; ?>
@ -120,11 +121,11 @@
</div>
<?php } ?>
<?php if($post['post_url_domain']) { ?>
<span class="post_url_detal">
<div class="italic vertical-ind">
<?= lang('Website'); ?>: <a rel="nofollow noreferrer ugc" href="<?= $post['post_url']; ?>">
<?= $post['post_url_domain']; ?>
</a>
</span>
</div>
<?php } ?>
<?php if(!empty($post_related)) { ?>
@ -147,7 +148,7 @@
<div class="related">
<h3 class="style small"><?= lang('Topics'); ?>:</h3>
<?php foreach ($topics as $topic) { ?>
<a class="tags" href="/topic/<?= $topic['topic_slug']; ?>">
<a class="tags small" href="/topic/<?= $topic['topic_slug']; ?>">
<?= $topic['topic_title']; ?>
</a>
<?php } ?>
@ -238,7 +239,7 @@
<?php if($post['post_content_img']) { ?>
<div class="space-info white-box">
<div id="layer-photos" class="layer-photos inner-padding big">
<img class="img-post" layer-src="/uploads/posts/cover/<?= $post['post_content_img']; ?>" alt="<?= $post['post_title']; ?>" src="/uploads/posts/cover/<?= $post['post_content_img']; ?>">
<?= post_img($post['post_content_img'], $post['post_title'], 'img-post', 'cover', $post['post_content_img']); ?>
</div>
</div>
<?php } ?>

View file

@ -19,7 +19,7 @@
</header>
<?php if($post['post_content_img']) { ?>
<figure>
<?= post_cover_img($post['post_content_img'], $post['post_title'], 'img-post'); ?>
<?= post_img($post['post_content_img'], $post['post_title'], 'img-post', 'cover'); ?>
</figure>
<?php } ?>
<?= $post['post_content']; ?>

View file

@ -77,8 +77,10 @@
<div class="boxline">
<label class="form-label" for="topic_content"><?= lang('Root'); ?></label>
<select name="topic_parent_id[]" multiple="multiple" id='selMainLinked'>
<?php foreach ($topic_parent_id as $parent) { ?>
<option selected value="<?= $parent['topic_id']; ?>"><?= $parent['topic_title']; ?></option>
<?php if (!empty($topic_parent_id)) { ?>
<?php foreach ($topic_parent_id as $parent) { ?>
<option selected value="<?= $parent['topic_id']; ?>"><?= $parent['topic_title']; ?></option>
<?php } ?>
<?php } ?>
</select>
</div>

View file

@ -3,7 +3,7 @@
<main>
<div class="white-box">
<div class="inner-padding">
<a class="tel-topics" title="<?= lang('All topics'); ?>" href="/topics"> <?= lang('Topics'); ?></a>
<a class="small" title="<?= lang('All topics'); ?>" href="/topics"> <?= lang('Topics'); ?></a>
<h1 class="topics"><a href="/topic/<?= $topic['topic_slug']; ?>"><?= $data['h1']; ?></a>
<?php if($uid['trust_level'] == 5) { ?>
@ -62,7 +62,7 @@
<div class="inner-padding big">
<h3 class="style small"><?= lang('Root'); ?></h3>
<div class="related-box">
<a class="tags" href="/topic/<?= $main_topic['topic_slug']; ?>">
<a class="tags small" href="/topic/<?= $main_topic['topic_slug']; ?>">
<?= $main_topic['topic_title']; ?>
</a>
</div>
@ -76,7 +76,7 @@
<h3 class="style small"><?= lang('Subtopics'); ?></h3>
<?php foreach ($subtopics as $sub) { ?>
<div class="related-box">
<a class="tags" href="/topic/<?= $sub['topic_slug']; ?>">
<a class="tags small" href="/topic/<?= $sub['topic_slug']; ?>">
<?= $sub['topic_title']; ?>
</a>
</div>
@ -92,7 +92,7 @@
<h3 class="style small"><?= lang('Related'); ?></h3>
<?php foreach ($topic_related as $related) { ?>
<div class="related-box">
<a class="tags" href="/topic/<?= $related['topic_slug']; ?>">
<a class="tags small" href="/topic/<?= $related['topic_slug']; ?>">
<?= $related['topic_title']; ?>
</a>
</div>

View file

@ -4,12 +4,12 @@
<div class="white-box">
<div class="inner-padding">
<div class="box-flex">
<div class="flex">
<div>
<?= topic_logo_img($topic['topic_img'], 'max', $topic['topic_title'], 'ava-94'); ?>
</div>
<div class="indent-big box-100">
<h1 class="topics">
<h1>
<?= $data['h1']; ?>
<?php if($uid['trust_level'] == 5) { ?>
<a class="right" href="/topic/edit/<?= $topic['topic_id']; ?>">
@ -51,7 +51,7 @@
<aside>
<div class="white-box">
<div class="inner-padding big">
<div class="box-flex">
<div class="flex">
<div class="box-post center box-number">
<div class="style small gray lowercase"><?= lang('Posts-m'); ?></div>
<?= $topic['topic_count']; ?>
@ -69,7 +69,7 @@
<div class="inner-padding big">
<h3 class="style small"><?= lang('Root'); ?></h3>
<div class="related-box">
<a class="tags" href="/topic/<?= $main_topic['topic_slug']; ?>">
<a class="tags small" href="/topic/<?= $main_topic['topic_slug']; ?>">
<?= $main_topic['topic_title']; ?>
</a>
</div>
@ -83,7 +83,7 @@
<h3 class="style small"><?= lang('Subtopics'); ?></h3>
<?php foreach ($subtopics as $sub) { ?>
<div class="related-box">
<a class="tags" href="/topic/<?= $sub['topic_slug']; ?>">
<a class="tags small" href="/topic/<?= $sub['topic_slug']; ?>">
<?= $sub['topic_title']; ?>
</a>
</div>
@ -99,7 +99,7 @@
<h3 class="style small"><?= lang('Related'); ?></h3>
<?php foreach ($topic_related as $related) { ?>
<div class="related-box">
<a class="tags" href="/topic/<?= $related['topic_slug']; ?>">
<a class="tags small" href="/topic/<?= $related['topic_slug']; ?>">
<?= $related['topic_title']; ?>
</a>
</div>

View file

@ -56,7 +56,7 @@
<div class="inner-padding big">
<h3 class="style small"><?= lang('New ones'); ?></h3>
<?php foreach ($news as $new) { ?>
<a title="<?= $new['topic_title']; ?>" class="tags" href="/topic/<?= $new['topic_slug']; ?>">
<a title="<?= $new['topic_title']; ?>" class="tags snall" href="/topic/<?= $new['topic_slug']; ?>">
<?= $new['topic_title']; ?>
</a><br>
<?php } ?>

View file

@ -7,7 +7,7 @@
<div class="right heart-link">
<?= votes($uid['id'], $link, 'link'); ?>
</div>
<h1 class="domain"><?= $link['link_title']; ?>
<h1><?= $link['link_title']; ?>
<?php if($uid['trust_level'] > 4) { ?>
<span class="indent"></span>
<a class="small" title="<?= lang('Edit'); ?>" href="/web/edit/<?= $link['link_id']; ?>">

View file

@ -4,30 +4,31 @@
<div class="white-box">
<div class="inner-padding space-tags">
<?php if ($uid['trust_level'] == 5) { ?>
<a title="<?= lang('Add'); ?>" class="right vertical-ind" href="/web/add">
<a title="<?= lang('Add'); ?>" class="right" href="/web/add">
<i class="light-icon-plus middle"></i>
</a>
<?php } ?>
<h1><?= $data['h1']; ?></h1>
</div>
</div>
<?php if (!empty($links)) { ?>
<?php foreach ($links as $key => $link) { ?>
<div class="domain-telo">
<div class="white-box">
<a href="/domain/<?= $link['link_url_domain']; ?>">
<h2 class="title">
<?php if($link['link_title']) { ?>
<h2 class="title indent-big">
<?php if ($link['link_title']) { ?>
<?= $link['link_title']; ?>
<?php } else { ?>
Add title...
<?php } ?>
<?php if($uid['trust_level'] == 5) { ?>
<span class="indent"></span>
<a class="small" title="<?= lang('Edit'); ?>" href="/web/edit/<?= $link['link_id']; ?>">
<i class="light-icon-edit"></i>
</a>
<?php } ?>
</h2>
</a>
<?php if($uid['trust_level'] == 5) { ?>
<a class="small right" title="<?= lang('Edit'); ?>" href="/web/edit/<?= $link['link_id']; ?>">
<i class="light-icon-edit"></i>
</a>
<?php } ?>
<span class="green indent-big">
<?= favicon_img($link['link_id'], $link['link_url_domain']); ?>
<?= $link['link_url_domain']; ?>
@ -47,9 +48,8 @@
<?php } else { ?>
<div class="no-content"><?= lang('No'); ?>...</div>
<?php } ?>
</div>
</div>
<?= pagination($data['pNum'], $data['pagesCount'], $data['sheet'], '/domains'); ?>
<?= pagination($data['pNum'], $data['pagesCount'], $data['sheet'], '/domains'); ?>
</main>
<aside>
<div class="white-box">