Compare commits

..

7 commits

Author SHA1 Message Date
mrilyew
23a7c38f61
Merge a99ffbdafe into b557f42daa 2024-10-30 10:40:30 +03:00
Vladimir Barinov
a99ffbdafe
Merge branch 'master' into ignored-sources 2024-10-25 17:12:17 +03:00
lalka2018
874a654bd4 Спустя три месяца
- Новые методы апи, newsfeed addBan и deleteBan. В newsfeed.getGlobal добавлен параметр return_banned хотя в ориг вк он был в newsfeed.get
- Все методы, связанные с игнором, перемещены в трейт
- Я уже забыл чё я там ещё добавил. А, ну да. В окне игноров теперь вместо описания группычеловека показывается кнопка "не игнорировать". И Кнопка Показать Игноры Не Показывается Если Игноров Нет
2023-12-26 15:37:09 +03:00
lalka2018
484b19dd8c
Merge branch 'master' into ignored-sources 2023-12-08 16:35:07 +03:00
lalka2016
66852e4334 Fix wide avatars 2023-09-28 10:23:57 +03:00
lalka2016
eaaa454a45 Some apis + locales 2023-09-26 17:58:14 +03:00
lalka2016
51775a9ccf 888 2023-09-26 14:17:59 +03:00
27 changed files with 408 additions and 684 deletions

View file

@ -143,4 +143,30 @@ class Wall implements Handler
$resolve($arr); $resolve($arr);
} }
function getIgnoredSources(int $page = 1, callable $resolve, callable $reject)
{
$surses = $this->user->getIgnoredSources($page, 10);
$arr = [
"count" => $this->user->getIgnoredSourcesCount(),
"items" => []
];
foreach($surses as $surs) {
$arr["items"][] = [
"id" => $surs->getRealId(),
"name" => $surs->getCanonicalName(),
"additional" => (($surs->getRealId() > 0 ? $surs->getStatus() : $surs->getDescription()) ?? "..."),
"avatar" => $surs->getAvatarURL(),
"url" => $surs->getURL(),
];
}
if(rand(0, 200) == 50) {
$arr["fact"] = $this->user->getIgnoresCount();
}
$resolve($arr);
}
} }

View file

@ -1,9 +1,9 @@
<?php declare(strict_types=1); <?php declare(strict_types=1);
namespace openvk\VKAPI\Handlers; namespace openvk\VKAPI\Handlers;
use Chandler\Database\DatabaseConnection; use Chandler\Database\DatabaseConnection;
use openvk\Web\Models\Repositories\Posts as PostsRepo; use openvk\Web\Models\Repositories\Posts as PostsRepo, Users as UsersRepo, Clubs;
use openvk\Web\Models\Entities\User; use openvk\Web\Models\Entities\User;
use openvk\VKAPI\Handlers\Wall; use openvk\VKAPI\Handlers\{Wall, Users, Groups};
final class Newsfeed extends VKAPIRequestHandler final class Newsfeed extends VKAPIRequestHandler
{ {
@ -32,7 +32,6 @@ final class Newsfeed extends VKAPIRequestHandler
->select("id") ->select("id")
->where("wall IN (?)", $ids) ->where("wall IN (?)", $ids)
->where("deleted", 0) ->where("deleted", 0)
->where("suggested", 0)
->where("id < (?)", empty($start_from) ? PHP_INT_MAX : $start_from) ->where("id < (?)", empty($start_from) ? PHP_INT_MAX : $start_from)
->where("? <= created", empty($start_time) ? 0 : $start_time) ->where("? <= created", empty($start_time) ? 0 : $start_time)
->where("? >= created", empty($end_time) ? PHP_INT_MAX : $end_time) ->where("? >= created", empty($end_time) ? PHP_INT_MAX : $end_time)
@ -48,7 +47,7 @@ final class Newsfeed extends VKAPIRequestHandler
return $response; return $response;
} }
function getGlobal(string $fields = "", int $start_from = 0, int $start_time = 0, int $end_time = 0, int $offset = 0, int $count = 30, int $extended = 0) function getGlobal(string $fields = "", int $start_from = 0, int $start_time = 0, int $end_time = 0, int $offset = 0, int $count = 30, int $extended = 0, int $return_banned = 0)
{ {
$this->requireUser(); $this->requireUser();
@ -58,13 +57,10 @@ final class Newsfeed extends VKAPIRequestHandler
if($this->getUser()->getNsfwTolerance() === User::NSFW_INTOLERANT) if($this->getUser()->getNsfwTolerance() === User::NSFW_INTOLERANT)
$queryBase .= " AND `nsfw` = 0"; $queryBase .= " AND `nsfw` = 0";
if($return_banned == 0) { if(($ignoredCount = $this->getUser()->getIgnoredSourcesCount()) > 0 && $return_banned == 0) {
$ignored_sources_ids = $this->getUser()->getIgnoredSources(0, OPENVK_ROOT_CONF['openvk']['preferences']['newsfeed']['ignoredSourcesLimit'] ?? 50, true); $sources = implode("', '", $this->getUser()->getIgnoredSources(1, $ignoredCount, true));
if(sizeof($ignored_sources_ids) > 0) { $queryBase .= " AND `posts`.`wall` NOT IN ('$sources')";
$imploded_ids = implode("', '", $ignored_sources_ids);
$queryBase .= " AND `posts`.`wall` NOT IN ('$imploded_ids')";
}
} }
$start_from = empty($start_from) ? PHP_INT_MAX : $start_from; $start_from = empty($start_from) ? PHP_INT_MAX : $start_from;
@ -85,65 +81,52 @@ final class Newsfeed extends VKAPIRequestHandler
return $response; return $response;
} }
function getByType(string $feed_type = 'top', string $fields = "", int $start_from = 0, int $start_time = 0, int $end_time = 0, int $offset = 0, int $count = 30, int $extended = 0, int $return_banned = 0) function getBanned(int $extended = 0, string $fields = "", string $name_case = "nom")
{
$this->requireUser();
switch($feed_type) {
case 'top':
return $this->getGlobal($fields, $start_from, $start_time, $end_time, $offset, $count, $extended, $return_banned);
break;
default:
return $this->get($fields, $start_from, $start_time, $end_time, $offset, $count, $extended);
break;
}
}
function getBanned(int $extended = 0, string $fields = "", string $name_case = "nom", int $merge = 0): object
{ {
$this->requireUser(); $this->requireUser();
$count = 50;
$offset = 0; $offset = 0;
$count = OPENVK_ROOT_CONF['openvk']['preferences']['newsfeed']['ignoredSourcesLimit'] ?? 50;
$banned = $this->getUser()->getIgnoredSources($offset, $count, ($extended != 1)); $banned = array_slice($this->getUser()->getIgnoredSources(1, $count + $offset, true), $offset);
$return_object = (object) [
'groups' => [],
'members' => [],
];
if($extended == 0) { if($extended == 0) {
foreach($banned as $ban) { $retArr/*d*/ = [
if($ban > 0) "groups" => [],
$return_object->members[] = $ban; "members" => [] # why
else
$return_object->groups[] = $ban;
}
} else {
if($merge == 1) {
$return_object = (object) [
'count' => sizeof($banned),
'items' => [],
]; ];
foreach($banned as $ban) { foreach($banned as $ban) {
$return_object->items[] = $ban->toVkApiStruct($this->getUser(), $fields); if($ban > 0) {
} $retArr["members"][] = $ban;
} else { } else {
$return_object = (object) [ $retArr["groups"][] = $ban;
'groups' => [], }
'profiles' => [], }
return $retArr;
} else {
$retArr = [
"groups" => [],
"profiles" => []
]; ];
$usIds = "";
$clubIds = "";
foreach($banned as $ban) { foreach($banned as $ban) {
if($ban->getRealId() > 0) if($ban > 0) {
$return_object->profiles[] = $ban->toVkApiStruct($this->getUser(), $fields); $usIds .= $ban . ",";
else } else {
$return_object->groups[] = $ban->toVkApiStruct($this->getUser(), $fields); $clubIds .= ($ban * -1) . ",";
}
} }
} }
return $return_object; $retArr["profiles"][] = (new Users)->get($usIds, $fields);
$retArr["groups"][] = (new Groups)->getById($clubIds, $fields);
return $retArr;
}
} }
function addBan(string $user_ids = "", string $group_ids = "") function addBan(string $user_ids = "", string $group_ids = "")
@ -151,46 +134,38 @@ final class Newsfeed extends VKAPIRequestHandler
$this->requireUser(); $this->requireUser();
$this->willExecuteWriteAction(); $this->willExecuteWriteAction();
# Formatting input ids if(empty($user_ids) && empty($group_ids))
$this->fail(52, "Provide 'user_ids' or 'groups_ids'");
$arr = [];
if(!empty($user_ids)) { if(!empty($user_ids)) {
$user_ids = array_map(function($el) { $arr = array_merge($arr, array_map(function($el) {
return (int)$el; return (int)$el;
}, explode(',', $user_ids)); }, explode(",", $user_ids)));
$user_ids = array_unique($user_ids);
} else
$user_ids = [];
if(!empty($group_ids)) {
$group_ids = array_map(function($el) {
return abs((int)$el) * -1;
}, explode(',', $group_ids));
$group_ids = array_unique($group_ids);
} else
$group_ids = [];
$ids = array_merge($user_ids, $group_ids);
if(sizeof($ids) < 1)
return 0;
if(sizeof($ids) > 10)
$this->fail(-10, "Limit of 'ids' is 10");
$config_limit = OPENVK_ROOT_CONF['openvk']['preferences']['newsfeed']['ignoredSourcesLimit'] ?? 50;
$user_ignores = $this->getUser()->getIgnoredSourcesCount();
if(($user_ignores + sizeof($ids)) > $config_limit) {
$this->fail(-50, "Ignoring limit exceeded");
} }
$entities = get_entities($ids); if(!empty($group_ids)) {
$successes = 0; $arr = array_merge($arr, array_map(function($el) {
foreach($entities as $entity) { return abs((int)$el) * -1;
if(!$entity || $entity->getRealId() === $this->getUser()->getRealId() || $entity->isHideFromGlobalFeedEnabled() || $entity->isIgnoredBy($this->getUser())) continue; }, explode(",", $group_ids)));
}
$entity->addIgnore($this->getUser()); $arr = array_unique($arr);
if(sizeof($arr) > 10 || sizeof($arr) < 1)
$this->fail(20, "You can ignore only 10 users/groups at once");
$successes = 0;
foreach($arr as $ar) {
$entity = getEntity($ar);
if(!$entity || $entity->isHideFromGlobalFeedEnabled() || $entity->isIgnoredBy($this->getUser())) continue;
$entity->toggleIgnore($this->getUser());
$successes += 1; $successes += 1;
} }
return 1; return (int)($successes > 0);
} }
function deleteBan(string $user_ids = "", string $group_ids = "") function deleteBan(string $user_ids = "", string $group_ids = "")
@ -198,38 +173,37 @@ final class Newsfeed extends VKAPIRequestHandler
$this->requireUser(); $this->requireUser();
$this->willExecuteWriteAction(); $this->willExecuteWriteAction();
if(empty($user_ids) && empty($group_ids))
$this->fail(52, "Provide 'user_ids' or 'groups_ids'");
$arr = [];
if(!empty($user_ids)) { if(!empty($user_ids)) {
$user_ids = array_map(function($el) { $arr = array_merge($arr, array_map(function($el) {
return (int)$el; return (int)$el;
}, explode(',', $user_ids)); }, explode(",", $user_ids)));
$user_ids = array_unique($user_ids); }
} else
$user_ids = [];
if(!empty($group_ids)) { if(!empty($group_ids)) {
$group_ids = array_map(function($el) { $arr = array_merge($arr, array_map(function($el) {
return abs((int)$el) * -1; return abs((int)$el) * -1;
}, explode(',', $group_ids)); }, explode(",", $group_ids)));
$group_ids = array_unique($group_ids); }
} else
$group_ids = [];
$ids = array_merge($user_ids, $group_ids); $arr = array_unique($arr);
if(sizeof($ids) < 1) if(sizeof($arr) > 10 || sizeof($arr) < 1)
return 0; $this->fail(20, "You can unignore only 10 users/groups at once");
if(sizeof($ids) > 10)
$this->fail(-10, "Limit of ids is 10");
$entities = get_entities($ids);
$successes = 0; $successes = 0;
foreach($entities as $entity) { foreach($arr as $ar) {
if(!$entity || $entity->getRealId() === $this->getUser()->getRealId() || !$entity->isIgnoredBy($this->getUser())) continue; $entity = getEntity($ar);
$entity->removeIgnore($this->getUser()); if(!$entity || $entity->isHideFromGlobalFeedEnabled() || !$entity->isIgnoredBy($this->getUser())) continue;
$entity->toggleIgnore($this->getUser());
$successes += 1; $successes += 1;
} }
return 1; return (int)($successes > 0);
} }
} }

View file

@ -42,10 +42,9 @@ class Club extends RowModel
return iterator_to_array($avPhotos)[0] ?? NULL; return iterator_to_array($avPhotos)[0] ?? NULL;
} }
function getAvatarUrl(string $size = "miniscule", $avPhoto = NULL): string function getAvatarUrl(string $size = "miniscule"): string
{ {
$serverUrl = ovk_scheme(true) . $_SERVER["HTTP_HOST"]; $serverUrl = ovk_scheme(true) . $_SERVER["HTTP_HOST"];
if(!$avPhoto)
$avPhoto = $this->getAvatarPhoto(); $avPhoto = $this->getAvatarPhoto();
return is_null($avPhoto) ? "$serverUrl/assets/packages/static/openvk/img/camera_200.png" : $avPhoto->getURLBySizeId($size); return is_null($avPhoto) ? "$serverUrl/assets/packages/static/openvk/img/camera_200.png" : $avPhoto->getURLBySizeId($size);
@ -444,51 +443,25 @@ class Club extends RowModel
$res->id = $this->getId(); $res->id = $this->getId();
$res->name = $this->getName(); $res->name = $this->getName();
$res->screen_name = $this->getShortCode() ?? "club".$this->getId(); $res->screen_name = $this->getShortCode();
$res->is_closed = false; $res->is_closed = 0;
$res->type = 'group';
$res->is_member = $user ? (int)$this->getSubscriptionStatus($user) : 0;
$res->deactivated = NULL; $res->deactivated = NULL;
$res->can_access_closed = true; $res->is_admin = $user && $this->canBeModifiedBy($user);
if(!is_array($fields)) if($user && $this->canBeModifiedBy($user)) {
$fields = explode(',', $fields); $res->admin_level = 3;
}
$avatar_photo = $this->getAvatarPhoto(); $res->is_member = $user && $this->getSubscriptionStatus($user) ? 1 : 0;
foreach($fields as $field) {
switch($field) { $res->type = "group";
case 'verified': $res->photo_50 = $this->getAvatarUrl("miniscule");
$res->verified = (int)$this->isVerified(); $res->photo_100 = $this->getAvatarUrl("tiny");
break; $res->photo_200 = $this->getAvatarUrl("normal");
case 'site':
$res->site = $this->getWebsite(); $res->can_create_topic = $user && $this->canBeModifiedBy($user) ? 1 : ($this->isEveryoneCanCreateTopics() ? 1 : 0);
break;
case 'description': $res->can_post = $user && $this->canBeModifiedBy($user) ? 1 : ($this->canPost() ? 1 : 0);
$res->description = $this->getDescription();
break;
case 'background':
$res->background = $this->getBackDropPictureURLs();
break;
case 'photo_50':
$res->photo_50 = $this->getAvatarUrl('miniscule', $avatar_photo);
break;
case 'photo_100':
$res->photo_100 = $this->getAvatarUrl('tiny', $avatar_photo);
break;
case 'photo_200':
$res->photo_200 = $this->getAvatarUrl('normal', $avatar_photo);
break;
case 'photo_max':
$res->photo_max = $this->getAvatarUrl('original', $avatar_photo);
break;
case 'members_count':
$res->members_count = $this->getFollowersCount();
break;
case 'real_id':
$res->real_id = $this->getRealId();
break;
}
}
return $res; return $res;
} }

View file

@ -10,43 +10,39 @@ trait TIgnorable
$ctx = DatabaseConnection::i()->getContext(); $ctx = DatabaseConnection::i()->getContext();
$data = [ $data = [
"owner" => $user->getId(), "owner" => $user->getId(),
"source" => $this->getRealId(), "ignored_source" => $this->getRealId(),
]; ];
$sub = $ctx->table("ignored_sources")->where($data); $sub = $ctx->table("ignored_sources")->where($data);
return $sub->count() > 0;
if(!$sub->fetch()) {
return false;
} }
function addIgnore(User $for_user): bool return true;
}
function getIgnoresCount()
{ {
return sizeof(DatabaseConnection::i()->getContext()->table("ignored_sources")->where("ignored_source", $this->getRealId()));
}
function toggleIgnore(User $user): bool
{
if($this->isIgnoredBy($user)) {
DatabaseConnection::i()->getContext()->table("ignored_sources")->where([
"owner" => $user->getId(),
"ignored_source" => $this->getRealId(),
])->delete();
return false;
} else {
DatabaseConnection::i()->getContext()->table("ignored_sources")->insert([ DatabaseConnection::i()->getContext()->table("ignored_sources")->insert([
"owner" => $for_user->getId(), "owner" => $user->getId(),
"source" => $this->getRealId(), "ignored_source" => $this->getRealId(),
]); ]);
return true; return true;
} }
function removeIgnore(User $for_user): bool
{
DatabaseConnection::i()->getContext()->table("ignored_sources")->where([
"owner" => $for_user->getId(),
"source" => $this->getRealId(),
])->delete();
return true;
}
function toggleIgnore(User $for_user): bool
{
if($this->isIgnoredBy($for_user)) {
$this->removeIgnore($for_user);
return false;
} else {
$this->addIgnore($for_user);
return true;
}
} }
} }

View file

@ -112,7 +112,7 @@ class User extends RowModel
return "/id" . $this->getId(); return "/id" . $this->getId();
} }
function getAvatarUrl(string $size = "miniscule", $avPhoto = NULL): string function getAvatarUrl(string $size = "miniscule"): string
{ {
$serverUrl = ovk_scheme(true) . $_SERVER["HTTP_HOST"]; $serverUrl = ovk_scheme(true) . $_SERVER["HTTP_HOST"];
@ -121,9 +121,7 @@ class User extends RowModel
else if($this->isBanned()) else if($this->isBanned())
return "$serverUrl/assets/packages/static/openvk/img/banned.jpg"; return "$serverUrl/assets/packages/static/openvk/img/banned.jpg";
if(!$avPhoto)
$avPhoto = $this->getAvatarPhoto(); $avPhoto = $this->getAvatarPhoto();
if(is_null($avPhoto)) if(is_null($avPhoto))
return "$serverUrl/assets/packages/static/openvk/img/camera_200.png"; return "$serverUrl/assets/packages/static/openvk/img/camera_200.png";
else else
@ -1346,6 +1344,11 @@ class User extends RowModel
$res->first_name = $this->getFirstName(); $res->first_name = $this->getFirstName();
$res->last_name = $this->getLastName(); $res->last_name = $this->getLastName();
$res->deactivated = $this->isDeactivated(); $res->deactivated = $this->isDeactivated();
$res->photo_50 = $this->getAvatarURL();
$res->photo_100 = $this->getAvatarURL("tiny");
$res->photo_200 = $this->getAvatarURL("normal");
$res->photo_id = !is_null($this->getAvatarPhoto()) ? $this->getAvatarPhoto()->getPrettyId() : NULL;
$res->is_closed = $this->isClosed(); $res->is_closed = $this->isClosed();
if(!is_null($user)) if(!is_null($user))
@ -1354,53 +1357,10 @@ class User extends RowModel
if(!is_array($fields)) if(!is_array($fields))
$fields = explode(',', $fields); $fields = explode(',', $fields);
$avatar_photo = $this->getAvatarPhoto();
foreach($fields as $field) { foreach($fields as $field) {
switch($field) { switch($field) {
case 'is_dead': case 'is_dead':
$res->is_dead = $this->isDead(); $res->is_dead = $user->isDead();
break;
case 'verified':
$res->verified = (int)$this->isVerified();
break;
case 'sex':
$res->sex = $this->isFemale() ? 1 : ($this->isNeutral() ? 0 : 2);
break;
case 'photo_50':
$res->photo_50 = $this->getAvatarUrl('miniscule', $avatar_photo);
break;
case 'photo_100':
$res->photo_100 = $this->getAvatarUrl('tiny', $avatar_photo);
break;
case 'photo_200':
$res->photo_200 = $this->getAvatarUrl('normal', $avatar_photo);
break;
case 'photo_max':
$res->photo_max = $this->getAvatarUrl('original', $avatar_photo);
break;
case 'photo_id':
$res->photo_id = $avatar_photo ? $avatar_photo->getPrettyId() : NULL;
break;
case 'background':
$res->background = $this->getBackDropPictureURLs();
break;
case 'reg_date':
$res->reg_date = $this->getRegistrationTime()->timestamp();
break;
case 'nickname':
$res->nickname = $this->getPseudo();
break;
case 'rating':
$res->rating = $this->getRating();
break;
case 'status':
$res->status = $this->getStatus();
break;
case 'screen_name':
$res->screen_name = $this->getShortCode() ?? "id".$this->getId();
break;
case 'real_id':
$res->real_id = $this->getRealId();
break; break;
} }
} }
@ -1408,6 +1368,36 @@ class User extends RowModel
return $res; return $res;
} }
function getIgnoredSources(int $page = 1, int $perPage = 10, bool $onlyIds = false)
{
$sources = DatabaseConnection::i()->getContext()->table("ignored_sources")->where("owner", $this->getId())->page($page, $perPage);
$arr = [];
foreach($sources as $source) {
$ignoredSource = (int)$source->ignored_source;
if($ignoredSource > 0)
$ignoredSourceModel = (new Users)->get($ignoredSource);
else
$ignoredSourceModel = (new Clubs)->get(abs($ignoredSource));
if(!$ignoredSourceModel)
continue;
if(!$onlyIds)
$arr[] = $ignoredSourceModel;
else
$arr[] = $ignoredSourceModel->getRealId();
}
return $arr;
}
function getIgnoredSourcesCount()
{
return sizeof(DatabaseConnection::i()->getContext()->table("ignored_sources")->where("owner", $this->getId()));
}
function getAudiosCollectionSize() function getAudiosCollectionSize()
{ {
return (new \openvk\Web\Models\Repositories\Audios)->getUserCollectionSize($this); return (new \openvk\Web\Models\Repositories\Audios)->getUserCollectionSize($this);
@ -1447,36 +1437,9 @@ class User extends RowModel
return $returnArr; return $returnArr;
} }
function getIgnoredSources(int $offset = 0, int $limit = 10, bool $onlyIds = false) function isHideFromGlobalFeedEnabled(): bool
{ {
$sources = DatabaseConnection::i()->getContext()->table("ignored_sources")->where("owner", $this->getId())->limit($limit, $offset)->order('id DESC'); return $this->isClosed();
$output_array = [];
foreach($sources as $source) {
if($onlyIds) {
$output_array[] = (int)$source->source;
} else {
$ignored_source_model = NULL;
$ignored_source_id = (int)$source->source;
if($ignored_source_id > 0)
$ignored_source_model = (new Users)->get($ignored_source_id);
else
$ignored_source_model = (new Clubs)->get(abs($ignored_source_id));
if(!$ignored_source_model)
continue;
$output_array[] = $ignored_source_model;
}
}
return $output_array;
}
function getIgnoredSourcesCount()
{
return DatabaseConnection::i()->getContext()->table("ignored_sources")->where("owner", $this->getId())->count();
} }
use Traits\TBackDrops; use Traits\TBackDrops;

View file

@ -43,18 +43,6 @@ class Clubs
return $this->toClub($this->clubs->get($id)); return $this->toClub($this->clubs->get($id));
} }
function getByIds(array $ids = []): array
{
$clubs = $this->clubs->select('*')->where('id IN (?)', $ids);
$clubs_array = [];
foreach($clubs as $club) {
$clubs_array[] = $this->toClub($club);
}
return $clubs_array;
}
function find(string $query, array $params = [], array $order = ['type' => 'id', 'invert' => false], int $page = 1, ?int $perPage = NULL): \Traversable function find(string $query, array $params = [], array $order = ['type' => 'id', 'invert' => false], int $page = 1, ?int $perPage = NULL): \Traversable
{ {
$query = "%$query%"; $query = "%$query%";

View file

@ -29,18 +29,6 @@ class Users
return $this->toUser($this->users->get($id)); return $this->toUser($this->users->get($id));
} }
function getByIds(array $ids = []): array
{
$users = $this->users->select('*')->where('id IN (?)', $ids);
$users_array = [];
foreach($users as $user) {
$users_array[] = $this->toUser($user);
}
return $users_array;
}
function getByShortURL(string $url): ?User function getByShortURL(string $url): ?User
{ {
$shortcode = $this->toUser($this->users->where("shortcode", $url)->fetch()); $shortcode = $this->toUser($this->users->where("shortcode", $url)->fetch());

View file

@ -43,7 +43,6 @@ final class GroupPresenter extends OpenVKPresenter
} }
$this->template->club = $club; $this->template->club = $club;
$this->template->ignore_status = $club->isIgnoredBy($this->user->identity);
} }
} }

View file

@ -54,10 +54,6 @@ final class UserPresenter extends OpenVKPresenter
$this->template->audioStatus = $user->getCurrentAudioStatus(); $this->template->audioStatus = $user->getCurrentAudioStatus();
$this->template->user = $user; $this->template->user = $user;
if($id !== $this->user->id) {
$this->template->ignore_status = $user->isIgnoredBy($this->user->identity);
}
} }
} }

View file

@ -197,14 +197,10 @@ final class WallPresenter extends OpenVKPresenter
if($this->user->identity->getNsfwTolerance() === User::NSFW_INTOLERANT) if($this->user->identity->getNsfwTolerance() === User::NSFW_INTOLERANT)
$queryBase .= " AND `nsfw` = 0"; $queryBase .= " AND `nsfw` = 0";
if(((int)$this->queryParam('return_banned')) == 0) { if(($ignoredCount = $this->user->identity->getIgnoredSourcesCount()) > 0) {
$ignored_sources_ids = $this->user->identity->getIgnoredSources(0, OPENVK_ROOT_CONF['openvk']['preferences']['newsfeed']['ignoredSourcesLimit'] ?? 50, true); $sources = implode("', '", $this->user->identity->getIgnoredSources(1, $ignoredCount, true));
if(sizeof($ignored_sources_ids) > 0) { $queryBase .= " AND `posts`.`wall` NOT IN ('$sources')";
$imploded_ids = implode("', '", $ignored_sources_ids);
$queryBase .= " AND `posts`.`wall` NOT IN ('$imploded_ids')";
}
} }
$posts = DatabaseConnection::i()->getConnection()->query("SELECT `posts`.`id` " . $queryBase . " ORDER BY `created` DESC LIMIT " . $pPage . " OFFSET " . ($page - 1) * $pPage); $posts = DatabaseConnection::i()->getConnection()->query("SELECT `posts`.`id` " . $queryBase . " ORDER BY `created` DESC LIMIT " . $pPage . " OFFSET " . ($page - 1) * $pPage);
@ -661,6 +657,60 @@ final class WallPresenter extends OpenVKPresenter
]]); ]]);
} }
function renderIgnoreSource()
{
$this->assertUserLoggedIn();
$this->willExecuteWriteAction(true);
if($_SERVER["REQUEST_METHOD"] !== "POST")
exit("");
$owner = $this->user->id;
$ignoredSource = (int)$this->postParam("source");
if($this->user->identity->getIgnoredSourcesCount() > 50)
$this->flashFail("err", "Error", tr("max_ignores", 50), null, true);
if($ignoredSource > 0) {
$ignoredSourceModel = (new Users)->get($ignoredSource);
if(!$ignoredSourceModel)
$this->flashFail("err", "Error", tr("invalid_user"), null, true);
if($ignoredSourceModel->getId() == $this->user->id)
$this->flashFail("err", "Error", tr("cant_ignore_self"), null, true);
if($ignoredSourceModel->isClosed())
$this->flashFail("err", "Error", tr("no_sense"), null, true);
} else {
$ignoredSourceModel = (new Clubs)->get(abs($ignoredSource));
if(!$ignoredSourceModel)
$this->flashFail("err", "Error", tr("invalid_club"), null, true);
if($ignoredSourceModel->isHideFromGlobalFeedEnabled())
$this->flashFail("err", "Error", tr("no_sense"), null, true);
}
if(!$ignoredSourceModel->toggleIgnore($this->user->identity)) {
$tr = "";
if($ignoredSource > 0)
$tr = tr("ignore_user");
else
$tr = tr("ignore_club");
$this->returnJson(["success" => true, "act" => "unignored", "text" => $tr]);
} else {
if($ignoredSource > 0)
$tr = tr("unignore_user");
else
$tr = tr("unignore_club");
$this->returnJson(["success" => true, "act" => "ignored", "text" => $tr]);
}
}
function renderAccept() { function renderAccept() {
$this->assertUserLoggedIn(); $this->assertUserLoggedIn();
$this->willExecuteWriteAction(true); $this->willExecuteWriteAction(true);

View file

@ -169,6 +169,9 @@
{var $canReport = $thisUser->getId() != $club->getOwner()->getId()} {var $canReport = $thisUser->getId() != $club->getOwner()->getId()}
{if $canReport} {if $canReport}
<a class="profile_link" style="display:block;" href="javascript:reportVideo()">{_report}</a> <a class="profile_link" style="display:block;" href="javascript:reportVideo()">{_report}</a>
<a n:if="!$club->isHideFromGlobalFeedEnabled()" class="profile_link" style="display:block;" id="ignoreSomeone" data-id="-{$club->getId()}">
{if !$club->isIgnoredBy($thisUser)}{_ignore_club}{else}{_unignore_club}{/if}
</a>
<script> <script>
function reportVideo() { function reportVideo() {
@ -194,9 +197,6 @@
} }
</script> </script>
{/if} {/if}
<a n:if="!$club->isHideFromGlobalFeedEnabled()" class="profile_link" style="display:block;" id="__ignoreSomeone" data-val='{!$ignore_status ? 1 : 0}' data-id="{$club->getRealId()}">
{if !$ignore_status}{_ignore_club}{else}{_unignore_club}{/if}
</a>
</div> </div>
<div> <div>
<div class="content_title_expanded" onclick="hidePanel(this);"> <div class="content_title_expanded" onclick="hidePanel(this);">

View file

@ -166,8 +166,8 @@
{/if} {/if}
<a class="profile_link" style="display:block;width:96%;" href="javascript:reportUser()">{_report}</a> <a class="profile_link" style="display:block;width:96%;" href="javascript:reportUser()">{_report}</a>
<a n:if="!$user->isHideFromGlobalFeedEnabled()" class="profile_link" style="display:block;width:96%;" id="__ignoreSomeone" data-val='{!$ignore_status ? 1 : 0}' data-id="{$user->getId()}"> <a class="profile_link" style="display:block;width:96%;" id="ignoreSomeone" data-id="{$user->getId()}">
{if !$ignore_status}{_ignore_user}{else}{_unignore_user}{/if} {if !$user->isIgnoredBy($thisUser)}{_ignore_user}{else}{_unignore_user}{/if}
</a> </a>
<script> <script>
function reportUser() { function reportUser() {

View file

@ -16,7 +16,7 @@
<a n:attr="id => (isset($globalFeed) ? 'act_tab_a' : 'ki')" href="/feed/all">{_all_news}</a> <a n:attr="id => (isset($globalFeed) ? 'act_tab_a' : 'ki')" href="/feed/all">{_all_news}</a>
</div> </div>
<a href='#' id="__feed_settings_link" data-pagescount='{ceil($paginatorConf->count / $paginatorConf->perPage)}'>{_feed_settings}</a> <span n:if="isset($globalFeed) && $thisUser->getIgnoredSourcesCount() > 0" id="_ignoredSourcesLink">{_ignored_sources}</span>
</div> </div>
<div n:class="postFeedWrapper, $thisUser->hasMicroblogEnabled() ? postFeedWrapperMicroblog"> <div n:class="postFeedWrapper, $thisUser->hasMicroblogEnabled() ? postFeedWrapperMicroblog">

View file

@ -40,8 +40,8 @@
<span n:if="$comment->getEditTime()" class="edited editedMark">({_edited_short})</span> <span n:if="$comment->getEditTime()" class="edited editedMark">({_edited_short})</span>
</a> </a>
{if !$timeOnly} {if !$timeOnly}
&nbsp;|
{if $comment->canBeDeletedBy($thisUser)} {if $comment->canBeDeletedBy($thisUser)}
|
<a href="/comment{$comment->getId()}/delete">{_delete}</a> <a href="/comment{$comment->getId()}/delete">{_delete}</a>
{/if} {/if}
{if $comment->canBeEditedBy($thisUser)} {if $comment->canBeEditedBy($thisUser)}

View file

@ -141,6 +141,8 @@ routes:
handler: "Wall->delete" handler: "Wall->delete"
- url: "/wall{num}_{num}/pin" - url: "/wall{num}_{num}/pin"
handler: "Wall->pin" handler: "Wall->pin"
- url: "/wall/ignoreSource"
handler: "Wall->ignoreSource"
- url: "/wall/accept" - url: "/wall/accept"
handler: "Wall->accept" handler: "Wall->accept"
- url: "/wall/decline" - url: "/wall/decline"

View file

@ -88,7 +88,3 @@ div.ovk-video > div > img
height: 31px; height: 31px;
min-width: 30px; min-width: 30px;
} }
.entity_vertical_list .entity_vertical_list_item img {
border-radius: 20px;
}

View file

@ -621,16 +621,6 @@ input[type=checkbox]:checked:disabled {
background-position: 0 -42px; background-position: 0 -42px;
} }
input[type="number"] {
border: 1px solid #C0CAD5;
padding: 3px;
font-size: 11px;
font-family: tahoma, verdana, arial, sans-serif;
width: 100%;
box-sizing: border-box;
outline: none;
}
#auth { #auth {
padding: 10px; padding: 10px;
} }
@ -2112,10 +2102,6 @@ table td[width="120"] {
border-radius: 2px; border-radius: 2px;
} }
.mb_tab:hover {
background: #e2e0e0;
}
.mb_tab div, .mb_tab > a { .mb_tab div, .mb_tab > a {
padding: 5px 9px; padding: 5px 9px;
display: block; display: block;
@ -3202,6 +3188,43 @@ body.article .floating_sidebar, body.article .page_content {
background: #E9F0F1 !important; background: #E9F0F1 !important;
} }
#_ignoredSourcesLink {
float: right;
margin-right: 3px;
margin-top: 2px;
color: #2B587A;
cursor: pointer;
}
#_ignoredSourcesLink:hover {
text-decoration: underline;
}
._ignorredList {
height: 87%;
border: 1px solid gray;
overflow-y: auto;
margin-top: 4px;
padding: 5px;
}
._ignorredList ._ignoredListContent img {
width: 38px;
}
._ignorredList ._ignoredListContent {
height: 42px;
padding-bottom: 9px;
}
.searchOptions.newer {
padding-left: 6px;
border-top: unset !important;
height: unset !important;
border-left: 1px solid #d8d8d8;
width: 26% !important;
}
hr { hr {
background-color: #d8d8d8; background-color: #d8d8d8;
border: none; border: none;
@ -3276,44 +3299,3 @@ hr {
width: 30px; width: 30px;
height: 7px; height: 7px;
} }
#__feed_settings_link {
float: right;
margin-right: 3px;
margin-top: 2px;
}
#__feed_settings_link:hover {
text-decoration: underline;
}
#_feed_settings_container {
height: 100%;
}
#_feed_settings_container #__content {
display: flex;
flex-direction: column;
gap: 4px;
padding: 5px;
height: 100%;
}
#_feed_settings_container #__content .settings_item {
display: flex;
flex-direction: column;
}
#_feed_settings_container #__content .final_settings_item {
align-self: end;
margin-top: 74px;
}
#_feed_settings_container #pageNumber {
width: 70px;
}
#_feed_settings_container .entity_vertical_list {
height: 206px;
overflow-x: hidden;
}

View file

@ -1,243 +1,80 @@
//u('.postFeedPageSelect').attr('style', 'display:none') $(document).on("click", "#_ignoredSourcesLink", (e) => {
// Source ignoring let body = `
u(document).on("click", "#__ignoreSomeone", async (e) => { <span id="ignoredClubersList">${tr("ignored_clubsers_list")}</span>
e.preventDefault() <div class="_ignorredList"></div>
const TARGET = u(e.target)
const ENTITY_ID = Number(e.target.dataset.id)
const VAL = Number(e.target.dataset.val)
const ACT = VAL == 1 ? 'ignore' : 'unignore'
const METHOD_NAME = ACT == 'ignore' ? 'addBan' : 'deleteBan'
const PARAM_NAME = ENTITY_ID < 0 ? 'group_ids' : 'user_ids'
const ENTITY_NAME = ENTITY_ID < 0 ? 'club' : 'user'
const URL = `/method/newsfeed.${METHOD_NAME}?auth_mechanism=roaming&${PARAM_NAME}=${Math.abs(ENTITY_ID)}`
TARGET.addClass('lagged')
const REQ = await fetch(URL)
const RES = await REQ.json()
TARGET.removeClass('lagged')
if(RES.error_code) {
switch(RES.error_code) {
case -10:
fastError(';/')
break
case -50:
fastError(tr('ignored_sources_limit'))
break
default:
fastError(res.error_msg)
break
}
return
}
if(RES.response == 1) {
if(ACT == 'unignore') {
TARGET.attr('data-val', '1')
TARGET.html(tr(`ignore_${ENTITY_NAME}`))
} else {
TARGET.attr('data-val', '0')
TARGET.html(tr(`unignore_${ENTITY_NAME}`))
}
}
})
u(document).on('click', '#__feed_settings_link', (e) => {
e.preventDefault()
let current_tab = 'main';
const body = `
<div id='_feed_settings_container'>
<div id='_tabs'>
<div class="mb_tabs">
<div class="mb_tab" data-name='main'>
<a>
${tr('main')}
</a>
</div>
<div class="mb_tab" data-name='ignored'>
<a>
${tr('ignored_sources')}
</a>
</div>
</div>
</div>
<div id='__content'></div>
</div>
` `
MessageBox(tr("ignored_sources"), body, [tr("cancel")], [Function.noop]);
MessageBox(tr("feed_settings"), body, [tr("close")], [Function.noop]) document.querySelector(".ovk-diag-body").style.padding = "10px"
u('.ovk-diag-body').attr('style', 'padding:0px;height: 255px;') document.querySelector(".ovk-diag-body").style.height = "330px"
async function __switchTab(tab) async function insertMoreSources(page) {
{ document.querySelector("._ignorredList").insertAdjacentHTML("beforeend", `<img id="loader" src="/assets/packages/static/openvk/img/loading_mini.gif">`)
current_tab = tab let ar = await API.Wall.getIgnoredSources(page)
u(`#_feed_settings_container .mb_tab`).attr('id', 'ki') u("#loader").remove()
u(`#_feed_settings_container .mb_tab[data-name='${tab}']`).attr('id', 'active')
u(`#_feed_settings_container .mb_tabs input`).remove()
switch(current_tab) { let pagesCount = Math.ceil(Number(ar.count) / 10)
case 'main':
const __temp_url = new URL(location.href)
const PAGES_COUNT = Number(e.target.dataset.pagescount ?? '10')
const CURRENT_PERPAGE = Number(__temp_url.searchParams.get('posts') ?? 10)
const CURRENT_PAGE = Number(__temp_url.searchParams.get('p') ?? 1)
const CURRENT_RETURN_BANNED = Number(__temp_url.searchParams.get('return_banned') ?? 0)
const COUNT = [1, 5, 10, 20, 30, 40, 50]
u('#_feed_settings_container #__content').html(`
<div class='settings_item'>
${tr('posts_per_page')}:
<select id="pageSelect"></select>
</div>
<div class='settings_item'>
${tr('start_from_page')}
<input type='number' min='1' max='${PAGES_COUNT}' id='pageNumber' value='${CURRENT_PAGE}' placeholder='${CURRENT_PAGE}'>
</div>
<div class='settings_item'>
<label>
<input type='checkbox' id="showIgnored" ${CURRENT_RETURN_BANNED == 1 ? 'checked' : ''}>
${tr('show_ignored_sources')}
</label>
</div>
<div class='final_settings_item'>
<input class='button' type='button' value='${tr('apply')}'>
</div>
`)
u('#_feed_settings_container').on('click', '.final_settings_item input', (e) => { for(const a of ar.items) {
const INPUT_PAGES_COUNT = parseInt(u('#_feed_settings_container #pageSelect').nodes[0].selectedOptions[0].value ?? '10') document.querySelector("._ignorredList").insertAdjacentHTML("beforeend", `
const INPUT_PAGE = parseInt(u('#pageNumber').nodes[0].value ?? '1') <div class="_ignoredListContent">
const INPUT_IGNORED = Number(u('#showIgnored').nodes[0].checked ?? false) <a href="${a.url}" target="_blank">
<img style="float: left" class="ava" src="${a.avatar}">
const FINAL_URL = new URL(location.href)
if(CURRENT_PERPAGE != INPUT_PAGES_COUNT) {
FINAL_URL.searchParams.set('posts', INPUT_PAGES_COUNT)
}
if(CURRENT_PAGE != INPUT_PAGE && INPUT_PAGE <= PAGES_COUNT) {
FINAL_URL.searchParams.set('p', Math.max(1, INPUT_PAGE))
}
if(INPUT_IGNORED == 1) {
FINAL_URL.searchParams.set('return_banned', 1)
} else {
FINAL_URL.searchParams.delete('return_banned')
}
window.location.assign(FINAL_URL.href)
})
COUNT.forEach(item => {
u('#_feed_settings_container #pageSelect').append(`
<option value="${item}" ${item == CURRENT_PERPAGE ? 'selected' : ''}>${item}</option>
`)
})
break
case 'ignored':
u('#_feed_settings_container #__content').html(`
<div id='gif_loader'></div>
`)
if(!window.openvk.ignored_list) {
const IGNORED_RES = await fetch('/method/newsfeed.getBanned?auth_mechanism=roaming&extended=1&fields=real_id,screen_name,photo_50&merge=1')
const IGNORED_LIST = await IGNORED_RES.json()
window.openvk.ignored_list = IGNORED_LIST
}
u('#_feed_settings_container #__content').html(`
<div class='entity_vertical_list mini'></div>
`)
u('#_feed_settings_container .mb_tabs').append(`
<input class='button lagged' id='_remove_ignores' type='button' value='${tr('stop_ignore')}'>
`)
if(window.openvk.ignored_list.error_code) {
fastError(IGNORED_LIST.error_msg)
return
}
if(window.openvk.ignored_list.response.items.length < 1) {
u('#_feed_settings_container #__content').html(tr('no_ignores_count'))
u('#_remove_ignores').remove()
}
window.openvk.ignored_list.response.items.forEach(ignore_item => {
let name = ignore_item.name
if(!name) {
name = ignore_item.first_name + ' ' + ignore_item.last_name
}
u('#_feed_settings_container #__content .entity_vertical_list').append(`
<label class='entity_vertical_list_item with_third_column' data-id='${ignore_item.real_id}'>
<div class='first_column'>
<a href='/${ignore_item.screen_name}' class='avatar'>
<img src='${ignore_item.photo_50}'>
</a> </a>
<div style="float: left;margin-left: 6px;">
<div class='info'> <a href="${a.url}" target="_blank">${ovk_proc_strtr(escapeHtml(a.name), 30)}</a><br>
<b class='noOverflow'>${ovk_proc_strtr(escapeHtml(name), 100)}</b> <a class="profile_link" id="ignoreSomeone" data-id="${a.id}">${a.id > 0 ? tr("unignore_user") : tr("unignore_club")}</a>
</div> </div>
</div> </div>
<div class='third_column'>
<input type='checkbox' name='remove_me'>
</div>
</label>
`) `)
}
if(ar.fact && document.querySelector("#ignoredClubersList").dataset.fact != 1) {
document.querySelector("#ignoredClubersList").innerHTML += " "+tr("interesting_fact", Number(ar.fact))
document.querySelector("#ignoredClubersList").setAttribute("data-fact", "1")
}
if(page < pagesCount) {
document.querySelector("._ignorredList").insertAdjacentHTML("beforeend", `
<div id="showMoreIgnors" data-pagesCount="${pagesCount}" data-page="${page + 1}" style="width: 99%;text-align: center;background: #d5d5d5;height: 22px;padding-top: 9px;cursor:pointer;">
<span>more...</span>
</div>`)
}
}
insertMoreSources(1)
$(".ignorredList .list").on("click", "#showMoreIgnors", (e) => {
u(e.currentTarget).remove()
insertMoreSources(Number(e.currentTarget.dataset.page))
})
}) })
u("#_feed_settings_container").on("click", "input[name='remove_me']", async (e) => { $(document).on("click", "#ignoreSomeone", (e) => {
const checks_count = u(`input[name='remove_me']:checked`).length let xhr = new XMLHttpRequest()
if(checks_count > 0) { xhr.open("POST", "/wall/ignoreSource")
u('.mb_tabs #_remove_ignores').removeClass('lagged')
xhr.onloadstart = () => {
e.currentTarget.classList.add("lagged")
}
xhr.onerror = xhr.ontimeout = () => {
MessageBox(tr("error"), "Unknown error occured", [tr("ok")], [Function.noop]);
}
xhr.onload = () => {
let result = JSON.parse(xhr.responseText)
e.currentTarget.classList.remove("lagged")
if(result.success) {
e.currentTarget.innerHTML = result.text
} else { } else {
u('.mb_tabs #_remove_ignores').addClass('lagged') MessageBox(tr("error"), result.flash.message, [tr("ok")], [Function.noop]);
}
if(checks_count > 10) {
e.preventDefault()
}
})
u('#_feed_settings_container').on('click', '#_remove_ignores', async (e) => {
e.target.classList.add('lagged')
const ids = []
u('#__content .entity_vertical_list label').nodes.forEach(item => {
const _checkbox = item.querySelector(`input[type='checkbox'][name='remove_me']`)
if(_checkbox.checked) {
ids.push(item.dataset.id)
}
})
const user_ids = []
const group_ids = []
ids.forEach(id => {
id > 0 ? user_ids.push(id) : group_ids.push(Math.abs(id))
})
const res = await fetch(`/method/newsfeed.deleteBan?auth_mechanism=roaming&user_ids=${user_ids.join(',')}&group_ids=${group_ids.join(',')}`)
const resp = await res.json()
if(resp.error_code) {
console.error(resp.error_msg)
return
}
window.openvk.ignored_list = null
__switchTab('ignored')
})
break
} }
} }
u("#_feed_settings_container").on("click", ".mb_tab a", async (e) => { let formdata = new FormData
await __switchTab(u(e.target).closest('.mb_tab').attr('data-name')) formdata.append("hash", u("meta[name=csrf]").attr("value"))
}) formdata.append("source", e.currentTarget.dataset.id)
__switchTab('main') xhr.send(formdata)
}) })

View file

@ -277,45 +277,13 @@ function parseAttachments(string $attachments): array
return $returnArr; return $returnArr;
} }
function get_entity_by_id(int $id) function getEntity(int $id) {
{
if($id > 0) if($id > 0)
return (new openvk\Web\Models\Repositories\Users)->get($id); return (new openvk\Web\Models\Repositories\Users)->get($id);
return (new openvk\Web\Models\Repositories\Clubs)->get(abs($id)); return (new openvk\Web\Models\Repositories\Clubs)->get(abs($id));
} }
function get_entities(array $ids = []): array
{
$main_result = [];
$users = [];
$clubs = [];
foreach($ids as $id) {
$id = (int)$id;
if($id < 0)
$clubs[] = abs($id);
if($id > 0)
$users[] = $id;
}
if(sizeof($users) > 0) {
$users_tmp = (new openvk\Web\Models\Repositories\Users)->getByIds($users);
foreach($users_tmp as $user) {
$main_result[] = $user;
}
}
if(sizeof($clubs) > 0) {
$clubs_tmp = (new openvk\Web\Models\Repositories\Clubs)->getByIds($clubs);
foreach($clubs_tmp as $club) {
$main_result[] = $club;
}
}
return $main_result;
}
function ovk_scheme(bool $with_slashes = false): string function ovk_scheme(bool $with_slashes = false): string
{ {
$scheme = ovk_is_ssl() ? "https" : "http"; $scheme = ovk_is_ssl() ? "https" : "http";

View file

@ -0,0 +1,6 @@
CREATE TABLE `ignored_sources` (
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`owner` bigint(20) UNSIGNED NOT NULL,
`ignored_source` bigint(20) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci;

View file

@ -1,2 +0,0 @@
CREATE TABLE `openvk`.`ignored_sources` (`id` BIGINT(20) UNSIGNED NULL AUTO_INCREMENT , `owner` BIGINT(20) UNSIGNED NOT NULL , `source` BIGINT(20) NOT NULL , PRIMARY KEY (`id`), INDEX (`owner`)) ENGINE = InnoDB;
ALTER TABLE `openvk`.`ignored_sources` ADD INDEX `owner_source` (`owner`, `source`);

View file

@ -219,7 +219,6 @@
"my_news" = "My news"; "my_news" = "My news";
"all_news" = "All news"; "all_news" = "All news";
"posts_per_page" = "Number of posts per page"; "posts_per_page" = "Number of posts per page";
"show_ignored_sources" = "Show ignored sources";
"attachment" = "Attachment"; "attachment" = "Attachment";
"post_as_group" = "Post as group"; "post_as_group" = "Post as group";
@ -246,16 +245,20 @@
"edited_short" = "edited"; "edited_short" = "edited";
"feed_settings" = "Feed settings";
"ignored_sources" = "Ignored sources"; "ignored_sources" = "Ignored sources";
"ignore_user" = "Ignore user"; "ignore_user" = "Ignore user";
"unignore_user" = "Unignore user"; "unignore_user" = "Stop ignoring user";
"ignore_club" = "Ignore club"; "ignore_club" = "Ignore club";
"unignore_club" = "Unignore club"; "unignore_club" = "Stop ignoring club";
"no_ignores_count" = "No ignored sources.";
"stop_ignore" = "Unignore"; "ignored_clubsers_list" = "This users and clubs doesn't appears in your global feed.";
"start_from_page" = "Start from page"; "interesting_fact_zero" = "Fun fact: you doesn't have been ignored!";
"interesting_fact_one" = "Fun fact: you have been ignored by one user";
"interesting_fact_few" = "Fun fact: you have been ignored by $1 users.";
"interesting_fact_many" = "Fun fact: you have been ignored by $1 users.";
"interesting_fact_other" = "Fun fact: you have been ignored by $1 users.";
"add_new_ignores" = "Add new";
"all_posts" = "All posts"; "all_posts" = "All posts";
"users_posts" = "Posts by $1"; "users_posts" = "Posts by $1";
@ -1549,7 +1552,9 @@
"description_too_long" = "Description is too long."; "description_too_long" = "Description is too long.";
"invalid_club" = "This group does not exists."; "invalid_club" = "This group does not exists.";
"invalid_user" = "This user does not exists."; "invalid_user" = "This user does not exists.";
"ignored_sources_limit" = "Limit of ignored sources has exceed"; "no_sense" = "No sense.";
"cant_ignore_self" = "Can't ignore urself.";
"max_ignores" = "Max ignores — $1";
"invalid_audio" = "Invalid audio."; "invalid_audio" = "Invalid audio.";
"do_not_have_audio" = "You don't have this audio."; "do_not_have_audio" = "You don't have this audio.";
@ -1764,7 +1769,6 @@
"question_confirm" = "This action can't be undone. Do you really wanna do it?"; "question_confirm" = "This action can't be undone. Do you really wanna do it?";
"confirm_m" = "Confirm"; "confirm_m" = "Confirm";
"action_successfully" = "Success"; "action_successfully" = "Success";
"apply" = "Apply";
/* User Alerts */ /* User Alerts */

View file

@ -204,7 +204,6 @@
"my_news" = "Мои новости"; "my_news" = "Мои новости";
"all_news" = "Все новости"; "all_news" = "Все новости";
"posts_per_page" = "Количество записей на странице"; "posts_per_page" = "Количество записей на странице";
"show_ignored_sources" = "Показывать игнорируемые источники";
"attachment" = "Вложение"; "attachment" = "Вложение";
"post_as_group" = "От имени сообщества"; "post_as_group" = "От имени сообщества";
"comment_as_group" = "От имени сообщества"; "comment_as_group" = "От имени сообщества";
@ -226,16 +225,19 @@
"post_is_ad" = "Этот пост был размещён за взятку."; "post_is_ad" = "Этот пост был размещён за взятку.";
"edited_short" = "ред."; "edited_short" = "ред.";
"feed_settings" = "Настройки ленты";
"ignored_sources" = "Игнорируемые источники"; "ignored_sources" = "Игнорируемые источники";
"ignore_user" = "Игнорировать пользователя"; "ignore_user" = "Игнорировать пользователя";
"unignore_user" = "Не игнорировать пользователя"; "unignore_user" = "Не игнорировать пользователя";
"ignore_club" = "Игнорировать группу"; "ignore_club" = "Игнорировать группу";
"unignore_club" = "Не игнорировать группу"; "unignore_club" = "Не игнорировать группу";
"no_ignores_count" = "Игнорируемых источников нет."; "ignored_clubsers_list" = "Эти пользователи и группы не показываются в глобальной ленте.";
"stop_ignore" = "Не игнорировать"; "interesting_fact_zero" = "Интересный факт: вас никто не игнорирует!";
"start_from_page" = "Начинать со страницы"; "interesting_fact_one" = "Интересный факт: вас игнорирует один пользователь.";
"interesting_fact_few" = "Интересный факт: вас игнорирует $1 пользователя.";
"interesting_fact_many" = "Интересный факт: вас игнорирует $1 пользователей.";
"interesting_fact_other" = "Интересный факт: вас игнорирует $1 пользователей.";
"add_new_ignores" = "Добавить новое";
"all_posts" = "Все записи"; "all_posts" = "Все записи";
"users_posts" = "Записи $1"; "users_posts" = "Записи $1";
@ -1453,7 +1455,9 @@
"invalid_club" = "Такой группы не существует."; "invalid_club" = "Такой группы не существует.";
"invalid_user" = "Такого пользователя не существует."; "invalid_user" = "Такого пользователя не существует.";
"ignored_sources_limit" = "Превышен лимит игнорируемых источников."; "no_sense" = "Нет смысла.";
"cant_ignore_self" = "Нельзя игнорировать себя.";
"max_ignores" = "Максимальное число игноров — $1";
"invalid_audio" = "Такой аудиозаписи не существует."; "invalid_audio" = "Такой аудиозаписи не существует.";
"do_not_have_audio" = "У вас нет этой аудиозаписи."; "do_not_have_audio" = "У вас нет этой аудиозаписи.";
@ -1658,7 +1662,6 @@
"question_confirm" = "Это действие нельзя отменить. Вы действительно уверены в том что хотите сделать?"; "question_confirm" = "Это действие нельзя отменить. Вы действительно уверены в том что хотите сделать?";
"confirm_m" = "Подтвердить"; "confirm_m" = "Подтвердить";
"action_successfully" = "Операция успешна"; "action_successfully" = "Операция успешна";
"apply" = "Применить";
/* User alerts */ /* User alerts */

View file

@ -52,8 +52,6 @@ openvk:
strict: false strict: false
music: music:
exposeOriginalURLs: true exposeOriginalURLs: true
newsfeed:
ignoredSourcesLimit: 50
wall: wall:
christian: false christian: false
anonymousPosting: anonymousPosting:

View file

@ -1,7 +1,7 @@
.page_header { .page_header {
background-image: url('/themepack/midnight/0.0.3.0/resource/xheader.png') !important; background-image: url('/themepack/midnight/0.0.2.9/resource/xheader.png') !important;
} }
.page_custom_header { .page_custom_header {
background-image: url('/themepack/midnight/0.0.3.0/resource/xheader_custom.png') !important; background-image: url('/themepack/midnight/0.0.2.9/resource/xheader_custom.png') !important;
} }

View file

@ -9,8 +9,7 @@ html {
body, body,
#backdropDripper, #backdropDripper,
#standaloneCommentBox, #standaloneCommentBox,
.ovk-photo-view, .ovk-photo-view {
.articleView {
background-color: #0e0b1a; background-color: #0e0b1a;
color: #c6d2e8; color: #c6d2e8;
} }
@ -24,8 +23,7 @@ span,
.crp-entry--message---text, .crp-entry--message---text,
.messenger-app--messages---message .time, .messenger-app--messages---message .time,
.navigation-lang .link_new, .navigation-lang .link_new,
.tippy-box text, .tippy-box text {
.articleView_author > div > span > a {
color: #8b9ab5 !important; color: #8b9ab5 !important;
} }
@ -132,19 +130,10 @@ th,
.borderup, .borderup,
#tour, #tour,
#auth, #auth,
.ovk-photo-view, .ovk-photo-view {
.page_wrap_content_main .def_row_content,
.topGrayBlock,
.bigPlayer {
border-color: #2c2640 !important; border-color: #2c2640 !important;
} }
.post-upload,
.post-has-poll,
.post-has-note {
color: #777;
}
.tippy-box[data-theme~="vk"][data-placement^='top']>.tippy-arrow::before, .tippy-box[data-theme~="vk"][data-placement^='top']>.tippy-arrow::before,
.tippy-box[data-theme~="vk"][data-placement^='bottom']>.tippy-arrow::before { .tippy-box[data-theme~="vk"][data-placement^='bottom']>.tippy-arrow::before {
border-top-color: #1e1a2b; border-top-color: #1e1a2b;
@ -165,28 +154,22 @@ hr {
.messagebox-content-header, .messagebox-content-header,
.accent-box, .accent-box,
.button_search, .button_search,
.header_navigation #search_box .search_box_button { .search_box_button {
background-color: #383052; background-color: #383052;
} }
.header_navigation #search_box .search_box_button {
box-shadow: 0px 2px 0px 0px rgb(70, 63, 96) inset;
}
.search_option_name { .search_option_name {
background-color: #383052 !important; background-color: #383052 !important;
color: lightgrey !important; color: lightgrey !important;
} }
.tab:hover, .tab:hover {
.ntSelect:hover {
background-color: #40375e; background-color: #40375e;
} }
.menu_divider, .menu_divider,
.ovk-diag-action, .ovk-diag-action,
.minilink .counter, .minilink .counter {
.topGrayBlock {
background-color: #2c2640; background-color: #2c2640;
} }
@ -283,8 +266,7 @@ center[style="background: white;border: #DEDEDE solid 1px;"],
td.e, td.e,
tr.e, tr.e,
.playlistListView:hover, .playlistListView:hover,
.playlistListView .playlistCover, .playlistListView .playlistCover {
.photosInsert > div {
background-color: #231e33 !important; background-color: #231e33 !important;
} }
@ -313,11 +295,11 @@ tr.v,
} }
.content_title_expanded { .content_title_expanded {
background-image: url("/themepack/midnight/0.0.3.0/resource/flex_arrow_open.png") !important; background-image: url("/themepack/midnight/0.0.2.9/resource/flex_arrow_open.png") !important;
} }
.content_title_unexpanded { .content_title_unexpanded {
background-image: url("/themepack/midnight/0.0.3.0/resource/flex_arrow_shut.gif") !important; background-image: url("/themepack/midnight/0.0.2.9/resource/flex_arrow_shut.gif") !important;
} }
.ovk-video>.preview, .ovk-video>.preview,
@ -344,17 +326,17 @@ tr.h {
.page_yellowheader { .page_yellowheader {
color: #c6d2e8; color: #c6d2e8;
background-image: url("/themepack/midnight/0.0.3.0/resource/header_purple.png") !important; background-image: url("/themepack/midnight/0.0.2.9/resource/header_purple.png") !important;
background-color: #231f34; background-color: #231f34;
border-color: #231f34; border-color: #231f34;
} }
.page_header { .page_header {
background-image: url("/themepack/midnight/0.0.3.0/resource/header.png") !important; background-image: url("/themepack/midnight/0.0.2.9/resource/header.png") !important;
} }
.page_custom_header { .page_custom_header {
background-image: url("/themepack/midnight/0.0.3.0/resource/header_custom.png") !important; background-image: url("/themepack/midnight/0.0.2.9/resource/header_custom.png") !important;
} }
.page_yellowheader span, .page_yellowheader span,
@ -392,11 +374,11 @@ select,
} }
input[type="checkbox"] { input[type="checkbox"] {
background-image: url("/themepack/midnight/0.0.3.0/resource/checkbox.png") !important; background-image: url("/themepack/midnight/0.0.2.9/resource/checkbox.png") !important;
} }
input[type="radio"] { input[type="radio"] {
background-image: url("/themepack/midnight/0.0.3.0/resource/radio.png") !important; background-image: url("/themepack/midnight/0.0.2.9/resource/radio.png") !important;
} }
.header_navigation .link, .header_navigation .header_divider_stick { .header_navigation .link, .header_navigation .header_divider_stick {
@ -404,20 +386,20 @@ input[type="radio"] {
} }
.heart { .heart {
background-image: url("/themepack/midnight/0.0.3.0/resource/like.gif") !important; background-image: url("/themepack/midnight/0.0.2.9/resource/like.gif") !important;
} }
.pinned-mark, .pinned-mark,
.post-author .pin { .post-author .pin {
background-image: url("/themepack/midnight/0.0.3.0/resource/pin.png") !important; background-image: url("/themepack/midnight/0.0.2.9/resource/pin.png") !important;
} }
.repost-icon { .repost-icon {
background-image: url("/themepack/midnight/0.0.3.0/resource/published.gif") !important; background-image: url("/themepack/midnight/0.0.2.9/resource/published.gif") !important;
} }
.post-author .delete { .post-author .delete {
background-image: url("/themepack/midnight/0.0.3.0/resource/input_clear.gif") !important; background-image: url("/themepack/midnight/0.0.2.9/resource/input_clear.gif") !important;
} }
.user-alert { .user-alert {
@ -450,7 +432,7 @@ input[type="radio"] {
} }
#backdropEditor { #backdropEditor {
background-image: url("/themepack/midnight/0.0.3.0/resource/backdrop-editor.gif") !important; background-image: url("/themepack/midnight/0.0.2.9/resource/backdrop-editor.gif") !important;
border-color: #473e66 !important; border-color: #473e66 !important;
} }
@ -503,8 +485,7 @@ input[type="radio"] {
background: #19142D !important; background: #19142D !important;
} }
.audioEntry .performer a, .audioEntry .performer a {
.bigPlayer .paddingLayer .trackInfo a {
color: #a2a1a1 !important; color: #a2a1a1 !important;
} }
@ -610,7 +591,3 @@ ul {
background: #28223a; background: #28223a;
border: #2c2640 solid 1px; border: #2c2640 solid 1px;
} }
#backdropFilePicker {
margin: 15px !important;
}

View file

@ -1,5 +1,5 @@
id: midnight id: midnight
version: "0.0.3.0" version: "0.0.2.9"
openvk_version: 0 openvk_version: 0
enabled: 1 enabled: 1
metadata: metadata: