diff --git a/index.php b/index.php index 9f87c14973d87773a500332b5fba586a61632cc9..5a62ce4978a467131571f4758364be1c6b44cd30 100644 --- a/index.php +++ b/index.php @@ -9,10 +9,15 @@ $start = 0; $count = 3; // Check if the user is on a mobile device -if (isset($_SERVER['HTTP_USER_AGENT']) && preg_match('/mobile/i', $_SERVER['HTTP_USER_AGENT'])) { - $count = 1; // Load 1 project initially on mobile devices +if (isset($_SERVER['HTTP_USER_AGENT'])) { + if (preg_match('/(tablet|ipad|android(?!.*mobile))/i', $_SERVER['HTTP_USER_AGENT'])) { + $count = 2; // Load 2 projects initially on tablet devices + } elseif (preg_match('/mobile/i', $_SERVER['HTTP_USER_AGENT'])) { + $count = 1; // Load 1 project initially on mobile devices + } } +echo $count; $allProject = $projects->getProjectBetween($start, $count); // header("Content-Type: application/json"); // echo json_encode($projects);