Global: Add user option to hide ad poster

This commit is contained in:
Maxim Leshchenko 2022-01-03 21:13:53 +02:00
parent 1b1c88dd96
commit 3edf34e0ea
No known key found for this signature in database
GPG key ID: BB9C44A8733FBEEE
6 changed files with 23 additions and 8 deletions

View file

@ -354,6 +354,7 @@ class User extends RowModel
"groups",
"news",
"links",
"poster",
],
])->get($id);
}
@ -774,6 +775,7 @@ class User extends RowModel
"groups",
"news",
"links",
"poster",
],
])->set($id, (int) $status)->toInteger();

View file

@ -370,13 +370,14 @@ final class UserPresenter extends OpenVKPresenter
$user->setNsfwTolerance((int) $this->postParam("nsfw"));
} else if($_GET['act'] === "lMenu") {
$settings = [
"menu_bildoj" => "photos",
"menu_filmetoj" => "videos",
"menu_mesagoj" => "messages",
"menu_notatoj" => "notes",
"menu_grupoj" => "groups",
"menu_novajoj" => "news",
"menu_ligiloj" => "links",
"menu_bildoj" => "photos",
"menu_filmetoj" => "videos",
"menu_mesagoj" => "messages",
"menu_notatoj" => "notes",
"menu_grupoj" => "groups",
"menu_novajoj" => "news",
"menu_ligiloj" => "links",
"menu_standardo" => "poster",
];
foreach($settings as $checkbox => $setting)
$user->setLeftMenuItemStatus($setting, $this->checkbox($checkbox));

View file

@ -195,7 +195,7 @@
</div>
<a
n:if="OPENVK_ROOT_CONF['openvk']['preferences']['adPoster']['enable']"
n:if="OPENVK_ROOT_CONF['openvk']['preferences']['adPoster']['enable'] && $thisUser->getLeftMenuItemStatus('poster')"
href="{php echo OPENVK_ROOT_CONF['openvk']['preferences']['adPoster']['link']}" >
<img
src="{php echo OPENVK_ROOT_CONF['openvk']['preferences']['adPoster']['src']}"

View file

@ -552,6 +552,16 @@
<td>
<span class="nobold">{_additional_links}</span>
</td>
</tr><tr n:if="OPENVK_ROOT_CONF['openvk']['preferences']['adPoster']['enable']">
<td width="120" valign="top" align="right" align="right">
<input
n:attr="checked => $user->getLeftMenuItemStatus('poster')"
type="checkbox"
name="menu_standardo" />
</td>
<td>
<span class="nobold">{_ad_poster}</span>
</td>
</tr>
<tr>
<td>

View file

@ -412,6 +412,7 @@
"ui_settings_rating_hide" = "Hide";
"additional_links" = "Additional links";
"ad_poster" = "Ad poster";
/* Two-factor authentication */

View file

@ -432,6 +432,7 @@
"ui_settings_rating_hide" = "Скрывать";
"additional_links" = "Дополнительные ссылки";
"ad_poster" = "Рекламный плакат";
/* Two-factor authentication */