Browse Source

automatically redirect to mobile/ using Mobile_Detect class

Andrew Dolgov 8 years ago
parent
commit
955d4f82ea
2 changed files with 43 additions and 0 deletions
  1. 8 0
      index.php
  2. 35 0
      lib/Mobile_Detect.php

+ 8 - 0
index.php

@@ -14,6 +14,14 @@
 	require_once "version.php";
 	require_once "config.php";
 	require_once "db-prefs.php";
+	require_once "lib/Mobile_Detect.php";
+
+	$mobile = new Mobile_Detect();
+
+	if ($mobile->isMobile() && !$mobile->isTablet() && !$_REQUEST['mobile']) {
+		header('Location: mobile/index.php');
+		exit;
+	}
 
 	$link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
 

File diff suppressed because it is too large
+ 35 - 0
lib/Mobile_Detect.php


Some files were not shown because too many files changed in this diff