Fix something about sysmessage

Fix something about sysmessage
This commit is contained in:
novgorodschi catalin
2026-07-27 15:11:17 +03:00
parent 064416826e
commit 1d70f9a328
30 changed files with 23 additions and 4 deletions
+1 -1
View File
@@ -266,7 +266,7 @@ $cronKeyMasked = ($cronKey === '')
<tr><td><?php echo ADM_T4_HERO_ITEMS_ADVENTURES_AUCTION; ?><em class="tooltip">?<span class="classic"><?php echo ADM_T4_HERO_ITEMS_ADVENTURES_AUCTION; ?></span></em></td><td><?php echo NEW_FUNCTIONS_HERO_T4 ? "<span class='badge green'>Enabled</span>" : "<span class='badge red'>Disabled</span>"; ?></td></tr>
<tr><td><?php echo ADM_REGISTRATION_BONUS_GOLD; ?><em class="tooltip">?<span class="classic"><?php echo ADM_GIVE_EVERY_NEWLY_REGISTERED_PLAYER_A_ONE_TIM; ?></span></em></td><td><?php echo (defined('NEW_FUNCTION_REGISTRATION_GOLD') && NEW_FUNCTION_REGISTRATION_GOLD) ? "<span class='badge green'>Enabled</span>" : "<span class='badge red'>Disabled</span>"; ?></td></tr>
<tr><td><?php echo ADM_REGISTRATION_BONUS_GOLD_AMOUNT; ?><em class="tooltip">?<span class="classic"><?php echo ADM_HOW_MUCH_GOLD_EACH_NEW_PLAYER_RECEIVES_WHEN; ?></span></em></td><td><?php echo (defined('NEW_FUNCTION_REGISTRATION_GOLD_VALUE') ? (int) NEW_FUNCTION_REGISTRATION_GOLD_VALUE : 200); ?></td></tr>
<tr><td><?php echo ADM_ALLIANCE_BONUSES; ?> <em class="tooltip">?<span class="classic"><?php echo ADM_ALLIANCE_BONUSES_TIP; ?></span></em></td><td><b><?php echo (defined('NEW_FUNCTIONS_ALLIANCE_BONUSES') && NEW_FUNCTIONS_ALLIANCE_BONUSES) ? "<span class='badge green'>Enabled</span>" : "<span class='badge red'>Disabled</span>"; ?></b></td></tr>
<tr><td><?php echo ADM_ALLIANCE_BONUSES; ?> <em class="tooltip">?<span class="classic"><?php echo ADM_ALLIANCE_BONUSES_TIP; ?></span></em></td><td><?php echo (defined('NEW_FUNCTIONS_ALLIANCE_BONUSES') && NEW_FUNCTIONS_ALLIANCE_BONUSES) ? "<span class='badge green'>Enabled</span>" : "<span class='badge red'>Disabled</span>"; ?></td></tr>
</table>
</div>
+3 -1
View File
@@ -245,7 +245,9 @@ if($_SESSION['access'] < 9) die(ACCESS_DENIED_ADMIN);
</td>
</tr>
<tr>
<td class="b">Alliance bonuses (T4)</td>
<td class="b"><?php echo ADM_ALLIANCE_BONUSES; ?><em class="tooltip">?<span class="classic"><?php echo ADM_ALLIANCE_BONUSES_TIP; ?></span></em>
<?php if (!defined('NEW_FUNCTIONS_ALLIANCE_BONUSES')): ?><br><span style="color:#c0392b;font-size:11px;font-weight:normal;text-transform:none;"><?php echo ADM_NOT_PRESENT_IN_CONFIG_PHP_YET_SAVING_THIS_FO; ?></span><?php endif; ?>
</td>
<td>
<select name="alliance_bonuses">
<option value="true" <?php if (defined('NEW_FUNCTIONS_ALLIANCE_BONUSES') && NEW_FUNCTIONS_ALLIANCE_BONUSES) echo "selected"; ?>>True</option>
+18 -1
View File
@@ -98,7 +98,24 @@ if (isset($_POST['action']) && $_POST['action'] == 'execute') {
die("Cannot read Templates/text_format.tpl");
}
$out = str_replace('%TEKST%', $safe, $format);
// Inlocuim DOAR atribuirea reala, nu orice aparitie a marcajului.
//
// BUG REPARAT: text_format.tpl continea marcajul si intr-un comentariu din
// antetul de credite ("Preserved original placeholder logic (%TEKST%)").
// str_replace le lovea pe amandoua, deci mesajul ajungea si in mijlocul
// comentariului. Textul avea ghilimele si linii noi, care inchideau blocul
// de comentariu si rupeau fisierul - de aici "imi rupe jocul".
//
// Tiparul de mai jos prinde exact linia de atribuire, deci un marcaj ramas
// intr-un comentariu nu mai poate face rau.
$pattern = '/\$txt\s*=\s*"%TEKST%"\s*;/';
$out = preg_replace($pattern, '$txt = "' . str_replace('$', '\\$', $safe) . '";', $format, 1, $count);
if ($out === null || $count !== 1) {
// Sablonul nu mai arata cum ne asteptam: mai bine oprim decat sa
// scriem un fisier stricat peste unul care functioneaza.
die("Cannot update Templates/text.tpl: the placeholder was not found exactly once in text_format.tpl");
}
if (@file_put_contents($autoprefix . 'Templates/text.tpl', $out) === false) {
die("Cannot write Templates/text.tpl (check permissions)");
+1 -1
View File
@@ -9,7 +9,7 @@
## Copyright: TravianZ (c) 2010-2026. All rights reserved. ##
## ##
## Incremental Refactor Notes: ##
## - Preserved original placeholder logic (%TEKST%) ##
## - Preserved original placeholder logic (the message placeholder) ##
## - Improved BBCode parsing using str_replace ##
## - Reduced repeated preg_replace calls ##
## - Added safety structure for PHP 7+ ##
Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB