open system/johncms/Environment.php

Find:
[code=php]
    public function __invoke(ContainerInterface $container)
    {
        $this->container = $container;
        $this->ipLog($this->getIp());
        return $this;
    }
[/code]

Add this line:
[code=php]
        $this->AgentWeb();
        //access web
[/code]

And put this code:
[code=php]
    /*
      * web view johncms 7.1.0
      * By Gabriel
      * http://nircable.esy.es
    */
    public function AgentWeb()
	{
       if (isset($_GET['w']))
			$_SESSION['agent_web'] = 'web';
		if (isset($_GET['m']))
			$_SESSION['agent_web'] = 'wap';
		if (isset($_POST['web']))
			$_SESSION['agent_web'] = 'web';
		if (isset($_POST['wap']))
			$_SESSION['agent_web'] = 'wap';
		if ($_SESSION['agent_web'] == 'web')
			$agent_web = 'web';
		elseif ($_SESSION['agent_web'] == 'wap')
			$agent_web = 'wap';
		else
			$agent_web = 'wap';
		return $agent_web;
	}
[/code]
close and save Environment.php
Go to system/johncms/Tools.php
open and put this code:
[code=php]
    public function getSkins()
    {
        return $this->user->isValid() && !empty($this->userConfig->skins)
            ? $this->userConfig->skins
            : $this->config->skinweb;
    }
[/code]
Close and save.

Go to system/johncms/UserConfig.php
Find:
[code=php]
            'kmess'       => 20, // Число сообщений на страницу
            'skin'        => '', // Тема оформления
[/code]
Add this line:
[code=php]
            'skins'      => '', // Theme web
[/code]
Close and save.


Now open admin/includes/settings.php
Find:
[code=php]
    $config['skindef'] = isset($_POST['skindef']) ? trim($_POST['skindef']) : 'default';
[/code]
Add this line:
[code=php]
    $config['skinweb'] = isset($_POST['skinweb']) ? trim($_POST['skinweb']) : 'default'; //default skin is default
[/code]

And add the selected style:
[code=php]
echo '<p><h3>' . _t('Themes') . ' Web</h3>&#160;<select name="skinweb">';
$dirs = opendir('../themes');

while ($skinweb = readdir($dirs)) {
    if (($skinweb != '.') && ($skinweb != '..') && ($skinweb != '.svn')) {
        $skinweb = str_replace('.css', '', $skinweb);
        echo '<option' . ($config['skinweb'] == $skinweb ? ' selected="selected">' : '>') . $skinweb . '</option>';
    }
}

closedir($dirs);

echo '</select>' .
    '</p>';
[/code]
Close and save
Now open profile/includes/settings.php
Find:
[code=php]
            // Устанавливаем скин
            foreach (glob('../theme/*/*.css') as $val) {
                $theme_list[] = array_pop(explode('/', dirname($val)));
            }

            $set_user['skin'] = isset($_POST['skin']) && in_array($_POST['skin'], $theme_list) ? htmlspecialchars(trim($_POST['skin'])) : $config['skindef'];
[/code]
Add this line:
[code=php]
            // Устанавливаем скин web
            foreach (glob('../themes/*/*.css') as $vals) {
                $themes_list[] = array_pop(explode('/', dirname($vals)));
            }

            $set_user['skins'] = isset($_POST['skins']) && in_array($_POST['skins'], $themes_list) ? htmlspecialchars(trim($_POST['skins'])) : $config['skinweb'];
[/code]

Add the selected theme for user
[code=php]
        echo '<p><h3>' . _t('Appearance') . ' Web</h3>';
        // Выбор темы оформления
        echo '<select name="skins">';

        foreach (glob('../themes/*/*.css') as $vals) {
            $dirs = explode('/', dirname($vals));
            $themes = array_pop($dirs);
            echo '<option' . ($userConfig->skins == $themes ? ' selected="selected">' : '>') . $themes . '</option>';
        }

        echo '</select> ' . _t('Theme') . '</p>';
[/code]
Close and save!

Go to system/bootstrap.php
add this line:
[code=php]
require __DIR__ . '/Mobile_Detect/Mobile_Detect.php';
# @var Mobile_Detect
$Mobile_Detect = new Mobile_Detect;

# @var Mobile_Detect with Version
$OpMin = $Mobile_Detect->version('Opera Mini');
$Android = $Mobile_Detect->version('Android');

# @var Mobile_Detect with is
$Mobile = $Mobile_Detect->isMobile();
$Tablet = $Mobile_Detect->isTablet();
if (empty($_SESSION['agent_web'])){
       if (!$Mobile) {
		    $_SESSION['agent_web'] = 'web';
       } else {
			 $_SESSION['agent_web'] = 'wap';
       }
}	

if ($_SESSION['agent_web'] == 'web') {
	$agent_web = 'web';
} elseif ($_SESSION['agent_web'] == 'wap') {
	$agent_web = 'wap';
} else {
	$agent_web = 'wap';
}
[/code]

Go to system/head.php
This For menu mobile and web
[code=php]
if ($agent_web == 'web') {
   require(ROOT_PATH . 'themes/' . $tools->getSkins() . '/head.php');
  // themes head for web im use and put on dir /themes/
} else {
   //head mobile
}
[/code]

for end.php
[code=php]
if ($agent_web == 'web') {
   require(ROOT_PATH . 'themes/' . $tools->getSkins() . '/end.php');
  // themes head for web im use and put on dir /themes/
} else {
   //head mobile
}
[/code]

To access web you can use domain/?w
To access web you can use domain/?m

Or you can use form like this
[code=php]
echo '<form action="" method="post">
			<input type="submit" name="web" value="Dekstop Views">
		</form>';
[/code]


