addConnection(array( 'driver' => 'mysql', 'host' => $_G['config']['mysql']['host'], 'database' => $_G['config']['mysql']['dbname'], 'username' => $_G['config']['mysql']['user'], 'password' => $_G['config']['mysql']['pass'], 'charset' => 'utf8', 'collation' => 'utf8_general_ci', 'prefix' => 'pre_', )); use Illuminate\Events\Dispatcher; use Illuminate\Container\Container; $capsule->setEventDispatcher(new Dispatcher(new Container)); $capsule->setAsGlobal(); $capsule->bootEloquent(); //------------------------ CLIENT IP -------------------------// if (!empty($_SERVER['HTTP_CLIENT_IP'])) $_G['CLIENT_IP'] = $_SERVER['HTTP_CLIENT_IP']; elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) $_G['CLIENT_IP'] = $_SERVER['HTTP_X_FORWARDED_FOR']; else $_G['CLIENT_IP'] = $_SERVER['REMOTE_ADDR']; //----------------------- Function File -----------------------// require_once('function/roz.shortid.php'); require_once('function/roz.xCore.php'); require_once('function/roz.pagination.php'); require_once('function/UserAgentDetector.php'); //------------------------- Data Get -------------------------// $_G['data'] = array_merge($_GET, $_POST); //----------------------- Check Admin -----------------------// $admlcookie = getFile(ROZ_ROOT.'./admin/data/cookie.e'); if($_COOKIE["adml"] == $admlcookie && !empty($admlcookie)) $_G['isAdmin'] = true; //------------------------ Get Page ------------------------// if (!$page = $_GET['page']) $page = 1; $page = preg_replace("/[^0-9]+/", '', $page); if (!is_numeric($page)) $page = 1; $_G['page']['get'] = (int)(!isset($page) ? 1 : $page); $_G['page']['startpoint'] = ($page * $_G['config']['limit']) - $_G['config']['limit']; $_G['num'] = ($_G['page']['get'] * $_G['config']['limit']) - $_G['config']['limit'] + 1; $_G['page']['url'] = $_SERVER[REQUEST_URI]; $_G['page']['url'] = str_replace("/page/" . $_G['page']['get'] . ".html", "", $_G['page']['url']); $_G['page']['url'] = str_replace($_G['page']['get'] . ".html", "", $_G['page']['url']); $_G['page']['url'] = str_replace(".html", "", $_G['page']['url']); $_G['page']['url'] = $_G['page']['url'] . "/page/"; //------------------------- Get URL ---------------------------// $_G['url'] = $_SERVER[REQUEST_URI]; ?> Short Url