mirror of
https://github.com/openvk/openvk
synced 2024-12-23 00:51:03 +03:00
add fav games
This commit is contained in:
parent
e67963ed37
commit
996108289c
10 changed files with 48 additions and 10 deletions
|
@ -269,7 +269,7 @@ final class Account extends VKAPIRequestHandler
|
|||
return 1;
|
||||
|
||||
$entity = get_entity_by_id($owner_id);
|
||||
if(!$entity || $entity->isDeleted())
|
||||
if(!$entity)
|
||||
return 0;
|
||||
|
||||
if(!$entity->isBlacklistedBy($this->getUser()))
|
||||
|
|
|
@ -12,8 +12,14 @@ final class Users extends VKAPIRequestHandler
|
|||
if($authuser == NULL) $authuser = $this->getUser();
|
||||
|
||||
$users = new UsersRepo;
|
||||
if($user_ids == "0")
|
||||
if($user_ids == "0") {
|
||||
if(!$authuser) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$user_ids = (string) $authuser->getId();
|
||||
}
|
||||
|
||||
|
||||
$usrs = explode(',', $user_ids);
|
||||
$response = array();
|
||||
|
@ -198,6 +204,13 @@ final class Users extends VKAPIRequestHandler
|
|||
|
||||
$response[$i]->quotes = $usr->getFavoriteQuote();
|
||||
break;
|
||||
case "games":
|
||||
if(!$canView) {
|
||||
break;
|
||||
}
|
||||
|
||||
$response[$i]->games = $usr->getFavoriteGames();
|
||||
break;
|
||||
case "email":
|
||||
if(!$canView) {
|
||||
break;
|
||||
|
|
|
@ -415,6 +415,11 @@ class User extends RowModel
|
|||
return $this->getRecord()->fav_quote;
|
||||
}
|
||||
|
||||
function getFavoriteGames(): ?string
|
||||
{
|
||||
return $this->getRecord()->fav_games;
|
||||
}
|
||||
|
||||
function getCity(): ?string
|
||||
{
|
||||
return $this->getRecord()->city;
|
||||
|
@ -1432,6 +1437,9 @@ class User extends RowModel
|
|||
|
||||
$res->blacklisted = (int)$user->isBlacklistedBy($this);
|
||||
break;
|
||||
case "games":
|
||||
$res->games = $this->getFavoriteGames();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -251,13 +251,14 @@ final class UserPresenter extends OpenVKPresenter
|
|||
else
|
||||
$user->setWebsite((!parse_url($website, PHP_URL_SCHEME) ? "https://" : "") . $website);
|
||||
} elseif($_GET['act'] === "interests") {
|
||||
$user->setInterests(empty($this->postParam("interests")) ? NULL : ovk_proc_strtr($this->postParam("interests"), 300));
|
||||
$user->setFav_Music(empty($this->postParam("fav_music")) ? NULL : ovk_proc_strtr($this->postParam("fav_music"), 300));
|
||||
$user->setFav_Films(empty($this->postParam("fav_films")) ? NULL : ovk_proc_strtr($this->postParam("fav_films"), 300));
|
||||
$user->setFav_Shows(empty($this->postParam("fav_shows")) ? NULL : ovk_proc_strtr($this->postParam("fav_shows"), 300));
|
||||
$user->setFav_Books(empty($this->postParam("fav_books")) ? NULL : ovk_proc_strtr($this->postParam("fav_books"), 300));
|
||||
$user->setFav_Quote(empty($this->postParam("fav_quote")) ? NULL : ovk_proc_strtr($this->postParam("fav_quote"), 300));
|
||||
$user->setAbout(empty($this->postParam("about")) ? NULL : ovk_proc_strtr($this->postParam("about"), 300));
|
||||
$user->setInterests(empty($this->postParam("interests")) ? NULL : ovk_proc_strtr($this->postParam("interests"), 1000));
|
||||
$user->setFav_Music(empty($this->postParam("fav_music")) ? NULL : ovk_proc_strtr($this->postParam("fav_music"), 1000));
|
||||
$user->setFav_Films(empty($this->postParam("fav_films")) ? NULL : ovk_proc_strtr($this->postParam("fav_films"), 1000));
|
||||
$user->setFav_Shows(empty($this->postParam("fav_shows")) ? NULL : ovk_proc_strtr($this->postParam("fav_shows"), 1000));
|
||||
$user->setFav_Books(empty($this->postParam("fav_books")) ? NULL : ovk_proc_strtr($this->postParam("fav_books"), 1000));
|
||||
$user->setFav_Quote(empty($this->postParam("fav_quote")) ? NULL : ovk_proc_strtr($this->postParam("fav_quote"), 1000));
|
||||
$user->setFav_Games(empty($this->postParam("fav_games")) ? NULL : ovk_proc_strtr($this->postParam("fav_games"), 1000));
|
||||
$user->setAbout(empty($this->postParam("about")) ? NULL : ovk_proc_strtr($this->postParam("about"), 1000));
|
||||
} elseif($_GET["act"] === "backdrop") {
|
||||
if($this->postParam("subact") === "remove") {
|
||||
$user->unsetBackDropPictures();
|
||||
|
|
|
@ -294,6 +294,14 @@
|
|||
<textarea type="text" name="fav_quote">{$user->getFavoriteQuote()}</textarea>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="120" valign="top">
|
||||
<span class="nobold">{_favorite_games}: </span>
|
||||
</td>
|
||||
<td>
|
||||
<textarea type="text" name="fav_games">{$user->getFavoriteGames()}</textarea>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="120" valign="top">
|
||||
<span class="nobold">{_information_about}: </span>
|
||||
|
|
|
@ -567,6 +567,10 @@
|
|||
<td class="label"><span class="nobold">{_favorite_quotes}: </span></td>
|
||||
<td class="data">{$user->getFavoriteQuote()}</td>
|
||||
</tr>
|
||||
<tr n:if="!is_null($user->getFavoriteGames())">
|
||||
<td class="label"><span class="nobold">{_favorite_games}: </span></td>
|
||||
<td class="data">{$user->getFavoriteGames()}</td>
|
||||
</tr>
|
||||
<tr n:if="!is_null($user->getDescription())">
|
||||
<td class="label"><span class="nobold">{_information_about}: </span></td>
|
||||
<td class="data">{$user->getDescription()}</td>
|
||||
|
|
|
@ -924,7 +924,8 @@ u(document).on("click", "#editPost", async (e) => {
|
|||
const target = u(e.target)
|
||||
const post = target.closest("table")
|
||||
const content = post.find(".post-content")
|
||||
const edit_place = post.find('.post-edit')
|
||||
const edit_place_l = post.find('.post-edit')
|
||||
const edit_place = u(edit_place_l.first())
|
||||
const id = post.attr('data-id').split('_')
|
||||
|
||||
let type = 'post'
|
||||
|
|
1
install/sqls/00053-new-fields.sql
Normal file
1
install/sqls/00053-new-fields.sql
Normal file
|
@ -0,0 +1 @@
|
|||
ALTER TABLE `profiles` ADD `fav_games` MEDIUMTEXT NULL DEFAULT NULL AFTER `fav_quote`;
|
|
@ -152,6 +152,7 @@
|
|||
"favorite_shows" = "Favorite TV-shows";
|
||||
"favorite_books" = "Favorite books";
|
||||
"favorite_quotes" = "Favorite quotes";
|
||||
"favorite_games" = "Favorite games";
|
||||
"information_about" = "About";
|
||||
|
||||
"updated_at" = "Updated at $1";
|
||||
|
|
|
@ -136,6 +136,7 @@
|
|||
"favorite_shows" = "Любимые ТВ-шоу";
|
||||
"favorite_books" = "Любимые книги";
|
||||
"favorite_quotes" = "Любимые цитаты";
|
||||
"favorite_games" = "Любимые игры";
|
||||
"information_about" = "О себе";
|
||||
"updated_at" = "Обновлено $1";
|
||||
"user_banned" = "К сожалению, нам пришлось заблокировать страницу пользователя <b>$1</b>.";
|
||||
|
|
Loading…
Reference in a new issue