mirror of
https://github.com/openvk/openvk
synced 2025-07-07 08:19:49 +03:00
Compare commits
12 commits
0bd023bef3
...
598b2f47ad
Author | SHA1 | Date | |
---|---|---|---|
|
598b2f47ad | ||
|
a3560876ad | ||
|
1256a34e37 | ||
|
ffc5bb1627 | ||
|
71a388e5d2 | ||
|
6a81f21537 | ||
|
3e9a271921 | ||
|
0a4032eaed | ||
|
851c4e29f7 | ||
|
fdb0735041 | ||
|
3e69d06474 | ||
|
dd97ded326 |
30 changed files with 2267 additions and 133 deletions
429
VKAPI/Handlers/Board.php
Normal file
429
VKAPI/Handlers/Board.php
Normal file
|
@ -0,0 +1,429 @@
|
|||
<?php declare(strict_types=1);
|
||||
namespace openvk\VKAPI\Handlers;
|
||||
use openvk\VKAPI\Handlers\Wall;
|
||||
use openvk\Web\Models\Repositories\Topics as TopicsRepo;
|
||||
use openvk\Web\Models\Repositories\Clubs as ClubsRepo;
|
||||
use openvk\Web\Models\Repositories\Photos as PhotosRepo;
|
||||
use openvk\Web\Models\Repositories\Videos as VideosRepo;
|
||||
use openvk\Web\Models\Repositories\Comments as CommentsRepo;
|
||||
use openvk\Web\Models\Entities\{Topic, Comment, User, Photo, Video};
|
||||
|
||||
final class Board extends VKAPIRequestHandler
|
||||
{
|
||||
# 13/13
|
||||
function addTopic(int $group_id, string $title, string $text = "", bool $from_group = true, string $attachments = "")
|
||||
{
|
||||
$this->requireUser();
|
||||
$this->willExecuteWriteAction();
|
||||
|
||||
$club = (new ClubsRepo)->get($group_id);
|
||||
|
||||
if(!$club) {
|
||||
$this->fail(403, "Invalid club");
|
||||
}
|
||||
|
||||
if(!$club->canBeModifiedBy($this->getUser()) && !$club->isEveryoneCanCreateTopics()) {
|
||||
$this->fail(403, "Access to club denied");
|
||||
}
|
||||
|
||||
$flags = 0;
|
||||
|
||||
if($from_group == true && $club->canBeModifiedBy($this->getUser()))
|
||||
$flags |= 0b10000000;
|
||||
|
||||
$topic = new Topic;
|
||||
$topic->setGroup($club->getId());
|
||||
$topic->setOwner($this->getUser()->getId());
|
||||
$topic->setTitle(ovk_proc_strtr($title, 127));
|
||||
$topic->setCreated(time());
|
||||
$topic->setFlags($flags);
|
||||
$topic->save();
|
||||
|
||||
if(!empty($text)) {
|
||||
$comment = new Comment;
|
||||
$comment->setOwner($this->getUser()->getId());
|
||||
$comment->setModel(get_class($topic));
|
||||
$comment->setTarget($topic->getId());
|
||||
$comment->setContent($text);
|
||||
$comment->setCreated(time());
|
||||
$comment->setFlags($flags);
|
||||
$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 $topic->getId();
|
||||
}
|
||||
|
||||
function closeTopic(int $group_id, int $topic_id)
|
||||
{
|
||||
$this->requireUser();
|
||||
$this->willExecuteWriteAction();
|
||||
|
||||
$topic = (new TopicsRepo)->getTopicById($group_id, $topic_id);
|
||||
|
||||
if(!$topic || !$topic->getClub() || !$topic->getClub()->canBeModifiedBy($this->getUser())) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(!$topic->isClosed()) {
|
||||
$topic->setClosed(1);
|
||||
$topic->save();
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
function createComment(int $group_id, int $topic_id, string $message = "", string $attachments = "", bool $from_group = true)
|
||||
{
|
||||
$this->requireUser();
|
||||
$this->willExecuteWriteAction();
|
||||
|
||||
if(empty($message) && empty($attachments)) {
|
||||
$this->fail(100, "Required parameter 'message' missing.");
|
||||
}
|
||||
|
||||
$topic = (new TopicsRepo)->getTopicById($group_id, $topic_id);
|
||||
|
||||
if(!$topic || $topic->isDeleted() || $topic->isClosed()) {
|
||||
$this->fail(100, "Topic is deleted, closed or invalid.");
|
||||
}
|
||||
|
||||
$flags = 0;
|
||||
|
||||
if($from_group != 0 && !is_null($topic->getClub()) && $topic->getClub()->canBeModifiedBy($this->user))
|
||||
$flags |= 0b10000000;
|
||||
|
||||
if(strlen($message) > 300) {
|
||||
$this->fail(20, "Comment is too long.");
|
||||
}
|
||||
|
||||
$comment = new Comment;
|
||||
$comment->setOwner($this->getUser()->getId());
|
||||
$comment->setModel(get_class($topic));
|
||||
$comment->setTarget($topic->getId());
|
||||
$comment->setContent($message);
|
||||
$comment->setCreated(time());
|
||||
$comment->setFlags($flags);
|
||||
$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();
|
||||
}
|
||||
|
||||
function deleteComment(int $comment_id, int $group_id = 0, int $topic_id = 0)
|
||||
{
|
||||
$this->requireUser();
|
||||
$this->willExecuteWriteAction();
|
||||
|
||||
$comment = (new CommentsRepo)->get($comment_id);
|
||||
|
||||
if($comment->isDeleted() || !$comment || !$comment->canBeDeletedBy($this->getUser()))
|
||||
$this->fail(403, "Access to comment denied");
|
||||
|
||||
$comment->delete();
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
function deleteTopic(int $group_id, int $topic_id)
|
||||
{
|
||||
$this->requireUser();
|
||||
$this->willExecuteWriteAction();
|
||||
|
||||
$topic = (new TopicsRepo)->getTopicById($group_id, $topic_id);
|
||||
|
||||
if(!$topic || !$topic->getClub() || $topic->isDeleted() || !$topic->getClub()->canBeModifiedBy($this->getUser())) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
$topic->deleteTopic();
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
function editComment(int $comment_id, int $group_id = 0, int $topic_id = 0, string $message, string $attachments)
|
||||
{
|
||||
/*
|
||||
$this->requireUser();
|
||||
$this->willExecuteWriteAction();
|
||||
|
||||
$comment = (new CommentsRepo)->get($comment_id);
|
||||
|
||||
if($comment->getOwner() != $this->getUser()->getId())
|
||||
$this->fail(15, "Access to comment denied");
|
||||
|
||||
$comment->setContent($message);
|
||||
$comment->setEdited(time());
|
||||
$comment->save();
|
||||
*/
|
||||
return 1;
|
||||
}
|
||||
|
||||
function editTopic(int $group_id, int $topic_id, string $title)
|
||||
{
|
||||
$this->requireUser();
|
||||
$this->willExecuteWriteAction();
|
||||
|
||||
$topic = (new TopicsRepo)->getTopicById($group_id, $topic_id);
|
||||
|
||||
if(!$topic || !$topic->getClub() || $topic->isDeleted() || !$topic->getClub()->canBeModifiedBy($this->getUser())) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
$topic->setTitle(ovk_proc_strtr($title, 127));
|
||||
|
||||
$topic->save();
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
function fixTopic(int $group_id, int $topic_id)
|
||||
{
|
||||
$this->requireUser();
|
||||
$this->willExecuteWriteAction();
|
||||
|
||||
$topic = (new TopicsRepo)->getTopicById($group_id, $topic_id);
|
||||
|
||||
if(!$topic || !$topic->getClub() || !$topic->getClub()->canBeModifiedBy($this->getUser())) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
$topic->setPinned(1);
|
||||
|
||||
$topic->save();
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
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")
|
||||
{
|
||||
# start_comment_id ne robit
|
||||
$this->requireUser();
|
||||
$this->willExecuteWriteAction();
|
||||
|
||||
$topic = (new TopicsRepo)->getTopicById($group_id, $topic_id);
|
||||
|
||||
if(!$topic || !$topic->getClub() || $topic->isDeleted() || !$topic->getClub()->canBeModifiedBy($this->getUser())) {
|
||||
$this->fail(5, "Invalid topic");
|
||||
}
|
||||
|
||||
$arr = [
|
||||
"items" => []
|
||||
];
|
||||
|
||||
$comms = array_slice(iterator_to_array($topic->getComments(1, $count + $offset)), $offset);
|
||||
foreach($comms as $comm) {
|
||||
$arr["items"][] = $this->getApiBoardComment($comm, $need_likes);
|
||||
|
||||
if($extended) {
|
||||
if($comm->getOwner() instanceof \openvk\Web\Models\Entities\User) {
|
||||
$arr["profiles"][] = $comm->getOwner()->toVkApiStruct();
|
||||
}
|
||||
|
||||
if($comm->getOwner() instanceof \openvk\Web\Models\Entities\Club) {
|
||||
$arr["groups"][] = $comm->getOwner()->toVkApiStruct();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $arr;
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
# order и extended ничё не делают
|
||||
$this->requireUser();
|
||||
$this->willExecuteWriteAction();
|
||||
|
||||
$arr = [];
|
||||
$club = (new ClubsRepo)->get($group_id);
|
||||
$topics = array_slice(iterator_to_array((new TopicsRepo)->getClubTopics($club, 1, $count + $offset)), $offset);
|
||||
$arr["count"] = (new TopicsRepo)->getClubTopicsCount($club);
|
||||
$arr["items"] = [];
|
||||
$arr["default_order"] = $order;
|
||||
$arr["can_add_topics"] = $club->canBeModifiedBy($this->getUser()) ? true : $club->isEveryoneCanCreateTopics() ? true : false;
|
||||
$arr["profiles"] = [];
|
||||
|
||||
if(empty($topic_ids)) {
|
||||
foreach($topics as $topic) {
|
||||
if($topic->isDeleted()) continue;
|
||||
$arr["items"][] = $topic->toVkApiStruct($preview, $preview_length);
|
||||
}
|
||||
} else {
|
||||
$topics = explode(',', $topic_ids);
|
||||
|
||||
foreach($topics as $topic) {
|
||||
$id = explode("_", $topic);
|
||||
$topicy = (new TopicsRepo)->getTopicById((int)$id[0], (int)$id[1]);
|
||||
if($topicy) {
|
||||
$arr["items"] = $topicy->toVkApiStruct();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $arr;
|
||||
}
|
||||
|
||||
function openTopic(int $group_id, int $topic_id)
|
||||
{
|
||||
$this->requireUser();
|
||||
$this->willExecuteWriteAction();
|
||||
|
||||
$topic = (new TopicsRepo)->getTopicById($group_id, $topic_id);
|
||||
|
||||
if(!$topic || !$topic->getClub() || !$topic->isDeleted() || !$topic->getClub()->canBeModifiedBy($this->getUser())) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if($topic->isClosed()) {
|
||||
$topic->setClosed(0);
|
||||
$topic->save();
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
function restoreComment(int $group_id, int $topic_id, int $comment_id)
|
||||
{
|
||||
$this->fail(501, "Not implemented");
|
||||
}
|
||||
|
||||
function unfixTopic(int $group_id, int $topic_id)
|
||||
{
|
||||
$this->requireUser();
|
||||
$this->willExecuteWriteAction();
|
||||
|
||||
$topic = (new TopicsRepo)->getTopicById($group_id, $topic_id);
|
||||
|
||||
if(!$topic || !$topic->getClub() || !$topic->getClub()->canBeModifiedBy($this->getUser())) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if($topic->isPinned()) {
|
||||
$topic->setClosed(0);
|
||||
$topic->save();
|
||||
}
|
||||
|
||||
$topic->setPinned(0);
|
||||
|
||||
$topic->save();
|
||||
|
||||
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();
|
||||
$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;
|
||||
}
|
||||
}
|
174
VKAPI/Handlers/Gifts.php
Normal file
174
VKAPI/Handlers/Gifts.php
Normal file
|
@ -0,0 +1,174 @@
|
|||
<?php declare(strict_types=1);
|
||||
namespace openvk\VKAPI\Handlers;
|
||||
use openvk\Web\Models\Repositories\Users as UsersRepo;
|
||||
use openvk\Web\Models\Repositories\Gifts as GiftsRepo;
|
||||
use openvk\Web\Models\Entities\Notifications\GiftNotification;
|
||||
|
||||
final class Gifts extends VKAPIRequestHandler
|
||||
{
|
||||
function get(int $user_id, int $count = 10, int $offset = 0)
|
||||
{
|
||||
$this->requireUser();
|
||||
|
||||
$i = 0;
|
||||
|
||||
$i += $offset;
|
||||
|
||||
$user = (new UsersRepo)->get($user_id);
|
||||
|
||||
if(!$user || $user->isDeleted())
|
||||
$this->fail(177, "Invalid user");
|
||||
|
||||
$gift_item = [];
|
||||
|
||||
$userGifts = array_slice(iterator_to_array($user->getGifts(1, $count, false)), $offset);
|
||||
|
||||
if(sizeof($userGifts) < 0) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
foreach($userGifts as $gift) {
|
||||
if($i < $count) {
|
||||
$gift_item[] = [
|
||||
"id" => $i,
|
||||
"from_id" => $gift->anon == true ? 0 : $gift->sender->getId(),
|
||||
"message" => $gift->caption == NULL ? "" : $gift->caption,
|
||||
"date" => $gift->sent->timestamp(),
|
||||
"gift" => [
|
||||
"id" => $gift->gift->getId(),
|
||||
"thumb_256" => $gift->gift->getImage(2),
|
||||
"thumb_96" => $gift->gift->getImage(2),
|
||||
"thumb_48" => $gift->gift->getImage(2)
|
||||
],
|
||||
"privacy" => 0
|
||||
];
|
||||
}
|
||||
$i+=1;
|
||||
}
|
||||
|
||||
return $gift_item;
|
||||
}
|
||||
|
||||
function send(int $user_ids, int $gift_id, string $message = "", int $privacy = 0)
|
||||
{
|
||||
$this->requireUser();
|
||||
$this->willExecuteWriteAction();
|
||||
|
||||
$user = (new UsersRepo)->get((int) $user_ids);
|
||||
|
||||
if(!OPENVK_ROOT_CONF['openvk']['preferences']['commerce'])
|
||||
$this->fail(105, "Commerce is disabled on this instance");
|
||||
|
||||
if(!$user || $user->isDeleted())
|
||||
$this->fail(177, "Invalid user");
|
||||
|
||||
$gift = (new GiftsRepo)->get($gift_id);
|
||||
|
||||
if(!$gift)
|
||||
$this->fail(165, "Invalid gift");
|
||||
|
||||
$price = $gift->getPrice();
|
||||
$coinsLeft = $this->getUser()->getCoins() - $price;
|
||||
|
||||
if(!$gift->canUse($this->getUser()))
|
||||
return (object)
|
||||
[
|
||||
"success" => 0,
|
||||
"user_ids" => $user_ids,
|
||||
"error" => "You don't have any more of these gifts."
|
||||
];
|
||||
|
||||
if($coinsLeft < 0)
|
||||
return (object)
|
||||
[
|
||||
"success" => 0,
|
||||
"user_ids" => $user_ids,
|
||||
"error" => "You don't have enough voices."
|
||||
];
|
||||
|
||||
$user->gift($this->getUser(), $gift, $message);
|
||||
$gift->used();
|
||||
|
||||
$this->getUser()->setCoins($coinsLeft);
|
||||
$this->getUser()->save();
|
||||
|
||||
$notification = new GiftNotification($user, $this->getUser(), $gift, $message);
|
||||
$notification->emit();
|
||||
|
||||
return (object)
|
||||
[
|
||||
"success" => 1,
|
||||
"user_ids" => $user_ids,
|
||||
"withdraw_votes" => $price
|
||||
];
|
||||
}
|
||||
|
||||
function delete()
|
||||
{
|
||||
$this->requireUser();
|
||||
$this->willExecuteWriteAction();
|
||||
|
||||
$this->fail(501, "Not implemented");
|
||||
}
|
||||
|
||||
# этих методов не было в ВК, но я их добавил чтобы можно было отобразить список подарков
|
||||
function getCategories(bool $extended = false, int $page = 1)
|
||||
{
|
||||
$cats = (new GiftsRepo)->getCategories($page);
|
||||
$categ = [];
|
||||
$i = 0;
|
||||
|
||||
if(!OPENVK_ROOT_CONF['openvk']['preferences']['commerce'])
|
||||
$this->fail(105, "Commerce is disabled on this instance");
|
||||
|
||||
foreach($cats as $cat) {
|
||||
$categ[$i] = [
|
||||
"name" => $cat->getName(),
|
||||
"description" => $cat->getDescription(),
|
||||
"id" => $cat->getId(),
|
||||
"thumbnail" => $cat->getThumbnailURL(),
|
||||
];
|
||||
|
||||
if($extended == true) {
|
||||
$categ[$i]["localizations"] = [];
|
||||
foreach(getLanguages() as $lang) {
|
||||
$code = $lang["code"];
|
||||
$categ[$i]["localizations"][$code] =
|
||||
[
|
||||
"name" => $cat->getName($code),
|
||||
"desc" => $cat->getDescription($code),
|
||||
];
|
||||
}
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
|
||||
return $categ;
|
||||
}
|
||||
|
||||
function getGiftsInCategory(int $id, int $page = 1)
|
||||
{
|
||||
$this->requireUser();
|
||||
|
||||
if(!OPENVK_ROOT_CONF['openvk']['preferences']['commerce'])
|
||||
$this->fail(105, "Commerce is disabled on this instance");
|
||||
|
||||
if(!(new GiftsRepo)->getCat($id))
|
||||
$this->fail(177, "Category not found");
|
||||
|
||||
$giftz = ((new GiftsRepo)->getCat($id))->getGifts($page);
|
||||
$gifts = [];
|
||||
|
||||
foreach($giftz as $gift) {
|
||||
$gifts[] = [
|
||||
"name" => $gift->getName(),
|
||||
"image" => $gift->getImage(2),
|
||||
"usages_left" => (int)$gift->getUsagesLeft($this->getUser()),
|
||||
"price" => $gift->getPrice(), # голосов
|
||||
"is_free" => $gift->isFree()
|
||||
];
|
||||
}
|
||||
|
||||
return $gifts;
|
||||
}
|
||||
}
|
|
@ -2,6 +2,7 @@
|
|||
namespace openvk\VKAPI\Handlers;
|
||||
use openvk\Web\Models\Repositories\Clubs as ClubsRepo;
|
||||
use openvk\Web\Models\Repositories\Users as UsersRepo;
|
||||
use openvk\Web\Models\Entities\Club;
|
||||
|
||||
final class Groups extends VKAPIRequestHandler
|
||||
{
|
||||
|
@ -263,4 +264,271 @@ final class Groups extends VKAPIRequestHandler
|
|||
|
||||
return 1;
|
||||
}
|
||||
|
||||
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());
|
||||
}
|
||||
|
||||
function edit(
|
||||
int $group_id,
|
||||
string $title = NULL,
|
||||
string $description = NULL,
|
||||
string $screen_name = NULL,
|
||||
string $website = NULL,
|
||||
int $wall = NULL,
|
||||
int $topics = NULL,
|
||||
int $adminlist = NULL,
|
||||
int $topicsAboveWall = NULL,
|
||||
int $hideFromGlobalFeed = NULL)
|
||||
{
|
||||
$this->requireUser();
|
||||
$this->willExecuteWriteAction();
|
||||
|
||||
$club = (new ClubsRepo)->get($group_id);
|
||||
|
||||
if(!$club) $this->fail(203, "Club not found");
|
||||
if(!$club || !$club->canBeModifiedBy($this->getUser())) $this->fail(15, "You can't modify this group.");
|
||||
if(!empty($screen_name) && !$club->setShortcode($screen_name)) $this->fail(103, "Invalid shortcode.");
|
||||
|
||||
!is_null($title) ? $club->setName($title) : NULL;
|
||||
!is_null($description) ? $club->setAbout($description) : NULL;
|
||||
!is_null($screen_name) ? $club->setShortcode($screen_name) : NULL;
|
||||
!is_null($website) ? $club->setWebsite((!parse_url($website, PHP_URL_SCHEME) ? "https://" : "") . $website) : NULL;
|
||||
!is_null($wall) ? $club->setWall($wall) : NULL;
|
||||
!is_null($topics) ? $club->setEveryone_Can_Create_Topics($topics) : NULL;
|
||||
!is_null($adminlist) ? $club->setAdministrators_List_Display($adminlist) : NULL;
|
||||
!is_null($topicsAboveWall) ? $club->setDisplay_Topics_Above_Wall($topicsAboveWall) : NULL;
|
||||
!is_null($hideFromGlobalFeed) ? $club->setHide_From_Global_Feed($hideFromGlobalFeed) : NULL;
|
||||
|
||||
$club->save();
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
function getMembers(string $group_id, string $sort = "id_asc", int $offset = 0, int $count = 100, string $fields = "", string $filter = "any")
|
||||
{
|
||||
# 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
|
||||
$club = (new ClubsRepo)->get((int) $group_id);
|
||||
if(!$club)
|
||||
$this->fail(125, "Invalid group id");
|
||||
|
||||
$sorter = "follower ASC";
|
||||
|
||||
switch($sort) {
|
||||
default:
|
||||
case "time_asc":
|
||||
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" => array()];
|
||||
|
||||
$filds = explode(",", $fields);
|
||||
|
||||
$i = 0;
|
||||
foreach($members as $member) {
|
||||
if($i > $count) {
|
||||
break;
|
||||
}
|
||||
|
||||
$arr->items[] = (object) [
|
||||
"id" => $member->getId(),
|
||||
"name" => $member->getCanonicalName(),
|
||||
];
|
||||
|
||||
foreach($filds as $fild) {
|
||||
switch($fild) {
|
||||
case "bdate":
|
||||
$arr->items[$i]->bdate = $member->getBirthday()->format('%e.%m.%Y');
|
||||
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 = 0;
|
||||
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":
|
||||
$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":
|
||||
$arr->items[$i]->last_seen = $member->getOnline()->timestamp();
|
||||
break;
|
||||
case "lists":
|
||||
$arr->items[$i]->lists = "";
|
||||
break;
|
||||
case "online":
|
||||
$arr->items[$i]->online = $member->isOnline();
|
||||
break;
|
||||
case "online_mobile":
|
||||
$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":
|
||||
$arr->items[$i]->sex = $member->isFemale() ? 1 : 2;
|
||||
break;
|
||||
case "site":
|
||||
$arr->items[$i]->site = $member->getWebsite();
|
||||
break;
|
||||
case "status":
|
||||
$arr->items[$i]->status = $member->getStatus();
|
||||
break;
|
||||
case "universities":
|
||||
$arr->items[$i]->universities = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
return $arr;
|
||||
}
|
||||
|
||||
function getSettings(string $group_id)
|
||||
{
|
||||
$this->requireUser();
|
||||
$club = (new ClubsRepo)->get((int)$group_id);
|
||||
|
||||
if(!$club || !$club->canBeModifiedBy($this->getUser()))
|
||||
$this->fail(15, "You can't get settings of this group.");
|
||||
|
||||
$arr = (object) [
|
||||
"title" => $club->getName(),
|
||||
"description" => $club->getDescription() != NULL ? $club->getDescription() : "",
|
||||
"address" => $club->getShortcode(),
|
||||
"wall" => $club->canPost() == true ? 1 : 0,
|
||||
"photos" => 1,
|
||||
"video" => 0,
|
||||
"audio" => 0,
|
||||
"docs" => 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(),
|
||||
"age_limits" => 0,
|
||||
"market" => [],
|
||||
];
|
||||
|
||||
return $arr;
|
||||
}
|
||||
|
||||
function isMember(string $group_id, int $user_id, string $user_ids = "", bool $extended = false)
|
||||
{
|
||||
$this->requireUser();
|
||||
$id = $user_id != NULL ? $user_id : explode(",", $user_ids);
|
||||
|
||||
if($group_id < 0)
|
||||
$this->fail(228, "Remove the minus from group_id");
|
||||
|
||||
$club = (new ClubsRepo)->get((int)$group_id);
|
||||
$usver = (new UsersRepo)->get((int)$id);
|
||||
|
||||
if(!$club || $group_id == 0)
|
||||
$this->fail(203, "Invalid club");
|
||||
|
||||
if(!$usver || $usver->isDeleted() || $user_id == 0)
|
||||
$this->fail(30, "Invalid user");
|
||||
|
||||
if($extended == false) {
|
||||
return $club->getSubscriptionStatus($usver) ? 1 : 0;
|
||||
} else {
|
||||
return (object)
|
||||
[
|
||||
"member" => $club->getSubscriptionStatus($usver) ? 1 : 0,
|
||||
"request" => 0,
|
||||
"invitation" => 0,
|
||||
"can_invite" => 0,
|
||||
"can_recall" => 0
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
function remove(int $group_id, int $user_id)
|
||||
{
|
||||
$this->requireUser();
|
||||
|
||||
$this->fail(501, "Not implemented");
|
||||
}
|
||||
}
|
||||
|
|
271
VKAPI/Handlers/Notes.php
Normal file
271
VKAPI/Handlers/Notes.php
Normal file
|
@ -0,0 +1,271 @@
|
|||
<?php declare(strict_types=1);
|
||||
namespace openvk\VKAPI\Handlers;
|
||||
use openvk\Web\Models\Repositories\Notes as NotesRepo;
|
||||
use openvk\Web\Models\Repositories\Users as UsersRepo;
|
||||
use openvk\Web\Models\Repositories\Comments as CommentsRepo;
|
||||
use openvk\Web\Models\Repositories\Photos as PhotosRepo;
|
||||
use openvk\Web\Models\Repositories\Videos as VideosRepo;
|
||||
use openvk\Web\Models\Entities\{Note, Comment};
|
||||
|
||||
final class Notes extends VKAPIRequestHandler
|
||||
{
|
||||
function add(string $title, string $text, int $privacy = 0, int $comment_privacy = 0, string $privacy_view = "", string $privacy_comment = "")
|
||||
{
|
||||
$this->requireUser();
|
||||
$this->willExecuteWriteAction();
|
||||
|
||||
$note = new Note;
|
||||
$note->setOwner($this->getUser()->getId());
|
||||
$note->setCreated(time());
|
||||
$note->setName($title);
|
||||
$note->setSource($text);
|
||||
$note->setEdited(time());
|
||||
$note->save();
|
||||
|
||||
return $note->getVirtualId();
|
||||
}
|
||||
|
||||
function createComment(string $note_id, int $owner_id, string $message, int $reply_to = 0, string $attachments = "")
|
||||
{
|
||||
$this->requireUser();
|
||||
$this->willExecuteWriteAction();
|
||||
$note = (new NotesRepo)->getNoteById((int)$owner_id, (int)$note_id);
|
||||
|
||||
if(!$note)
|
||||
$this->fail(180, "Note not found");
|
||||
|
||||
if($note->isDeleted())
|
||||
$this->fail(189, "Note is deleted");
|
||||
|
||||
if($note->getOwner()->isDeleted())
|
||||
$this->fail(403, "Owner is deleted");
|
||||
|
||||
if(empty($message) && empty($attachments))
|
||||
$this->fail(100, "Required parameter 'message' missing.");
|
||||
|
||||
$comment = new Comment;
|
||||
$comment->setOwner($this->getUser()->getId());
|
||||
$comment->setModel(get_class($note));
|
||||
$comment->setTarget($note->getId());
|
||||
$comment->setContent($message);
|
||||
$comment->setCreated(time());
|
||||
$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();
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
function deleteComment(int $comment_id, int $owner_id = 0)
|
||||
{
|
||||
$this->requireUser();
|
||||
$this->willExecuteWriteAction();
|
||||
|
||||
$comment = (new CommentsRepo)->get($comment_id);
|
||||
|
||||
if(!$comment || !$comment->canBeDeletedBy($this->getUser()))
|
||||
$this->fail(403, "Access to comment denied");
|
||||
|
||||
$comment->delete();
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
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->willExecuteWriteAction();
|
||||
|
||||
$note = (new NotesRepo)->getNoteById($this->getUser()->getId(), (int)$note_id);
|
||||
|
||||
if(!$note)
|
||||
$this->fail(180, "Note not found");
|
||||
|
||||
if($note->isDeleted())
|
||||
$this->fail(189, "Note is deleted");
|
||||
|
||||
if(!$note->canBeModifiedBy($this->getUser()))
|
||||
$this->fail(403, "No access");
|
||||
|
||||
!empty($title) ? $note->setName($title) : NULL;
|
||||
!empty($text) ? $note->setSource($text) : NULL;
|
||||
|
||||
$note->setCached_Content(NULL);
|
||||
$note->setEdited(time());
|
||||
$note->save();
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
function editComment(int $comment_id, string $message, int $owner_id = NULL)
|
||||
{
|
||||
/*
|
||||
$this->requireUser();
|
||||
$this->willExecuteWriteAction();
|
||||
|
||||
$comment = (new CommentsRepo)->get($comment_id);
|
||||
|
||||
if($comment->getOwner() != $this->getUser()->getId())
|
||||
$this->fail(15, "Access to comment denied");
|
||||
|
||||
$comment->setContent($message);
|
||||
$comment->setEdited(time());
|
||||
$comment->save();
|
||||
*/
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
function get(int $user_id, string $note_ids = "", int $offset = 0, int $count = 10, int $sort = 0)
|
||||
{
|
||||
$this->requireUser();
|
||||
$user = (new UsersRepo)->get($user_id);
|
||||
|
||||
if(!$user || $user->isDeleted())
|
||||
$this->fail(15, "Invalid user");
|
||||
|
||||
if(empty($note_ids)) {
|
||||
$notes = array_slice(iterator_to_array((new NotesRepo)->getUserNotes($user, 1, $count + $offset, $sort == 0 ? "ASC" : "DESC")), $offset);
|
||||
$nodez = (object) [
|
||||
"count" => (new NotesRepo)->getUserNotesCount((new UsersRepo)->get($user_id)),
|
||||
"notes" => []
|
||||
];
|
||||
|
||||
foreach($notes as $note) {
|
||||
if($note->isDeleted()) continue;
|
||||
|
||||
$nodez->notes[] = $note->toVkApiStruct();
|
||||
}
|
||||
} else {
|
||||
$notes = explode(',', $note_ids);
|
||||
|
||||
foreach($notes as $note)
|
||||
{
|
||||
$id = explode("_", $note);
|
||||
|
||||
$items = [];
|
||||
|
||||
$note = (new NotesRepo)->getNoteById((int)$id[0], (int)$id[1]);
|
||||
if($note) {
|
||||
$nodez->notes[] = $note->toVkApiStruct();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $nodez;
|
||||
}
|
||||
|
||||
function getById(int $note_id, int $owner_id, bool $need_wiki = false)
|
||||
{
|
||||
$this->requireUser();
|
||||
|
||||
$note = (new NotesRepo)->getNoteById($owner_id, $note_id);
|
||||
|
||||
if(!$note)
|
||||
$this->fail(180, "Note not found");
|
||||
|
||||
if($note->isDeleted())
|
||||
$this->fail(189, "Note is deleted");
|
||||
|
||||
if(!$note->getOwner() || $note->getOwner()->isDeleted())
|
||||
$this->fail(177, "Owner does not exists");
|
||||
|
||||
return $note->toVkApiStruct();
|
||||
}
|
||||
|
||||
function getComments(int $note_id, int $owner_id, int $sort = 1, int $offset = 0, int $count = 100)
|
||||
{
|
||||
$this->requireUser();
|
||||
|
||||
$note = (new NotesRepo)->getNoteById($owner_id, $note_id);
|
||||
|
||||
if(!$note)
|
||||
$this->fail(180, "Note not found");
|
||||
|
||||
if($note->isDeleted())
|
||||
$this->fail(189, "Note is deleted");
|
||||
|
||||
if(!$note->getOwner())
|
||||
$this->fail(177, "Owner does not exists");
|
||||
|
||||
$arr = (object) [
|
||||
"count" => $note->getCommentsCount(),
|
||||
"comments" => []];
|
||||
$comments = array_slice(iterator_to_array($note->getComments(1, $count + $offset)), $offset);
|
||||
|
||||
foreach($comments as $comment) {
|
||||
$arr->comments[] = $comment->toVkApiStruct($this->getUser(), false, false, $note);
|
||||
}
|
||||
|
||||
return $arr;
|
||||
}
|
||||
|
||||
function getFriendsNotes(int $offset = 0, int $count = 0)
|
||||
{
|
||||
$this->fail(501, "Not implemented");
|
||||
}
|
||||
|
||||
function restoreComment(int $comment_id = 0, int $owner_id = 0)
|
||||
{
|
||||
$this->fail(501, "Not implemented");
|
||||
}
|
||||
}
|
|
@ -3,9 +3,12 @@ namespace openvk\VKAPI\Handlers;
|
|||
|
||||
use Nette\InvalidStateException;
|
||||
use Nette\Utils\ImageException;
|
||||
use openvk\Web\Models\Entities\Photo;
|
||||
use openvk\Web\Models\Entities\{Photo, Album, Comment};
|
||||
use openvk\Web\Models\Repositories\Albums;
|
||||
use openvk\Web\Models\Repositories\Photos as PhotosRepo;
|
||||
use openvk\Web\Models\Repositories\Clubs;
|
||||
use openvk\Web\Models\Repositories\Users as UsersRepo;
|
||||
use openvk\Web\Models\Repositories\Comments as CommentsRepo;
|
||||
|
||||
final class Photos extends VKAPIRequestHandler
|
||||
{
|
||||
|
@ -227,4 +230,504 @@ final class Photos extends VKAPIRequestHandler
|
|||
"items" => $images,
|
||||
];
|
||||
}
|
||||
|
||||
function createAlbum(string $title, int $group_id = 0, string $description = "", int $privacy = 0)
|
||||
{
|
||||
$this->requireUser();
|
||||
$this->willExecuteWriteAction();
|
||||
|
||||
if($group_id != 0) {
|
||||
$club = (new Clubs)->get((int) $group_id);
|
||||
|
||||
if(!$club || !$club->canBeModifiedBy($this->getUser())) {
|
||||
$this->fail(20, "Invalid club");
|
||||
}
|
||||
}
|
||||
|
||||
$album = new Album;
|
||||
$album->setOwner(isset($club) ? $club->getId() * -1 : $this->getUser()->getId());
|
||||
$album->setName($title);
|
||||
$album->setDescription($description);
|
||||
$album->setCreated(time());
|
||||
$album->save();
|
||||
|
||||
return $album->toVkApiStruct($this->getUser());
|
||||
}
|
||||
|
||||
function editAlbum(int $album_id, int $owner_id, string $title, string $description = "", int $privacy = 0)
|
||||
{
|
||||
$this->requireUser();
|
||||
$this->willExecuteWriteAction();
|
||||
|
||||
$album = (new Albums)->getAlbumByOwnerAndId($owner_id, $album_id);
|
||||
|
||||
if(!$album || $album->isDeleted()) {
|
||||
$this->fail(2, "Invalid album");
|
||||
}
|
||||
|
||||
if(empty($title)) {
|
||||
$this->fail(25, "Title is empty");
|
||||
}
|
||||
|
||||
if($album->isCreatedBySystem()) {
|
||||
$this->fail(40, "You can't change system album");
|
||||
}
|
||||
|
||||
if(!$album->canBeModifiedBy($this->getUser())) {
|
||||
$this->fail(2, "Access to album denied");
|
||||
}
|
||||
|
||||
$album->setName($title);
|
||||
$album->setDescription($description);
|
||||
|
||||
$album->save();
|
||||
|
||||
return $album->toVkApiStruct($this->getUser());
|
||||
}
|
||||
|
||||
function getAlbums(int $owner_id, string $album_ids = "", int $offset = 0, int $count = 100, bool $need_system = true, bool $need_covers = true, bool $photo_sizes = false)
|
||||
{
|
||||
$this->requireUser();
|
||||
$this->willExecuteWriteAction();
|
||||
|
||||
$res = [];
|
||||
|
||||
if(empty($album_ids)) {
|
||||
if($owner_id > 0) {
|
||||
$user = (new UsersRepo)->get($owner_id);
|
||||
|
||||
$res = [
|
||||
"count" => (new Albums)->getUserAlbumsCount($user),
|
||||
"items" => []
|
||||
];
|
||||
|
||||
if(!$user || $user->isDeleted())
|
||||
$this->fail(2, "Invalid user");
|
||||
|
||||
|
||||
if(!$user->getPrivacyPermission('photos.read', $this->getUser()))
|
||||
$this->fail(21, "This user chose to hide his albums.");
|
||||
|
||||
$albums = array_slice(iterator_to_array((new Albums)->getUserAlbums($user, 1, $count + $offset)), $offset);
|
||||
|
||||
foreach($albums as $album) {
|
||||
if(!$need_system && $album->isCreatedBySystem()) continue;
|
||||
$res["items"][] = $album->toVkApiStruct($this->getUser(), $need_covers, $photo_sizes);
|
||||
}
|
||||
}
|
||||
|
||||
else {
|
||||
$club = (new Clubs)->get($owner_id * -1);
|
||||
|
||||
$res = [
|
||||
"count" => (new Albums)->getClubAlbumsCount($club),
|
||||
"items" => []
|
||||
];
|
||||
|
||||
if(!$club)
|
||||
$this->fail(2, "Invalid club");
|
||||
|
||||
$albums = array_slice(iterator_to_array((new Albums)->getClubAlbums($club, 1, $count + $offset)), $offset);
|
||||
|
||||
foreach($albums as $album) {
|
||||
if(!$need_system && $album->isCreatedBySystem()) continue;
|
||||
$res["items"][] = $album->toVkApiStruct($this->getUser(), $need_covers, $photo_sizes);
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
$albums = explode(',', $album_ids);
|
||||
|
||||
$res = [
|
||||
"count" => sizeof($albums),
|
||||
"items" => []
|
||||
];
|
||||
|
||||
foreach($albums as $album)
|
||||
{
|
||||
$id = explode("_", $album);
|
||||
|
||||
$album = (new Albums)->getAlbumByOwnerAndId((int)$id[0], (int)$id[1]);
|
||||
if($album && !$album->isDeleted()) {
|
||||
if(!$need_system && $album->isCreatedBySystem()) continue;
|
||||
$res["items"][] = $album->toVkApiStruct($this->getUser(), $need_covers, $photo_sizes);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
function getAlbumsCount(int $user_id = 0, int $group_id = 0)
|
||||
{
|
||||
$this->requireUser();
|
||||
$this->willExecuteWriteAction();
|
||||
|
||||
if($user_id == 0 && $group_id == 0 || $user_id > 0 && $group_id > 0) {
|
||||
$this->fail(21, "Select user_id or group_id");
|
||||
}
|
||||
|
||||
if($user_id > 0) {
|
||||
|
||||
$us = (new UsersRepo)->get($user_id);
|
||||
if(!$us || $us->isDeleted()) {
|
||||
$this->fail(21, "Invalid user");
|
||||
}
|
||||
|
||||
if(!$us->getPrivacyPermission('photos.read', $this->getUser())) {
|
||||
$this->fail(21, "This user chose to hide his albums.");
|
||||
}
|
||||
|
||||
return (new Albums)->getUserAlbumsCount($us);
|
||||
}
|
||||
|
||||
if($group_id > 0)
|
||||
{
|
||||
$cl = (new Clubs)->get($group_id);
|
||||
if(!$cl) {
|
||||
$this->fail(21, "Invalid club");
|
||||
}
|
||||
|
||||
return (new Albums)->getClubAlbumsCount($cl);
|
||||
}
|
||||
}
|
||||
|
||||
function getById(string $photos, bool $extended = false, bool $photo_sizes = false)
|
||||
{
|
||||
$this->requireUser();
|
||||
$this->willExecuteWriteAction();
|
||||
|
||||
$phts = explode(",", $photos);
|
||||
$res = [];
|
||||
|
||||
foreach($phts as $phota) {
|
||||
$ph = explode("_", $phota);
|
||||
$photo = (new PhotosRepo)->getByOwnerAndVID((int)$ph[0], (int)$ph[1]);
|
||||
|
||||
if(!$photo || $photo->isDeleted()) {
|
||||
$this->fail(21, "Invalid photo");
|
||||
}
|
||||
|
||||
if($photo->getOwner()->isDeleted()) {
|
||||
$this->fail(21, "Owner of this photo is deleted");
|
||||
}
|
||||
|
||||
if(!$photo->getOwner()->getPrivacyPermission('photos.read', $this->getUser())) {
|
||||
$this->fail(21, "This user chose to hide his photos.");
|
||||
}
|
||||
|
||||
$res[] = $photo->toVkApiStruct($photo_sizes, $extended);
|
||||
}
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
function get(int $owner_id, int $album_id, string $photo_ids = "", bool $extended = false, bool $photo_sizes = false, int $offset = 0, int $count = 10)
|
||||
{
|
||||
$this->requireUser();
|
||||
$this->willExecuteWriteAction();
|
||||
|
||||
$res = [];
|
||||
|
||||
if(empty($photo_ids)) {
|
||||
$album = (new Albums)->getAlbumByOwnerAndId($owner_id, $album_id);
|
||||
|
||||
if(!$album->getOwner()->getPrivacyPermission('photos.read', $this->getUser())) {
|
||||
$this->fail(21, "This user chose to hide his albums.");
|
||||
}
|
||||
|
||||
if(!$album || $album->isDeleted()) {
|
||||
$this->fail(21, "Invalid album");
|
||||
}
|
||||
|
||||
$photos = array_slice(iterator_to_array($album->getPhotos(1, $count + $offset)), $offset);
|
||||
$res["count"] = sizeof($photos);
|
||||
|
||||
foreach($photos as $photo) {
|
||||
if(!$photo || $photo->isDeleted()) continue;
|
||||
$res["items"][] = $photo->toVkApiStruct($photo_sizes, $extended);
|
||||
}
|
||||
|
||||
} else {
|
||||
$photos = explode(',', $photo_ids);
|
||||
|
||||
$res = [
|
||||
"count" => sizeof($photos),
|
||||
"items" => []
|
||||
];
|
||||
|
||||
foreach($photos as $photo)
|
||||
{
|
||||
$id = explode("_", $photo);
|
||||
|
||||
$phot = (new PhotosRepo)->getByOwnerAndVID((int)$id[0], (int)$id[1]);
|
||||
if($phot && !$phot->isDeleted()) {
|
||||
$res["items"][] = $phot->toVkApiStruct($photo_sizes, $extended);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
function deleteAlbum(int $album_id, int $group_id = 0)
|
||||
{
|
||||
$this->requireUser();
|
||||
$this->willExecuteWriteAction();
|
||||
|
||||
$album = (new Albums)->get($album_id);
|
||||
|
||||
if(!$album || $album->canBeModifiedBy($this->getUser())) {
|
||||
$this->fail(21, "Invalid album");
|
||||
}
|
||||
|
||||
if($album->isDeleted()) {
|
||||
$this->fail(22, "Album already deleted");
|
||||
}
|
||||
|
||||
$album->delete();
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
function edit(int $owner_id, int $photo_id, string $caption = "")
|
||||
{
|
||||
$this->requireUser();
|
||||
$this->willExecuteWriteAction();
|
||||
|
||||
$photo = (new PhotosRepo)->getByOwnerAndVID($owner_id, $photo_id);
|
||||
|
||||
if(!$photo) {
|
||||
$this->fail(21, "Invalid photo");
|
||||
}
|
||||
|
||||
if($photo->isDeleted()) {
|
||||
$this->fail(21, "Photo is deleted");
|
||||
}
|
||||
|
||||
if(!empty($caption)) {
|
||||
$photo->setDescription($caption);
|
||||
$photo->save();
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
function delete(int $owner_id, int $photo_id, string $photos = "")
|
||||
{
|
||||
$this->requireUser();
|
||||
$this->willExecuteWriteAction();
|
||||
|
||||
if(empty($photos)) {
|
||||
$photo = (new PhotosRepo)->getByOwnerAndVID($owner_id, $photo_id);
|
||||
|
||||
if($this->getUser()->getId() !== $photo->getOwner()->getId()) {
|
||||
$this->fail(21, "You can't delete another's photo");
|
||||
}
|
||||
|
||||
if(!$photo) {
|
||||
$this->fail(21, "Invalid photo");
|
||||
}
|
||||
|
||||
if($photo->isDeleted()) {
|
||||
$this->fail(21, "Photo already deleted");
|
||||
}
|
||||
|
||||
$photo->delete();
|
||||
} else {
|
||||
$photozs = explode(',', $photos);
|
||||
|
||||
foreach($photozs as $photo)
|
||||
{
|
||||
$id = explode("_", $photo);
|
||||
|
||||
$phot = (new PhotosRepo)->getByOwnerAndVID((int)$id[0], (int)$id[1]);
|
||||
|
||||
if($this->getUser()->getId() !== $phot->getOwner()->getId()) {
|
||||
$this->fail(21, "You can't delete another's photo");
|
||||
}
|
||||
|
||||
if(!$phot) {
|
||||
$this->fail(21, "Invalid photo");
|
||||
}
|
||||
|
||||
if($phot->isDeleted()) {
|
||||
$this->fail(21, "Photo already deleted");
|
||||
}
|
||||
|
||||
$phot->delete();
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
function getAllComments(int $owner_id, int $album_id, bool $need_likes = false, int $offset = 0, int $count = 100)
|
||||
{
|
||||
$this->fail(501, "Not implemented");
|
||||
}
|
||||
|
||||
function deleteComment(int $comment_id, int $owner_id = 0)
|
||||
{
|
||||
$this->requireUser();
|
||||
$this->willExecuteWriteAction();
|
||||
|
||||
$comment = (new CommentsRepo)->get($comment_id);
|
||||
if(!$comment) {
|
||||
$this->fail(21, "Invalid comment");
|
||||
}
|
||||
|
||||
if(!$comment->canBeModifiedBy($this->getUser())) {
|
||||
$this->fail(21, "Forbidden");
|
||||
}
|
||||
|
||||
if($comment->isDeleted()) {
|
||||
$this->fail(4, "Comment already deleted");
|
||||
}
|
||||
|
||||
$comment->delete();
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
function createComment(int $owner_id, int $photo_id, string $message = "", string $attachments = "", bool $from_group = false)
|
||||
{
|
||||
$this->requireUser();
|
||||
$this->willExecuteWriteAction();
|
||||
|
||||
if(empty($message) && empty($attachments)) {
|
||||
$this->fail(100, "Required parameter 'message' missing.");
|
||||
}
|
||||
|
||||
$photo = (new PhotosRepo)->getByOwnerAndVID($owner_id, $photo_id);
|
||||
|
||||
if(!$photo->getAlbum()->getOwner()->getPrivacyPermission('photos.read', $this->getUser())) {
|
||||
$this->fail(21, "This user chose to hide his albums.");
|
||||
}
|
||||
|
||||
if(!$photo)
|
||||
$this->fail(180, "Photo not found");
|
||||
if($photo->isDeleted())
|
||||
$this->fail(189, "Photo is deleted");
|
||||
|
||||
$comment = new Comment;
|
||||
$comment->setOwner($this->getUser()->getId());
|
||||
$comment->setModel(get_class($photo));
|
||||
$comment->setTarget($photo->getId());
|
||||
$comment->setContent($message);
|
||||
$comment->setCreated(time());
|
||||
$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();
|
||||
}
|
||||
|
||||
function getAll(int $owner_id, bool $extended = false, int $offset = 0, int $count = 100, bool $photo_sizes = false)
|
||||
{
|
||||
$this->requireUser();
|
||||
$this->willExecuteWriteAction();
|
||||
|
||||
if($owner_id < 0) {
|
||||
$this->fail(4, "This method doesn't works with clubs");
|
||||
}
|
||||
|
||||
$user = (new UsersRepo)->get($owner_id);
|
||||
|
||||
if(!$user) {
|
||||
$this->fail(4, "Invalid user");
|
||||
}
|
||||
|
||||
if(!$user->getPrivacyPermission('photos.read', $this->getUser())) {
|
||||
$this->fail(21, "This user chose to hide his albums.");
|
||||
}
|
||||
|
||||
$photos = array_slice(iterator_to_array((new PhotosRepo)->getEveryUserPhoto($user, 1, $count + $offset)), $offset);
|
||||
$res = [];
|
||||
|
||||
foreach($photos as $photo) {
|
||||
if(!$photo || $photo->isDeleted()) continue;
|
||||
$res["items"][] = $photo->toVkApiStruct($photo_sizes, $extended);
|
||||
}
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
function getComments(int $owner_id, int $photo_id, bool $need_likes = false, int $offset = 0, int $count = 100, bool $extended = false, string $fields = "")
|
||||
{
|
||||
$this->requireUser();
|
||||
$this->willExecuteWriteAction();
|
||||
|
||||
$photo = (new PhotosRepo)->getByOwnerAndVID($owner_id, $photo_id);
|
||||
$comms = array_slice(iterator_to_array($photo->getComments(1, $offset + $count)), $offset);
|
||||
|
||||
if(!$photo) {
|
||||
$this->fail(4, "Invalid photo");
|
||||
}
|
||||
|
||||
if(!$photo->getAlbum()->getOwner()->getPrivacyPermission('photos.read', $this->getUser())) {
|
||||
$this->fail(21, "This user chose to hide his photos.");
|
||||
}
|
||||
|
||||
if($photo->isDeleted()) {
|
||||
$this->fail(4, "Photo is deleted");
|
||||
}
|
||||
|
||||
$res = [
|
||||
"count" => sizeof($comms),
|
||||
"items" => []
|
||||
];
|
||||
|
||||
foreach($comms as $comment) {
|
||||
$res["items"][] = $comment->toVkApiStruct($this->getUser(), $need_likes, $extended);
|
||||
if($extended) {
|
||||
if($comment->getOwner() instanceof \openvk\Web\Models\Entities\User) {
|
||||
$res["profiles"][] = $comment->getOwner()->toVkApiStruct();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $res;
|
||||
}
|
||||
}
|
35
VKAPI/Handlers/Status.php
Normal file
35
VKAPI/Handlers/Status.php
Normal file
|
@ -0,0 +1,35 @@
|
|||
<?php declare(strict_types=1);
|
||||
namespace openvk\VKAPI\Handlers;
|
||||
use openvk\Web\Models\Entities\User;
|
||||
use openvk\Web\Models\Repositories\Users as UsersRepo;
|
||||
|
||||
final class Status extends VKAPIRequestHandler
|
||||
{
|
||||
function get(int $user_id = 0, int $group_id = 0)
|
||||
{
|
||||
$this->requireUser();
|
||||
if($user_id == 0 && $group_id == 0) {
|
||||
return $this->getUser()->getStatus();
|
||||
} else {
|
||||
if($group_id > 0)
|
||||
$this->fail(501, "Group statuses are not implemented");
|
||||
else
|
||||
return (new UsersRepo)->get($user_id)->getStatus();
|
||||
}
|
||||
}
|
||||
|
||||
function set(string $text, int $group_id = 0)
|
||||
{
|
||||
$this->requireUser();
|
||||
$this->willExecuteWriteAction();
|
||||
|
||||
if($group_id > 0) {
|
||||
$this->fail(501, "Group statuses are not implemented");
|
||||
} else {
|
||||
$this->getUser()->setStatus($text);
|
||||
$this->getUser()->save();
|
||||
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -9,6 +9,10 @@ use openvk\Web\Models\Entities\Post;
|
|||
use openvk\Web\Models\Repositories\Posts as PostsRepo;
|
||||
use openvk\Web\Models\Entities\Comment;
|
||||
use openvk\Web\Models\Repositories\Comments as CommentsRepo;
|
||||
use openvk\Web\Models\Entities\Photo;
|
||||
use openvk\Web\Models\Repositories\Photos as PhotosRepo;
|
||||
use openvk\Web\Models\Entities\Video;
|
||||
use openvk\Web\Models\Repositories\Videos as VideosRepo;
|
||||
|
||||
final class Wall extends VKAPIRequestHandler
|
||||
{
|
||||
|
@ -367,7 +371,7 @@ final class Wall extends VKAPIRequestHandler
|
|||
];
|
||||
}
|
||||
|
||||
function post(string $owner_id, string $message = "", int $from_group = 0, int $signed = 0): object
|
||||
function post(string $owner_id, string $message = "", int $from_group = 0, int $signed = 0, string $attachments = ""): object
|
||||
{
|
||||
$this->requireUser();
|
||||
$this->willExecuteWriteAction();
|
||||
|
@ -405,27 +409,7 @@ final class Wall extends VKAPIRequestHandler
|
|||
if($signed == 1)
|
||||
$flags |= 0b01000000;
|
||||
|
||||
# TODO: Compatible implementation of this
|
||||
try {
|
||||
$photo = NULL;
|
||||
$video = NULL;
|
||||
if($_FILES["photo"]["error"] === UPLOAD_ERR_OK) {
|
||||
$album = NULL;
|
||||
if(!$anon && $owner_id > 0 && $owner_id === $this->getUser()->getId())
|
||||
$album = (new AlbumsRepo)->getUserWallAlbum($wallOwner);
|
||||
|
||||
$photo = Photo::fastMake($this->getUser()->getId(), $message, $_FILES["photo"], $album, $anon);
|
||||
}
|
||||
|
||||
if($_FILES["video"]["error"] === UPLOAD_ERR_OK)
|
||||
$video = Video::fastMake($this->getUser()->getId(), $_FILES["video"]["name"], $message, $_FILES["video"], $anon);
|
||||
} catch(\DomainException $ex) {
|
||||
$this->fail(-156, "The media file is corrupted");
|
||||
} catch(ISE $ex) {
|
||||
$this->fail(-156, "The media file is corrupted or too large ");
|
||||
}
|
||||
|
||||
if(empty($message) && !$photo && !$video)
|
||||
if(empty($message) && empty($attachments))
|
||||
$this->fail(100, "Required parameter 'message' missing.");
|
||||
|
||||
try {
|
||||
|
@ -441,11 +425,50 @@ final class Wall extends VKAPIRequestHandler
|
|||
$this->fail(100, "One of the parameters specified was missing or invalid");
|
||||
}
|
||||
|
||||
if(!is_null($photo))
|
||||
$post->attach($photo);
|
||||
if(!empty($attachments)) {
|
||||
$attachmentsArr = explode(",", $attachments);
|
||||
# Аттачи такого вида: [тип][id владельца]_[id вложения]
|
||||
# Пример: photo1_1
|
||||
|
||||
if(!is_null($video))
|
||||
$post->attach($video);
|
||||
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");
|
||||
|
||||
$post->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");
|
||||
|
||||
$post->attach($attacc);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if($wall > 0 && $wall !== $this->user->identity->getId())
|
||||
(new WallPostNotification($wallOwner, $post, $this->user->identity))->emit();
|
||||
|
@ -632,16 +655,20 @@ final class Wall extends VKAPIRequestHandler
|
|||
return $response;
|
||||
}
|
||||
|
||||
function createComment(int $owner_id, int $post_id, string $message, int $from_group = 0) {
|
||||
function createComment(int $owner_id, int $post_id, string $message, int $from_group = 0, string $attachments = "") {
|
||||
$this->requireUser();
|
||||
$this->willExecuteWriteAction();
|
||||
|
||||
$post = (new PostsRepo)->getPostById($owner_id, $post_id);
|
||||
if(!$post || $post->isDeleted()) $this->fail(100, "One of the parameters specified was missing or invalid");
|
||||
if(!$post || $post->isDeleted()) $this->fail(100, "Invalid post");
|
||||
|
||||
if($post->getTargetWall() < 0)
|
||||
$club = (new ClubsRepo)->get(abs($post->getTargetWall()));
|
||||
|
||||
if(empty($message) && empty($attachments)) {
|
||||
$this->fail(100, "Required parameter 'message' missing.");
|
||||
}
|
||||
|
||||
$flags = 0;
|
||||
if($from_group != 0 && !is_null($club) && $club->canBeModifiedBy($this->user))
|
||||
$flags |= 0b10000000;
|
||||
|
@ -659,6 +686,49 @@ final class Wall extends VKAPIRequestHandler
|
|||
$this->fail(1, "ошибка про то что коммент большой слишком");
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if($post->getOwner()->getId() !== $this->user->getId())
|
||||
if(($owner = $post->getOwner()) instanceof User)
|
||||
(new CommentNotification($owner, $comment, $post, $this->user))->emit();
|
||||
|
|
|
@ -66,4 +66,31 @@ class Album extends MediaCollection
|
|||
{
|
||||
return $this->has($photo);
|
||||
}
|
||||
|
||||
function toVkApiStruct(?User $user = NULL, bool $need_covers = false, bool $photo_sizes = false): object
|
||||
{
|
||||
$res = (object) [];
|
||||
|
||||
$res->id = $this->getPrettyId();
|
||||
$res->thumb_id = !is_null($this->getCoverPhoto()) ? $this->getCoverPhoto()->getPrettyId() : 0;
|
||||
$res->owner_id = $this->getOwner()->getId();
|
||||
$res->title = $this->getName();
|
||||
$res->description = $this->getDescription();
|
||||
$res->created = $this->getCreationTime()->timestamp();
|
||||
$res->updated = $this->getEditTime() ? $this->getEditTime()->timestamp() : NULL;
|
||||
$res->size = $this->size();
|
||||
$res->privacy_comment = 1;
|
||||
$res->upload_by_admins_only = 1;
|
||||
$res->comments_disabled = 0;
|
||||
$res->can_upload = $this->canBeModifiedBy($user); # thisUser недоступен в entities
|
||||
if($need_covers) {
|
||||
$res->thumb_src = $this->getCoverURL();
|
||||
|
||||
if($photo_sizes) {
|
||||
$res->sizes = !is_null($this->getCoverPhoto()) ? $this->getCoverPhoto()->getVkApiSizes() : NULL;
|
||||
}
|
||||
}
|
||||
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -160,7 +160,7 @@ class Club extends RowModel
|
|||
|
||||
function canPost(): bool
|
||||
{
|
||||
return (bool) $this->getRecord()->wall;
|
||||
return (bool) $this->getRecord()->wall;
|
||||
}
|
||||
|
||||
|
||||
|
@ -262,12 +262,12 @@ class Club extends RowModel
|
|||
return $subbed && ($this->getOpennesStatus() === static::CLOSED ? $this->isSubscriptionAccepted($user) : true);
|
||||
}
|
||||
|
||||
function getFollowersQuery(): GroupedSelection
|
||||
function getFollowersQuery(string $sort = "follower ASC"): GroupedSelection
|
||||
{
|
||||
$query = $this->getRecord()->related("subscriptions.target");
|
||||
|
||||
if($this->getOpennesStatus() === static::OPEN) {
|
||||
$query = $query->where("model", "openvk\\Web\\Models\\Entities\\Club");
|
||||
$query = $query->where("model", "openvk\\Web\\Models\\Entities\\Club")->order($sort);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
@ -280,9 +280,9 @@ class Club extends RowModel
|
|||
return sizeof($this->getFollowersQuery());
|
||||
}
|
||||
|
||||
function getFollowers(int $page = 1): \Traversable
|
||||
function getFollowers(int $page = 1, int $perPage = 6, string $sort = "follower ASC"): \Traversable
|
||||
{
|
||||
$rels = $this->getFollowersQuery()->page($page, 6);
|
||||
$rels = $this->getFollowersQuery($sort)->page($page, $perPage);
|
||||
|
||||
foreach($rels as $rel) {
|
||||
$rel = (new Users)->get($rel->follower);
|
||||
|
@ -360,6 +360,35 @@ class Club extends RowModel
|
|||
return $this->getRecord()->alert;
|
||||
}
|
||||
|
||||
function toVkApiStruct(?User $user = NULL): object
|
||||
{
|
||||
$res = [];
|
||||
|
||||
$res->id = $this->getId();
|
||||
$res->name = $this->getName();
|
||||
$res->screen_name = $this->getShortCode();
|
||||
$res->is_closed = 0;
|
||||
$res->deactivated = NULL;
|
||||
$res->is_admin = $this->canBeModifiedBy($user);
|
||||
|
||||
if($this->canBeModifiedBy($user)) {
|
||||
$res->admin_level = 3;
|
||||
}
|
||||
|
||||
$res->is_member = $this->getSubscriptionStatus($user) ? 1 : 0;
|
||||
|
||||
$res->type = "group";
|
||||
$res->photo_50 = $this->getAvatarUrl("miniscule");
|
||||
$res->photo_100 = $this->getAvatarUrl("tiny");
|
||||
$res->photo_200 = $this->getAvatarUrl("normal");
|
||||
|
||||
$res->can_create_topic = $this->canBeModifiedBy($user) ? 1 : $this->isEveryoneCanCreateTopics() ? 1 : 0;
|
||||
|
||||
$res->can_post = $this->canBeModifiedBy($user) ? 1 : $this->canPost() ? 1 : 0;
|
||||
|
||||
return (object) $res;
|
||||
}
|
||||
|
||||
use Traits\TBackDrops;
|
||||
use Traits\TSubscribable;
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
namespace openvk\Web\Models\Entities;
|
||||
use openvk\Web\Models\Repositories\Clubs;
|
||||
use openvk\Web\Models\RowModel;
|
||||
use openvk\Web\Models\Entities\{Note};
|
||||
|
||||
class Comment extends Post
|
||||
{
|
||||
|
@ -52,4 +53,36 @@ class Comment extends Post
|
|||
$this->getTarget() instanceof Post && $this->getTarget()->getTargetWall() < 0 && (new Clubs)->get(abs($this->getTarget()->getTargetWall()))->canBeModifiedBy($user) ||
|
||||
$this->getTarget() instanceof Topic && $this->getTarget()->canBeModifiedBy($user);
|
||||
}
|
||||
|
||||
function toVkApiStruct(?User $user = NULL, bool $need_likes = false, bool $extended = false, ?Note $note = NULL): object
|
||||
{
|
||||
$res = (object) [];
|
||||
|
||||
$res->id = $this->getId();
|
||||
$res->from_id = $this->getOwner()->getId();
|
||||
$res->date = $this->getPublicationTime()->timestamp();
|
||||
$res->text = $this->getText();
|
||||
$res->attachments = [];
|
||||
$res->parents_stack = [];
|
||||
|
||||
if(!is_null($note)) {
|
||||
$res->uid = $this->getOwner()->getId();
|
||||
$res->nid = $note->getId();
|
||||
$res->oid = $note->getOwner()->getId();
|
||||
}
|
||||
|
||||
foreach($this->getChildren() as $attachment) {
|
||||
if($attachment->isDeleted())
|
||||
continue;
|
||||
|
||||
$res->attachments[] = $attachment->toVkApiStruct();
|
||||
}
|
||||
|
||||
if($need_likes) {
|
||||
$res->count = $this->getLikesCount();
|
||||
$res->user_likes = (int)$this->hasLikeFrom($user);
|
||||
$res->can_like = 1;
|
||||
}
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -118,4 +118,23 @@ class Note extends Postable
|
|||
{
|
||||
return $this->getRecord()->source;
|
||||
}
|
||||
|
||||
function toVkApiStruct(): object
|
||||
{
|
||||
$res = (object) [];
|
||||
|
||||
$res->id = $this->getId();
|
||||
$res->owner_id = $this->getOwner()->getId();
|
||||
$res->title = $this->getName();
|
||||
$res->text = $this->getText();
|
||||
$res->date = $this->getPublicationTime()->timestamp();
|
||||
$res->comments = $this->getCommentsCount();
|
||||
$res->read_comments = $this->getCommentsCount();
|
||||
$res->view_url = "/note".$this->getOwner()->getId()."_".$this->getId();
|
||||
$res->privacy_view = 1;
|
||||
$res->can_comment = 1;
|
||||
$res->text_wiki = "r";
|
||||
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -296,25 +296,35 @@ class Photo extends Media
|
|||
return (new Albums)->getAlbumByPhotoId($this);
|
||||
}
|
||||
|
||||
function toVkApiStruct(): object
|
||||
function toVkApiStruct(bool $photo_sizes = true, bool $extended = false): object
|
||||
{
|
||||
$res = (object) [];
|
||||
|
||||
$res->id = $res->pid = $this->getId();
|
||||
$res->owner_id = $res->user_id = $this->getOwner()->getId()->getId();
|
||||
$res->owner_id = $res->user_id = $this->getOwner()->getId();
|
||||
$res->aid = $res->album_id = NULL;
|
||||
$res->width = $this->getDimensions()[0];
|
||||
$res->height = $this->getDimensions()[1];
|
||||
$res->date = $res->created = $this->getPublicationTime()->timestamp();
|
||||
|
||||
$res->sizes = $this->getVkApiSizes();
|
||||
$res->src_small = $res->photo_75 = $this->getURLBySizeId("miniscule");
|
||||
$res->src = $res->photo_130 = $this->getURLBySizeId("tiny");
|
||||
$res->src_big = $res->photo_604 = $this->getURLBySizeId("normal");
|
||||
$res->src_xbig = $res->photo_807 = $this->getURLBySizeId("large");
|
||||
$res->src_xxbig = $res->photo_1280 = $this->getURLBySizeId("larger");
|
||||
$res->src_xxxbig = $res->photo_2560 = $this->getURLBySizeId("original");
|
||||
$res->src_original = $res->url = $this->getURLBySizeId("UPLOADED_MAXRES");
|
||||
if($photo_sizes) {
|
||||
$res->sizes = $this->getVkApiSizes();
|
||||
$res->src_small = $res->photo_75 = $this->getURLBySizeId("miniscule");
|
||||
$res->src = $res->photo_130 = $this->getURLBySizeId("tiny");
|
||||
$res->src_big = $res->photo_604 = $this->getURLBySizeId("normal");
|
||||
$res->src_xbig = $res->photo_807 = $this->getURLBySizeId("large");
|
||||
$res->src_xxbig = $res->photo_1280 = $this->getURLBySizeId("larger");
|
||||
$res->src_xxxbig = $res->photo_2560 = $this->getURLBySizeId("original");
|
||||
$res->src_original = $res->url = $this->getURLBySizeId("UPLOADED_MAXRES");
|
||||
}
|
||||
|
||||
if($extended) {
|
||||
$res->likes = $this->getLikesCount(); # их нету но пусть будут
|
||||
$res->comments = $this->getCommentsCount();
|
||||
$res->tags = 0;
|
||||
$res->can_comment = 1;
|
||||
$res->can_repost = 0;
|
||||
}
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
|
|
@ -1110,6 +1110,23 @@ class User extends RowModel
|
|||
return true;
|
||||
}
|
||||
|
||||
function toVkApiStruct(): object
|
||||
{
|
||||
$res = (object) [];
|
||||
|
||||
$res->id = $this->getId();
|
||||
$res->first_name = $this->getFirstName();
|
||||
$res->last_name = $this->getLastName();
|
||||
$res->deactivated = $this->isDeactivated();
|
||||
$res->photo_50 = $this->getAvatarURL();
|
||||
$res->photo_100 = $this->getAvatarURL("tiny");
|
||||
$res->photo_200 = $this->getAvatarURL("normal");
|
||||
$res->photo_id = !is_null($this->getAvatarPhoto()) ? $this->getAvatarPhoto()->getPrettyId() : NULL;
|
||||
# TODO: Perenesti syuda vsyo ostalnoyie
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
use Traits\TBackDrops;
|
||||
use Traits\TSubscribable;
|
||||
}
|
||||
|
|
|
@ -165,6 +165,11 @@ class Video extends Media
|
|||
];
|
||||
}
|
||||
|
||||
function toVkApiStruct(): object
|
||||
{
|
||||
return $this->getApiStructure();
|
||||
}
|
||||
|
||||
function setLink(string $link): string
|
||||
{
|
||||
if(preg_match(file_get_contents(__DIR__ . "/../VideoDrivers/regex/youtube.txt"), $link, $matches)) {
|
||||
|
|
|
@ -123,4 +123,14 @@ class Albums
|
|||
|
||||
return $dbalbum->collection ? $this->get($dbalbum->collection) : null;
|
||||
}
|
||||
|
||||
function getAlbumByOwnerAndId(int $owner, int $id)
|
||||
{
|
||||
$album = $this->albums->where([
|
||||
"owner" => $owner,
|
||||
"id" => $id
|
||||
])->fetch();
|
||||
|
||||
return new Album($album);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,10 +26,10 @@ class Notes
|
|||
return $this->toNote($this->notes->get($id));
|
||||
}
|
||||
|
||||
function getUserNotes(User $user, int $page = 1, ?int $perPage = NULL): \Traversable
|
||||
function getUserNotes(User $user, int $page = 1, ?int $perPage = NULL, string $sort = "DESC"): \Traversable
|
||||
{
|
||||
$perPage = $perPage ?? OPENVK_DEFAULT_PER_PAGE;
|
||||
foreach($this->notes->where("owner", $user->getId())->where("deleted", 0)->order("created DESC")->page($page, $perPage) as $album)
|
||||
foreach($this->notes->where("owner", $user->getId())->where("deleted", 0)->order("created $sort")->page($page, $perPage) as $album)
|
||||
yield new Note($album);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php declare(strict_types=1);
|
||||
namespace openvk\Web\Models\Repositories;
|
||||
use openvk\Web\Models\Entities\Photo;
|
||||
use openvk\Web\Models\Entities\{Photo, User};
|
||||
use Chandler\Database\DatabaseConnection;
|
||||
|
||||
class Photos
|
||||
|
@ -32,4 +32,15 @@ class Photos
|
|||
|
||||
return new Photo($photo);
|
||||
}
|
||||
|
||||
function getEveryUserPhoto(User $user): \Traversable
|
||||
{
|
||||
$photos = $this->photos->where([
|
||||
"owner" => $user->getId()
|
||||
]);
|
||||
|
||||
foreach($photos as $photo) {
|
||||
yield new Photo($photo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -58,7 +58,7 @@ class Videos
|
|||
else
|
||||
$paramValue != NULL ? $notNullParams+=["$paramName" => "$paramValue"] : NULL;
|
||||
|
||||
$result = $this->videos->where("name OR description LIKE ?", $query)->where("deleted", 0);
|
||||
$result = $this->videos->where("CONCAT_WS(' ', name, description) LIKE ?", $query)->where("deleted", 0);
|
||||
$nnparamsCount = sizeof($notNullParams);
|
||||
|
||||
if($nnparamsCount > 0) {
|
||||
|
|
|
@ -89,7 +89,7 @@
|
|||
{if !is_null($_GET['address']) && $_GET['address'] != "" && $x->getPrivacySetting("page.info.read") > 1}
|
||||
<tr>
|
||||
<td><span class="nobold">{_address}:</span></td>
|
||||
<td><a href="{$x->getPhysicalAddress()}">{$x->getPhysicalAddress()}</a></td>
|
||||
<td>{$x->getPhysicalAddress()}</td>
|
||||
</tr>
|
||||
{/if}
|
||||
{if $x->getPrivacySetting("page.info.read") > 1}
|
||||
|
@ -114,7 +114,7 @@
|
|||
<span class="nobold">{_description}:</span>
|
||||
</td>
|
||||
{/if}
|
||||
<td>
|
||||
<td {if $type == "apps"}style="width:400px"{/if}>
|
||||
{$x->getDescription() ?? '(' . tr("none") . ')'}
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -204,13 +204,9 @@
|
|||
</div>
|
||||
{elseif $type == "videos"}
|
||||
{foreach $data as $dat}
|
||||
{if $dat->getOwner()->isDeleted()}
|
||||
{php continue;}
|
||||
{else}
|
||||
<div class="content">
|
||||
{include "../components/video.xml", video => $dat}
|
||||
</div>
|
||||
{/if}
|
||||
{/foreach}
|
||||
{elseif $type == "audios"}
|
||||
хуй
|
||||
|
@ -239,9 +235,7 @@
|
|||
<li {if $type === "comments"}id="used"{/if}><a href="/search?type=comments{if $_GET['query']}&query={urlencode($_GET['query'])}{/if}&sort=id">{_s_comments} {if $type === "comments"}({$count}){/if}</a></li>
|
||||
<li {if $type === "posts"} id="used"{/if}><a href="/search?type=posts{if $_GET['query']}&query={urlencode($_GET['query'])}{/if}&sort=id"> {_s_posts} {if $type === "posts"} ({$count}){/if}</a></li>
|
||||
<li {if $type === "videos"} id="used"{/if}><a href="/search?type=videos{if $_GET['query']}&query={urlencode($_GET['query'])}{/if}&sort=id"> {_s_videos} {if $type === "videos"} ({$count}){/if}</a></li>
|
||||
<!--<li {if $type === "audios"}id="used"{/if}><a href="/search?type=audios{if $_GET['query']}&query={urlencode($_GET['query'])}{/if}&sort=id">{_s_audios} {if $type === "audios"} ({$count}){/if}</a></li>-->
|
||||
<li {if $type === "apps"} id="used"{/if}><a href="/search?type=apps{if $_GET['query']}&query={urlencode($_GET['query'])}{/if}&sort=id"> {_s_apps} {if $type === "apps"} ({$count}){/if}</a></li>
|
||||
<!--<li {if $type === "notes"}id="used"{/if}><a href="/search?type=notes{if $_GET['query']}&query={urlencode($_GET['query'])}{/if}&sort=id">{_s_notes} {if $type === "notes"}({$count}){/if}</a></li>-->
|
||||
</ul>
|
||||
|
||||
<div class="searchOption">
|
||||
|
@ -262,11 +256,15 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
{if $type !== "groups" && $type !== "apps"} {* В OpenVK не сохраняется дата создания группы *}
|
||||
{if $type !== "groups" && $type !== "apps"} {* В OpenVK не сохраняется дата создания групп и приложений *}
|
||||
<div class="searchOption">
|
||||
<div class="searchOptionName" id="n_dates" onclick="hideParams('dates')"><img src="/assets/packages/static/openvk/img/hide.png" class="searchHide">{_s_by_date}</div>
|
||||
<div class="searchOptionBlock" id="s_dates">
|
||||
<p id="bydate">{_s_date_before}:<br>
|
||||
{if $type != "users"}
|
||||
<p id="bydate">{_s_date_before}:<br>
|
||||
{else}
|
||||
<p id="bydate">{_s_registered_before}:<br>
|
||||
{/if}
|
||||
<input type="date" name="datebefore"
|
||||
form="searcher"
|
||||
id="bydate"
|
||||
|
@ -274,7 +272,11 @@
|
|||
value="{if !is_null($_GET['datebefore'])}{$_GET['datebefore']}{/if}"
|
||||
min="2019-11-19"
|
||||
max={date('Y-m-d')}></p>
|
||||
<p id="bydate">{_s_date_after}:<br>
|
||||
{if $type != "users"}
|
||||
<p id="bydate">{_s_date_after}:<br>
|
||||
{else}
|
||||
<p id="bydate">{_s_registered_after}:<br>
|
||||
{/if}
|
||||
<input type="date" name="dateafter"
|
||||
form="searcher"
|
||||
style="width:100%"
|
||||
|
@ -300,9 +302,9 @@
|
|||
<div class="searchOption">
|
||||
<div class="searchOptionName" id="n_gender" onclick="hideParams('gender')"><img src="/assets/packages/static/openvk/img/hide.png" class="searchHide">{_gender}</div>
|
||||
<div class="searchOptionBlock" id="s_gender">
|
||||
<p><input type="radio" form="searcher" {if $_GET['gender'] == 0}checked{/if} name="gender" value="0">{_male}</p>
|
||||
<p><input type="radio" form="searcher" {if $_GET['gender'] == 1}checked{/if} name="gender" value="1">{_female}</p>
|
||||
<p><input type="radio" form="searcher" {if $_GET['gender'] == 2 || is_null($_GET['gender'])}checked{/if} name="gender" value="2">{_s_any}</p>
|
||||
<p><input type="radio" form="searcher" id="gend" {if $_GET['gender'] == 0}checked{/if} name="gender" value="0">{_male}</p>
|
||||
<p><input type="radio" form="searcher" id="gend1"{if $_GET['gender'] == 1}checked{/if} name="gender" value="1">{_female}</p>
|
||||
<p><input type="radio" form="searcher" id="gend2"{if $_GET['gender'] == 2 || is_null($_GET['gender'])}checked{/if} name="gender" value="2">{_s_any}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -29,7 +29,21 @@
|
|||
</div>
|
||||
</div>
|
||||
<div n:if="isset($thisUser) &&! ($compact ?? false)" class="post-menu">
|
||||
<a {if is_null($linkW)}href="#_comment{$comment->getId()}"{else}href="wall{!is_null($comment->getTarget()) ? $comment->getTarget()->getPrettyId() : $comment->getOwner()->getId()}#_comment{$comment->getId()}"{/if} class="date">{$comment->getPublicationTime()}</a> |
|
||||
{var $target = "wall"}
|
||||
|
||||
{if get_class($comment->getTarget()) == "openvk\Web\Models\Entities\Note"}
|
||||
{php $target = "note"}
|
||||
{elseif get_class($comment->getTarget()) == "openvk\Web\Models\Entities\Post"}
|
||||
{php $target = "wall"}
|
||||
{elseif get_class($comment->getTarget()) == "openvk\Web\Models\Entities\Photo"}
|
||||
{php $target = "photo"}
|
||||
{elseif get_class($comment->getTarget()) == "openvk\Web\Models\Entities\Video"}
|
||||
{php $target = "video"}
|
||||
{elseif get_class($comment->getTarget()) == "openvk\Web\Models\Entities\Topic"}
|
||||
{php $target = "topic"}
|
||||
{/if}
|
||||
|
||||
<a {if is_null($linkW)}href="#_comment{$comment->getId()}"{else}href="{$target}{!is_null($comment->getTarget()) ? $comment->getTarget()->getPrettyId() : $comment->getOwner()->getId()}#_comment{$comment->getId()}"{/if} class="date">{$comment->getPublicationTime()}</a> |
|
||||
{if $comment->canBeDeletedBy($thisUser)}
|
||||
<a href="/comment{$comment->getId()}/delete">{_delete}</a> |
|
||||
{/if}
|
||||
|
|
|
@ -117,7 +117,7 @@ h1 {
|
|||
}
|
||||
|
||||
.sidebar {
|
||||
width: 118px;
|
||||
width: 131px;
|
||||
margin: 4px 0 0 4px;
|
||||
float: left;
|
||||
}
|
||||
|
|
|
@ -629,7 +629,7 @@ function resetSearch()
|
|||
|
||||
for(const input of inputs)
|
||||
{
|
||||
if(input != dnt) {
|
||||
if(input != dnt && input != gend && input != gend1 && input != gend2) {
|
||||
input.value = ""
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
"home" = "Галоўная";
|
||||
"welcome" = "Сардэчна запрашаем";
|
||||
"to_top" = "Уверх";
|
||||
|
||||
/* Login */
|
||||
|
||||
|
@ -42,9 +43,20 @@
|
|||
"all_title" = "Усе";
|
||||
"information" = "Інфармацыя";
|
||||
"status" = "Статус";
|
||||
"no_information_provided" = "Няма інфармацыі.";
|
||||
"deceased_person" = "Старонка памерлага чалавека";
|
||||
"none" = "адсутнічае";
|
||||
"desc_none" = "няма апісання";
|
||||
"send" = "Адправіць";
|
||||
"years_zero" = "0 гадоў";
|
||||
"years_one" = "1 год";
|
||||
"years_few" = "$1 год";
|
||||
"years_many" = "$1 год";
|
||||
"years_other" = "$1 год";
|
||||
"show_my_birthday" = "Паказаць дату нараджэння";
|
||||
"show_only_month_and_day" = "Паказваць толькі дзень і месяц";
|
||||
|
||||
"relationship" = "Сямейнае становішча";
|
||||
|
||||
"relationship_0" = "Не выбрана";
|
||||
"relationship_1" = "Ня женаты";
|
||||
"relationship_2" = "Сустракаюся";
|
||||
|
@ -308,7 +320,13 @@
|
|||
"round_avatars" = "Круглы аватар";
|
||||
|
||||
"search_for_groups" = "Пошук груп";
|
||||
"search_for_people" = "Пошук людзей";
|
||||
"search_for_users" = "Шукаць карыстальнікаў";
|
||||
"search_for_posts" = "Пошук пастоў";
|
||||
"search_for_comments" = "Пошук каментарыяў";
|
||||
"search_for_videos" = "Шукаць відэа";
|
||||
"search_for_apps" = "Шукаць праграмы";
|
||||
"search_for_notes" = "Шукаць нататкі";
|
||||
"search_for_audios" = "Пошук музыкі";
|
||||
"search_button" = "Знайсці";
|
||||
|
||||
"privacy_setting_access_page" = "Каму ў інтэрнэце відаць маю старонку";
|
||||
|
@ -495,3 +513,50 @@
|
|||
|
||||
"cookies_popup_content" = "Усе хлопчыкi любяць пэчыва, таму гэты вэб-сайт выкарыстоўвае Cookies для таго, каб ідэнтыфікаваць вашу сесію і нічога болей. Звяртайцеся да нашай <a href='/privacy'>палiтыкi канфiдэнцыальнастi</a> для палучэння поўнай iнфармацыi.";
|
||||
"cookies_popup_agree" = "Прынiмаю";
|
||||
|
||||
/* Пошук */
|
||||
|
||||
"s_people" = "Людзі";
|
||||
"s_groups" = "Супольнасці";
|
||||
"s_events" = "Падзеі";
|
||||
"s_apps" = "Прылады";
|
||||
"s_questions" = "Пытанні";
|
||||
"s_notes" = "Нататкі";
|
||||
"s_themes" = "Тэмы";
|
||||
"s_posts" = "Пасты";
|
||||
"s_comments" = "Каментарыі";
|
||||
"s_videos" = "Відэа";
|
||||
"s_audios" = "Музыка";
|
||||
"s_by_people" = "па людзям";
|
||||
"s_by_groups" = "па суполках";
|
||||
"s_by_posts" = "па паведамленнях";
|
||||
"s_by_comments" = "па каментарыях";
|
||||
"s_by_videos" = "па відэа";
|
||||
"s_by_apps" = "па прыладам";
|
||||
"s_by_audios" = "па музыцы";
|
||||
|
||||
"s_order_by" = "Сартаваць па...";
|
||||
|
||||
"s_order_by_id" = "ID";
|
||||
"s_order_by_name" = "Па імені";
|
||||
"s_order_by_random" = "Выпадкова";
|
||||
"s_order_by_rating" = "Па рэйтынгу";
|
||||
"s_order_invert" = "Інвертаваць";
|
||||
|
||||
"s_by_date" = "Па даце";
|
||||
"s_registered_before" = "Зарэгістравана да";
|
||||
"s_registered_after" = "Зарэгістравана пасля";
|
||||
"s_date_before" = "Да";
|
||||
"s_date_after" = "Пасля";
|
||||
|
||||
"s_main" = "Асноўны";
|
||||
|
||||
"s_now_on_site" = "зараз на сайце";
|
||||
"s_with_photo" = "з фота";
|
||||
"s_only_in_names" = "толькі ў імёнах";
|
||||
|
||||
"s_any" = "любы";
|
||||
"reset" = "Ачысціць";
|
||||
|
||||
"closed_group_post" = "Гэта паведамленне з прыватнай групы";
|
||||
"deleted_target_comment" = "Гэты каментарый належыць да выдаленага поста";
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
|
||||
"home" = "Hałoŭnaja";
|
||||
"welcome" = "Sardečna zaprašajem";
|
||||
"to_top" = "Uvierch";
|
||||
|
||||
/* Login */
|
||||
|
||||
|
@ -44,6 +45,17 @@
|
|||
"information" = "Infarmacyja";
|
||||
"status" = "Status";
|
||||
"no_information_provided" = "Niama infarmacyi.";
|
||||
"deceased_person" = "Staronka pamierlaha čalavieka";
|
||||
"none" = "adsutničaje";
|
||||
"desc_none" = "niama apisannia";
|
||||
"send" = "Adpravić";
|
||||
"years_zero" = "0 hadoŭ";
|
||||
"years_one" = "1 hod";
|
||||
"years_few" = "$1 hod";
|
||||
"years_many" = "$1 hod";
|
||||
"years_other" = "$1 hod";
|
||||
"show_my_birthday" = "Pakazać datu naradžennia";
|
||||
"show_only_month_and_day" = "Pakazać toĺki dzień i miesiac";
|
||||
|
||||
"relationship" = "Siamiejnaje stanovišča";
|
||||
|
||||
|
@ -295,7 +307,13 @@
|
|||
"round_avatars" = "Kruhły avatar";
|
||||
|
||||
"search_for_groups" = "Pošuk hurtoŭ";
|
||||
"search_for_people" = "Pošuk ludziaŭ";
|
||||
"search_for_users" = "Šukać karystaĺnikaŭ";
|
||||
"search_for_posts" = "Pošuk pastoŭ";
|
||||
"search_for_comments" = "Pošuk kamentaryjaŭ";
|
||||
"search_for_videos" = "Šukać videa";
|
||||
"search_for_apps" = "Šukać prahramy";
|
||||
"search_for_notes" = "Šukać natatki";
|
||||
"search_for_audios" = "Pošuk muzyki";
|
||||
"search_button" = "Znajści";
|
||||
|
||||
"privacy_setting_access_page" = "Kamu ŭ interniecie vidać maju staronku";
|
||||
|
@ -455,3 +473,50 @@
|
|||
"paginator_back" = "Nazad";
|
||||
"paginator_page" = "Staronka $1";
|
||||
"paginator_next" = "Dalej";
|
||||
|
||||
/* Пошук */
|
||||
|
||||
"s_people" = "Liudzi";
|
||||
"s_groups" = "Supolnasci";
|
||||
"s_events" = "Padziei";
|
||||
"s_apps" = "Prylady";
|
||||
"s_questions" = "Pytanni";
|
||||
"s_notes" = "Natatki";
|
||||
"s_themes" = "Temy";
|
||||
"s_posts" = "Pasty";
|
||||
"s_comments" = "Kamentaryi";
|
||||
"s_videos" = "Videa";
|
||||
"s_audios" = "Muzyka";
|
||||
"s_by_people" = "pa liudziam";
|
||||
"s_by_groups" = "pa supolkach";
|
||||
"s_by_posts" = "pa paviedamlienniach";
|
||||
"s_by_comments" = "pa kamentaryjach";
|
||||
"s_by_videos" = "pa videa";
|
||||
"s_by_apps" = "pa pryladam";
|
||||
"s_by_audios" = "pa muzycy";
|
||||
|
||||
"s_order_by" = "Sartavać pa...";
|
||||
|
||||
"s_order_by_id" = "ID";
|
||||
"s_order_by_name" = "Imieni";
|
||||
"s_order_by_random" = "Vypadkova";
|
||||
"s_order_by_rating" = "Pa rejtynhu";
|
||||
"s_order_invert" = "Invertavać";
|
||||
|
||||
"s_by_date" = "Pa dacie";
|
||||
"s_registered_before" = "Zarehistravana da";
|
||||
"s_registered_after" = "Zarehistravana paslia";
|
||||
"s_date_before" = "Da";
|
||||
"s_date_after" = "Paslia";
|
||||
|
||||
"s_main" = "Asnoŭny";
|
||||
|
||||
"s_now_on_site" = "zaraz na sajcie";
|
||||
"s_with_photo" = "z fota";
|
||||
"s_only_in_names" = "toĺki ŭ imionach";
|
||||
|
||||
"s_any" = "liuby";
|
||||
"reset" = "Ačyscić";
|
||||
|
||||
"closed_group_post" = "Heta paviedamliennie z pryvatnaj hrupy";
|
||||
"deleted_target_comment" = "Heta paviedamliennie z pryvatnaj hrupy";
|
||||
|
|
|
@ -421,18 +421,10 @@
|
|||
"my_settings" = "My Settings";
|
||||
"bug_tracker" = "Bug-tracker";
|
||||
|
||||
"mobile_friends" = "Friends";
|
||||
"mobile_photos" = "Photos";
|
||||
"mobile_videos" = "Videos";
|
||||
"mobile_messages" = "Messages";
|
||||
"mobile_notes" = "Notes";
|
||||
"mobile_groups" = "Groups";
|
||||
"mobile_search" = "Search";
|
||||
|
||||
"menu_settings" = "Settings";
|
||||
"menu_login" = "Login";
|
||||
"menu_registration" = "Registration";
|
||||
"menu_desktop_version" = "Desktop version";
|
||||
|
||||
"menu_help" = "Help";
|
||||
|
||||
"menu_logout" = "Logout";
|
||||
|
@ -495,6 +487,7 @@
|
|||
"search_for_videos" = "Search for videos";
|
||||
"search_for_apps" = "Search for apps";
|
||||
"search_for_notes" = "Search for notes";
|
||||
"search_for_audios" = "Search for music";
|
||||
"search_button" = "Find";
|
||||
"search_placeholder" = "Start typing any name, title or word";
|
||||
"results_zero" = "No results";
|
||||
|
@ -1497,6 +1490,8 @@
|
|||
"s_order_invert" = "Invert";
|
||||
|
||||
"s_by_date" = "By date";
|
||||
"s_registered_before" = "Registered before";
|
||||
"s_registered_after" = "Registered after";
|
||||
"s_date_before" = "Before";
|
||||
"s_date_after" = "After";
|
||||
|
||||
|
@ -1511,3 +1506,15 @@
|
|||
|
||||
"closed_group_post" = "This is a post from private group";
|
||||
"deleted_target_comment" = "This comment belongs to deleted post";
|
||||
|
||||
/* Mobile */
|
||||
"mobile_friends" = "Friends";
|
||||
"mobile_photos" = "Photos";
|
||||
"mobile_videos" = "Videos";
|
||||
"mobile_messages" = "Messages";
|
||||
"mobile_notes" = "Notes";
|
||||
"mobile_groups" = "Groups";
|
||||
"mobile_search" = "Search";
|
||||
"mobile_desktop_version" = "Desktop version";
|
||||
"mobile_menu" = "Menu";
|
||||
"mobile_like" = "Like";
|
||||
|
|
|
@ -405,20 +405,11 @@
|
|||
"my_settings" = "Мои Настройки";
|
||||
"bug_tracker" = "Баг-трекер";
|
||||
|
||||
"mobile_friends" = "Друзья";
|
||||
"mobile_photos" = "Фотографии";
|
||||
"mobile_videos" = "Видеозаписи";
|
||||
"mobile_messages" = "Сообщения";
|
||||
"mobile_notes" = "Заметки";
|
||||
"mobile_groups" = "Группы";
|
||||
"mobile_search" = "Поиск";
|
||||
|
||||
"menu_settings" = "Настройки";
|
||||
"menu_login" = "Вход";
|
||||
"menu_registration" = "Регистрация";
|
||||
"menu_help" = "Помощь";
|
||||
"menu_logout" = "Выйти";
|
||||
"menu_desktop_version" = "Полная версия";
|
||||
"menu_support" = "Поддержка";
|
||||
|
||||
"header_home" = "главная";
|
||||
|
@ -469,6 +460,7 @@
|
|||
"search_for_videos" = "Поиск видео";
|
||||
"search_for_apps" = "Поиск приложений";
|
||||
"search_for_notes" = "Поиск записок";
|
||||
"search_for_audios" = "Поиск музыки";
|
||||
"search_button" = "Найти";
|
||||
"search_placeholder" = "Начните вводить любое имя, название или слово";
|
||||
"results_zero" = "Ни одного результата";
|
||||
|
@ -1391,6 +1383,8 @@
|
|||
"s_order_invert" = "Инвертировать";
|
||||
|
||||
"s_by_date" = "По дате";
|
||||
"s_registered_before" = "Зарегистрирован до";
|
||||
"s_registered_after" = "Зарегистрирован после";
|
||||
"s_date_before" = "До";
|
||||
"s_date_after" = "После";
|
||||
|
||||
|
@ -1405,3 +1399,15 @@
|
|||
|
||||
"closed_group_post" = "Эта запись из закрытой группы";
|
||||
"deleted_target_comment" = "Этот комментарий принадлежит к удалённой записи";
|
||||
|
||||
/* Mobile */
|
||||
"mobile_friends" = "Друзья";
|
||||
"mobile_photos" = "Фотографии";
|
||||
"mobile_videos" = "Видеозаписи";
|
||||
"mobile_messages" = "Сообщения";
|
||||
"mobile_notes" = "Заметки";
|
||||
"mobile_groups" = "Группы";
|
||||
"mobile_search" = "Поиск";
|
||||
"mobile_desktop_version" = "Полная версия";
|
||||
"mobile_menu" = "Меню";
|
||||
"mobile_like" = "Мне нравится";
|
||||
|
|
|
@ -414,6 +414,7 @@
|
|||
"search_for_videos" = "Поискъ синематографовъ";
|
||||
"search_for_apps" = "Поискъ забав";
|
||||
"search_for_notes" = "Поискъ запiсокъ";
|
||||
"search_for_audios" = "Поиск музыкъ";
|
||||
"search_button" = "Найти";
|
||||
"results_zero" = "Ни одного результата";
|
||||
"results_one" = "Одинъ результатъ";
|
||||
|
@ -757,6 +758,8 @@
|
|||
"s_order_invert" = "Отразiть";
|
||||
|
||||
"s_by_date" = "По датѣ";
|
||||
"s_registered_before" = "Зарѣгистрированъ до";
|
||||
"s_registered_after" = "Зарѣгистрированъ после";
|
||||
"s_date_before" = "До";
|
||||
"s_date_after" = "После";
|
||||
|
||||
|
|
|
@ -433,6 +433,7 @@
|
|||
"search_for_videos" = "Розыск кинолент";
|
||||
"search_for_apps" = "Розыск приложений";
|
||||
"search_for_notes" = "Розыск записок";
|
||||
"search_for_audios" = "Розыск аудио";
|
||||
|
||||
"search_button" = "Найти";
|
||||
"search_placeholder" = "Начните вводить любое имя, название или слово";
|
||||
|
@ -962,6 +963,8 @@
|
|||
"s_order_invert" = "Отразить";
|
||||
|
||||
"s_by_date" = "По дате";
|
||||
"s_registered_before" = "Зарегистрирован до";
|
||||
"s_registered_after" = "Зарегистрирован после";
|
||||
"s_date_before" = "До";
|
||||
"s_date_after" = "После";
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
"register_referer_meta_title" = "$1 запрошує вас у $2!";
|
||||
"register_referer_meta_desc" = "Приєднуйтесь до $1 та багатьох інших користувачів у $2!";
|
||||
"registration_welcome_1" = "- універсальний засіб пошуку колег, засноване на структурі ВКонтакте.";
|
||||
"registration_welcome_2" = "Ми бажаємо, щоб друзі, однокурсники, однокласники, сусіди і колеги завжди могли бути в контакті.";
|
||||
"registration_welcome_2" = "Ми бажаємо, щоб друзі, однокурсники, однокласники, сусіди та колеги завжди могли бути в контакті.";
|
||||
"users" = "Користувачі";
|
||||
"other_fields" = "Інше";
|
||||
|
||||
|
@ -82,6 +82,7 @@
|
|||
"no_information_provided" = "Інформація відсутня.";
|
||||
"deceased_person" = "Сторінка покійної людини";
|
||||
"none" = "відсутній";
|
||||
"desc_none" = "немає опису";
|
||||
"send" = "Відправити";
|
||||
"years_zero" = "0 років";
|
||||
"years_one" = "1 рік";
|
||||
|
@ -406,20 +407,11 @@
|
|||
"my_settings" = "Мої Налаштування";
|
||||
"bug_tracker" = "Баг-трекер";
|
||||
|
||||
"mobile_friends" = "Друзі";
|
||||
"mobile_photos" = "Фотографії";
|
||||
"mobile_videos" = "Відеозаписи";
|
||||
"mobile_messages" = "Повідомлення";
|
||||
"mobile_notes" = "Нотатки";
|
||||
"mobile_groups" = Групи";
|
||||
"mobile_search" = "Пошук";
|
||||
|
||||
"menu_settings" = "Налаштування";
|
||||
"menu_login" = "Вхід";
|
||||
"menu_registration" = "Реєстрація";
|
||||
"menu_help" = "Допомога";
|
||||
"menu_logout" = "Вийти";
|
||||
"menu_desktop_version" = "Повна версія";
|
||||
"menu_support" = "Підтримка";
|
||||
|
||||
"header_home" = "головна";
|
||||
|
@ -464,7 +456,13 @@
|
|||
"round avatars" = "Круглі";
|
||||
"apply_style_for_this_device" = "Застосувати стиль лише для цього пристрою";
|
||||
"search_for_groups" = "Пошук груп";
|
||||
"search_for_people" = "Пошук людей";
|
||||
"search_for_users" = "Пошук користувачів";
|
||||
"search_for_posts" = "Пошук дописів";
|
||||
"search_for_comments" = "Пошук коментарів";
|
||||
"search_for_videos" = "Пошук відео";
|
||||
"search_for_apps" = "Пошук додатків";
|
||||
"search_for_notes" = "Пошук нотаток";
|
||||
"search_for_audios" = "Пошук музики";
|
||||
"search_button" = "Знайти";
|
||||
"search_placeholder" = "Почніть вводити будь-яке ім'я, назву чи слово";
|
||||
"results_zero" = "Жодного результату";
|
||||
|
@ -849,7 +847,7 @@
|
|||
"banned_2" = "Привід: <b>$1</b>.";
|
||||
"banned_perm" = "На цей раз, Ви заблоковані назавжди.";
|
||||
"banned_until_time" = "На цей раз, Ви заблоковані до <b>$1</b>";
|
||||
"banned_3" = "Ви все ще можете <a href=\"/support?act=new\">написати в службу підтримки</a>, якщо вважаєте, що сталася помилка або <a href=\"/logout?hash= $1\">вийти</a>.";
|
||||
"banned_3" = "Ви все ще можете <a href=\"/support?act=new\">написати в службу підтримки</a>, якщо вважаєте що сталася помилка або <a href=\"/logout?hash= $1\">вийти</a>.";
|
||||
"banned_unban_myself" = "Розблокувати сторінку";
|
||||
"banned_unban_title" = "Ваш обліковий запис розблокований";
|
||||
"banned_unban_description" = "Намагайтеся, більше не порушувати правила.";
|
||||
|
@ -1176,8 +1174,8 @@
|
|||
|
||||
"global_maintenance" = "Технічні роботи";
|
||||
"section_maintenance" = "Розділ недоступний";
|
||||
"undergoing_global_maintenance" = "На жаль, зараз інстанція закрита на технічні роботи. Ми вже працюємо над усуненням неполадок. Будь ласка, спробуйте зайти пізніше.";
|
||||
"undergoing_section_maintenance" = "На жаль, розділ <b>$1</b> тимчасово недоступний. Ми вже працюємо над усуненням неполадок. Будь ласка, спробуйте зайти пізніше.";
|
||||
"undergoing_global_maintenance" = "Інстанція закрита на технічні роботи. Будь ласка, спробуйте зайти пізніше.";
|
||||
"undergoing_section_maintenance" = "Розділ <b>$1</b> тимчасово недоступний. Будь ласка, спробуйте зайти пізніше.";
|
||||
"topics" = "Теми";
|
||||
|
||||
/* Polls */
|
||||
|
@ -1269,11 +1267,11 @@
|
|||
"tour_section_2_text_2_2" = "Ви маєте змогу закрити доступ до своєї сторінки від пошукових систем і незареєстрованих користувачів.";
|
||||
"tour_section_2_text_2_3" = "<b>Пам'ятайте:</b> у майбутньому налаштування приватності будуть розширюватися.";
|
||||
"tour_section_2_title_3" = "Персональна адреса сторінки";
|
||||
"tour_section_2_text_3_1" = "Після реєстрації сторінки, вам видається персональний ID типу: <b>/id12345</b>";
|
||||
"tour_section_2_text_3_1" = "Після реєстрації сторінки, вам видається персональний ID типа: <b>/id12345</b>";
|
||||
"tour_section_2_text_3_2" = "<b>Стандартний ID</b>, який був отриманий після реєстрації, <b>змінити не можна!</b>";
|
||||
"tour_section_2_text_3_3" = "Однак, в налаштуваннях своєї сторінки ви зможете прив'язати свою персональну адресу і цю адресу <b>можна буде змінити</b> в будь-який час";
|
||||
"tour_section_2_text_3_4" = "<b>Порада:</b> Можна займати будь-яку вільну адресу, довжина якої не менша за 5 символів.";
|
||||
"tour_section_2_bottom_text_2" = "<i>Підтримується встановлення будь-якої короткої адреси з латинських маленьких літер; адреса може містити цифри (однак, не на початку), крапки та нижні підкреслення (не на початку або наприкінці)</i>";
|
||||
"tour_section_2_bottom_text_2" = "<i>Коротка адреса може складатися лише з латинських маленьких літер (a-z), цифр, крапок та нижніх підкреслень (але </i><b>не</b><i> напочатку чи кінці)</i>";
|
||||
"tour_section_2_title_4" = "Стіна";
|
||||
|
||||
"tour_section_3_title_1" = "Діліться своїми фотографіями";
|
||||
|
@ -1297,7 +1295,7 @@
|
|||
"tour_section_5_text_3" = "Окрім завантаження відео напряму, сайт підтримує і вбудовані відео через YouTube";
|
||||
|
||||
"tour_section_6_title_1" = "Аудіозаписи";
|
||||
"tour_section_6_text_1" = "!!! АУДІОЗАПИСІВ НЕМАЄ, ЧЕКАЙТЕ ІНФОРМАЦІЇ ВІД ГЕН.ШТАБУ !!!";
|
||||
"tour_section_6_text_1" = "Аудіозаписи в розробці, стежте за новинами";
|
||||
|
||||
"tour_section_7_title_1" = "Слідкуйте за тим, що пишуть ваші друзі";
|
||||
"tour_section_7_text_1" = "Розділ "Мої Новини" поділяється на два типи: локальна стрічка та глобальна стрічка новин";
|
||||
|
@ -1342,14 +1340,14 @@
|
|||
"tour_section_12_text_3_1" = "За потреби, ви можете приховати непотрібні розділи сайту";
|
||||
"tour_section_12_text_3_2" = "<b>Нагадування: </b>Розділи першої необхідності (Моя Сторінка; Мої Друзі; Мої Відповіді; Мої Налаштування) приховати не можна";
|
||||
"tour_section_12_title_4" = "Вид постів";
|
||||
"tour_section_12_text_4_1" = "Якщо набрид старий дизайн стіни, який був у колись популярному оригінальному ВКонтактє.сру, то ви завжди можете змінити вигляд постів на Мікроблог";
|
||||
"tour_section_12_text_4_1" = "Якщо набрид старий дизайн стіни, який був у колись популярному оригінальному ВКонтакті, то ви завжди можете змінити вигляд постів на Мікроблог";
|
||||
"tour_section_12_text_4_2" = "Вид постів можна змінювати між двома варіантами в будь-який час";
|
||||
"tour_section_12_text_4_3" = "<b>Зверніть увагу</b>, що якщо обрано старий вид відображення постів, то останні коментарі довантажуватися не будуть";
|
||||
"tour_section_12_bottom_text_1" = "Сторінка встановлення фону";
|
||||
"tour_section_12_bottom_text_2" = "Приклади сторінок зі встановленим фоном";
|
||||
"tour_section_12_bottom_text_3" = "За допомогою цієї можливості ви можете додати своєму профілю більше індивідуальності";
|
||||
"tour_section_12_bottom_text_4" = "Старий вигляд постів";
|
||||
"tour_section_12_bottom_text_5" = "Мікроблок";
|
||||
"tour_section_12_bottom_text_5" = "Мікроблог";
|
||||
|
||||
"tour_section_13_title_1" = "Ваучер";
|
||||
"tour_section_13_text_1" = "Ваучер в OpenVK це щось на кшталт промокоду на додавання будь-якої валюти (відсотки рейтингу, голосів тощо)";
|
||||
|
@ -1358,11 +1356,11 @@
|
|||
"tour_section_13_text_4" = "<b>Пам'ятайте: </b>Усі ваучери мають обмежений термін активації";
|
||||
"tour_section_13_bottom_text_1" = "Ваучери складаються з 24 цифр та літер";
|
||||
"tour_section_13_bottom_text_2" = "Активація пройшла вдало (наприклад, нам зарахували 100 голосів)";
|
||||
"tour_section_13_bottom_text_3" = "<b>Увага: </b>Після активації ваучера на вашу сторінку, той самий ваучер не можна буде активувати повторно";
|
||||
"tour_section_13_bottom_text_3" = "<b>Зверніть увагу: </b>Якщо ви вже активували ваучер на цьому аккаунті, його не можна повторно використати.";
|
||||
|
||||
"tour_section_14_title_1" = "Мобільна версія";
|
||||
"tour_section_14_text_1" = "Наразі мобільної вебверсії сайту поки що немає, проте є мобільний додаток для Android";
|
||||
"tour_section_14_text_2" = "OpenVK Legacy - це мобільний додаток OpenVK для пристроїв на базі Android із дизайном ВКонтакте 3.0.4 2013 року";
|
||||
"tour_section_14_text_2" = "OpenVK Legacy - це мобільний додаток OpenVK для пристроїв на базі Android із дизайном ВКонтакті 3.0.4 2013 року";
|
||||
"tour_section_14_text_3" = "Мінімально підтримуваною версією є Android 2.1 Eclair, тобто апарати часів початку 2010-их стануть у пригоді.";
|
||||
|
||||
"tour_section_14_title_2" = "Де це можна завантажити?";
|
||||
|
@ -1373,3 +1371,63 @@
|
|||
"tour_section_14_bottom_text_1" = "Скріншоти застосунку";
|
||||
"tour_section_14_bottom_text_2" = "На цьому екскурсія сайтом завершена. Якщо ви хочете спробувати наш мобільний застосунок, створити тут свою групу, покликати своїх друзів чи знайти нових, або взагалі просто якось розважитися, то це можна зробити просто зараз, пройшовши невелику <a href='/reg'>реєстрацію</a>";
|
||||
"tour_section_14_bottom_text_3" = "На цьому екскурсія сайтом завершена.";
|
||||
|
||||
/* Search */
|
||||
|
||||
"s_people" = "Люди";
|
||||
"s_groups" = "Спільноти";
|
||||
"s_events" = "Події";
|
||||
"s_apps" = "Застосунки";
|
||||
"s_questions" = "Запитання";
|
||||
"s_notes" = "Нотатки";
|
||||
"s_themes" = "Теми";
|
||||
"s_posts" = "Дописи";
|
||||
"s_comments" = "Коментарі";
|
||||
"s_videos" = "Відео";
|
||||
"s_audios" = "Музика";
|
||||
"s_by_people" = "по людям";
|
||||
"s_by_groups" = "по спільнотах";
|
||||
"s_by_posts" = "по дописах";
|
||||
"s_by_comments" = "по коментарях";
|
||||
"s_by_videos" = "по відео";
|
||||
"s_by_apps" = "по застосункам";
|
||||
"s_by_audios" = "по музиці";
|
||||
|
||||
"s_order_by" = "Сортувати за...";
|
||||
|
||||
"s_order_by_id" = "ID";
|
||||
"s_order_by_name" = "Назвою";
|
||||
"s_order_by_random" = "Випадковістю";
|
||||
"s_order_by_rating" = "Рейтингом";
|
||||
"s_order_invert" = "Інвертувати";
|
||||
|
||||
"s_by_date" = "За датою";
|
||||
"s_registered_before" = "Зареєстровано до";
|
||||
"s_registered_after" = "Зареєстровано після";
|
||||
"s_date_before" = "До";
|
||||
"s_date_after" = "Після";
|
||||
|
||||
"s_main" = "Основне";
|
||||
|
||||
"s_now_on_site" = "зараз на сайті";
|
||||
"s_with_photo" = "з фото";
|
||||
"s_only_in_names" = "тільки в іменах";
|
||||
|
||||
"s_any" = "будь-який";
|
||||
"reset" = "Очистити";
|
||||
|
||||
"closed_group_post" = "Цей допис з приватної групи";
|
||||
"deleted_target_comment" = "Цей коментар належить до видаленого допису";
|
||||
|
||||
/* Mobile */
|
||||
|
||||
"mobile_friends" = "Друзі";
|
||||
"mobile_photos" = "Фотографії";
|
||||
"mobile_videos" = "Відеозаписи";
|
||||
"mobile_messages" = "Повідомлення";
|
||||
"mobile_notes" = "Нотатки";
|
||||
"mobile_groups" = Групи";
|
||||
"mobile_search" = "Пошук";
|
||||
"mobile_desktop_version" = "Повна версія";
|
||||
"mobile_menu" = "Меню";
|
||||
"mobile_like" = "Мені подобається";
|
||||
|
|
|
@ -250,7 +250,7 @@ input[type=checkbox] {
|
|||
{
|
||||
overflow-y: hidden;
|
||||
overflow-x:hidden;
|
||||
width:28.8%;
|
||||
width:25.5%;
|
||||
border-top:1px solid #2B2B2B;
|
||||
float:right;
|
||||
scrollbar-width: none;
|
||||
|
@ -263,10 +263,10 @@ input[type=checkbox] {
|
|||
{
|
||||
border: none;
|
||||
background-color: #555555;
|
||||
color:#ffffff;
|
||||
color: #ffffff;
|
||||
margin-left: -3px;
|
||||
padding-bottom:2px;
|
||||
width:80px;
|
||||
padding-bottom: 2px;
|
||||
width: 80px;
|
||||
cursor: pointer;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
@ -275,7 +275,7 @@ input[type=checkbox] {
|
|||
{
|
||||
border: none;
|
||||
background-color: rgb(77, 77, 77);
|
||||
color:white;
|
||||
color: white;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
|
@ -283,14 +283,14 @@ input[type=checkbox] {
|
|||
{
|
||||
margin-left:0px;
|
||||
color: white;
|
||||
padding:2px;
|
||||
padding-top:5px;
|
||||
padding-bottom:5px;
|
||||
padding: 2px;
|
||||
padding-top: 5px;
|
||||
padding-bottom: 5px;
|
||||
border: none;
|
||||
background: #a4a4a4;
|
||||
margin-bottom:2px;
|
||||
padding-left:5px;
|
||||
width:90%;
|
||||
margin-bottom: 2px;
|
||||
padding-left: 5px;
|
||||
width: 90%;
|
||||
}
|
||||
|
||||
.searchList #used a
|
||||
|
@ -305,24 +305,24 @@ input[type=checkbox] {
|
|||
|
||||
.searchList li:hover
|
||||
{
|
||||
margin-left:0px;
|
||||
margin-left: 0px;
|
||||
color: #2B587A !important;
|
||||
background:#eeeeee;
|
||||
padding:2px;
|
||||
padding-top:5px;
|
||||
padding-bottom:5px;
|
||||
margin-bottom:2px;
|
||||
padding-left:5px;
|
||||
width:91%;
|
||||
background: #eeeeee;
|
||||
padding: 2px;
|
||||
padding-top: 5px;
|
||||
padding-bottom: 5px;
|
||||
margin-bottom: 2px;
|
||||
padding-left: 5px;
|
||||
width: 91%;
|
||||
}
|
||||
|
||||
.searchOptionName
|
||||
{
|
||||
cursor:pointer;
|
||||
cursor: pointer;
|
||||
background-color: #a4a4a4;
|
||||
padding-left:5px;
|
||||
padding-top:5px;
|
||||
padding-bottom:5px;
|
||||
padding-left: 5px;
|
||||
padding-top: 5px;
|
||||
padding-bottom: 5px;
|
||||
width: 90%;
|
||||
font-weight: 600;
|
||||
color: #fff;
|
||||
|
@ -330,10 +330,10 @@ input[type=checkbox] {
|
|||
|
||||
.searchOptionName img
|
||||
{
|
||||
display:none;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.borderup
|
||||
{
|
||||
border-top:1px solid #2f2f2f;
|
||||
border-top: 1px solid #2f2f2f;
|
||||
}
|
Loading…
Reference in a new issue