mirror of
https://github.com/Znote/ZnoteAAC.git
synced 2025-05-08 15:19:21 +02:00
Toggle guild nick feature in config.php
Fix #407 TFS 1.3 has a potential unresolved crash bug related to guild nicks. You can check out the details here: https://github.com/otland/forgottenserver/issues/2561#issuecomment-633101435
This commit is contained in:
parent
31c233d559
commit
5a80034915
@ -620,6 +620,11 @@
|
|||||||
// Do you need to have premium account to create a guild?
|
// Do you need to have premium account to create a guild?
|
||||||
$config['guild_require_premium'] = true;
|
$config['guild_require_premium'] = true;
|
||||||
|
|
||||||
|
// There is a TFS 1.3 bug related to guild nicks
|
||||||
|
// https://github.com/otland/forgottenserver/issues/2561
|
||||||
|
// So if your using TFS 1.x, you might need to disable guild nicks until the crash has been fixed.
|
||||||
|
$config['guild_allow_nicknames'] = true;
|
||||||
|
|
||||||
$config['guildwar_enabled'] = false;
|
$config['guildwar_enabled'] = false;
|
||||||
|
|
||||||
// Use htaccess rewrite? (basically this makes website.com/username work instead of website.com/characterprofile.php?name=username
|
// Use htaccess rewrite? (basically this makes website.com/username work instead of website.com/characterprofile.php?name=username
|
||||||
|
@ -436,7 +436,7 @@ function update_player_guildnick($cid, $nick) {
|
|||||||
|
|
||||||
mysql_update("UPDATE `players` SET `guildnick`='$nick' WHERE `id`=$cid");
|
mysql_update("UPDATE `players` SET `guildnick`='$nick' WHERE `id`=$cid");
|
||||||
} else {
|
} else {
|
||||||
mysql_update("UPDATE `players` SET `guildnick`= NULL WHERE `id`=$cid");
|
mysql_update("UPDATE `players` SET `guildnick`='' WHERE `id`=$cid");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function update_player_guildnick_10($cid, $nick) {
|
function update_player_guildnick_10($cid, $nick) {
|
||||||
@ -445,7 +445,7 @@ function update_player_guildnick_10($cid, $nick) {
|
|||||||
if (!empty($nick)) {
|
if (!empty($nick)) {
|
||||||
mysql_update("UPDATE `guild_membership` SET `nick`='$nick' WHERE `player_id`=$cid");
|
mysql_update("UPDATE `guild_membership` SET `nick`='$nick' WHERE `player_id`=$cid");
|
||||||
} else {
|
} else {
|
||||||
mysql_update("UPDATE `guild_membership` SET `nick`= NULL WHERE `player_id`=$cid");
|
mysql_update("UPDATE `guild_membership` SET `nick`='' WHERE `player_id`=$cid");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -400,6 +400,7 @@ if ($highest_access >= 2) {
|
|||||||
|
|
||||||
// Change Guild Nick
|
// Change Guild Nick
|
||||||
if (!empty($_POST['player_guildnick'])) {
|
if (!empty($_POST['player_guildnick'])) {
|
||||||
|
if ($config['guild_allow_nicknames']) {
|
||||||
$p_cid = user_character_id($_POST['player_guildnick']);
|
$p_cid = user_character_id($_POST['player_guildnick']);
|
||||||
$p_guild = get_player_guild_data($p_cid);
|
$p_guild = get_player_guild_data($p_cid);
|
||||||
if (preg_match("/^[a-zA-Z_ ]+$/", $_POST['guildnick']) || empty($_POST['guildnick'])) {
|
if (preg_match("/^[a-zA-Z_ ]+$/", $_POST['guildnick']) || empty($_POST['guildnick'])) {
|
||||||
@ -416,6 +417,7 @@ if ($highest_access >= 2) {
|
|||||||
} else echo '<font color="red" size="4">Character not offline.</font>';
|
} else echo '<font color="red" size="4">Character not offline.</font>';
|
||||||
}
|
}
|
||||||
} else echo '<font color="red" size="4">Character guild nick may only contain a-z, A-Z and spaces.</font>';
|
} else echo '<font color="red" size="4">Character guild nick may only contain a-z, A-Z and spaces.</font>';
|
||||||
|
} else echo '<font color="red" size="4">Change guild nickname feature has been disabled.</font>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Promote character to guild position
|
// Promote character to guild position
|
||||||
@ -696,6 +698,7 @@ if ($highest_access >= 2) {
|
|||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</form>
|
</form>
|
||||||
|
<?php if ($config['guild_allow_nicknames']): ?>
|
||||||
<!-- FORMS TO CHANGE GUILD NICK -->
|
<!-- FORMS TO CHANGE GUILD NICK -->
|
||||||
<form action="" method="post">
|
<form action="" method="post">
|
||||||
<ul>
|
<ul>
|
||||||
@ -722,6 +725,7 @@ if ($highest_access >= 2) {
|
|||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</form>
|
</form>
|
||||||
|
<?php endif; ?>
|
||||||
<!-- END FORMS TO CHANGE GUILD NICK -->
|
<!-- END FORMS TO CHANGE GUILD NICK -->
|
||||||
<?php if ($members > 1) { ?>
|
<?php if ($members > 1) { ?>
|
||||||
<!-- FORMS TO PROMOTE CHARACTER-->
|
<!-- FORMS TO PROMOTE CHARACTER-->
|
||||||
|
Loading…
x
Reference in New Issue
Block a user