From bac35fe7792a28dbeb0df185b00031afce6371bd Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Fri, 30 Jun 2023 19:29:58 -0400 Subject: [PATCH] blog limit --- www-api/app/Controllers/WrenchBlog.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/www-api/app/Controllers/WrenchBlog.php b/www-api/app/Controllers/WrenchBlog.php index 2c1cbb08..a294b142 100644 --- a/www-api/app/Controllers/WrenchBlog.php +++ b/www-api/app/Controllers/WrenchBlog.php @@ -67,6 +67,10 @@ class WrenchBlog extends BaseController public function website(){ + // echo "EXYTACT INPUT DATA HERE"; + $raw_json = file_get_contents('php://input'); + $in = json_decode($raw_json, true); + $endpoint = "WRENCH_BLOG_DATA"; $res1 = $this->getCache($endpoint); if (count($res1)==0){ @@ -75,6 +79,17 @@ class WrenchBlog extends BaseController $this->saveCache($endpoint,$res1); } + $limit = isset($in['limit']) ? $in['limit']: 0; + if ($limit> 0){ + $res1['blogdata'] = array_slice($res1['blogdata'], 0, $limit); + } + + + $res1['blogconfig'] = [ + "media_url" => "https://blog.wrenchboard.com", + "other_cofig1" => "NONE", + "other_cofig2" => "NONE", + ]; return $this->response->setJson($res1); }