Add 4 tribes for addUser Admin CP

Add 4 tribes for addUser Admin CP
This commit is contained in:
novgorodschi catalin
2026-07-14 11:07:26 +03:00
parent 585fe3af5a
commit 13d3244e28
2 changed files with 18 additions and 3 deletions
+5 -1
View File
@@ -42,7 +42,7 @@ if(isset($_GET['e'])) {
}
elseif(isset($_GET['g']) && $_GET['g']=='OK'){
$baseName = $_GET['bn']; $mode = $_GET['mo']; $skipped=(int)$_GET['sk']; $bp=(int)$_GET['bp'];
$tribe = [0=>RANDOM,1=>TRIBE1,2=>TRIBE2,3=>TRIBE3][$_GET['tr']]??'Unknown';
$tribe = [0=>RANDOM,1=>TRIBE1,2=>TRIBE2,3=>TRIBE3,6=>TRIBE6,7=>TRIBE7,8=>TRIBE8,9=>TRIBE9][$_GET['tr']]??'Unknown';
if($mode==='many_accounts'){
$amount=(int)$_GET['am'];
@@ -149,6 +149,10 @@ elseif(isset($_GET['g']) && $_GET['g']=='OK'){
<label><input type="radio" name="tribe" value="1"><span class="tribe-icon">🏛</span><span class="tribe-text"><?php echo TRIBE1;?></span></label>
<label><input type="radio" name="tribe" value="2"><span class="tribe-icon">🪓</span><span class="tribe-text"><?php echo TRIBE2;?></span></label>
<label><input type="radio" name="tribe" value="3"><span class="tribe-icon">🌾</span><span class="tribe-text"><?php echo TRIBE3;?></span></label>
<label><input type="radio" name="tribe" value="6"><span class="tribe-icon">🏛</span><span class="tribe-text"><?php echo TRIBE6;?></span></label>
<label><input type="radio" name="tribe" value="7"><span class="tribe-icon">🪓</span><span class="tribe-text"><?php echo TRIBE7;?></span></label>
<label><input type="radio" name="tribe" value="8"><span class="tribe-icon">🌾</span><span class="tribe-text"><?php echo TRIBE8;?></span></label>
<label><input type="radio" name="tribe" value="9"><span class="tribe-icon">🏛</span><span class="tribe-text"><?php echo TRIBE9;?></span></label>
</div>
</div>
+13 -2
View File
@@ -69,8 +69,19 @@ if (strlen($baseName) > 20) {
// convenience closure: pick tribe once (for a user)
$chooseTribe = function(int $postTribe) {
if ($postTribe === 0) return rand(1,3);
return max(1, min(3, $postTribe));
// Random doar triburile jucabile
if ($postTribe === 0) {
$tribes = [1,2,3,6,7,8,9];
return $tribes[array_rand($tribes)];
}
// Permite doar triburile jucabile
if (!in_array($postTribe, [1,2,3,6,7,8,9])) {
return 1;
}
return $postTribe;
};
/* ===================== FIX UNIT BUG ===================== */