mirror of
https://github.com/openvk/openvk
synced 2025-03-15 05:55:29 +03:00
🤮🤢
This commit is contained in:
parent
9a20682e01
commit
1fcc372f18
2 changed files with 25 additions and 12 deletions
|
@ -113,6 +113,7 @@ class Wall implements Handler
|
||||||
$reject(22, "Access to post denied");
|
$reject(22, "Access to post denied");
|
||||||
|
|
||||||
$post->setSuggested(2);
|
$post->setSuggested(2);
|
||||||
|
$post->setDeleted(1);
|
||||||
$post->save();
|
$post->save();
|
||||||
|
|
||||||
$resolve($this->posts->getSuggestedPostsCount($post->getWallOwner()->getId()));
|
$resolve($this->posts->getSuggestedPostsCount($post->getWallOwner()->getId()));
|
||||||
|
|
|
@ -288,7 +288,7 @@ final class Groups extends VKAPIRequestHandler
|
||||||
string $description = NULL,
|
string $description = NULL,
|
||||||
string $screen_name = NULL,
|
string $screen_name = NULL,
|
||||||
string $website = NULL,
|
string $website = NULL,
|
||||||
int $wall = NULL,
|
int $wall = -1,
|
||||||
int $topics = NULL,
|
int $topics = NULL,
|
||||||
int $adminlist = NULL,
|
int $adminlist = NULL,
|
||||||
int $topicsAboveWall = NULL,
|
int $topicsAboveWall = NULL,
|
||||||
|
@ -303,17 +303,29 @@ final class Groups extends VKAPIRequestHandler
|
||||||
if(!$club || !$club->canBeModifiedBy($this->getUser())) $this->fail(15, "You can't modify this group.");
|
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.");
|
if(!empty($screen_name) && !$club->setShortcode($screen_name)) $this->fail(103, "Invalid shortcode.");
|
||||||
|
|
||||||
!is_null($title) ? $club->setName($title) : NULL;
|
!empty($title) ? $club->setName($title) : NULL;
|
||||||
!is_null($description) ? $club->setAbout($description) : NULL;
|
!empty($description) ? $club->setAbout($description) : NULL;
|
||||||
!is_null($screen_name) ? $club->setShortcode($screen_name) : NULL;
|
!empty($screen_name) ? $club->setShortcode($screen_name) : NULL;
|
||||||
!is_null($website) ? $club->setWebsite((!parse_url($website, PHP_URL_SCHEME) ? "https://" : "") . $website) : NULL;
|
!empty($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;
|
|
||||||
|
|
||||||
|
try {
|
||||||
|
$wall != -1 ? $club->setWall($wall) : NULL;
|
||||||
|
} catch(\Exception $e) {
|
||||||
|
$this->fail(50, "Invalid wall value");
|
||||||
|
}
|
||||||
|
|
||||||
|
!empty($topics) ? $club->setEveryone_Can_Create_Topics($topics) : NULL;
|
||||||
|
!empty($adminlist) ? $club->setAdministrators_List_Display($adminlist) : NULL;
|
||||||
|
!empty($topicsAboveWall) ? $club->setDisplay_Topics_Above_Wall($topicsAboveWall) : NULL;
|
||||||
|
!empty($hideFromGlobalFeed) ? $club->setHide_From_Global_Feed($hideFromGlobalFeed) : NULL;
|
||||||
|
|
||||||
|
try {
|
||||||
$club->save();
|
$club->save();
|
||||||
|
} catch(\TypeError $e) {
|
||||||
|
$this->fail(15, "Nothing changed");
|
||||||
|
} catch(\Exception $e) {
|
||||||
|
$this->fail(18, "An unknown error occurred: maybe you set an incorrect value?");
|
||||||
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -466,7 +478,7 @@ final class Groups extends VKAPIRequestHandler
|
||||||
"title" => $club->getName(),
|
"title" => $club->getName(),
|
||||||
"description" => $club->getDescription() != NULL ? $club->getDescription() : "",
|
"description" => $club->getDescription() != NULL ? $club->getDescription() : "",
|
||||||
"address" => $club->getShortcode(),
|
"address" => $club->getShortcode(),
|
||||||
"wall" => $club->canPost() == true ? 1 : 0,
|
"wall" => $club->getWallType(), # отличается от вкшных но да ладно
|
||||||
"photos" => 1,
|
"photos" => 1,
|
||||||
"video" => 0,
|
"video" => 0,
|
||||||
"audio" => 0,
|
"audio" => 0,
|
||||||
|
|
Loading…
Reference in a new issue