Change o_show_post_count

This commit is contained in:
Visman 2021-12-19 12:25:27 +07:00
parent 848bd4af1e
commit a394735f89
4 changed files with 11 additions and 9 deletions

View file

@ -1208,7 +1208,7 @@ class Install extends Admin
'i_timeout_online' => 900,
'i_redirect_delay' => 1,
'b_show_user_info' => 1,
'o_show_post_count' => 1,
'b_show_post_count' => 1,
'o_smilies' => 1,
'o_smilies_sig' => 1,
'o_make_links' => 1,

View file

@ -47,7 +47,7 @@ class Options extends Admin
'i_timeout_online' => 'required|integer|min:0|max:99999|check_timeout',
'i_redirect_delay' => 'required|integer|min:0|max:99999',
'b_show_user_info' => 'required|integer|in:0,1',
'o_show_post_count' => 'required|integer|in:0,1',
'b_show_post_count' => 'required|integer|in:0,1',
'i_topic_review' => 'required|integer|min:0|max:50',
'i_disp_topics_default' => 'required|integer|min:10|max:50',
'i_disp_posts_default' => 'required|integer|min:10|max:50',
@ -333,9 +333,9 @@ class Options extends Admin
'caption' => 'Info in posts label',
'help' => 'Info in posts help',
],
'o_show_post_count' => [
'b_show_post_count' => [
'type' => 'radio',
'value' => $config->o_show_post_count,
'value' => $config->b_show_post_count,
'values' => $yn,
'caption' => 'Post count label',
'help' => 'Post count help',

View file

@ -498,15 +498,17 @@ class Update extends Admin
*/
protected function stageNumber43(array $args): ?int
{
$this->c->config->i_timeout_visit = $this->c->config->o_timeout_visit ?? 3600;
$this->c->config->i_timeout_online = $this->c->config->o_timeout_online ?? 900;
$this->c->config->i_redirect_delay = $this->c->config->o_redirect_delay ?? 1;
$this->c->config->b_show_user_info = '1' == $this->c->config->o_show_user_info ? 1 : 0;
$this->c->config->i_timeout_visit = $this->c->config->o_timeout_visit ?? 3600;
$this->c->config->i_timeout_online = $this->c->config->o_timeout_online ?? 900;
$this->c->config->i_redirect_delay = $this->c->config->o_redirect_delay ?? 1;
$this->c->config->b_show_user_info = '1' == $this->c->config->o_show_user_info ? 1 : 0;
$this->c->config->o_show_post_count = '1' == $this->c->config->o_show_post_count ? 1 : 0;
unset($this->c->config->o_timeout_visit);
unset($this->c->config->o_timeout_online);
unset($this->c->config->o_redirect_delay);
unset($this->c->config->o_show_user_info);
unset($this->c->config->o_show_post_count);
$this->c->config->save();

View file

@ -306,7 +306,7 @@ class User extends DataModel
*/
protected function getshowPostCount(): bool
{
return '1' == $this->c->config->o_show_post_count || $this->isAdmMod;
return 1 == $this->c->config->b_show_post_count || $this->isAdmMod;
}
/**