|
Server : Apache/2.4.62 System : FreeBSD fbsdweb2.web.rcn.net 14.1-RELEASE FreeBSD 14.1-RELEASE releng/14.1-n267679-10e31f0946d8 GENERIC amd64 User : www ( 80) PHP Version : 8.3.8 Disable Function : NONE Directory : /domains/owens.enteract/inc/ |
Upload File : |
<?php
include_once("constants.php");
include_once("libs/db/dbconn.class.php");
include_once("libs/date/date.class.php");
include_once("libs/validation/validation.class.php");
//Determine which libraries to load
if (USE_CACHING) {include_once("libs/cache/cache.class.php");}
if (USE_MAPS) {include_once("libs/maps/geocoder.php");}
if (USE_MOBILE) {include_once('libs/mobile/mobile_device_detect.php');mobileDetect();}
if (USE_TWITTER) {include_once("libs/twitter/utils.php");}
/* -----------------------------------------------------------------------------------------------
COMMON UTILS
-----------------------------------------------------------------------------------------------*/
function logError($error){
error_log(ROOT_LOCATION . "\n\n" . $error, 1, ERROR_EMAIL);
}
function getFullImage($img,$defaultImage,$imgPrepend = ""){
if ($img != ""){
return DYNAMIC_ASSETS_URL . $imgPrepend . $img;
}else{
return STATIC_ASSETS_URL . "img/" . $defaultImage;
}
}
/* -----------------------------------------------------------------------------------------------
MOBILE DETECTION
Only use this for PHP level detection. If page level caching is happening make sure to
have 'device' get passed OUTSIDE of cache in querystring so each device can have their
own cached page ('?device=' . DEVICE_TYPE)
-----------------------------------------------------------------------------------------------*/
function mobileDetect(){
$deviceType = ValidationUtils::getRequestVar("GET","device","");
if ($deviceType == ""){
$detect = new Mobile_Detect;
$deviceType = ($detect->isMobile() ? ($detect->isTablet() ? 'tablet' : 'phone') : 'computer');
}
define("DEVICE_TYPE",$deviceType);
if ($deviceType == "phone"){
define("IS_MOBILE",true);
define("IS_TABLET",false);
}else if($deviceType == "tablet"){
define("IS_MOBILE",false);
define("IS_TABLET",true);
}else{
define("IS_MOBILE",false);
define("IS_TABLET",false);
}
}
/* -----------------------------------------------------------------------------------------------
PROJECT FUNCTIONS
-----------------------------------------------------------------------------------------------*/
?>