Skip to content
Snippets Groups Projects
Commit ef06b9b7 authored by DIALLO ABDOUL-AZIZ's avatar DIALLO ABDOUL-AZIZ
Browse files

load two projects initially on tablet

parent ffb5399c
Branches
No related merge requests found
...@@ -9,10 +9,15 @@ $start = 0; ...@@ -9,10 +9,15 @@ $start = 0;
$count = 3; $count = 3;
// Check if the user is on a mobile device // Check if the user is on a mobile device
if (isset($_SERVER['HTTP_USER_AGENT']) && preg_match('/mobile/i', $_SERVER['HTTP_USER_AGENT'])) { if (isset($_SERVER['HTTP_USER_AGENT'])) {
$count = 1; // Load 1 project initially on mobile devices 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); $allProject = $projects->getProjectBetween($start, $count);
// header("Content-Type: application/json"); // header("Content-Type: application/json");
// echo json_encode($projects); // echo json_encode($projects);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment