1
0
Fork 0

update classes

This commit is contained in:
Christopher 2021-11-22 02:38:34 +01:00
parent 948e11a952
commit 7143488770
2 changed files with 20 additions and 3 deletions

View File

@ -18,7 +18,24 @@
function getNextRegion()
{
return array_shift($this->allRegions);
global $RUNTIME;
$region = array_shift($this->allRegions);
if($region != null)
{
if(count($region) != 0)
{
$regionDescStatement = $RUNTIME['PDO']->prepare("SELECT ParcelDescription AS Description FROM parcels WHERE ParcelRegionUUID = ? LIMIT 1");
$regionDescStatement->execute(array($region['UUID']));
if($row = $regionDescStatement->fetch())
$region['Description'] = $row['Description'];
}
}
return $region;
}
public static function setOnlineTime($uuid)

View File

@ -119,7 +119,7 @@ function getTopRegionHTML($row)
if(!file_exists("./data/RegionImages/".$row['Image'].".jpg"))
$row['Image'] = "notFound";
if(!isset($row['Description']))
if(!isset($row['Description']) || trim($row['Description']) == "")
$row['Description'] = "(Es wurde noch keine Beschreibung hinterlegt.)";
return '<section id="banner"><div class="content"><header><h1>'.substr($row['Name'], 0, 50).'</h1><p>Online: '.$row['OnlineCount'].'</p></header><p>'.substr($row['Description'], 0, 800).'</p><ul class="actions"><a href="region_-'.$row['UUID'].'.html" class="button big html5lightbox">Menr Infos</a></ul></div>
@ -131,7 +131,7 @@ function getRegionHTML($row)
if(!file_exists("./data/RegionImages/".$row['Image'].".jpg"))
$row['Image'] = "notFound";
if(!isset($row['Description']))
if(!isset($row['Description']) || trim($row['Description']) == "")
$row['Description'] = "(Es wurde noch keine Beschreibung hinterlegt.)";
return '<article><a href="index.php?page=regionInfo&id='.$row['UUID'].'" class="image"><img style="min-height: 250px; max-height: 250px;" src="./data/RegionImages/'.$row['Image'].'.jpg" alt="Region Image '.substr($row['Name'], 0, 50).'" /></a>