Fix(farmlist): raid bugs and PHP 8.3 warnings (#217)

This commit is contained in:
Ferywir
2026-06-15 06:53:14 +02:00
committed by GitHub
parent 8398265641
commit 2e09148bb7
4 changed files with 6 additions and 6 deletions
+2 -2
View File
@@ -2744,7 +2744,7 @@ class MYSQLi_DB implements IDbConnection {
return mysqli_query($this->dblink,$q);
}
function getVillageType2($wref) {
function getVillageType2($wref, $use_cache = true) {
// retirieve form cache
return $this->getVillageByWorldID($wref, $use_cache)['oasistype'];
}
@@ -8003,7 +8003,7 @@ $q = "INSERT INTO ".TB_PREFIX."demolition VALUES (
$q = 'SELECT * FROM ' . TB_PREFIX . 'farmlist WHERE owner = '.$uid.' ORDER BY wref ASC LIMIT 1';
$result = mysqli_query($this->dblink,$q);
$dbarray = mysqli_fetch_array($result);
return $dbarray['id'] > 0;
return ($dbarray['id'] ?? 0) > 0;
}
// no need to cache this method
+1 -1
View File
@@ -761,7 +761,7 @@ class Units {
public function startRaidList($post){
global $database, $generator, $session;
$slots = $post['slot'];
$slots = $post['slot'] ?? [];
if(empty($slots)){
header("Location: build.php?id=39&t=99");
exit();
+1 -1
View File
@@ -259,7 +259,7 @@ if (mysqli_num_rows($getnotice) > 0) {
<?php if ($database->getVilFarmlist($session->uid)) { ?>
<div class="markAll">
<input type="checkbox" onclick="Allmsg(this.form);">
<input class="check" type="checkbox" id="s10" name="s10" onclick="Allmsg(this.form);">
<label><?php echo TZ_SELECT_ALL; ?></label>
</div>
+2 -2
View File
@@ -8,7 +8,7 @@ $errormsg = $errormsg ?? null;
/* =====================================================
LOAD SLOT DATA (EDIT MODE)
===================================================== */
if ($action === 'editSlot' && $eid) {
if ($action === 'showSlot' && $eid) {
$eiddata = $database->getRaidList($eid);
@@ -192,7 +192,7 @@ if (
$lname = $row["name"];
$lvname = $database->getVillageField($row["wref"], 'name');
$selected = ($lid == $lid2) ? 'selected' : '';
$selected = ($lid == ($eiddata['lid'] ?? 0)) ? 'selected' : '';
echo '<option value="'.$lid.'" '.$selected.'>'
.$lvname.' - '.$lname.