From 1ba751acb3f50362ca2867164b6b77e5c5087477 Mon Sep 17 00:00:00 2001 From: marcdeb1 Date: Sat, 5 Jan 2019 21:44:37 +0100 Subject: [PATCH] Thumbnail text and content tag fix --- src/Controller/MainController.php | 2 ++ src/Model/Entity/Claim.php | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Controller/MainController.php b/src/Controller/MainController.php index a2b7f58..e3e1257 100644 --- a/src/Controller/MainController.php +++ b/src/Controller/MainController.php @@ -572,6 +572,7 @@ class MainController extends AppController { $resultSet = []; // get avg prices + /* $conn_local = ConnectionManager::get('localdb'); $stmt_price = $conn_local->execute("SELECT AVG(USD) AS AvgUSD, DATE_FORMAT(Created, '$sqlDateFormat') AS TimePeriod " . "FROM PriceHistory WHERE DATE_FORMAT(Created, '$sqlDateFormat') >= ? GROUP BY TimePeriod ORDER BY TimePeriod ASC", [$start->format($dateFormat)]); @@ -582,6 +583,7 @@ class MainController extends AppController { } $resultSet[$price->TimePeriod]['AvgUSD'] = (float) $price->AvgUSD; } + */ $conn = ConnectionManager::get('default'); // get avg block sizes for the time period diff --git a/src/Model/Entity/Claim.php b/src/Model/Entity/Claim.php index a7651e7..cfd183d 100644 --- a/src/Model/Entity/Claim.php +++ b/src/Model/Entity/Claim.php @@ -29,7 +29,7 @@ class Claim extends Entity { $ctTag = 'image'; } - if (!$ctTag && $this->claim_type == 1) { + if (!$ctTag && $this->claim_type == 2) { $ctTag = 'identity'; } return $ctTag; @@ -37,11 +37,11 @@ class Claim extends Entity { function getAutoThumbText() { $autoThumbText = ''; - if ($this->claim_type == 1) { - $autoThumbText = strtoupper(substr($this->name, 1, min( strlen($this->name), 3 ))); + if ($this->claim_type == 2) { + $autoThumbText = strtoupper(substr($this->name, 1, min(strlen($this->name), 10))); } else { $str = (strlen(trim($this->title)) > 0) ? $this->title : $this->name; - $autoThumbText = strtoupper(substr($str, 0, min (strlen($str), 2 ))); + $autoThumbText = strtoupper(substr($str, 0, min(strlen($str), 5))); } return $autoThumbText; }