mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-28 06:57:22 +08:00
fix change username card useage
This commit is contained in:
+2
-1
@@ -15,6 +15,7 @@ Complete PT website building solution. Based on NexusPHP + Laravel + Filament.
|
|||||||
- Attendance
|
- Attendance
|
||||||
- Retroactive attendance card
|
- Retroactive attendance card
|
||||||
- Medal
|
- Medal
|
||||||
|
- Props
|
||||||
- Custom tags
|
- Custom tags
|
||||||
- SeedBox rule
|
- SeedBox rule
|
||||||
- Forum
|
- Forum
|
||||||
@@ -36,7 +37,7 @@ Complete PT website building solution. Based on NexusPHP + Laravel + Filament.
|
|||||||
## System Requirements
|
## 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
|
- 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
|
- Mysql: 5.7 latest version or above
|
||||||
- Redis:2.0.0 or above
|
- Redis:2.6.12 or above
|
||||||
|
|
||||||
## Quick Start
|
## Quick Start
|
||||||
Install docker.
|
Install docker.
|
||||||
|
|||||||
@@ -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
|
- PHP: 8.0,必须扩展:bcmath, ctype, curl, fileinfo, json, mbstring, openssl, pdo_mysql, tokenizer, xml, mysqli, gd, redis, pcntl, sockets, posix, gmp
|
||||||
- Mysql: 5.7 最新版或以上版本
|
- Mysql: 5.7 最新版或以上版本
|
||||||
- Redis:2.0.0 或以上版本
|
- Redis:2.6.12 或以上版本
|
||||||
|
|
||||||
## 快速开始
|
## 快速开始
|
||||||
安装 docker。
|
安装 docker。
|
||||||
|
|||||||
@@ -668,7 +668,7 @@ class Install
|
|||||||
$redis = NexusDB::redis();
|
$redis = NexusDB::redis();
|
||||||
$result = $redis->info();
|
$result = $redis->info();
|
||||||
$version = $result['redis_version'];
|
$version = $result['redis_version'];
|
||||||
$match = version_compare($version, '2.0.0', '>=');
|
$match = version_compare($version, '2.6.12', '>=');
|
||||||
return compact('version', 'match');
|
return compact('version', 'match');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+11
-5
@@ -313,11 +313,16 @@ if ($metas->has($metaKey)) {
|
|||||||
$triggerId = "consume-$metaKey";
|
$triggerId = "consume-$metaKey";
|
||||||
$changeUsernameCards = $metas->get($metaKey);
|
$changeUsernameCards = $metas->get($metaKey);
|
||||||
$cardName = $changeUsernameCards->first()->meta_key_text;
|
$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(
|
$props[] = sprintf(
|
||||||
'<div><strong>[%s]</strong>(%s)<input type="button" value="%s" id="%s"></div>',
|
'<div><strong>[%s]</strong>(%s)</div>%s',
|
||||||
$cardName, $changeUsernameCards->count(), $lang_userdetails['consume'], $triggerId
|
$cardName, $changeUsernameCards->count(), $useInput
|
||||||
);
|
);
|
||||||
$consumeChangeUsernameForm = <<<HTML
|
if ($useInput) {
|
||||||
|
$consumeChangeUsernameForm = <<<HTML
|
||||||
<div class="layer-form">
|
<div class="layer-form">
|
||||||
<form id="layer-form-$metaKey">
|
<form id="layer-form-$metaKey">
|
||||||
<input type="hidden" name="params[meta_key]" value="$metaKey">
|
<input type="hidden" name="params[meta_key]" value="$metaKey">
|
||||||
@@ -328,7 +333,7 @@ if ($metas->has($metaKey)) {
|
|||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
HTML;
|
HTML;
|
||||||
$consumeChangeUsernameJs = <<<JS
|
$consumeChangeUsernameJs = <<<JS
|
||||||
jQuery('#{$triggerId}').on("click", function () {
|
jQuery('#{$triggerId}').on("click", function () {
|
||||||
layer.open({
|
layer.open({
|
||||||
type: 1,
|
type: 1,
|
||||||
@@ -350,7 +355,8 @@ jQuery('#{$triggerId}').on("click", function () {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
JS;
|
JS;
|
||||||
\Nexus\Nexus::js($consumeChangeUsernameJs, 'footer', false);
|
\Nexus\Nexus::js($consumeChangeUsernameJs, 'footer', false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$metaKey = \App\Models\UserMeta::META_KEY_PERSONALIZED_USERNAME;
|
$metaKey = \App\Models\UserMeta::META_KEY_PERSONALIZED_USERNAME;
|
||||||
|
|||||||
Reference in New Issue
Block a user