fix change username card useage

This commit is contained in:
xiaomlove
2022-08-11 20:47:02 +08:00
parent e72d2fba78
commit 83cadfe77c
4 changed files with 16 additions and 8 deletions
+2 -1
View File
@@ -15,6 +15,7 @@ Complete PT website building solution. Based on NexusPHP + Laravel + Filament.
- Attendance
- Retroactive attendance card
- Medal
- Props
- Custom tags
- SeedBox rule
- Forum
@@ -36,7 +37,7 @@ Complete PT website building solution. Based on NexusPHP + Laravel + Filament.
## System Requirements
- PHP: 8.0, must have extensions: bcmath, ctype, curl, fileinfo, json, mbstring, openssl, pdo_mysql, tokenizer, xml, mysqli, gd, redis, pcntl, sockets, posix, gmp
- Mysql: 5.7 latest version or above
- Redis2.0.0 or above
- Redis2.6.12 or above
## Quick Start
Install docker.
+2 -1
View File
@@ -14,6 +14,7 @@
- 签到
- 补签卡
- 勋章
- 道具
- 自定义标签
- 盒子规则
- 论坛
@@ -35,7 +36,7 @@
## 系统要求
- PHP: 8.0,必须扩展:bcmath, ctype, curl, fileinfo, json, mbstring, openssl, pdo_mysql, tokenizer, xml, mysqli, gd, redis, pcntl, sockets, posix, gmp
- Mysql: 5.7 最新版或以上版本
- Redis2.0.0 或以上版本
- Redis2.6.12 或以上版本
## 快速开始
安装 docker。
+1 -1
View File
@@ -668,7 +668,7 @@ class Install
$redis = NexusDB::redis();
$result = $redis->info();
$version = $result['redis_version'];
$match = version_compare($version, '2.0.0', '>=');
$match = version_compare($version, '2.6.12', '>=');
return compact('version', 'match');
}
+11 -5
View File
@@ -313,11 +313,16 @@ if ($metas->has($metaKey)) {
$triggerId = "consume-$metaKey";
$changeUsernameCards = $metas->get($metaKey);
$cardName = $changeUsernameCards->first()->meta_key_text;
$useInput = '';
if ($CURUSER['id'] == $user['id']) {
$useInput = sprintf('<input type="button" value="%s" id="%s">', $lang_userdetails['consume'], $triggerId);
}
$props[] = sprintf(
'<div><strong>[%s]</strong>(%s)<input type="button" value="%s" id="%s"></div>',
$cardName, $changeUsernameCards->count(), $lang_userdetails['consume'], $triggerId
'<div><strong>[%s]</strong>(%s)</div>%s',
$cardName, $changeUsernameCards->count(), $useInput
);
$consumeChangeUsernameForm = <<<HTML
if ($useInput) {
$consumeChangeUsernameForm = <<<HTML
<div class="layer-form">
<form id="layer-form-$metaKey">
<input type="hidden" name="params[meta_key]" value="$metaKey">
@@ -328,7 +333,7 @@ if ($metas->has($metaKey)) {
</form>
</div>
HTML;
$consumeChangeUsernameJs = <<<JS
$consumeChangeUsernameJs = <<<JS
jQuery('#{$triggerId}').on("click", function () {
layer.open({
type: 1,
@@ -350,7 +355,8 @@ jQuery('#{$triggerId}').on("click", function () {
})
})
JS;
\Nexus\Nexus::js($consumeChangeUsernameJs, 'footer', false);
\Nexus\Nexus::js($consumeChangeUsernameJs, 'footer', false);
}
}
$metaKey = \App\Models\UserMeta::META_KEY_PERSONALIZED_USERNAME;