We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 54551
    • 1 Posts
    Всем доброго времени суток. Недавно на сайте friends-vl.ru с мобильной версии сайта, появилась страница, где предлагается либо загрузить приложение, либо перейти на страницу сайта, так вот, хотелось бы от нее избавится. Что бы сразу переходил на сайт.

    Вот основной индекс:
    <?php
    
    require_once $_SERVER['DOCUMENT_ROOT'].'/Mobile_Detect/Mobile_Detect.php';
    $md = new Mobile_Detect;
    
    
    if ($md->isAndroidOS() && !($md->isWindowsMobileOS()) && !($md->isWindowsPhoneOS())) {
        if (isset($_COOKIE['android-app']) && $_COOKIE['android-app'] == 'browser');
        else {
            include $_SERVER['DOCUMENT_ROOT']."/android-app/index.php";
            exit;
        }
    }
    
    if( $md->isiOS() && !($md->isWindowsMobileOS()) && !($md->isWindowsPhoneOS())){
        if (isset($_COOKIE['apple-app']) && $_COOKIE['apple-app'] == 'browser');
        else {
            include $_SERVER['DOCUMENT_ROOT']."/apple-app/index.php";
            exit;
        }
    }
    /*
     * This file is part of MODX Revolution.
     *
     * Copyright (c) MODX, LLC. All Rights Reserved.
     *
     * For the full copyright and license information, please view the LICENSE
     * file that was distributed with this source code.
     */
    
    $tstart= microtime(true);
    
    /* define this as true in another entry file, then include this file to simply access the API
     * without executing the MODX request handler */
    if (!defined('MODX_API_MODE')) {
        define('MODX_API_MODE', false);
    }
    
    /* this can be used to disable caching in MODX absolutely */
    $modx_cache_disabled= false;
    
    /* include custom core config and define core path */
    @include(dirname(__FILE__) . '/config.core.php');
    if (!defined('MODX_CORE_PATH')) define('MODX_CORE_PATH', dirname(__FILE__) . '/core/');
    
    /* include the modX class */
    if (!@include_once (MODX_CORE_PATH . "model/modx/modx.class.php")) {
        $errorMessage = 'Site temporarily unavailable';
        @include(MODX_CORE_PATH . 'error/unavailable.include.php');
        header($_SERVER['SERVER_PROTOCOL'] . ' 503 Service Unavailable');
        echo "<html><title>Error 503: Site temporarily unavailable</title><body><h1>Error 503</h1><p>{$errorMessage}</p></body></html>";
        exit();
    }
    
    /* start output buffering */
    ob_start();
    
    /* Create an instance of the modX class */
    $modx= new modX();
    if (!is_object($modx) || !($modx instanceof modX)) {
        ob_get_level() && @ob_end_flush();
        $errorMessage = '<a href="setup/">MODX not installed. Install now?</a>';
        @include(MODX_CORE_PATH . 'error/unavailable.include.php');
        header($_SERVER['SERVER_PROTOCOL'] . ' 503 Service Unavailable');
        echo "<html><title>Error 503: Site temporarily unavailable</title><body><h1>Error 503</h1><p>{$errorMessage}</p></body></html>";
        exit();
    }
    
    /* Set the actual start time */
    $modx->startTime= $tstart;
    
    /* Initialize the default 'web' context */
    $modx->initialize('web');
    
    /* execute the request handler */
    if (!MODX_API_MODE) {
        $modx->handleRequest();
    }
    


    А вот файл /apple-app/index.php, который подгружается, ну и такой же на андроид:

    <?php
    if (isset($_GET['browser'])) {
    	setcookie('apple-app', 'browser', strtotime('+1 day'), '/');
    	header('Location: ' . (isset($_GET['redirect-to']) ? $_GET['redirect-to'] : '/'), TRUE, 302);
    	exit();
    }
    ?>
    <!doctype html>
    <html>
    <head>
    	<meta charset="utf-8">
    	<link rel="stylesheet" href="/android-app/index.css">
    	<title>Apple-приложение</title>
    </head>
    <body>
    	<img src="/android-app/bg2.png" usemap="#map">
    	<map name="map" id="map">
    		<area shape="rect" coords="104,261,469,318" data-metrica-goal="android-promo-download" href="https://itunes.apple.com/us/app/the-friends/id1395662202?l=ru&ls=1&mt=8">
    		<area shape="rect" coords="104,336,469,393" data-metrica-goal="iphone-promo-download" href="?browser<?php echo isset($_GET['redirect-to']) ? ('&redirect-to=' . $_GET['redirect-to']) : '' ?>">
    	</map>
    </body>
    </html>


    В программировании не силен, помогите плз.