Merge branch 'master' into FeedIgnore

This commit is contained in:
Ry0 2025-06-02 01:13:57 +03:00 committed by GitHub
commit cf3a664143
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
66 changed files with 650 additions and 702 deletions

View file

@ -5,6 +5,7 @@ declare(strict_types=1);
namespace openvk\VKAPI\Handlers; namespace openvk\VKAPI\Handlers;
use openvk\Web\Models\Exceptions\InvalidUserNameException; use openvk\Web\Models\Exceptions\InvalidUserNameException;
use openvk\Web\Util\Validator;
final class Account extends VKAPIRequestHandler final class Account extends VKAPIRequestHandler
{ {
@ -95,7 +96,7 @@ final class Account extends VKAPIRequestHandler
# TODO: Filter # TODO: Filter
} }
public function saveProfileInfo(string $first_name = "", string $last_name = "", string $screen_name = "", int $sex = -1, int $relation = -1, string $bdate = "", int $bdate_visibility = -1, string $home_town = "", string $status = ""): object public function saveProfileInfo(string $first_name = "", string $last_name = "", string $screen_name = "", int $sex = -1, int $relation = -1, string $bdate = "", int $bdate_visibility = -1, string $home_town = "", string $status = "", string $telegram = null): object
{ {
$this->requireUser(); $this->requireUser();
$this->willExecuteWriteAction(); $this->willExecuteWriteAction();
@ -138,13 +139,13 @@ final class Account extends VKAPIRequestHandler
$user->setSex($sex == 1 ? 1 : 0); $user->setSex($sex == 1 ? 1 : 0);
} }
if ($relation > -1) { if ($relation > -1 && $relation <= 8) {
$user->setMarital_Status($relation); $user->setMarital_Status($relation);
} }
if (!empty($bdate)) { if (!empty($bdate)) {
$birthday = strtotime($bdate); $birthday = strtotime($bdate);
if (!is_int($birthday)) { if (!is_int($birthday) || $birthday > time()) {
$this->fail(100, "invalid value of bdate."); $this->fail(100, "invalid value of bdate.");
} }
@ -171,9 +172,26 @@ final class Account extends VKAPIRequestHandler
$user->setStatus($status); $user->setStatus($status);
} }
if ($sex > 0 || $relation > -1 || $bdate_visibility > 1 || !empty("$first_name$last_name$screen_name$bdate$home_town$status")) { if (!is_null($telegram)) {
if (empty($telegram)) {
$user->setTelegram(null);
} elseif (Validator::i()->telegramValid($telegram)) {
if (strpos($telegram, "t.me/") === 0) {
$user->setTelegram($telegram);
} else {
$user->setTelegram(ltrim($telegram, "@"));
}
}
}
if ($sex > 0 || $relation > -1 || $bdate_visibility > 1 || !is_null($telegram) || !empty("$first_name$last_name$screen_name$bdate$home_town$status")) {
$output["changed"] = 1; $output["changed"] = 1;
try {
$user->save(); $user->save();
} catch (\TypeError $e) {
$output["changed"] = 0;
}
} }
return (object) $output; return (object) $output;
@ -183,7 +201,7 @@ final class Account extends VKAPIRequestHandler
{ {
$this->requireUser(); $this->requireUser();
if (!OPENVK_ROOT_CONF['openvk']['preferences']['commerce']) { if (!OPENVK_ROOT_CONF['openvk']['preferences']['commerce']) {
$this->fail(105, "Commerce is disabled on this instance"); $this->fail(-105, "Commerce is disabled on this instance");
} }
return (object) ['votes' => $this->getUser()->getCoins()]; return (object) ['votes' => $this->getUser()->getCoins()];

View file

@ -14,7 +14,7 @@ use openvk\Web\Models\Entities\{Topic, Comment, User, Photo, Video};
final class Board extends VKAPIRequestHandler final class Board extends VKAPIRequestHandler
{ {
public function addTopic(int $group_id, string $title, string $text = "", bool $from_group = true) public function addTopic(int $group_id, string $title, string $text = null, bool $from_group = true)
{ {
$this->requireUser(); $this->requireUser();
$this->willExecuteWriteAction(); $this->willExecuteWriteAction();
@ -30,6 +30,7 @@ final class Board extends VKAPIRequestHandler
} }
$flags = 0; $flags = 0;
if ($from_group == true && $club->canBeModifiedBy($this->getUser())) { if ($from_group == true && $club->canBeModifiedBy($this->getUser())) {
$flags |= 0b10000000; $flags |= 0b10000000;
} }
@ -40,8 +41,10 @@ final class Board extends VKAPIRequestHandler
$topic->setTitle(ovk_proc_strtr($title, 127)); $topic->setTitle(ovk_proc_strtr($title, 127));
$topic->setCreated(time()); $topic->setCreated(time());
$topic->setFlags($flags); $topic->setFlags($flags);
$topic->save(); $topic->save();
try {
if (!empty($text)) { if (!empty($text)) {
$comment = new Comment(); $comment = new Comment();
$comment->setOwner($this->getUser()->getId()); $comment->setOwner($this->getUser()->getId());
@ -50,8 +53,12 @@ final class Board extends VKAPIRequestHandler
$comment->setContent($text); $comment->setContent($text);
$comment->setCreated(time()); $comment->setCreated(time());
$comment->setFlags($flags); $comment->setFlags($flags);
$comment->save(); $comment->save();
} }
} catch (\Throwable $e) {
return $topic->getId();
}
return $topic->getId(); return $topic->getId();
} }
@ -75,32 +82,35 @@ final class Board extends VKAPIRequestHandler
return 1; return 1;
} }
public function createComment(int $group_id, int $topic_id, string $message = "", string $attachments = "", bool $from_group = true) public function createComment(int $group_id, int $topic_id, string $message = "", bool $from_group = true)
{ {
$this->requireUser(); $this->requireUser();
$this->willExecuteWriteAction(); $this->willExecuteWriteAction();
if (empty($message) && empty($attachments)) { if (empty($message)) {
$this->fail(100, "Required parameter 'message' missing."); $this->fail(100, "Required parameter 'message' missing.");
} }
$topic = (new TopicsRepo())->getTopicById($group_id, $topic_id); $topic = (new TopicsRepo())->getTopicById($group_id, $topic_id);
if (!$topic || $topic->isDeleted() || $topic->isClosed()) { if (!$topic || $topic->isDeleted() || $topic->isClosed()) {
$this->fail(15, "Access denied"); $this->fail(15, "Access denied");
} }
$flags = 0; $flags = 0;
if ($from_group != 0 && !is_null($topic->getClub()) && $topic->getClub()->canBeModifiedBy($this->user)) { if ($from_group != 0 && ($topic->getClub()->canBeModifiedBy($this->user))) {
$flags |= 0b10000000; $flags |= 0b10000000;
} }
$comment = new Comment(); $comment = new Comment();
$comment->setOwner($this->getUser()->getId()); $comment->setOwner($this->getUser()->getId());
$comment->setModel(get_class($topic)); $comment->setModel(get_class($topic));
$comment->setTarget($topic->getId()); $comment->setTarget($topic->getId());
$comment->setContent($message); $comment->setContent($message);
$comment->setCreated(time()); $comment->setCreated(time());
$comment->setFlags($flags); $comment->setFlags($flags);
$comment->save(); $comment->save();
return $comment->getId(); return $comment->getId();
@ -113,7 +123,7 @@ final class Board extends VKAPIRequestHandler
$topic = (new TopicsRepo())->getTopicById($group_id, $topic_id); $topic = (new TopicsRepo())->getTopicById($group_id, $topic_id);
if (!$topic || !$topic->getClub() || $topic->isDeleted() || !$topic->getClub()->canBeModifiedBy($this->getUser())) { if (!$topic || $topic->isDeleted() || !$topic->getClub()->canBeModifiedBy($this->getUser())) {
return 0; return 0;
} }
@ -129,7 +139,7 @@ final class Board extends VKAPIRequestHandler
$topic = (new TopicsRepo())->getTopicById($group_id, $topic_id); $topic = (new TopicsRepo())->getTopicById($group_id, $topic_id);
if (!$topic || !$topic->getClub() || $topic->isDeleted() || !$topic->getClub()->canBeModifiedBy($this->getUser())) { if (!$topic || $topic->isDeleted() || !$topic->canBeModifiedBy($this->getUser())) {
return 0; return 0;
} }
@ -147,7 +157,7 @@ final class Board extends VKAPIRequestHandler
$topic = (new TopicsRepo())->getTopicById($group_id, $topic_id); $topic = (new TopicsRepo())->getTopicById($group_id, $topic_id);
if (!$topic || !$topic->getClub() || !$topic->getClub()->canBeModifiedBy($this->getUser())) { if (!$topic || !$topic->getClub()->canBeModifiedBy($this->getUser())) {
return 0; return 0;
} }
@ -158,75 +168,92 @@ final class Board extends VKAPIRequestHandler
return 1; return 1;
} }
public function getComments(int $group_id, int $topic_id, bool $need_likes = false, int $start_comment_id = 0, int $offset = 0, int $count = 40, bool $extended = false, string $sort = "asc") public function getComments(int $group_id, int $topic_id, bool $need_likes = false, int $offset = 0, int $count = 10, bool $extended = false)
{ {
# start_comment_id ne robit
$this->requireUser(); $this->requireUser();
if ($count < 1 || $count > 100) {
$this->fail(4, "Invalid count");
}
$topic = (new TopicsRepo())->getTopicById($group_id, $topic_id); $topic = (new TopicsRepo())->getTopicById($group_id, $topic_id);
if (!$topic || !$topic->getClub() || $topic->isDeleted()) { if (!$topic || $topic->isDeleted()) {
$this->fail(5, "Invalid topic"); $this->fail(5, "Not found");
} }
$arr = [ $obj = (object) [
"items" => [], "items" => [],
]; ];
$comms = array_slice(iterator_to_array($topic->getComments(1, $count + $offset)), $offset); if ($extended) {
foreach ($comms as $comm) { $obj->profiles = [];
$arr["items"][] = $this->getApiBoardComment($comm, $need_likes); $obj->groups = [];
}
$comments = array_slice(iterator_to_array($topic->getComments(1, $count + $offset)), $offset);
foreach ($comments as $comment) {
$obj->items[] = $comment->toVkApiStruct($this->getUser(), $need_likes);
if ($extended) { if ($extended) {
if ($comm->getOwner() instanceof \openvk\Web\Models\Entities\User) { $owner = $comment->getOwner();
$arr["profiles"][] = $comm->getOwner()->toVkApiStruct();
if ($owner instanceof \openvk\Web\Models\Entities\User) {
$obj->profiles[] = $owner->toVkApiStruct();
} }
if ($comm->getOwner() instanceof \openvk\Web\Models\Entities\Club) { if ($owner instanceof \openvk\Web\Models\Entities\Club) {
$arr["groups"][] = $comm->getOwner()->toVkApiStruct(); $obj->groups[] = $owner->toVkApiStruct();
} }
} }
} }
return $arr; return $obj;
} }
public function getTopics(int $group_id, string $topic_ids = "", int $order = 1, int $offset = 0, int $count = 40, bool $extended = false, int $preview = 0, int $preview_length = 90) public function getTopics(int $group_id, string $topic_ids = "", int $offset = 0, int $count = 10, bool $extended = false, int $preview = 0, int $preview_length = 90)
{ {
# order и extended ничё не делают # TODO: $extended
$this->requireUser(); $this->requireUser();
$arr = []; if ($count < 1 || $count > 100) {
$this->fail(4, "Invalid count");
}
$obj = (object) [];
$club = (new ClubsRepo())->get($group_id); $club = (new ClubsRepo())->get($group_id);
if (!$club || !$club->canBeViewedBy($this->getUser())) {
$this->fail(15, "Access denied");
}
$topics = array_slice(iterator_to_array((new TopicsRepo())->getClubTopics($club, 1, $count + $offset)), $offset); $topics = array_slice(iterator_to_array((new TopicsRepo())->getClubTopics($club, 1, $count + $offset)), $offset);
$arr["count"] = (new TopicsRepo())->getClubTopicsCount($club);
$arr["items"] = []; $obj->count = (new TopicsRepo())->getClubTopicsCount($club);
$arr["default_order"] = $order; $obj->items = [];
$arr["can_add_topics"] = $club->canBeModifiedBy($this->getUser()) ? true : ($club->isEveryoneCanCreateTopics() ? true : false); $obj->profiles = [];
$arr["profiles"] = []; $obj->can_add_topics = $club->canBeModifiedBy($this->getUser()) ? true : ($club->isEveryoneCanCreateTopics() ? true : false);
if (empty($topic_ids)) { if (empty($topic_ids)) {
foreach ($topics as $topic) { foreach ($topics as $topic) {
if ($topic->isDeleted()) { $obj->items[] = $topic->toVkApiStruct($preview, $preview_length > 1 ? $preview_length : 90);
continue;
}
$arr["items"][] = $topic->toVkApiStruct($preview, $preview_length > 1 ? $preview_length : 90);
} }
} else { } else {
$topics = explode(',', $topic_ids); $topics = explode(',', $topic_ids);
foreach ($topics as $topic) { foreach ($topics as $topic_id) {
$id = explode("_", $topic); $topic = (new TopicsRepo())->getTopicById($group_id, (int) $topic_id);
$topicy = (new TopicsRepo())->getTopicById((int) $id[0], (int) $id[1]);
if ($topicy && !$topicy->isDeleted()) { if ($topic && !$topic->isDeleted()) {
$arr["items"][] = $topicy->toVkApiStruct($preview, $preview_length > 1 ? $preview_length : 90); $obj->items[] = $topic->toVkApiStruct($preview, $preview_length > 1 ? $preview_length : 90);
} }
} }
} }
return $arr; return $obj;
} }
public function openTopic(int $group_id, int $topic_id) public function openTopic(int $group_id, int $topic_id)
@ -236,7 +263,7 @@ final class Board extends VKAPIRequestHandler
$topic = (new TopicsRepo())->getTopicById($group_id, $topic_id); $topic = (new TopicsRepo())->getTopicById($group_id, $topic_id);
if (!$topic || !$topic->getClub() || !$topic->isDeleted() || !$topic->getClub()->canBeModifiedBy($this->getUser())) { if (!$topic || !$topic->isDeleted() || !$topic->getClub()->canBeModifiedBy($this->getUser())) {
return 0; return 0;
} }
@ -248,11 +275,6 @@ final class Board extends VKAPIRequestHandler
return 1; return 1;
} }
public function restoreComment(int $group_id, int $topic_id, int $comment_id)
{
$this->fail(501, "Not implemented");
}
public function unfixTopic(int $group_id, int $topic_id) public function unfixTopic(int $group_id, int $topic_id)
{ {
$this->requireUser(); $this->requireUser();
@ -260,7 +282,7 @@ final class Board extends VKAPIRequestHandler
$topic = (new TopicsRepo())->getTopicById($group_id, $topic_id); $topic = (new TopicsRepo())->getTopicById($group_id, $topic_id);
if (!$topic || !$topic->getClub() || !$topic->getClub()->canBeModifiedBy($this->getUser())) { if (!$topic || !$topic->getClub()->canBeModifiedBy($this->getUser())) {
return 0; return 0;
} }
@ -275,33 +297,4 @@ final class Board extends VKAPIRequestHandler
return 1; return 1;
} }
private function getApiBoardComment(?Comment $comment, bool $need_likes = false)
{
$res = (object) [];
$res->id = $comment->getId();
$res->from_id = $comment->getOwner()->getId();
$res->date = $comment->getPublicationTime()->timestamp();
$res->text = $comment->getText(false);
$res->attachments = [];
$res->likes = [];
if ($need_likes) {
$res->likes = [
"count" => $comment->getLikesCount(),
"user_likes" => (int) $comment->hasLikeFrom($this->getUser()),
"can_like" => 1, # а чё типо не может ахахаххахах
];
}
foreach ($comment->getChildren() as $attachment) {
if ($attachment->isDeleted()) {
continue;
}
$res->attachments[] = $attachment->toVkApiStruct();
}
return $res;
}
} }

View file

@ -10,49 +10,33 @@ use openvk\Web\Models\Entities\Notifications\GiftNotification;
final class Gifts extends VKAPIRequestHandler final class Gifts extends VKAPIRequestHandler
{ {
public function get(int $user_id = null, int $count = 10, int $offset = 0) public function get(int $user_id = 0, int $count = 10, int $offset = 0)
{ {
# There is no extended :)
$this->requireUser(); $this->requireUser();
$i = 0;
$i += $offset;
$server_url = ovk_scheme(true) . $_SERVER["HTTP_HOST"]; $server_url = ovk_scheme(true) . $_SERVER["HTTP_HOST"];
if ($user_id) { if ($user_id < 1) {
$user = (new UsersRepo())->get($user_id); $user_id = $this->getUser()->getId();
} else {
$user = $this->getUser();
} }
$user = (new UsersRepo())->get($user_id);
if (!$user || $user->isDeleted()) { if (!$user || $user->isDeleted()) {
$this->fail(177, "Invalid user");
}
if (!$user->canBeViewedBy($this->getUser())) {
$this->fail(15, "Access denied"); $this->fail(15, "Access denied");
} }
/*
if(!$user->getPrivacyPermission('gifts.read', $this->getUser()))
$this->fail(15, "Access denied: this user chose to hide his gifts");*/
if (!$user->canBeViewedBy($this->getUser())) { if (!$user->canBeViewedBy($this->getUser())) {
$this->fail(15, "Access denied"); $this->fail(15, "Access denied");
} }
$gift_item = []; $gift_item = [];
$user_gifts = array_slice(iterator_to_array($user->getGifts(1, $count)), $offset, $count);
$userGifts = array_slice(iterator_to_array($user->getGifts(1, $count, false)), $offset); foreach ($user_gifts as $gift) {
if (sizeof($userGifts) < 0) {
return null;
}
foreach ($userGifts as $gift) {
if ($i < $count) {
$gift_item[] = [ $gift_item[] = [
"id" => $i,
"from_id" => $gift->anon == true ? 0 : $gift->sender->getId(), "from_id" => $gift->anon == true ? 0 : $gift->sender->getId(),
"message" => $gift->caption == null ? "" : $gift->caption, "message" => $gift->caption == null ? "" : $gift->caption,
"date" => $gift->sent->timestamp(), "date" => $gift->sent->timestamp(),
@ -62,11 +46,8 @@ final class Gifts extends VKAPIRequestHandler
"thumb_96" => $server_url . $gift->gift->getImage(2), "thumb_96" => $server_url . $gift->gift->getImage(2),
"thumb_48" => $server_url . $gift->gift->getImage(2), "thumb_48" => $server_url . $gift->gift->getImage(2),
], ],
"privacy" => 0,
]; ];
} }
$i += 1;
}
return $gift_item; return $gift_item;
} }
@ -76,14 +57,14 @@ final class Gifts extends VKAPIRequestHandler
$this->requireUser(); $this->requireUser();
$this->willExecuteWriteAction(); $this->willExecuteWriteAction();
$user = (new UsersRepo())->get((int) $user_ids);
if (!OPENVK_ROOT_CONF['openvk']['preferences']['commerce']) { if (!OPENVK_ROOT_CONF['openvk']['preferences']['commerce']) {
$this->fail(105, "Commerce is disabled on this instance"); $this->fail(-105, "Commerce is disabled on this instance");
} }
$user = (new UsersRepo())->get((int) $user_ids); # FAKE прогноз погоды (в данном случае user_ids)
if (!$user || $user->isDeleted()) { if (!$user || $user->isDeleted()) {
$this->fail(177, "Invalid user"); $this->fail(15, "Access denied");
} }
if (!$user->canBeViewedBy($this->getUser())) { if (!$user->canBeViewedBy($this->getUser())) {
@ -93,7 +74,7 @@ final class Gifts extends VKAPIRequestHandler
$gift = (new GiftsRepo())->get($gift_id); $gift = (new GiftsRepo())->get($gift_id);
if (!$gift) { if (!$gift) {
$this->fail(165, "Invalid gift"); $this->fail(15, "Invalid gift");
} }
$price = $gift->getPrice(); $price = $gift->getPrice();
@ -134,24 +115,17 @@ final class Gifts extends VKAPIRequestHandler
]; ];
} }
public function delete()
{
$this->requireUser();
$this->willExecuteWriteAction();
$this->fail(501, "Not implemented");
}
# в vk кстати называется gifts.getCatalog
public function getCategories(bool $extended = false, int $page = 1) public function getCategories(bool $extended = false, int $page = 1)
{ {
$this->requireUser();
$cats = (new GiftsRepo())->getCategories($page); $cats = (new GiftsRepo())->getCategories($page);
$categ = []; $categ = [];
$i = 0; $i = 0;
$server_url = ovk_scheme(true) . $_SERVER["HTTP_HOST"]; $server_url = ovk_scheme(true) . $_SERVER["HTTP_HOST"];
if (!OPENVK_ROOT_CONF['openvk']['preferences']['commerce']) { if (!OPENVK_ROOT_CONF['openvk']['preferences']['commerce']) {
$this->fail(105, "Commerce is disabled on this instance"); $this->fail(-105, "Commerce is disabled on this instance");
} }
foreach ($cats as $cat) { foreach ($cats as $cat) {
@ -184,17 +158,19 @@ final class Gifts extends VKAPIRequestHandler
$this->requireUser(); $this->requireUser();
if (!OPENVK_ROOT_CONF['openvk']['preferences']['commerce']) { if (!OPENVK_ROOT_CONF['openvk']['preferences']['commerce']) {
$this->fail(105, "Commerce is disabled on this instance"); $this->fail(-105, "Commerce is disabled on this instance");
} }
if (!(new GiftsRepo())->getCat($id)) { $gift_category = (new GiftsRepo())->getCat($id);
$this->fail(177, "Category not found");
if (!$gift_category) {
$this->fail(15, "Category not found");
} }
$giftz = ((new GiftsRepo())->getCat($id))->getGifts($page); $gifts_list = $gift_category->getGifts($page);
$gifts = []; $gifts = [];
foreach ($giftz as $gift) { foreach ($gifts_list as $gift) {
$gifts[] = [ $gifts[] = [
"name" => $gift->getName(), "name" => $gift->getName(),
"image" => $gift->getImage(2), "image" => $gift->getImage(2),

View file

@ -107,7 +107,6 @@ final class Groups extends VKAPIRequestHandler
$backgrounds = $usr->getBackDropPictureURLs(); $backgrounds = $usr->getBackDropPictureURLs();
$rClubs[$i]->background = $backgrounds; $rClubs[$i]->background = $backgrounds;
break; break;
# unstandard feild
case "suggested_count": case "suggested_count":
if ($usr->getWallType() != 2) { if ($usr->getWallType() != 2) {
$rClubs[$i]->suggested_count = null; $rClubs[$i]->suggested_count = null;
@ -246,7 +245,7 @@ final class Groups extends VKAPIRequestHandler
$response[$i]->suggested_count = $clb->getSuggestedPostsCount($this->getUser()); $response[$i]->suggested_count = $clb->getSuggestedPostsCount($this->getUser());
break; break;
case "contacts": case "contacts":
$contacts; $contacts = [];
$contactTmp = $clb->getManagers(1, true); $contactTmp = $clb->getManagers(1, true);
foreach ($contactTmp as $contact) { foreach ($contactTmp as $contact) {
@ -335,23 +334,6 @@ final class Groups extends VKAPIRequestHandler
return 1; return 1;
} }
public function create(string $title, string $description = "", string $type = "group", int $public_category = 1, int $public_subcategory = 1, int $subtype = 1)
{
$this->requireUser();
$this->willExecuteWriteAction();
$club = new Club();
$club->setName($title);
$club->setAbout($description);
$club->setOwner($this->getUser()->getId());
$club->save();
$club->toggleSubscription($this->getUser());
return $this->getById((string) $club->getId());
}
public function edit( public function edit(
int $group_id, int $group_id,
string $title = null, string $title = null,
@ -371,13 +353,15 @@ final class Groups extends VKAPIRequestHandler
$club = (new ClubsRepo())->get($group_id); $club = (new ClubsRepo())->get($group_id);
if (!$club) { if (!$club) {
$this->fail(203, "Club not found"); $this->fail(15, "Access denied");
} }
if (!$club || !$club->canBeModifiedBy($this->getUser())) { if (!$club || !$club->canBeModifiedBy($this->getUser())) {
$this->fail(15, "You can't modify this group."); $this->fail(15, "Access denied");
} }
if (!empty($screen_name) && !$club->setShortcode($screen_name)) { if (!empty($screen_name) && !$club->setShortcode($screen_name)) {
$this->fail(103, "Invalid shortcode."); $this->fail(103, "Invalid screen_name");
} }
!empty($title) ? $club->setName($title) : null; !empty($title) ? $club->setName($title) : null;
@ -404,260 +388,86 @@ final class Groups extends VKAPIRequestHandler
try { try {
$club->save(); $club->save();
} catch (\TypeError $e) { } catch (\TypeError $e) {
$this->fail(15, "Nothing changed"); return 1;
} catch (\Exception $e) { } catch (\Exception $e) {
$this->fail(18, "An unknown error occurred: maybe you set an incorrect value?"); return 0;
} }
return 1; return 1;
} }
public function getMembers(string $group_id, string $sort = "id_asc", int $offset = 0, int $count = 100, string $fields = "", string $filter = "any") public function getMembers(int $group_id, int $offset = 0, int $count = 10, string $fields = "")
{ {
# bdate,can_post,can_see_all_posts,can_see_audio,can_write_private_message,city,common_count,connections,contacts,country,domain,education,has_mobile,last_seen,lists,online,online_mobile,photo_100,photo_200,photo_200_orig,photo_400_orig,photo_50,photo_max,photo_max_orig,relation,relatives,schools,sex,site,status,universities $this->requireUser();
$club = (new ClubsRepo())->get((int) $group_id);
if (!$club) { $club = (new ClubsRepo())->get($group_id);
$this->fail(125, "Invalid group id");
if (!$club || !$club->canBeViewedBy($this->getUser())) {
$this->fail(15, "Access denied");
} }
$sorter = "follower ASC"; $sort_string = "follower ASC";
$members = array_slice(iterator_to_array($club->getFollowers(1, $count, $sort_string)), $offset, $count);
switch ($sort) { $obj = (object) [
default: "count" => sizeof($members),
case "time_asc": "items" => [],
case "id_asc":
$sorter = "follower ASC";
break;
case "time_desc":
case "id_desc":
$sorter = "follower DESC";
break;
}
$members = array_slice(iterator_to_array($club->getFollowers(1, $count, $sorter)), $offset);
$arr = (object) [
"count" => count($members),
"items" => []];
$filds = explode(",", $fields);
$i = 0;
foreach ($members as $member) {
if ($i > $count) {
break;
}
$arr->items[] = (object) [
"id" => $member->getId(),
"first_name" => $member->getFirstName(),
"last_name" => $member->getLastName(),
]; ];
foreach ($filds as $fild) { foreach ($members as $member) {
$canView = $member->canBeViewedBy($this->getUser()); $obj->items[] = $member->toVkApiStruct($this->getUser(), $fields);
switch ($fild) {
case "bdate":
if (!$canView) {
$arr->items[$i]->bdate = "01.01.1970";
break;
} }
$arr->items[$i]->bdate = $member->getBirthday() ? $member->getBirthday()->format('%e.%m.%Y') : null; return $obj;
break;
case "can_post":
$arr->items[$i]->can_post = $club->canBeModifiedBy($member);
break;
case "can_see_all_posts":
$arr->items[$i]->can_see_all_posts = 1;
break;
case "can_see_audio":
$arr->items[$i]->can_see_audio = 1;
break;
case "can_write_private_message":
$arr->items[$i]->can_write_private_message = 0;
break;
case "common_count":
$arr->items[$i]->common_count = 420;
break;
case "connections":
$arr->items[$i]->connections = 1;
break;
case "contacts":
if (!$canView) {
$arr->items[$i]->contacts = "secret@gmail.com";
break;
}
$arr->items[$i]->contacts = $member->getContactEmail();
break;
case "country":
$arr->items[$i]->country = 1;
break;
case "domain":
$arr->items[$i]->domain = "";
break;
case "education":
$arr->items[$i]->education = "";
break;
case "has_mobile":
$arr->items[$i]->has_mobile = false;
break;
case "last_seen":
if (!$canView) {
$arr->items[$i]->last_seen = 0;
break;
}
$arr->items[$i]->last_seen = $member->getOnline()->timestamp();
break;
case "lists":
$arr->items[$i]->lists = "";
break;
case "online":
if (!$canView) {
$arr->items[$i]->online = false;
break;
}
$arr->items[$i]->online = $member->isOnline();
break;
case "online_mobile":
if (!$canView) {
$arr->items[$i]->online_mobile = false;
break;
}
$arr->items[$i]->online_mobile = $member->getOnlinePlatform() == "android" || $member->getOnlinePlatform() == "iphone" || $member->getOnlinePlatform() == "mobile";
break;
case "photo_100":
$arr->items[$i]->photo_100 = $member->getAvatarURL("tiny");
break;
case "photo_200":
$arr->items[$i]->photo_200 = $member->getAvatarURL("normal");
break;
case "photo_200_orig":
$arr->items[$i]->photo_200_orig = $member->getAvatarURL("normal");
break;
case "photo_400_orig":
$arr->items[$i]->photo_400_orig = $member->getAvatarURL("normal");
break;
case "photo_max":
$arr->items[$i]->photo_max = $member->getAvatarURL("original");
break;
case "photo_max_orig":
$arr->items[$i]->photo_max_orig = $member->getAvatarURL();
break;
case "relation":
$arr->items[$i]->relation = $member->getMaritalStatus();
break;
case "relatives":
$arr->items[$i]->relatives = 0;
break;
case "schools":
$arr->items[$i]->schools = 0;
break;
case "sex":
if (!$canView) {
$arr->items[$i]->sex = -1;
break;
}
$arr->items[$i]->sex = $member->isFemale() ? 1 : 2;
break;
case "site":
if (!$canView) {
$arr->items[$i]->site = null;
break;
}
$arr->items[$i]->site = $member->getWebsite();
break;
case "status":
if (!$canView) {
$arr->items[$i]->status = "r";
break;
}
$arr->items[$i]->status = $member->getStatus();
break;
case "universities":
$arr->items[$i]->universities = 0;
break;
}
}
$i++;
}
return $arr;
} }
public function getSettings(string $group_id) public function getSettings(string $group_id)
{ {
$this->requireUser(); $this->requireUser();
$club = (new ClubsRepo())->get((int) $group_id); $club = (new ClubsRepo())->get((int) $group_id);
if (!$club || !$club->canBeModifiedBy($this->getUser())) { if (!$club || !$club->canBeModifiedBy($this->getUser())) {
$this->fail(15, "You can't get settings of this group."); $this->fail(15, "Access denied");
} }
$arr = (object) [ $arr = (object) [
"title" => $club->getName(), "title" => $club->getName(),
"description" => $club->getDescription() != null ? $club->getDescription() : "", "description" => $club->getDescription(),
"address" => $club->getShortcode(), "address" => $club->getShortcode(),
"wall" => $club->getWallType(), # отличается от вкшных но да ладно "wall" => $club->getWallType(), # is different from vk values
"photos" => 1, "photos" => 1,
"video" => 0, "video" => 0,
"audio" => $club->isEveryoneCanUploadAudios() ? 1 : 0, "audio" => $club->isEveryoneCanUploadAudios() ? 1 : 0,
"docs" => 0, "docs" => 1,
"topics" => $club->isEveryoneCanCreateTopics() == true ? 1 : 0, "topics" => $club->isEveryoneCanCreateTopics() == true ? 1 : 0,
"wiki" => 0,
"messages" => 0,
"obscene_filter" => 0,
"obscene_stopwords" => 0,
"obscene_words" => "",
"access" => 1,
"subject" => 1,
"subject_list" => [
0 => "в",
1 => "опенвк",
2 => "нет",
3 => "категорий",
4 => "групп",
],
"rss" => "/club" . $club->getId() . "/rss",
"website" => $club->getWebsite(), "website" => $club->getWebsite(),
"age_limits" => 0,
"market" => [],
]; ];
return $arr; return $arr;
} }
public function isMember(string $group_id, int $user_id, string $user_ids = "", bool $extended = false) public function isMember(string $group_id, int $user_id, int $extended = 0)
{ {
$this->requireUser(); $this->requireUser();
$id = $user_id != null ? $user_id : explode(",", $user_ids);
if ($group_id < 0) { $input_club = (new ClubsRepo())->get(abs((int) $group_id));
$this->fail(228, "Remove the minus from group_id"); $input_user = (new UsersRepo())->get(abs((int) $user_id));
if (!$input_club || !$input_club->canBeViewedBy($this->getUser())) {
$this->fail(15, "Access denied");
} }
$club = (new ClubsRepo())->get((int) $group_id); if (!$input_user || $input_user->isDeleted()) {
$usver = (new UsersRepo())->get((int) $id); $this->fail(15, "Not found");
if (!$club || $group_id == 0) {
$this->fail(203, "Invalid club");
} }
if (!$usver || $usver->isDeleted() || $user_id == 0) { if ($extended == 0) {
$this->fail(30, "Invalid user"); return $input_club->getSubscriptionStatus($input_user) ? 1 : 0;
}
if ($extended == false) {
return $club->getSubscriptionStatus($usver) ? 1 : 0;
} else { } else {
return (object) return (object)
[ [
"member" => $club->getSubscriptionStatus($usver) ? 1 : 0, "member" => $input_club->getSubscriptionStatus($input_user) ? 1 : 0,
"request" => 0, "request" => 0,
"invitation" => 0, "invitation" => 0,
"can_invite" => 0, "can_invite" => 0,
@ -665,11 +475,4 @@ final class Groups extends VKAPIRequestHandler
]; ];
} }
} }
public function remove(int $group_id, int $user_id)
{
$this->requireUser();
$this->fail(501, "Not implemented");
}
} }

View file

@ -118,7 +118,14 @@ final class Likes extends VKAPIRequestHandler
} }
if (!$user->canBeViewedBy($this->getUser())) { if (!$user->canBeViewedBy($this->getUser())) {
$this->fail(1984, "Access denied: you can't see this user"); $this->fail(15, "Access denied");
}
if ($user->isPrivateLikes()) {
return (object) [
"liked" => 1,
"copied" => 1,
];
} }
$postable = null; $postable = null;

View file

@ -13,38 +13,49 @@ use openvk\Web\Models\Entities\{Note, Comment};
final class Notes extends VKAPIRequestHandler final class Notes extends VKAPIRequestHandler
{ {
public function add(string $title, string $text, int $privacy = 0, int $comment_privacy = 0, string $privacy_view = "", string $privacy_comment = "") public function add(string $title, string $text)
{ {
$this->requireUser(); $this->requireUser();
$this->willExecuteWriteAction(); $this->willExecuteWriteAction();
if (empty($title)) {
$this->fail(100, "Required parameter 'title' missing.");
}
$note = new Note(); $note = new Note();
$note->setOwner($this->getUser()->getId()); $note->setOwner($this->getUser()->getId());
$note->setCreated(time()); $note->setCreated(time());
$note->setName($title); $note->setName($title);
$note->setSource($text); $note->setSource($text);
$note->setEdited(time()); $note->setEdited(time());
$note->save(); $note->save();
return $note->getVirtualId(); return $note->getVirtualId();
} }
public function createComment(string $note_id, int $owner_id, string $message, int $reply_to = 0, string $attachments = "") public function createComment(int $note_id, int $owner_id, string $message, string $attachments = "")
{ {
$this->requireUser(); $this->requireUser();
$this->willExecuteWriteAction(); $this->willExecuteWriteAction();
$note = (new NotesRepo())->getNoteById((int) $owner_id, (int) $note_id);
if (empty($message)) {
$this->fail(100, "Required parameter 'message' missing.");
}
$note = (new NotesRepo())->getNoteById($owner_id, $note_id);
if (!$note) { if (!$note) {
$this->fail(180, "Note not found"); $this->fail(15, "Access denied");
} }
if ($note->isDeleted()) { if ($note->isDeleted()) {
$this->fail(189, "Note is deleted"); $this->fail(15, "Access denied");
} }
if ($note->getOwner()->isDeleted()) { if ($note->getOwner()->isDeleted()) {
$this->fail(403, "Owner is deleted"); $this->fail(15, "Access denied");
} }
if (!$note->canBeViewedBy($this->getUser())) { if (!$note->canBeViewedBy($this->getUser())) {
@ -52,11 +63,7 @@ final class Notes extends VKAPIRequestHandler
} }
if (!$note->getOwner()->getPrivacyPermission('notes.read', $this->getUser())) { if (!$note->getOwner()->getPrivacyPermission('notes.read', $this->getUser())) {
$this->fail(43, "No access"); $this->fail(15, "Access denied");
}
if (empty($message) && empty($attachments)) {
$this->fail(100, "Required parameter 'message' missing.");
} }
$comment = new Comment(); $comment = new Comment();
@ -67,78 +74,9 @@ final class Notes extends VKAPIRequestHandler
$comment->setCreated(time()); $comment->setCreated(time());
$comment->save(); $comment->save();
if (!empty($attachments)) {
$attachmentsArr = explode(",", $attachments);
if (sizeof($attachmentsArr) > 10) {
$this->fail(50, "Error: too many attachments");
}
foreach ($attachmentsArr as $attac) {
$attachmentType = null;
if (str_contains($attac, "photo")) {
$attachmentType = "photo";
} elseif (str_contains($attac, "video")) {
$attachmentType = "video";
} else {
$this->fail(205, "Unknown attachment type");
}
$attachment = str_replace($attachmentType, "", $attac);
$attachmentOwner = (int) explode("_", $attachment)[0];
$attachmentId = (int) end(explode("_", $attachment));
$attacc = null;
if ($attachmentType == "photo") {
$attacc = (new PhotosRepo())->getByOwnerAndVID($attachmentOwner, $attachmentId);
if (!$attacc || $attacc->isDeleted()) {
$this->fail(100, "Photo does not exists");
}
if ($attacc->getOwner()->getId() != $this->getUser()->getId()) {
$this->fail(43, "You do not have access to this photo");
}
$comment->attach($attacc);
} elseif ($attachmentType == "video") {
$attacc = (new VideosRepo())->getByOwnerAndVID($attachmentOwner, $attachmentId);
if (!$attacc || $attacc->isDeleted()) {
$this->fail(100, "Video does not exists");
}
if ($attacc->getOwner()->getId() != $this->getUser()->getId()) {
$this->fail(43, "You do not have access to this video");
}
$comment->attach($attacc);
}
}
}
return $comment->getId(); return $comment->getId();
} }
public function delete(string $note_id)
{
$this->requireUser();
$this->willExecuteWriteAction();
$note = (new NotesRepo())->get((int) $note_id);
if (!$note) {
$this->fail(180, "Note not found");
}
if (!$note->canBeModifiedBy($this->getUser())) {
$this->fail(15, "Access to note denied");
}
$note->delete();
return 1;
}
public function edit(string $note_id, string $title = "", string $text = "", int $privacy = 0, int $comment_privacy = 0, string $privacy_view = "", string $privacy_comment = "") public function edit(string $note_id, string $title = "", string $text = "", int $privacy = 0, int $comment_privacy = 0, string $privacy_view = "", string $privacy_comment = "")
{ {
$this->requireUser(); $this->requireUser();
@ -147,15 +85,15 @@ final class Notes extends VKAPIRequestHandler
$note = (new NotesRepo())->getNoteById($this->getUser()->getId(), (int) $note_id); $note = (new NotesRepo())->getNoteById($this->getUser()->getId(), (int) $note_id);
if (!$note) { if (!$note) {
$this->fail(180, "Note not found"); $this->fail(15, "Access denied");
} }
if ($note->isDeleted()) { if ($note->isDeleted()) {
$this->fail(189, "Note is deleted"); $this->fail(15, "Access denied");
} }
if (!$note->canBeModifiedBy($this->getUser())) { if (!$note->canBeModifiedBy($this->getUser())) {
$this->fail(403, "No access"); $this->fail(15, "Access denied");
} }
!empty($title) ? $note->setName($title) : null; !empty($title) ? $note->setName($title) : null;
@ -171,26 +109,28 @@ final class Notes extends VKAPIRequestHandler
public function get(int $user_id, string $note_ids = "", int $offset = 0, int $count = 10, int $sort = 0) public function get(int $user_id, string $note_ids = "", int $offset = 0, int $count = 10, int $sort = 0)
{ {
$this->requireUser(); $this->requireUser();
$user = (new UsersRepo())->get($user_id); $user = (new UsersRepo())->get($user_id);
if (!$user || $user->isDeleted()) { if (!$user || $user->isDeleted()) {
$this->fail(15, "Invalid user"); $this->fail(15, "Access denied");
} }
if (!$user->getPrivacyPermission('notes.read', $this->getUser())) { if (!$user->getPrivacyPermission('notes.read', $this->getUser())) {
$this->fail(15, "Access denied: this user chose to hide his notes"); $this->fail(15, "Access denied");
} }
if (!$user->canBeViewedBy($this->getUser())) { if (!$user->canBeViewedBy($this->getUser())) {
$this->fail(15, "Access denied"); $this->fail(15, "Access denied");
} }
$nodez = (object) [ $notes_return_object = (object) [
"count" => 0, "count" => 0,
"notes" => [], "items" => [],
]; ];
if (empty($note_ids)) { if (empty($note_ids)) {
$nodez->count = (new NotesRepo())->getUserNotesCount($user); $notes_return_object->count = (new NotesRepo())->getUserNotesCount($user);
$notes = array_slice(iterator_to_array((new NotesRepo())->getUserNotes($user, 1, $count + $offset, $sort == 0 ? "ASC" : "DESC")), $offset); $notes = array_slice(iterator_to_array((new NotesRepo())->getUserNotes($user, 1, $count + $offset, $sort == 0 ? "ASC" : "DESC")), $offset);
@ -199,25 +139,21 @@ final class Notes extends VKAPIRequestHandler
continue; continue;
} }
$nodez->notes[] = $note->toVkApiStruct(); $notes_return_object->items[] = $note->toVkApiStruct();
} }
} else { } else {
$notes = explode(',', $note_ids); $notes_splitted = explode(',', $note_ids);
foreach ($notes as $note) { foreach ($notes_splitted as $note_id) {
$id = explode("_", $note); $note = (new NotesRepo())->getNoteById($user_id, $note_id);
$items = [];
$note = (new NotesRepo())->getNoteById((int) $id[0], (int) $id[1]);
if ($note && !$note->isDeleted()) { if ($note && !$note->isDeleted()) {
$nodez->notes[] = $note->toVkApiStruct(); $notes_return_object->items[] = $note->toVkApiStruct();
$nodez->count++;
} }
} }
} }
return $nodez; return $notes_return_object;
} }
public function getById(int $note_id, int $owner_id, bool $need_wiki = false) public function getById(int $note_id, int $owner_id, bool $need_wiki = false)
@ -227,23 +163,23 @@ final class Notes extends VKAPIRequestHandler
$note = (new NotesRepo())->getNoteById($owner_id, $note_id); $note = (new NotesRepo())->getNoteById($owner_id, $note_id);
if (!$note) { if (!$note) {
$this->fail(180, "Note not found"); $this->fail(15, "Access denied");
} }
if ($note->isDeleted()) { if ($note->isDeleted()) {
$this->fail(189, "Note is deleted"); $this->fail(15, "Access denied");
} }
if (!$note->getOwner() || $note->getOwner()->isDeleted()) { if (!$note->getOwner() || $note->getOwner()->isDeleted()) {
$this->fail(177, "Owner does not exists"); $this->fail(15, "Access denied");
} }
if (!$note->getOwner()->getPrivacyPermission('notes.read', $this->getUser())) { if (!$note->getOwner()->getPrivacyPermission('notes.read', $this->getUser())) {
$this->fail(40, "Access denied: this user chose to hide his notes"); $this->fail(15, "Access denied");
} }
if (!$note->canBeViewedBy($this->getUser())) { if (!$note->canBeViewedBy($this->getUser())) {
$this->fail(15, "Access to note denied"); $this->fail(15, "Access denied");
} }
return $note->toVkApiStruct(); return $note->toVkApiStruct();
@ -256,23 +192,23 @@ final class Notes extends VKAPIRequestHandler
$note = (new NotesRepo())->getNoteById($owner_id, $note_id); $note = (new NotesRepo())->getNoteById($owner_id, $note_id);
if (!$note) { if (!$note) {
$this->fail(180, "Note not found"); $this->fail(15, "Access denied");
} }
if ($note->isDeleted()) { if ($note->isDeleted()) {
$this->fail(189, "Note is deleted"); $this->fail(15, "Access denied");
} }
if (!$note->getOwner()) { if (!$note->getOwner()) {
$this->fail(177, "Owner does not exists"); $this->fail(15, "Access denied");
} }
if (!$note->getOwner()->getPrivacyPermission('notes.read', $this->getUser())) { if (!$note->getOwner()->getPrivacyPermission('notes.read', $this->getUser())) {
$this->fail(14, "No access"); $this->fail(15, "Access denied");
} }
if (!$note->canBeViewedBy($this->getUser())) { if (!$note->canBeViewedBy($this->getUser())) {
$this->fail(15, "Access to note denied"); $this->fail(15, "Access denied");
} }
$arr = (object) [ $arr = (object) [
@ -286,14 +222,4 @@ final class Notes extends VKAPIRequestHandler
return $arr; return $arr;
} }
public function getFriendsNotes(int $offset = 0, int $count = 0)
{
$this->fail(501, "Not implemented");
}
public function restoreComment(int $comment_id = 0, int $owner_id = 0)
{
$this->fail(501, "Not implemented");
}
} }

View file

@ -120,11 +120,11 @@ final class Polls extends VKAPIRequestHandler
$poll = (new PollsRepo())->get($poll_id); $poll = (new PollsRepo())->get($poll_id);
if (!$poll) { if (!$poll) {
$this->fail(251, "Invalid poll"); $this->fail(15, "Access denied");
} }
if ($poll->isAnonymous()) { if ($poll->isAnonymous()) {
$this->fail(251, "Access denied: poll is anonymous."); $this->fail(15, "Access denied");
} }
$voters = array_slice($poll->getVoters($answer_ids, 1, $offset + $count), $offset); $voters = array_slice($poll->getVoters($answer_ids, 1, $offset + $count), $offset);
@ -175,10 +175,4 @@ final class Polls extends VKAPIRequestHandler
return $this->getById($poll->getId()); return $this->getById($poll->getId());
} }
public function edit()
{
#todo
return 1;
}
} }

View file

@ -20,12 +20,18 @@ final class Video extends VKAPIRequestHandler
$this->requireUser(); $this->requireUser();
if (!empty($videos)) { if (!empty($videos)) {
$vids = explode(',', $videos); $vids = array_unique(explode(',', $videos));
if (sizeof($vids) > 100) {
$this->fail(15, "Too many ids given");
}
$profiles = []; $profiles = [];
$groups = []; $groups = [];
$items = [];
foreach ($vids as $vid) { foreach ($vids as $vid) {
$id = explode("_", $vid); $id = explode("_", $vid);
$items = [];
$video = (new VideosRepo())->getByOwnerAndVID(intval($id[0]), intval($id[1])); $video = (new VideosRepo())->getByOwnerAndVID(intval($id[0]), intval($id[1]));
if ($video && !$video->isDeleted()) { if ($video && !$video->isDeleted()) {

View file

@ -1104,13 +1104,18 @@ final class Wall extends VKAPIRequestHandler
$post = (new PostsRepo())->getPostById($owner_id, $post_id, true); $post = (new PostsRepo())->getPostById($owner_id, $post_id, true);
if (!$post || $post->isDeleted()) { if (!$post || $post->isDeleted()) {
$this->fail(583, "Invalid post"); $this->fail(15, "Not found");
} }
$wallOwner = $post->getWallOwner(); $wallOwner = $post->getWallOwner();
# trying to solve the condition below.
# $post->getTargetWall() < 0 - if post on wall of club
# !$post->getWallOwner()->canBeModifiedBy($this->getUser()) - group is cannot be modifiet by %user%
# $post->getWallOwner()->getWallType() != 1 - wall is not open
# $post->getSuggestionType() == 0 - post is not suggested
if ($post->getTargetWall() < 0 && !$post->getWallOwner()->canBeModifiedBy($this->getUser()) && $post->getWallOwner()->getWallType() != 1 && $post->getSuggestionType() == 0) { if ($post->getTargetWall() < 0 && !$post->getWallOwner()->canBeModifiedBy($this->getUser()) && $post->getWallOwner()->getWallType() != 1 && $post->getSuggestionType() == 0) {
$this->fail(12, "Access denied: you can't delete your accepted post."); $this->fail(15, "Access denied");
} }
if ($post->getOwnerPost() == $this->getUser()->getId() || $post->getTargetWall() == $this->getUser()->getId() || $owner_id < 0 && $wallOwner->canBeModifiedBy($this->getUser())) { if ($post->getOwnerPost() == $this->getUser()->getId() || $post->getTargetWall() == $this->getUser()->getId() || $owner_id < 0 && $wallOwner->canBeModifiedBy($this->getUser())) {

View file

@ -429,6 +429,11 @@ class Club extends RowModel
$this->save(); $this->save();
} }
public function delete(bool $softly = true): void
{
$this->ban("");
}
public function unban(): void public function unban(): void
{ {
$this->setBlock_Reason(null); $this->setBlock_Reason(null);

View file

@ -60,6 +60,11 @@ abstract class MediaCollection extends RowModel
} }
} }
public function getOwnerId(): int
{
return (int) $this->getRecord()->owner;
}
public function getPrettyId(): string public function getPrettyId(): string
{ {
return $this->getRecord()->owner . "_" . $this->getRecord()->id; return $this->getRecord()->owner . "_" . $this->getRecord()->id;

View file

@ -138,18 +138,13 @@ class Note extends Postable
{ {
$res = (object) []; $res = (object) [];
$res->type = "note";
$res->id = $this->getVirtualId(); $res->id = $this->getVirtualId();
$res->owner_id = $this->getOwner()->getId(); $res->owner_id = $this->getOwner()->getId();
$res->title = $this->getName(); $res->title = $this->getName();
$res->text = $this->getText(); $res->text = $this->getText();
$res->date = $this->getPublicationTime()->timestamp(); $res->date = $this->getPublicationTime()->timestamp();
$res->comments = $this->getCommentsCount(); $res->comments = $this->getCommentsCount();
$res->read_comments = $this->getCommentsCount();
$res->view_url = "/note" . $this->getOwner()->getId() . "_" . $this->getVirtualId(); $res->view_url = "/note" . $this->getOwner()->getId() . "_" . $this->getVirtualId();
$res->privacy_view = 1;
$res->can_comment = 1;
$res->text_wiki = "r";
return $res; return $res;
} }

View file

@ -336,7 +336,12 @@ class Photo extends Media
public function getAlbum(): ?Album public function getAlbum(): ?Album
{ {
return (new Albums())->getAlbumByPhotoId($this); $album = (new Albums())->getAlbumByPhotoId($this);
if (!$album || $album->isDeleted()) {
return null;
}
return $album;
} }
public function toVkApiStruct(bool $photo_sizes = true, bool $extended = false): object public function toVkApiStruct(bool $photo_sizes = true, bool $extended = false): object

View file

@ -260,6 +260,7 @@ class Playlist extends MediaCollection
$cover->setDescription("Playlist cover image"); $cover->setDescription("Playlist cover image");
$cover->setFile($file); $cover->setFile($file);
$cover->setCreated(time()); $cover->setCreated(time());
$cover->setSystem(true);
$cover->save(); $cover->save();
$this->setCover_photo_id($cover->getId()); $this->setCover_photo_id($cover->getId());

View file

@ -75,9 +75,9 @@ abstract class Postable extends Attachable
return new DateTime($edited); return new DateTime($edited);
} }
public function getComments(int $page, ?int $perPage = null): \Traversable public function getComments(int $page, ?int $perPage = null, string $sort = "ASC"): \Traversable
{ {
return (new Comments())->getCommentsByTarget($this, $page, $perPage); return (new Comments())->getCommentsByTarget($this, $page, $perPage, $sort);
} }
public function getCommentsCount(): int public function getCommentsCount(): int

View file

@ -1487,6 +1487,11 @@ class User extends RowModel
return $this->isClosed(); return $this->isClosed();
} }
public function HideGlobalFeed(): bool
{
return (bool) $this->getRecord()->hide_global_feed;
}
public function getRealId() public function getRealId()
{ {
return $this->getId(); return $this->getId();
@ -1497,7 +1502,7 @@ class User extends RowModel
return $this->getPrivacySetting("likes.read") == User::PRIVACY_NO_ONE; return $this->getPrivacySetting("likes.read") == User::PRIVACY_NO_ONE;
} }
public function toVkApiStruct(?User $user = null, string $fields = ''): object public function toVkApiStruct(?User $relation_user = null, string $fields = ''): object
{ {
$res = (object) []; $res = (object) [];
@ -1507,8 +1512,8 @@ class User extends RowModel
$res->deactivated = $this->isDeactivated(); $res->deactivated = $this->isDeactivated();
$res->is_closed = $this->isClosed(); $res->is_closed = $this->isClosed();
if (!is_null($user)) { if (!is_null($relation_user)) {
$res->can_access_closed = (bool) $this->canBeViewedBy($user); $res->can_access_closed = (bool) $this->canBeViewedBy($relation_user);
} }
if (!is_array($fields)) { if (!is_array($fields)) {
@ -1564,18 +1569,18 @@ class User extends RowModel
$res->real_id = $this->getRealId(); $res->real_id = $this->getRealId();
break; break;
case "blacklisted_by_me": case "blacklisted_by_me":
if (!$user) { if (!$relation_user) {
break; break;
} }
$res->blacklisted_by_me = (int) $this->isBlacklistedBy($user); $res->blacklisted_by_me = (int) $this->isBlacklistedBy($relation_user);
break; break;
case "blacklisted": case "blacklisted":
if (!$user) { if (!$relation_user) {
break; break;
} }
$res->blacklisted = (int) $user->isBlacklistedBy($this); $res->blacklisted = (int) $relation_user->isBlacklistedBy($this);
break; break;
case "games": case "games":
$res->games = $this->getFavoriteGames(); $res->games = $this->getFavoriteGames();

View file

@ -119,6 +119,7 @@ final class AdminPresenter extends OpenVKPresenter
$user->setLast_Name($this->postParam("last_name")); $user->setLast_Name($this->postParam("last_name"));
$user->setPseudo($this->postParam("nickname")); $user->setPseudo($this->postParam("nickname"));
$user->setStatus($this->postParam("status")); $user->setStatus($this->postParam("status"));
$user->setHide_Global_Feed(empty($this->postParam("hide_global_feed") ? 0 : 1));
if (!$user->setShortCode(empty($this->postParam("shortcode")) ? null : $this->postParam("shortcode"))) { if (!$user->setShortCode(empty($this->postParam("shortcode")) ? null : $this->postParam("shortcode"))) {
$this->flash("err", tr("error"), tr("error_shorturl_incorrect")); $this->flash("err", tr("error"), tr("error_shorturl_incorrect"));
} }

View file

@ -73,10 +73,10 @@ final class DocumentsPresenter extends OpenVKPresenter
$this->template->count = $docs->size(); $this->template->count = $docs->size();
$this->template->docs = iterator_to_array($docs->page($page, OPENVK_DEFAULT_PER_PAGE)); $this->template->docs = iterator_to_array($docs->page($page, OPENVK_DEFAULT_PER_PAGE));
$this->template->locale_string = "you_have_x_documents"; $this->template->locale_string = "you_have_x_documents";
if ($owner_id < 0) { if ($current_tab != 0) {
$this->template->locale_string = "group_has_x_documents";
} elseif ($current_tab != 0) {
$this->template->locale_string = "x_documents_in_tab"; $this->template->locale_string = "x_documents_in_tab";
} elseif ($owner_id < 0) {
$this->template->locale_string = "group_has_x_documents";
} }
$this->template->canUpload = $owner_id == $this->user->id || $this->template->group->canBeModifiedBy($this->user->identity); $this->template->canUpload = $owner_id == $this->user->id || $this->template->group->canBeModifiedBy($this->user->identity);

View file

@ -135,7 +135,7 @@ final class GroupPresenter extends OpenVKPresenter
$this->template->paginatorConf = (object) [ $this->template->paginatorConf = (object) [
"count" => $this->template->count, "count" => $this->template->count,
"page" => $this->queryParam("p") ?? 1, "page" => (int) ($this->queryParam("p") ?? 1),
"amount" => 10, "amount" => 10,
"perPage" => OPENVK_DEFAULT_PER_PAGE, "perPage" => OPENVK_DEFAULT_PER_PAGE,
]; ];

View file

@ -13,6 +13,8 @@ final class InternalAPIPresenter extends OpenVKPresenter
private function fail(int $code, string $message): void private function fail(int $code, string $message): void
{ {
header("HTTP/1.1 400 Bad Request"); header("HTTP/1.1 400 Bad Request");
header("Content-Type: application/x-msgpack");
exit(MessagePack::pack([ exit(MessagePack::pack([
"brpc" => 1, "brpc" => 1,
"error" => [ "error" => [
@ -25,6 +27,7 @@ final class InternalAPIPresenter extends OpenVKPresenter
private function succ($payload): void private function succ($payload): void
{ {
header("Content-Type: application/x-msgpack");
exit(MessagePack::pack([ exit(MessagePack::pack([
"brpc" => 1, "brpc" => 1,
"result" => $payload, "result" => $payload,
@ -146,7 +149,7 @@ final class InternalAPIPresenter extends OpenVKPresenter
{ {
if ($_SERVER["REQUEST_METHOD"] !== "POST") { if ($_SERVER["REQUEST_METHOD"] !== "POST") {
header("HTTP/1.1 405 Method Not Allowed"); header("HTTP/1.1 405 Method Not Allowed");
exit("ты‍ не по адресу"); $this->redirect("/");
} }
$type = $this->queryParam("type", false); $type = $this->queryParam("type", false);
@ -165,7 +168,7 @@ final class InternalAPIPresenter extends OpenVKPresenter
if ($type == 'post') { if ($type == 'post') {
$this->template->_template = 'components/post.xml'; $this->template->_template = 'components/post.xml';
$this->template->post = $post; $this->template->post = $post;
$this->template->commentSection = true; $this->template->commentSection = $this->queryParam("from_page") == "another";
} elseif ($type == 'comment') { } elseif ($type == 'comment') {
$this->template->_template = 'components/comment.xml'; $this->template->_template = 'components/comment.xml';
$this->template->comment = $post; $this->template->comment = $post;

View file

@ -102,7 +102,7 @@ final class NoSpamPresenter extends OpenVKPresenter
$item = new $model($item); $item = new $model($item);
if (key_exists("deleted", $item->unwrap()) && $item->isDeleted()) { if (property_exists($item->unwrap(), "deleted") && $item->isDeleted()) {
$item->setDeleted(0); $item->setDeleted(0);
$item->save(); $item->save();
} }

View file

@ -272,21 +272,27 @@ final class PhotosPresenter extends OpenVKPresenter
$this->assertUserLoggedIn(); $this->assertUserLoggedIn();
$this->willExecuteWriteAction(true); $this->willExecuteWriteAction(true);
$upload_context = $this->queryParam("upload_context");
if (is_null($this->queryParam("album"))) { if (is_null($this->queryParam("album"))) {
if ((int) $upload_context == $this->user->id) {
$album = $this->albums->getUserWallAlbum($this->user->identity); $album = $this->albums->getUserWallAlbum($this->user->identity);
}
} else { } else {
[$owner, $id] = explode("_", $this->queryParam("album")); [$owner, $id] = explode("_", $this->queryParam("album"));
$album = $this->albums->get((int) $id); $album = $this->albums->get((int) $id);
} }
if (!$album) { if ($_SERVER["REQUEST_METHOD"] == "GET" || $this->queryParam("act") == "finish") {
$this->flashFail("err", tr("error"), tr("error_adding_to_deleted"), 500, true); if (!$album || $album->isCreatedBySystem()) {
$this->flashFail("err", tr("error"), tr("error_adding_to_deleted"));
}
} }
# Для быстрой загрузки фоток из пикера фотографий нужен альбом, но юзер не может загружать фото if ($album && !$album->canBeModifiedBy($this->user->identity)) {
# в системные альбомы, так что так. if ($album->getOwnerId() != $this->user->id) {
if (is_null($this->user) || !is_null($this->queryParam("album")) && !$album->canBeModifiedBy($this->user->identity)) { $this->flashFail("err", tr("error_access_denied_short"), tr("error_access_denied"));
$this->flashFail("err", tr("error_access_denied_short"), tr("error_access_denied"), 500, true); }
} }
if ($_SERVER["REQUEST_METHOD"] === "POST") { if ($_SERVER["REQUEST_METHOD"] === "POST") {
@ -306,8 +312,6 @@ final class PhotosPresenter extends OpenVKPresenter
$phot->setDescription($description); $phot->setDescription($description);
$phot->save(); $phot->save();
$album = $phot->getAlbum();
} }
$this->returnJson(["success" => true, $this->returnJson(["success" => true,
@ -346,10 +350,12 @@ final class PhotosPresenter extends OpenVKPresenter
$this->flashFail("err", "Неизвестная ошибка", "Не удалось сохранить фотографию в $name.", 500, true); $this->flashFail("err", "Неизвестная ошибка", "Не удалось сохранить фотографию в $name.", 500, true);
} }
if ($album != null) {
$album->addPhoto($photo); $album->addPhoto($photo);
$album->setEdited(time()); $album->setEdited(time());
$album->save(); $album->save();
} }
}
$this->returnJson(["success" => true, $this->returnJson(["success" => true,
"photos" => $photos]); "photos" => $photos]);

View file

@ -133,6 +133,7 @@ final class VideosPresenter extends OpenVKPresenter
if ($_SERVER["REQUEST_METHOD"] === "POST") { if ($_SERVER["REQUEST_METHOD"] === "POST") {
$video->setName(empty($this->postParam("name")) ? null : $this->postParam("name")); $video->setName(empty($this->postParam("name")) ? null : $this->postParam("name"));
$video->setDescription(empty($this->postParam("desc")) ? null : $this->postParam("desc")); $video->setDescription(empty($this->postParam("desc")) ? null : $this->postParam("desc"));
$video->setUnlisted(false);
$video->save(); $video->save();
$this->flash("succ", tr("changes_saved"), tr("changes_saved_video_comment")); $this->flash("succ", tr("changes_saved"), tr("changes_saved_video_comment"));

View file

@ -211,7 +211,7 @@ final class WallPresenter extends OpenVKPresenter
$pPage = min((int) ($_GET["posts"] ?? OPENVK_DEFAULT_PER_PAGE), 50); $pPage = min((int) ($_GET["posts"] ?? OPENVK_DEFAULT_PER_PAGE), 50);
$queryBase = "FROM `posts` LEFT JOIN `groups` ON GREATEST(`posts`.`wall`, 0) = 0 AND `groups`.`id` = ABS(`posts`.`wall`) LEFT JOIN `profiles` ON LEAST(`posts`.`wall`, 0) = 0 AND `profiles`.`id` = ABS(`posts`.`wall`)"; $queryBase = "FROM `posts` LEFT JOIN `groups` ON GREATEST(`posts`.`wall`, 0) = 0 AND `groups`.`id` = ABS(`posts`.`wall`) LEFT JOIN `profiles` ON LEAST(`posts`.`wall`, 0) = 0 AND `profiles`.`id` = ABS(`posts`.`wall`)";
$queryBase .= "WHERE (`groups`.`hide_from_global_feed` = 0 OR `groups`.`name` IS NULL) AND (`profiles`.`profile_type` = 0 OR `profiles`.`first_name` IS NULL) AND `posts`.`deleted` = 0 AND `posts`.`suggested` = 0"; $queryBase .= "WHERE (`groups`.`hide_from_global_feed` = 0 OR `groups`.`name` IS NULL) AND ((`profiles`.`profile_type` = 0 AND `profiles`.`hide_global_feed` = 0) OR `profiles`.`first_name` IS NULL) AND `posts`.`deleted` = 0 AND `posts`.`suggested` = 0";
if ($this->user->identity->getNsfwTolerance() === User::NSFW_INTOLERANT) { if ($this->user->identity->getNsfwTolerance() === User::NSFW_INTOLERANT) {
$queryBase .= " AND `nsfw` = 0"; $queryBase .= " AND `nsfw` = 0";
@ -471,7 +471,11 @@ final class WallPresenter extends OpenVKPresenter
} }
$this->template->cCount = $post->getCommentsCount(); $this->template->cCount = $post->getCommentsCount();
$this->template->cPage = (int) ($_GET["p"] ?? 1); $this->template->cPage = (int) ($_GET["p"] ?? 1);
$this->template->comments = iterator_to_array($post->getComments($this->template->cPage)); $this->template->sort = $this->queryParam("sort") ?? "asc";
$input_sort = $this->template->sort == "asc" ? "ASC" : "DESC";
$this->template->comments = iterator_to_array($post->getComments($this->template->cPage, null, $input_sort));
} }
public function renderLike(int $wall, int $post_id): void public function renderLike(int $wall, int $post_id): void

View file

@ -210,7 +210,7 @@
{var $menuLinksAvaiable = sizeof(OPENVK_ROOT_CONF['openvk']['preferences']['menu']['links']) > 0 && $thisUser->getLeftMenuItemStatus('links')} {var $menuLinksAvaiable = sizeof(OPENVK_ROOT_CONF['openvk']['preferences']['menu']['links']) > 0 && $thisUser->getLeftMenuItemStatus('links')}
<div n:if="$canAccessAdminPanel || $canAccessHelpdesk || $menuLinksAvaiable" class="menu_divider"></div> <div n:if="$canAccessAdminPanel || $canAccessHelpdesk || $menuLinksAvaiable" class="menu_divider"></div>
<a href="/admin" class="link" n:if="$canAccessAdminPanel" title="{_admin} [Alt+Shift+A]" accesskey="a" rel="nofollow">{_admin}</a> <a href="/admin" class="link" n:if="$canAccessAdminPanel" title="{_admin} [Alt+Shift+A]" accesskey="a" rel="nofollow">{_admin}</a>
<a href="/support/tickets" class="link" n:if="$canAccessHelpdesk" rel="nofollow">{_helpdesk} <a href="/support/tickets" class="link" n:if="$canAccessHelpdesk">{_helpdesk}
{if $helpdeskTicketNotAnsweredCount > 0} {if $helpdeskTicketNotAnsweredCount > 0}
(<b>{$helpdeskTicketNotAnsweredCount}</b>) (<b>{$helpdeskTicketNotAnsweredCount}</b>)
{/if} {/if}

View file

@ -60,6 +60,10 @@
<label for="city">{_admin_verification}</label> <label for="city">{_admin_verification}</label>
<input class="toggle-large" type="checkbox" id="verify" name="verify" value="1" {if $user->isVerified()} checked {/if} /> <input class="toggle-large" type="checkbox" id="verify" name="verify" value="1" {if $user->isVerified()} checked {/if} />
</div> </div>
<div class="field-group">
<label for="city">{_admin_hide_global_feed}</label>
<input class="toggle-large" type="checkbox" id="hide_global_feed" name="hide_global_feed" value="1" n:attr="checked => $user->HideGlobalFeed()" />
</div>
<div class="field-group"> <div class="field-group">
<label for="city">{_admin_user_online}</label> <label for="city">{_admin_user_online}</label>
<select name="online" class="select"> <select name="online" class="select">

View file

@ -16,7 +16,7 @@
{block tabs} {block tabs}
<div n:attr="id => ($act === 'list' ? 'activetabs' : 'ki')" class="tab"> <div n:attr="id => ($act === 'list' ? 'activetabs' : 'ki')" class="tab">
<a n:attr="id => ($act === 'list' ? 'act_tab_a' : 'ki')" href="?act=list">{_all_apps}</a> <a n:attr="id => ($act === 'list' ? 'act_tab_a' : 'ki')" href="/search?q=&section=apps">{_all_apps}</a>
</div> </div>
<div n:attr="id => ($act === 'installed' ? 'activetabs' : 'ki')" class="tab"> <div n:attr="id => ($act === 'installed' ? 'activetabs' : 'ki')" class="tab">

View file

@ -20,15 +20,9 @@
{block content} {block content}
{var $is_gallery = $current_tab == 3 || $current_tab == 4} {var $is_gallery = $current_tab == 3 || $current_tab == 4}
<div id="docs_page_wrapper"> <div id="docs_page_wrapper">
<div class="docs_page_search"> <div class="docs_page_tabs">
<form action="/search" method="get"> <div class="mb_tabs display_flex_row display_flex_space_between">
<input type="hidden" name="section" value="docs"> <div>
<input type="search" name="q" class="input_with_search_icon" placeholder="{_search_by_documents}">
</form>
<input n:if="$canUpload" id="upload_entry_point" class="button" type="button" value="{_upload_button}" {if isset($group)}data-gid="{$group->getId()}"{/if}>
</div>
<div n:if="sizeof($tabs) > 1" class="docs_page_tabs">
<div class="mb_tabs">
<div class="mb_tab" n:attr="id => $current_tab == 0 ? active"> <div class="mb_tab" n:attr="id => $current_tab == 0 ? active">
<a href="?tab=0">{_document_type_0}</a> <a href="?tab=0">{_document_type_0}</a>
</div> </div>
@ -39,9 +33,12 @@
</a> </a>
</div> </div>
</div> </div>
<input n:if="$canUpload" id="upload_entry_point" class="button" type="button" value="{_upload_button}" {if isset($group)}data-gid="{$group->getId()}"{/if}>
</div>
</div> </div>
<div n:class="docs_page_content, $is_gallery ? docs_page_gallery"> <div n:class="docs_page_content, $is_gallery ? docs_page_gallery">
<div class="summaryBar display_flex_row display_flex_space_between"> <div n:if="$count > 0" class="summaryBar display_flex_row display_flex_space_between">
<div class="summary">{tr($locale_string, $count)}.</div> <div class="summary">{tr($locale_string, $count)}.</div>
<select n:if="$count > 3" name="docs_sort"> <select n:if="$count > 3" name="docs_sort">

View file

@ -34,6 +34,12 @@
</a> </a>
</td> </td>
</tr> </tr>
<tr>
<td><span class="nobold">{_sent}: </span></td>
<td>
{$x->sent}
</td>
</tr>
<tr n:if="!empty($x->caption)"> <tr n:if="!empty($x->caption)">
<td><span class="nobold">{_comment}: </span></td> <td><span class="nobold">{_comment}: </span></td>
<td>{$x->caption}</td> <td>{$x->caption}</td>

View file

@ -55,7 +55,7 @@
<tbody> <tbody>
<tr> <tr>
<td width="120" valign="top"><span class="nobold">{_pronouns}: </span></td> <td width="120" valign="top"><span class="nobold">{_pronouns}: </span></td>
<td>{$x->isFemale() ? tr("female") : ($x->isNeutral() ? tr("neutral") : tr("male"))}</td> <td>{$user->isFemale() ? tr("female") : ($user->isNeutral() ? tr("neutral") : tr("male"))}</td>
</tr> </tr>
<tr> <tr>
<td width="120" valign="top"><span class="nobold">{_registration_date}: </span></td> <td width="120" valign="top"><span class="nobold">{_registration_date}: </span></td>

View file

@ -269,7 +269,13 @@
search(); search();
} }
}); });
$("#apply").on("click", () => { search(Number($("#noSpam-ban-type").val())); }) $("#apply").on("click", (e) => {
e.preventDefault()
MessageBox(tr("warning"), tr("nospam_prevention"), [tr("no"), tr("yes")], [Function.noop, () => {
search(Number($("#noSpam-ban-type").val()));
}]);
})
async function selectChange(value) { async function selectChange(value) {
console.log(value); console.log(value);

View file

@ -13,7 +13,7 @@
<textarea name="html" style="display:none;"></textarea> <textarea name="html" style="display:none;"></textarea>
<div id="editor" style="width:600px;height:300px;border:1px solid grey"></div> <div id="editor" style="width:600px;height:300px;border:1px solid grey"></div>
<p><i><a href="/kb/notes">{_something}</a> {_supports_xhtml}</i></p> <p><i>{_something_is_supported_from_xhtml|noescape}</i></p>
<input type="hidden" name="hash" value="{$csrfToken}" /> <input type="hidden" name="hash" value="{$csrfToken}" />
<button class="button">{_save}</button> <button class="button">{_save}</button>

View file

@ -18,7 +18,7 @@
<textarea name="html" style="display:none;"></textarea> <textarea name="html" style="display:none;"></textarea>
<div id="editor" style="width:600px;height:300px;border:1px solid grey"></div> <div id="editor" style="width:600px;height:300px;border:1px solid grey"></div>
<p><i><a href="/kb/notes">{_something}</a> {_supports_xhtml}</i></p> <p><i>{_something_is_supported_from_xhtml|noescape}</i></p>
<input type="hidden" name="hash" value="{$csrfToken}" /> <input type="hidden" name="hash" value="{$csrfToken}" />
<button class="button">{_save}</button> <button class="button">{_save}</button>

View file

@ -5,7 +5,7 @@
{block title}{_albums} {$owner->getCanonicalName()}{/block} {block title}{_albums} {$owner->getCanonicalName()}{/block}
{block header} {block header}
{if isset($thisUser) && $thisUser->getId() == $owner->getId()} {if isset($thisUser) && $thisUser->getId() == $owner->getRealId()}
{_my_photos} {_my_photos}
{else} {else}
<a href="{$owner->getURL()}"> <a href="{$owner->getURL()}">
@ -18,7 +18,7 @@
{block size} {block size}
<div style="padding-bottom: 0px; padding-top: 0;" class="summaryBar"> <div style="padding-bottom: 0px; padding-top: 0;" class="summaryBar">
<div class="summary"> <div class="summary">
{if !is_null($thisUser) && $owner->getId() === $thisUser->getId()} {if !is_null($thisUser) && $owner->getRealId() === $thisUser->getId()}
{tr("albums_list", $count)} {tr("albums_list", $count)}
{else} {else}
{tr("albums", $count)} {tr("albums", $count)}

View file

@ -42,6 +42,6 @@
{block description} {block description}
{var $author = $x->getUser()} {var $author = $x->getUser()}
{ovk_proc_strtr($x->getContext(), 50)}<br/> {ovk_proc_strtr($x->getContext(), 200)}<br/>
<span class="nobold">{_author}: </span> <a href="{$author->getURL()}">{$author->getCanonicalName()}</a> <span class="nobold">{_author}: </span> <a href="{$author->getURL()}">{$author->getCanonicalName()}</a>
{/block} {/block}

View file

@ -76,14 +76,4 @@
<input type="hidden" name="hash" value="{$csrfToken}" /> <input type="hidden" name="hash" value="{$csrfToken}" />
</form> </form>
<script>
$(document).ready(() => {
u("#post-buttons1 .postFileSel").on("change", function() {
handleUpload.bind(this, 1)();
});
setupWallPostInputHandlers(1);
});
</script>
{/block} {/block}

View file

@ -33,14 +33,14 @@
</td> </td>
<td> <td>
{if $topic->getClub()->canBeModifiedBy($thisUser)} {if $topic->getClub()->canBeModifiedBy($thisUser)}
<input type="checkbox" name="pin" n:attr="checked => $topic->isPinned()" /> {_pin_topic}<br /> <label><input type="checkbox" name="pin" n:attr="checked => $topic->isPinned()" /> {_pin_topic}</label><br />
{/if} {/if}
<input type="checkbox" name="close" n:attr="checked => $topic->isClosed()" /> {_close_topic} <label><input type="checkbox" name="close" n:attr="checked => $topic->isClosed()" /> {_close_topic}</label>
</td> </td>
</tr> </tr>
<tr> <tr>
<td> <td>
<a class="button" href="/topic{$topic->getPrettyId()}/delete?hash={urlencode($csrfToken)}">{_delete_topic}</a> <a id="_anotherDelete" class="button" href="/topic{$topic->getPrettyId()}/delete?hash={urlencode($csrfToken)}">{_delete_topic}</a>
</td> </td>
<td> <td>
<input type="hidden" name="hash" value="{$csrfToken}" /> <input type="hidden" name="hash" value="{$csrfToken}" />

View file

@ -409,7 +409,7 @@
</td> </td>
<td> <td>
<select name="likes.read", style="width: 164px;"> <select name="likes.read", style="width: 164px;">
<option value="2" {if $user->getPrivacySetting('likes.read') == 2}selected{/if}>{_privacy_value_anybody}</option> <option value="2" {if $user->getPrivacySetting('likes.read') == 2}selected{/if}>{_privacy_value_anybody_dative}</option>
<option value="0" {if $user->getPrivacySetting('likes.read') == 0}selected{/if}>{_privacy_value_only_me_dative}</option> <option value="0" {if $user->getPrivacySetting('likes.read') == 0}selected{/if}>{_privacy_value_only_me_dative}</option>
</select> </select>
</td> </td>

View file

@ -419,7 +419,7 @@
{else} {else}
<div class="page_status" style="display: flex;"> <div class="page_status" style="display: flex;">
<div n:class="audioStatus, $thatIsThisUser ? page_status_edit_button" id="page_status_text"> <div n:class="audioStatus, $thatIsThisUser ? page_status_edit_button" id="page_status_text">
{$audioStatus->getName()} <a {if !$thatIsThisUser}href="/audio0_{$audioStatus->getId()}"{/if}>{$audioStatus->getName()}</a>
</div> </div>
</div> </div>
{/if} {/if}
@ -458,8 +458,8 @@
</tr> </tr>
<tr n:if="!is_null($user->getBirthday())"> <tr n:if="!is_null($user->getBirthday())">
<td class="label"><span class="nobold">{_birth_date}:</span></td> <td class="label"><span class="nobold">{_birth_date}:</span></td>
<td n:if="$user->getBirthdayPrivacy() == 0" class="data">{$user->getBirthday()->format('%e %B %Y')}, <td n:if="$user->getBirthdayPrivacy() == 0" class="data">{$user->getBirthday()->format('%e %B %Y')}{if $user->onlineStatus() != 2},
{tr("years", $user->getAge())}</td> {tr("years", $user->getAge())}{/if}</td>
<td n:if="$user->getBirthdayPrivacy() == 1" class="data">{$user->getBirthday()->format('%e %B')}</td> <td n:if="$user->getBirthdayPrivacy() == 1" class="data">{$user->getBirthday()->format('%e %B')}</td>
</tr> </tr>
</tbody> </tbody>

View file

@ -36,9 +36,10 @@
count => $cCount, count => $cCount,
page => $cPage, page => $cPage,
model => "posts", model => "posts",
parent => $post } parent => $post,
sort => $sort}
</div> </div>
<div style="float: left; min-height: 100px; width: 32%;"> <div style="float: left; min-height: 100px; width: 32%;padding-left: 10px;width: 30%;">
<h4>{_actions}</h4> <h4>{_actions}</h4>
{if isset($thisUser)} {if isset($thisUser)}
{var $canDelete = $post->canBeDeletedBy($thisUser)} {var $canDelete = $post->canBeDeletedBy($thisUser)}
@ -47,7 +48,7 @@
{/if} {/if}
{/if} {/if}
<a n:if="$canDelete ?? false" class="profile_link" style="display:block;width:96%;" href="/wall{$post->getPrettyId()}/delete">{_delete}</a> <a n:if="$canDelete ?? false" id="_ajaxDelete" class="profile_link" style="display:block;width:96%;" href="/wall{$post->getPrettyId()}/delete">{_delete}</a>
<a <a
n:if="isset($thisUser) && $thisUser->getChandlerUser()->can('access')->model('admin')->whichBelongsTo(NULL) AND $post->getEditTime()" n:if="isset($thisUser) && $thisUser->getChandlerUser()->can('access')->model('admin')->whichBelongsTo(NULL) AND $post->getEditTime()"
style="display:block;width:96%;" style="display:block;width:96%;"
@ -56,29 +57,6 @@
> >
{_changes_history} {_changes_history}
</a> </a>
<a n:if="$canReport ?? false" class="profile_link" style="display:block;width:96%;" href="javascript:reportPost()">{_report}</a> <a n:if="$canReport ?? false" class="profile_link" style="display:block;width:96%;" href="javascript:reportPost({$post->getId()})">{_report}</a>
</div> </div>
<script n:if="$canReport ?? false">
function reportPost() {
uReportMsgTxt = tr("going_to_report_post");
uReportMsgTxt += "<br/>"+tr("report_question_text");
uReportMsgTxt += "<br/><br/><b>"+tr("report_reason")+"</b>: <input type='text' id='uReportMsgInput' placeholder='" + tr("reason") + "' />"
MessageBox(tr("report_question"), uReportMsgTxt, [tr("confirm_m"), tr("cancel")], [
(function() {
res = document.querySelector("#uReportMsgInput").value;
xhr = new XMLHttpRequest();
xhr.open("GET", "/report/" + {$post->getId()} + "?reason=" + res + "&type=post", true);
xhr.onload = (function() {
if(xhr.responseText.indexOf("reason") === -1)
MessageBox(tr("error"), tr("error_sending_report"), ["OK"], [Function.noop]);
else
MessageBox(tr("action_successfully"), tr("will_be_watched"), ["OK"], [Function.noop]);
});
xhr.send(null);
}),
Function.noop
]);
}
</script>
{/block} {/block}

View file

@ -17,7 +17,9 @@
{/if} {/if}
{/if} {/if}
<link rel="stylesheet" href="/themepack/{$theme->getId()}/{$theme->getVersion()}/stylesheet/styles.css" /> {* remove the "n:if" if you having issues with your theme *}
<link n:if="$theme->getId() != 'mobile_ovk'" rel="stylesheet" href="/themepack/{$theme->getId()}/{$theme->getVersion()}/stylesheet/styles.css" />
{if $isXmas} {if $isXmas}
<link rel="stylesheet" href="/themepack/{$theme->getId()}/{$theme->getVersion()}/resource/xmas.css" /> <link rel="stylesheet" href="/themepack/{$theme->getId()}/{$theme->getVersion()}/resource/xmas.css" />

View file

@ -44,7 +44,7 @@
{if !$timeOnly} {if !$timeOnly}
{if $comment->canBeDeletedBy($thisUser)} {if $comment->canBeDeletedBy($thisUser)}
| |
<a href="/comment{$comment->getId()}/delete">{_delete}</a> <a href="/comment{$comment->getId()}/delete" id="_ajaxDelete">{_delete}</a>
{/if} {/if}
{if $comment->canBeEditedBy($thisUser)} {if $comment->canBeEditedBy($thisUser)}
| |

View file

@ -1,5 +1,18 @@
<h4 n:if="$showTitle ?? true">{_comments} ({$count})</h4> <div>
<h4 n:if="$showTitle ?? true">{_comments} ({$count})</h4>
{if !is_null($sort) && $count > 5}
<a class="sort_link" n:attr="href => $sort == 'desc' ? '?sort=asc' : '?sort=desc'">
{if $sort == 'desc'}
{_new_first}
{else}
{_old_first}
{/if}
<div n:class="sort_link_icon, $sort == 'desc' ? sort_link_icon_desc : sort_link_icon_asc"></div>
</a>
{/if}
</div>
<div n:ifset="$thisUser" id="standaloneCommentBox"> <div n:ifset="$thisUser" id="standaloneCommentBox">
{var $commentsURL = "/al_comments/create/$model/" . $parent->getId()} {var $commentsURL = "/al_comments/create/$model/" . $parent->getId()}
{var $club = $parent instanceof \openvk\Web\Models\Entities\Post && $parent->getTargetWall() < 0 ? (new openvk\Web\Models\Repositories\Clubs)->get(abs($parent->getTargetWall())) : $club} {var $club = $parent instanceof \openvk\Web\Models\Entities\Post && $parent->getTargetWall() < 0 ? (new openvk\Web\Models\Repositories\Clubs)->get(abs($parent->getTargetWall())) : $club}
@ -11,7 +24,7 @@
{if sizeof($comments) > 0} {if sizeof($comments) > 0}
<div class='scroll_container'> <div class='scroll_container'>
<div class='scroll_node' n:foreach="$comments as $comment"> <div class='scroll_node' n:foreach="$comments as $comment">
{include "comment.xml", comment => $comment} {include "comment.xml", comment => $comment, no_reply_button => $readOnly}
</div> </div>
</div> </div>
<div style="margin-top: 11px;"> <div style="margin-top: 11px;">

View file

@ -58,6 +58,9 @@
<span n:if="$post->isPinned()" class="nobold">{_pinned}</span> <span n:if="$post->isPinned()" class="nobold">{_pinned}</span>
<a n:if="$canBeDeleted && !($forceNoDeleteLink ?? false) && $compact == false" class="delete" href="/wall{$post->getPrettyId()}/delete"></a> <a n:if="$canBeDeleted && !($forceNoDeleteLink ?? false) && $compact == false" class="delete" href="/wall{$post->getPrettyId()}/delete"></a>
<a n:if="!$canBeDeleted" class="report" title="{_report}" href="javascript:reportPost({$post->getId()})"></a>
<a n:if="$feedIgnoreButton && !$canBeDeleted" class="delete" id="__ignoreSomeoneFeed" title="{_feed_ignore}" data-val='1' data-id="{$wallOwner->getRealId()}"></a> <a n:if="$feedIgnoreButton && !$canBeDeleted" class="delete" id="__ignoreSomeoneFeed" title="{_feed_ignore}" data-val='1' data-id="{$wallOwner->getRealId()}"></a>
{if $canBePinned && !($forceNoPinLink ?? false) && $compact == false} {if $canBePinned && !($forceNoPinLink ?? false) && $compact == false}
@ -149,7 +152,7 @@
{/if} {/if}
</div> </div>
<div n:if="!($forceNoCommentsLink ?? false) && $commentSection == true && $compact == false" class="post-menu-s"> <div n:if="!($forceNoCommentsLink ?? false) && $commentSection == true && $compact == false" class="post-menu-s">
<a n:if="$commentsCount > 3" href="/wall{$post->getPrettyId()}" class="expand_button">{_view_other_comments}</a> <a n:if="$commentsCount > 3" href="/wall{$post->getPrettyId()}" class="expand_button">{_view_other_comments} ({$commentsCount - 3})</a>
{foreach $comments as $comment} {foreach $comments as $comment}
{include "../comment.xml", comment => $comment, $compact => true} {include "../comment.xml", comment => $comment, $compact => true}
{/foreach} {/foreach}

View file

@ -139,6 +139,10 @@
<a id="__ignoreSomeoneFeed" data-val='1' data-id="{$wallOwner->getRealId()}">{_feed_ignore}</a> &nbsp;|&nbsp; <a id="__ignoreSomeoneFeed" data-val='1' data-id="{$wallOwner->getRealId()}">{_feed_ignore}</a> &nbsp;|&nbsp;
{/if} {/if}
{if !$canBeDeleted}
<a href="javascript:reportPost({$post->getId()})">{_report}</a> &nbsp;|&nbsp;
{/if}
{if !($forceNoPinLink ?? false) && $canBePinned} {if !($forceNoPinLink ?? false) && $canBePinned}
{if $post->isPinned()} {if $post->isPinned()}
<a href="/wall{$post->getPrettyId()}/pin?act=unpin&hash={rawurlencode($csrfToken)}">{_unpin}</a> <a href="/wall{$post->getPrettyId()}/pin?act=unpin&hash={rawurlencode($csrfToken)}">{_unpin}</a>

View file

@ -2,7 +2,7 @@
{var $textAreaId = ($post ?? NULL) === NULL ? (++$GLOBALS["textAreaCtr"]) : $post->getId()} {var $textAreaId = ($post ?? NULL) === NULL ? (++$GLOBALS["textAreaCtr"]) : $post->getId()}
{var $textAreaId = ($custom_id ?? NULL) === NULL ? $textAreaId : $custom_id} {var $textAreaId = ($custom_id ?? NULL) === NULL ? $textAreaId : $custom_id}
<div id="write" class='model_content_textarea' style="padding: 5px 0;"> <div id="write" class='model_content_textarea' style="padding: 5px 0;" data-id="{is_null($owner) || gettype($owner) == 'integer' ? $owner : $owner->getId()}">
<form action="{$route}" method="post" enctype="multipart/form-data" style="margin:0;"> <form action="{$route}" method="post" enctype="multipart/form-data" style="margin:0;">
<textarea id="wall-post-input{$textAreaId}" placeholder="{_write}" name="text" style="width: 100%;resize: none;" class="small-textarea"></textarea> <textarea id="wall-post-input{$textAreaId}" placeholder="{_write}" name="text" style="width: 100%;resize: none;" class="small-textarea"></textarea>
<div> <div>
@ -33,15 +33,15 @@
</script> </script>
<label> <label>
<input type="checkbox" name="as_group" onchange="onWallAsGroupClick(this)" /> {_post_as_group} <input type="checkbox" name="as_group" onchange="onWallAsGroupClick(this)" checked /> {_post_as_group}
</label> </label>
<label id="forceSignOpt" style="display: none;"> <label id="forceSignOpt" style="display: block;">
<input type="checkbox" name="force_sign" /> {_add_signature} <input type="checkbox" name="force_sign" /> {_add_signature}
</label> </label>
{/if} {/if}
{/if} {/if}
<label n:if="$anonEnabled" id="octoberAnonOpt"> <label n:if="$anonEnabled" id="octoberAnonOpt" style="display: none;">
<input type="checkbox" name="anon" /> {_as_anonymous} <input type="checkbox" name="anon" /> {_as_anonymous}
</label> </label>

View file

@ -1,5 +1,5 @@
<div class="content_divider"> <div class="content_divider">
<div class="content_title_expanded" onclick="hidePanel(this);"> <div class="content_title_expanded">
{_wall} {_wall}
<nobold> <nobold>
{tr("wall", $count)} {tr("wall", $count)}

View file

@ -763,8 +763,9 @@
fill-opacity: .7; fill-opacity: .7;
} }
.audioStatus span { .audioStatus a {
color: #2B587A; color: #2B587A;
font-weight: bold;
} }
.audioStatus span:hover { .audioStatus span:hover {

View file

@ -49,7 +49,7 @@ body.dimmed > .dimmer #absolute_territory {
.ovk-diag-body { .ovk-diag-body {
padding: 20px; padding: 20px;
overflow-y: auto; overflow-y: auto;
max-height: 80vh max-height: 83vh
} }
.ovk-diag-action { .ovk-diag-action {

View file

@ -14,6 +14,10 @@ body {
line-height: 1.19; line-height: 1.19;
} }
body.ajax_request_made {
cursor: progress;
}
body, .ovk-fullscreen-dimmer, .ovk-photo-view-dimmer { body, .ovk-fullscreen-dimmer, .ovk-photo-view-dimmer {
scrollbar-gutter: stable both-edges; scrollbar-gutter: stable both-edges;
} }
@ -876,7 +880,7 @@ h4 {
} }
.post-geo { .post-geo {
margin: 1px 0px; margin: 8px 0px 2px -3px;
padding: 0 4px; padding: 0 4px;
} }
@ -1575,6 +1579,10 @@ body.scrolled .toTop:hover, .toTop.has_down:hover {
color: #3c3c3c; color: #3c3c3c;
} }
.post-has-geo.appended-geo {
padding: 6px 0px;
}
.post-source #remove_source_button, #small_remove_button { .post-source #remove_source_button, #small_remove_button {
display: inline-block; display: inline-block;
background-repeat: no-repeat; background-repeat: no-repeat;
@ -1889,6 +1897,7 @@ body.scrolled .toTop:hover, .toTop.has_down:hover {
#ovkDraw { #ovkDraw {
border: 1px solid #757575; border: 1px solid #757575;
min-height: 510px;
} }
#ovkDraw .lc-drawing.with-gui { #ovkDraw .lc-drawing.with-gui {
@ -1897,6 +1906,7 @@ body.scrolled .toTop:hover, .toTop.has_down:hover {
#ovkDraw .literally { #ovkDraw .literally {
border-radius: 0; border-radius: 0;
height: 510px;
} }
#ovkDraw .literally .lc-picker, #ovkDraw .literally .lc-picker,
@ -2675,7 +2685,8 @@ a.poll-retract-vote {
} }
.post-buttons .vertical-attachment .vertical-attachment-content { .post-buttons .vertical-attachment .vertical-attachment-content {
max-height: 27px; /*max-height: 27px;*/
padding: 3px 2px;
} }
.vertical-attachment .vertical-attachment-content .overflowedName { .vertical-attachment .vertical-attachment-content .overflowedName {
@ -3206,6 +3217,11 @@ a.poll-retract-vote {
display: flex; display: flex;
align-items: center; align-items: center;
gap: 1px; gap: 1px;
padding: 5px 9px;
}
.post-buttons .attachment_note {
padding: 3px 0px;
} }
.attachment_note svg { .attachment_note svg {
@ -3221,6 +3237,10 @@ a.poll-retract-vote {
height: 12px; height: 12px;
} }
.attachments .attachment_note {
padding: 5px 5px;
}
#notesList #notesList
{ {
overflow-y: scroll; overflow-y: scroll;
@ -3257,7 +3277,7 @@ body.article .floating_sidebar, body.article .page_content {
display: none; display: none;
position: absolute; position: absolute;
z-index: 128; z-index: 128;
width: 100%; width: 98%;
min-height: 100vh; min-height: 100vh;
padding: 20px; padding: 20px;
box-sizing: border-box; box-sizing: border-box;
@ -3291,6 +3311,7 @@ body.article .floating_sidebar, body.article .page_content {
.articleView_author > div { .articleView_author > div {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
margin-top: 3px;
} }
.articleView_author > div > span { .articleView_author > div > span {
@ -3388,6 +3409,7 @@ body.article .floating_sidebar, body.article .page_content {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 22px; gap: 22px;
padding: 5px 10px;
} }
.sugglist { .sugglist {
@ -3661,7 +3683,7 @@ hr {
.entity_vertical_list { .entity_vertical_list {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 3px; gap: 10px;
height: 197px; height: 197px;
overflow-y: auto; overflow-y: auto;
} }
@ -3669,6 +3691,7 @@ hr {
.entity_vertical_list.scroll_container { .entity_vertical_list.scroll_container {
height: unset; height: unset;
overflow-y: unset; overflow-y: unset;
padding: 5px;
} }
.entity_vertical_list .entity_vertical_list_item { .entity_vertical_list .entity_vertical_list_item {
@ -3686,12 +3709,16 @@ hr {
} }
.entity_vertical_list.m_mini .entity_vertical_list_item .first_column { .entity_vertical_list.m_mini .entity_vertical_list_item .first_column {
gap: 10px; gap: 13px;
}
.entity_vertical_list.m_mini .entity_vertical_list_item:hover .first_column a {
text-decoration: underline;
} }
.entity_vertical_list.m_mini .entity_vertical_list_item .first_column .avatar img { .entity_vertical_list.m_mini .entity_vertical_list_item .first_column .avatar img {
width: 30px; width: 40px;
height: 30px; height: 40px;
} }
.entity_vertical_list .entity_vertical_list_item .avatar { .entity_vertical_list .entity_vertical_list_item .avatar {
@ -3822,12 +3849,13 @@ hr {
display: none; display: none;
position: fixed; position: fixed;
top: -10%; top: -10%;
background: rgba(26, 26, 26, 0.9);; background: rgba(0, 0, 0, 0.8);
box-shadow: 0px 0px 2px 0px black;
padding-top: 12px; padding-top: 12px;
width: 91px; width: 91px;
height: 25px; height: 25px;
text-align: center; text-align: center;
border-radius: 1px; border-radius: 2px;
margin: auto; margin: auto;
left: 0; left: 0;
right: 0; right: 0;
@ -3926,6 +3954,11 @@ hr {
height: 25px; height: 25px;
} }
.object_fit_ava {
object-fit: cover;
object-position: top;
}
.like_tooltip_wrapper .like_tooltip_body a { .like_tooltip_wrapper .like_tooltip_body a {
height: 25px; height: 25px;
} }
@ -4036,7 +4069,7 @@ hr {
#docs_page_wrapper .container_white { #docs_page_wrapper .container_white {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
padding: 5px 10px; padding: 10px 10px;
} }
#docs_page_wrapper .docs_page_content.docs_page_gallery .scroll_container { #docs_page_wrapper .docs_page_content.docs_page_gallery .scroll_container {
@ -4179,11 +4212,12 @@ hr {
justify-content: center; justify-content: center;
border-radius: 2px; border-radius: 2px;
height: 17px; height: 17px;
padding: 2px 0px; padding: 3px 0px;
} }
.docListViewItem .doc_icon.no_image span { .docListViewItem .doc_icon.no_image span {
color: #6b6b6b; color: #6b6b6b;
font-weight: bold;
} }
.doc_icon.no_image span::before { .doc_icon.no_image span::before {
@ -4268,8 +4302,8 @@ hr {
.attachments .docGalleryItem { .attachments .docGalleryItem {
display: block; display: block;
min-width: 170px; min-width: 170px;
height: 170px; min-height: 170px;
width: 50%; width: 60%;
margin-bottom: 4px; margin-bottom: 4px;
} }
@ -4295,3 +4329,23 @@ hr {
.deleted_mark_average { .deleted_mark_average {
padding: 5px 61px; padding: 5px 61px;
} }
.sort_link {
padding: 5px 2px;
display: inline-block;
}
.sort_link_icon {
background: url(/assets/packages/static/openvk/img/wall.png?v=3) no-repeat;
display: inline-block;
height: 11px;
width: 9px;
}
.sort_link_icon_desc {
background-position: 0px -15px;
}
.sort_link_icon_asc {
background-position: -11px -15px;
}

View file

@ -96,6 +96,16 @@
transition-duration: 0.3s; transition-duration: 0.3s;
} }
.report {
float: right;
height: 16px;
width: 16px;
overflow: auto;
background: url("/assets/packages/static/openvk/img/report.png") no-repeat 0 0;
opacity: 0.1;
transition-duration: 0.3s;
}
.ignore:hover { .ignore:hover {
opacity: 0.4; opacity: 0.4;
} }
@ -109,6 +119,10 @@
border-bottom: 1px #ddd solid; border-bottom: 1px #ddd solid;
} }
.report:hover {
opacity: 0.4;
}
.post-author .delete { .post-author .delete {
float: right; float: right;
height: 16px; height: 16px;

BIN
Web/static/img/report.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

View file

@ -333,7 +333,7 @@ async function __docAttachment(form, ctx = "wall", source = "user", source_arg =
<text id="photo_com_title_photos"> <text id="photo_com_title_photos">
${tr("select_doc")} ${tr("select_doc")}
</text> </text>
<span style="display: inline-flex;gap: 7px;"> <span style="display: inline-flex;gap: 7px;margin-left: 5px;">
${source != "user" ? `<a id="_doc_picker_go_to_my">${tr("go_to_my_documents")}</a>`: ""} ${source != "user" ? `<a id="_doc_picker_go_to_my">${tr("go_to_my_documents")}</a>`: ""}
<a id="_doc_picker_upload">${tr("upload_button")}</a> <a id="_doc_picker_upload">${tr("upload_button")}</a>
</span> </span>

View file

@ -353,3 +353,26 @@ function openJsSettings() {
</tr> </tr>
`) `)
} }
function reportPost(postId) {
uReportMsgTxt = tr("going_to_report_post");
uReportMsgTxt += "<br/>"+tr("report_question_text");
uReportMsgTxt += "<br/><br/><b>"+tr("report_reason")+"</b>: <input type='text' id='uReportMsgInput' placeholder='" + tr("reason") + "' />"
MessageBox(tr("report_question"), uReportMsgTxt, [tr("confirm_m"), tr("cancel")], [
(function() {
res = document.querySelector("#uReportMsgInput").value;
xhr = new XMLHttpRequest();
xhr.open("GET", "/report/" + postId + "?reason=" + res + "&type=post", true);
xhr.onload = (function() {
if(xhr.responseText.indexOf("reason") === -1)
MessageBox(tr("error"), tr("error_sending_report"), ["OK"], [Function.noop]);
else
MessageBox(tr("action_successfully"), tr("will_be_watched"), ["OK"], [Function.noop]);
});
xhr.send(null);
}),
Function.noop
]);
}

View file

@ -23,6 +23,7 @@ tippy.delegate("body", {
target: '.mention', target: '.mention',
theme: "light vk", theme: "light vk",
content: "⌛", content: "⌛",
delay: 300,
allowHTML: true, allowHTML: true,
interactive: true, interactive: true,
interactiveDebounce: 500, interactiveDebounce: 500,

View file

@ -176,7 +176,7 @@ window.player = new class {
} }
} }
if(window.player.listen_coef > 10) { if(window.player.listen_coef > 5) {
this.__countListen() this.__countListen()
window.player.listen_coef = -10 window.player.listen_coef = -10
} }
@ -845,22 +845,14 @@ u(document).on('click', '.audioEntry .playerButton > .playIcon', async (e) => {
if(!window.player.hasTrackWithId(id) && !window.player.isAtAudiosPage()) { if(!window.player.hasTrackWithId(id) && !window.player.isAtAudiosPage()) {
let _nodes = null let _nodes = null
if(u(e.target).closest('.attachments').length > 0) {
window.player.connectionType = '.attachments' try_these_containers = [".attachments", ".content_list", ".generic_audio_list", ".audiosInsert", ".scroll_container", ".container_gray"]
_nodes = u(e.target).closest('.attachments').find('.audioEmbed').nodes try_these_containers.forEach(__container => {
} else if(u(e.target).closest('.content_list').length > 0) { if(u(e.target).closest(__container).length > 0) {
window.player.connectionType = '.content_list' window.player.connectionType = __container
_nodes = u(e.target).closest('.content_list').find('.audioEmbed').nodes _nodes = u(e.target).closest(__container).find('.audioEmbed').nodes
} else if(u(e.target).closest('.generic_audio_list').length > 0) {
window.player.connectionType = '.generic_audio_list'
_nodes = u(e.target).closest('.generic_audio_list').find('.audioEmbed').nodes
} else if(u(e.target).closest('.audiosInsert').length > 0) {
window.player.connectionType = '.audiosInsert'
_nodes = u(e.target).closest('.audiosInsert').find('.audioEmbed').nodes
} else if(u(e.target).closest('.scroll_container').length > 0) {
window.player.connectionType = '.scroll_container'
_nodes = u(e.target).closest('.scroll_container').find('.audioEmbed').nodes
} }
})
window.player.tracks = [] window.player.tracks = []
_nodes.forEach(el => { _nodes.forEach(el => {
@ -1859,7 +1851,7 @@ function showAudioAttachment(type = 'form', form = null)
} }
let is_attached = false let is_attached = false
if(type == 'form') { if(type == 'form') {
is_attached = (u(form).find(`.post-vertical .vertical-attachment[data-id='${id}']`)).length > 0 is_attached = (u(form).find(`.post-vertical .vertical-attachment[data-type='audio'][data-id='${id}']`)).length > 0
} else { } else {
is_attached = (u(form).find(`.PE_audios .vertical-attachment[data-id='${id}']`)).length > 0 is_attached = (u(form).find(`.PE_audios .vertical-attachment[data-id='${id}']`)).length > 0
} }

View file

@ -12,7 +12,7 @@ $(document).on("change", ".photo_ajax_upload_button", (e) => {
return; return;
} }
if(file.size > 5 * 1024 * 1024) { if(file.size > window.openvk.max_filesize_mb * 1024 * 1024) {
MessageBox(tr("error"), tr("max_filesize", 5), [tr("ok")], [() => {Function.noop}]) MessageBox(tr("error"), tr("max_filesize", 5), [tr("ok")], [() => {Function.noop}])
return; return;
} }
@ -88,7 +88,6 @@ $(document).on("click", ".photo_upload_container #endUploading", (e) => {
data.append("hash", u("meta[name=csrf]").attr("value")) data.append("hash", u("meta[name=csrf]").attr("value"))
let xhr = new XMLHttpRequest() let xhr = new XMLHttpRequest()
// в самом вк на каждое изменение описания отправляется свой запрос, но тут мы экономим запросы
xhr.open("POST", "/photos/upload?act=finish&album="+document.getElementById("album").value) xhr.open("POST", "/photos/upload?act=finish&album="+document.getElementById("album").value)
xhr.onloadstart = () => { xhr.onloadstart = () => {
@ -108,10 +107,10 @@ $(document).on("click", ".photo_upload_container #endUploading", (e) => {
document.querySelector(".page_content .insertPhotos").innerHTML = "" document.querySelector(".page_content .insertPhotos").innerHTML = ""
document.getElementById("endUploading").style.display = "none" document.getElementById("endUploading").style.display = "none"
NewNotification(tr("photos_successfully_uploaded"), tr("click_to_go_to_album"), null, () => {window.router.route({url:`/album${result.owner}_${result.album}`})}) window.router.route({url:`/album${result.owner}_${result.album}`})
document.querySelector(".whiteBox").style.display = "block" /*document.querySelector(".whiteBox").style.display = "block"
document.querySelector(".insertAgain").append(document.getElementById("fakeButton")) document.querySelector(".insertAgain").append(document.getElementById("fakeButton"))*/
} }
e.currentTarget.removeAttribute("disabled") e.currentTarget.removeAttribute("disabled")

View file

@ -606,7 +606,22 @@ function reportClub(club_id) {
]); ]);
} }
$(document).on("click", "#_photoDelete, #_videoDelete", function(e) { $(document).on("click", "#_ajaxDelete", function(e) {
MessageBox(tr('warning'), tr('question_confirm'), [
tr('yes'),
tr('no')
], [
() => {
window.router.route(e.target.href)
},
Function.noop
]);
e.stopPropagation()
return e.preventDefault();
});
$(document).on("click", "#_photoDelete, #_videoDelete, #_anotherDelete", function(e) {
var formHtml = "<form id='tmpPhDelF' action='" + u(this).attr("href") + "' >"; var formHtml = "<form id='tmpPhDelF' action='" + u(this).attr("href") + "' >";
formHtml += "<input type='hidden' name='hash' value='" + u("meta[name=csrf]").attr("value") + "' />"; formHtml += "<input type='hidden' name='hash' value='" + u("meta[name=csrf]").attr("value") + "' />";
formHtml += "</form>"; formHtml += "</form>";
@ -825,6 +840,7 @@ tippy.delegate("body", {
target: '.client_app', target: '.client_app',
theme: "light vk", theme: "light vk",
content: "⌛", content: "⌛",
delay: 400,
allowHTML: true, allowHTML: true,
interactive: true, interactive: true,
interactiveDebounce: 500, interactiveDebounce: 500,
@ -864,6 +880,7 @@ tippy.delegate('body', {
target: `.post-like-button[data-type]:not([data-likes="0"])`, target: `.post-like-button[data-type]:not([data-likes="0"])`,
theme: "special vk", theme: "special vk",
content: "⌛", content: "⌛",
delay: 400,
allowHTML: true, allowHTML: true,
interactive: true, interactive: true,
interactiveDebounce: 500, interactiveDebounce: 500,
@ -900,7 +917,7 @@ tippy.delegate('body', {
that._likesList.items.forEach(item => { that._likesList.items.forEach(item => {
final_template.find('.like_tooltip_body .like_tooltip_body_grid').append(` final_template.find('.like_tooltip_body .like_tooltip_body_grid').append(`
<a title="${escapeHtml(item.first_name + " " + item.last_name)}" href='/id${item.id}'><img src='${item.photo_50}' alt='.'></a> <a title="${escapeHtml(item.first_name + " " + item.last_name)}" href='/id${item.id}'><img class="object_fit_ava" src='${item.photo_50}' alt='.'></a>
`) `)
}) })
that.setContent(final_template.nodes[0].outerHTML) that.setContent(final_template.nodes[0].outerHTML)
@ -1123,7 +1140,14 @@ u(document).on("click", "#editPost", async (e) => {
return return
} }
const new_post_html = await (await fetch(`/iapi/getPostTemplate/${id[0]}_${id[1]}?type=${type}`, { let is_at_post_page = false
try {
if(location.pathname.indexOf("wall") != -1 && location.pathname.split("_").length == 2) {
is_at_post_page = true
}
} catch(e) {}
const new_post_html = await (await fetch(`/iapi/getPostTemplate/${id[0]}_${id[1]}?type=${type}&from_page=${is_at_post_page ? "post" : "another"}`, {
'method': 'POST' 'method': 'POST'
})).text() })).text()
u(ev.target).removeClass('lagged') u(ev.target).removeClass('lagged')
@ -1174,7 +1198,7 @@ async function __uploadToTextarea(file, textareaNode) {
const rand = random_int(0, 1000) const rand = random_int(0, 1000)
textareaNode.find('.post-horizontal').append(`<a id='temp_filler${rand}' class="upload-item lagged"><img src='${temp_url}'></a>`) textareaNode.find('.post-horizontal').append(`<a id='temp_filler${rand}' class="upload-item lagged"><img src='${temp_url}'></a>`)
const res = await fetch(`/photos/upload`, { const res = await fetch(`/photos/upload?upload_context=${textareaNode.nodes[0].dataset.id}`, {
method: 'POST', method: 'POST',
body: form_data body: form_data
}) })
@ -1342,7 +1366,7 @@ u(document).on("click", "#__photoAttachment", async (e) => {
if(album == 0) { if(album == 0) {
photos = await window.OVKAPI.call('photos.getAll', {'owner_id': window.openvk.current_id, 'photo_sizes': 1, 'count': photos_per_page, 'offset': page * photos_per_page}) photos = await window.OVKAPI.call('photos.getAll', {'owner_id': window.openvk.current_id, 'photo_sizes': 1, 'count': photos_per_page, 'offset': page * photos_per_page})
} else { } else {
photos = await window.OVKAPI.call('photos.get', {'owner_id': window.openvk.current_id, 'album_id': album, 'photo_sizes': 1, 'count': photos_per_page, 'offset': page * photos_per_page}) photos = await window.OVKAPI.call('photos.get', {'owner_id': club != 0 ? Math.abs(club) * -1 : window.openvk.current_id, 'album_id': album, 'photo_sizes': 1, 'count': photos_per_page, 'offset': page * photos_per_page})
} }
} catch(e) { } catch(e) {
u("#attachment_insert_count h4").html(tr("is_x_photos", -1)) u("#attachment_insert_count h4").html(tr("is_x_photos", -1))
@ -1432,7 +1456,7 @@ u(document).on("click", "#__photoAttachment", async (e) => {
window.openvk.photoalbums = await window.OVKAPI.call('photos.getAlbums', {'owner_id': club != 0 ? Math.abs(club) * -1 : window.openvk.current_id}) window.openvk.photoalbums = await window.OVKAPI.call('photos.getAlbums', {'owner_id': club != 0 ? Math.abs(club) * -1 : window.openvk.current_id})
} }
window.openvk.photoalbums.items.forEach(item => { window.openvk.photoalbums.items.forEach(item => {
u('.ovk-diag-body #albumSelect').append(`<option value="${item.vid}">${ovk_proc_strtr(escapeHtml(item.title), 20)}</option>`) u('.ovk-diag-body #albumSelect').append(`<option value="${item.id}">${ovk_proc_strtr(escapeHtml(item.title), 20)}</option>`)
}) })
}) })
@ -1645,7 +1669,7 @@ u(document).on('click', '#__notesAttachment', async (e) => {
insert_place.append(tr('no_notes')) insert_place.append(tr('no_notes'))
} }
notes.notes.forEach(note => { notes.items.forEach(note => {
is_attached = (form.find(`.upload-item[data-type='note'][data-id='${note.owner_id}_${note.id}']`)).length > 0 is_attached = (form.find(`.upload-item[data-type='note'][data-id='${note.owner_id}_${note.id}']`)).length > 0
insert_place.append(` insert_place.append(`
<div class='display_flex_row _content' data-attachmentdata="${note.owner_id}_${note.id}" data-name='${escapeHtml(note.title)}'> <div class='display_flex_row _content' data-attachmentdata="${note.owner_id}_${note.id}" data-name='${escapeHtml(note.title)}'>
@ -1943,10 +1967,10 @@ async function repost(id, repost_type = 'post') {
title: tr('share'), title: tr('share'),
unique_name: 'repost_modal', unique_name: 'repost_modal',
body: ` body: `
<div class='display_flex_column' style='gap: 1px;'> <div class='display_flex_column' style='gap: 5px;'>
<b>${tr('auditory')}</b> <b>${tr('auditory')}</b>
<div class='display_flex_column'> <div class='display_flex_column' style="gap: 2px;padding-left: 1px;">
<label> <label>
<input type="radio" name="repost_type" value="wall" checked> <input type="radio" name="repost_type" value="wall" checked>
${tr("in_wall")} ${tr("in_wall")}
@ -1962,6 +1986,7 @@ async function repost(id, repost_type = 'post') {
<b>${tr('your_comment')}</b> <b>${tr('your_comment')}</b>
<div style="padding-left: 1px;">
<input type='hidden' id='repost_attachments'> <input type='hidden' id='repost_attachments'>
<textarea id='repostMsgInput' placeholder='...'></textarea> <textarea id='repostMsgInput' placeholder='...'></textarea>
@ -1970,6 +1995,7 @@ async function repost(id, repost_type = 'post') {
<label><input type='checkbox' name="signed">${tr('add_signature')}</label> <label><input type='checkbox' name="signed">${tr('add_signature')}</label>
</div> </div>
</div> </div>
</div>
`, `,
buttons: [tr('send'), tr('cancel')], buttons: [tr('send'), tr('cancel')],
callbacks: [ callbacks: [
@ -2036,7 +2062,7 @@ async function repost(id, repost_type = 'post') {
] ]
}); });
u('.ovk-diag-body').attr('style', 'padding: 14px;') u('.ovk-diag-body').attr('style', 'padding: 18px;')
u('.ovk-diag-body').on('change', `input[name='repost_type']`, (e) => { u('.ovk-diag-body').on('change', `input[name='repost_type']`, (e) => {
const value = e.target.value const value = e.target.value
@ -2062,6 +2088,7 @@ async function repost(id, repost_type = 'post') {
if(window.openvk.writeableClubs.items.length < 1) { if(window.openvk.writeableClubs.items.length < 1) {
u(`input[name='repost_type'][value='group']`).attr('disabled', 'disabled') u(`input[name='repost_type'][value='group']`).attr('disabled', 'disabled')
u(`input[name='repost_type'][value='group']`).closest("label").addClass("lagged")
} }
} }
@ -2371,7 +2398,10 @@ async function __processPaginatorNextPage(page)
const new_url = new URL(location.href) const new_url = new URL(location.href)
new_url.hash = page new_url.hash = page
history.replaceState(null, null, new_url) //history.replaceState(null, null, new_url)
showMoreObserver.disconnect()
showMoreObserver.observe(u('.paginator:not(.paginator-at-top)').nodes[0])
if(typeof __scrollHook != 'undefined') { if(typeof __scrollHook != 'undefined') {
__scrollHook(page) __scrollHook(page)
@ -2397,6 +2427,9 @@ const showMoreObserver = new IntersectionObserver(entries => {
if(target.length < 1 || target.hasClass('paginator-at-top')) { if(target.length < 1 || target.hasClass('paginator-at-top')) {
return return
} }
if(target.hasClass('lagged')) {
return
}
const current_url = new URL(location.href) const current_url = new URL(location.href)
if(current_url.searchParams && !isNaN(parseInt(current_url.searchParams.get('p')))) { if(current_url.searchParams && !isNaN(parseInt(current_url.searchParams.get('p')))) {
@ -2437,8 +2470,7 @@ u(document).on('click', '#__sourceAttacher', (e) => {
MessageBox(tr('add_source'), ` MessageBox(tr('add_source'), `
<div id='source_flex_kunteynir'> <div id='source_flex_kunteynir'>
<span>${tr('set_source_tip')}</span> <span>${tr('set_source_tip')}</span>
<!-- давай, копируй ссылку и переходи по ней --> <input type='text' maxlength='400' placeholder='...'>
<input type='text' maxlength='400' placeholder='https://www.youtube.com/watch?v=lkWuk_nzzVA'>
</div> </div>
`, [tr('cancel')], [ `, [tr('cancel')], [
() => {Function.noop} () => {Function.noop}
@ -2546,7 +2578,12 @@ u(document).on('mouseover mousemove mouseout', `div[data-tip='simple']`, (e) =>
}) })
function setStatusEditorShown(shown) { function setStatusEditorShown(shown) {
document.getElementById("status_editor").style.display = shown ? "block" : "none"; if(shown) {
document.getElementById("status_editor").style.display = "block"
document.querySelector("#status_editor input").focus()
} else {
document.getElementById("status_editor").style.display = "none"
}
} }
u(document).on('click', (event) => { u(document).on('click', (event) => {
@ -2648,7 +2685,7 @@ u(document).on('click', "#__geoAttacher", async (e) => {
${tplMapIcon} ${tplMapIcon}
<span>${escapeHtml(geo_name)}</span> <span>${escapeHtml(geo_name)}</span>
<div id="small_remove_button"></div> <div id="small_remove_button"></div>
`) `).addClass("appended-geo")
}, () => {}] }, () => {}]
}) })
@ -2951,3 +2988,28 @@ u(document).on("submit", "#additional_fields_form", (e) => {
} }
}) })
}) })
if(Number(localStorage.getItem('ux.gif_autoplay') ?? 0) == 1) {
const showMoreObserver = new IntersectionObserver(entries => {
entries.forEach(async x => {
doc_item = x.target.closest(".docGalleryItem")
if(doc_item.querySelector(".play-button") != null) {
if(x.isIntersecting) {
doc_item.classList.add("playing")
} else {
doc_item.classList.remove("playing")
}
}
})
}, {
root: null,
rootMargin: '0px',
threshold: 0,
})
if(u('.docGalleryItem').length > 0) {
u('.docGalleryItem').nodes.forEach(item => {
showMoreObserver.observe(item)
})
}
}

View file

@ -211,6 +211,8 @@ window.router = new class {
history.replaceState({'from_router': 1}, '', url) history.replaceState({'from_router': 1}, '', url)
} }
u('body').addClass('ajax_request_made')
const parser = new DOMParser const parser = new DOMParser
const next_page_request = await fetch(next_page_url, { const next_page_request = await fetch(next_page_url, {
method: 'AJAX', method: 'AJAX',
@ -228,6 +230,8 @@ window.router = new class {
this.__closeMsgs() this.__closeMsgs()
this.__unlinkObservers() this.__unlinkObservers()
u('body').removeClass('ajax_request_made')
try { try {
this.__appendPage(parsed_content) this.__appendPage(parsed_content)
await this.__integratePage() await this.__integratePage()
@ -397,8 +401,10 @@ window.addEventListener('popstate', (e) => {
return return
}*/ }*/
if(e.state != null) {
window.router.route({ window.router.route({
url: location.href, url: location.href,
push_state: false, push_state: false,
}) })
}
}) })

View file

@ -6429,6 +6429,21 @@ tools.ToolWithStroke = ToolWithStroke = (function(superClass) {
module.exports = tools; module.exports = tools;
},{}]},{},[22])(22) },{}]},{},[22])(22)
}); });
document.addEventListener('keydown', function (e) {
const redoBtn = document.querySelector(".lc-redo")
const undoBtn = document.querySelector(".lc-undo")
if (e.ctrlKey && undoBtn && redoBtn) {
if ((e.code === "KeyY") || (e.code === "KeyZ" && e.shiftKey)) {
e.preventDefault()
redoBtn.click()
}
else if (e.code === "KeyZ") {
e.preventDefault()
undoBtn.click()
}
}
})

View file

@ -0,0 +1 @@
ALTER TABLE `profiles` ADD COLUMN `hide_global_feed` boolean DEFAULT 0 NOT NULL AFTER `deleted`;

View file

@ -510,7 +510,7 @@
"edit_photo" = "Edit photo"; "edit_photo" = "Edit photo";
"creating_album" = "Creating album"; "creating_album" = "Creating album";
"delete_photo" = "Delete photo"; "delete_photo" = "Delete photo";
"sure_deleting_photo" = "Do you really want to delete this picture?"; "sure_deleting_photo" = "Do you sure you want to delete this photo from album?";
"upload_photo" = "Upload photo"; "upload_photo" = "Upload photo";
"photo" = "Photo"; "photo" = "Photo";
"upload_button" = "Upload"; "upload_button" = "Upload";
@ -624,6 +624,7 @@
"notes_closed" = "You can't attach a note to the post because only you can see them.<br> You can change this in <a href=\"/settings?act=privacy\">settings</a>."; "notes_closed" = "You can't attach a note to the post because only you can see them.<br> You can change this in <a href=\"/settings?act=privacy\">settings</a>.";
"do_not_attach_note" = "Do not attach a note"; "do_not_attach_note" = "Do not attach a note";
"something_is_supported_from_xhtml" = "<a href='/kb/notes'>Something</a> from (X)HTML supported.";
"something" = "Something"; "something" = "Something";
"supports_xhtml" = "from (X)HTML supported."; "supports_xhtml" = "from (X)HTML supported.";
@ -872,6 +873,9 @@
"sort_up" = "Sort by ID up"; "sort_up" = "Sort by ID up";
"sort_down" = "Sort by ID down"; "sort_down" = "Sort by ID down";
"new_first" = "New frist";
"old_first" = "Old first";
/* Videos */ /* Videos */
"videos" = "Videos"; "videos" = "Videos";
@ -1201,6 +1205,7 @@
"coins_other" = "$1 votes"; "coins_other" = "$1 votes";
"users_gifts" = "Gifts"; "users_gifts" = "Gifts";
"sent" = "Sent";
/* Apps */ /* Apps */
"app" = "Application"; "app" = "Application";
@ -1684,6 +1689,7 @@
"admin_first_known_ip" = "First known IP"; "admin_first_known_ip" = "First known IP";
"admin_shortcode" = "Short code"; "admin_shortcode" = "Short code";
"admin_verification" = "Verification"; "admin_verification" = "Verification";
"admin_hide_global_feed" = "Hide global feed";
"admin_banreason" = "Ban reason"; "admin_banreason" = "Ban reason";
"admin_banned" = "banned"; "admin_banned" = "banned";
"admin_gender" = "Sex"; "admin_gender" = "Sex";
@ -2326,6 +2332,8 @@
"roll_back" = "rollback"; "roll_back" = "rollback";
"roll_backed" = "rollbacked"; "roll_backed" = "rollbacked";
"nospam_prevention" = "This action will affect a lot of data. Are you sure you want to apply?";
/* RSS */ /* RSS */
"post_deact_in_general" = "Page deletion"; "post_deact_in_general" = "Page deletion";

View file

@ -494,7 +494,7 @@
"edit_photo" = "Изменить фотографию"; "edit_photo" = "Изменить фотографию";
"creating_album" = "Создание альбома"; "creating_album" = "Создание альбома";
"delete_photo" = "Удалить фотографию"; "delete_photo" = "Удалить фотографию";
"sure_deleting_photo" = "Вы уверены, что хотите удалить эту фотографию?"; "sure_deleting_photo" = "Вы уверены, что хотите удалить эту фотографию из альбома?";
"upload_photo" = "Загрузить фотографию"; "upload_photo" = "Загрузить фотографию";
"photo" = "Фотография"; "photo" = "Фотография";
"upload_button" = "Загрузить"; "upload_button" = "Загрузить";
@ -608,6 +608,7 @@
"notes_closed" = "Вы не можете прикрепить заметку к записи, так как ваши заметки видны только вам.<br><br> Вы можете поменять это в <a href=\"/settings?act=privacy\">настройках</a>."; "notes_closed" = "Вы не можете прикрепить заметку к записи, так как ваши заметки видны только вам.<br><br> Вы можете поменять это в <a href=\"/settings?act=privacy\">настройках</a>.";
"do_not_attach_note" = "Не прикреплять заметку"; "do_not_attach_note" = "Не прикреплять заметку";
"something_is_supported_from_xhtml" = "<a href='/kb/notes'>Кое-что</a> из (X)HTML поддерживается.";
"something" = "Кое-что"; "something" = "Кое-что";
"supports_xhtml" = "из (X)HTML поддерживается."; "supports_xhtml" = "из (X)HTML поддерживается.";
@ -830,6 +831,9 @@
"sort_up" = "Сортировать по дате создания вверх"; "sort_up" = "Сортировать по дате создания вверх";
"sort_down" = "Сортировать по дате создания вниз"; "sort_down" = "Сортировать по дате создания вниз";
"new_first" = "Сначала новые";
"old_first" = "Сначала старые";
/* Videos */ /* Videos */
"videos" = "Видеозаписи"; "videos" = "Видеозаписи";
@ -1143,6 +1147,7 @@
"coins_many" = "$1 голосов"; "coins_many" = "$1 голосов";
"coins_other" = "$1 голосов"; "coins_other" = "$1 голосов";
"users_gifts" = "Подарки"; "users_gifts" = "Подарки";
"sent" = "Отправлено";
/* Apps */ /* Apps */
"app" = "Приложение"; "app" = "Приложение";
@ -1587,6 +1592,7 @@
"admin_first_known_ip" = "Первый IP"; "admin_first_known_ip" = "Первый IP";
"admin_shortcode" = "Короткий адрес"; "admin_shortcode" = "Короткий адрес";
"admin_verification" = "Верификация"; "admin_verification" = "Верификация";
"admin_hide_global_feed" = "Не отображать в глобальной ленте";
"admin_banreason" = "Причина блокировки"; "admin_banreason" = "Причина блокировки";
"admin_banned" = "заблокирован"; "admin_banned" = "заблокирован";
"admin_actions" = "Действия"; "admin_actions" = "Действия";
@ -2221,6 +2227,8 @@
"roll_back" = "откатить"; "roll_back" = "откатить";
"roll_backed" = "откачено"; "roll_backed" = "откачено";
"nospam_prevention" = "Данное действие затронет множество данных. Вы действительно хотите применить?";
/* RSS */ /* RSS */
"post_deact_in_general" = "Удаление страницы"; "post_deact_in_general" = "Удаление страницы";

View file

@ -448,6 +448,7 @@
"notes_closed" = "Vy ne možete prikrepití zametku k zapisi, tak kak vaši zametki vidny tolíko vam.<br><br> Vy možete pomenjatí eto v <a href=\"/settings?act=privacy\">nastrojkah</a>."; "notes_closed" = "Vy ne možete prikrepití zametku k zapisi, tak kak vaši zametki vidny tolíko vam.<br><br> Vy možete pomenjatí eto v <a href=\"/settings?act=privacy\">nastrojkah</a>.";
"do_not_attach_note" = "Ne prikrepljatí zametku"; "do_not_attach_note" = "Ne prikrepljatí zametku";
"something_is_supported_from_xhtml" = "<a href='/kb/notes'>Koe-čto</a> iz (X)HTML podderživaetsja.";
"something" = "Koe-čto"; "something" = "Koe-čto";
"supports_xhtml" = "iz (X)HTML podderživaetsja."; "supports_xhtml" = "iz (X)HTML podderživaetsja.";

View file

@ -584,6 +584,7 @@
"notes_closed" = "Ви не можете прикріпити нотатку до запису, оскільки Ваші нотатки видно тільки Вам.<br><br> Ви можете змінити це в <a href=\"/settings?act=privacy\">налаштуваннях</a>."; "notes_closed" = "Ви не можете прикріпити нотатку до запису, оскільки Ваші нотатки видно тільки Вам.<br><br> Ви можете змінити це в <a href=\"/settings?act=privacy\">налаштуваннях</a>.";
"do_not_attach_note" = "Не прикріплювати нотатку"; "do_not_attach_note" = "Не прикріплювати нотатку";
"something_is_supported_from_xhtml" = "<a href='/kb/notes'>Певні</a> теги з (X)HTML підтримується.";
"something" = "Певні"; "something" = "Певні";
"supports_xhtml" = "теги з (X)HTML підтримується."; "supports_xhtml" = "теги з (X)HTML підтримується.";