Simple mobile skin auto change/lv

This page is a translated version of the page Simple mobile skin auto change and the translation is 14% complete.

The following code snippet (added to LocalSettings.php) allows for detection of an iPhone, followed by automatic switching of the skin / theme to an iPhone-compatible one (in this case, WPtouch). Add this code to your LocalSettings.php file (replacing the current $wgDefaultSkin variable) after installing the iPhone-compatible skin. This will make the default skin "wptouch" if an iPhone, "vector" otherwise. Modify as needed. If file cache is enabled you may need to disable it to prevent visitors from seeing the wrong skin.

Ja lietotājs ielogojās, tā ādiņas iestatījums pārraksta šo iestatījumu.

Example code

## Default skin: you can change the default skin.
## Use the internal symbolic names, ie 'vector', 'monobook':
if (preg_match("/(mobile|webos|opera mini)/i", $_SERVER['HTTP_USER_AGENT'])) {
    $wgDefaultSkin = 'wptouch';
} else {
    $wgDefaultSkin = 'vector';
}


Mobile configuration with Skin:MinervaNeue without using Extension:MobileFrontend

## Default skin: you can change the default skin.
## Use the internal symbolic names, ie 'vector', 'monobook':
if (preg_match("/(mobile|webos|opera mini|android|blackberry|tablet)/i", $_SERVER['HTTP_USER_AGENT'])) {
    $wgDefaultSkin = 'minerva';
} else {
    $wgDefaultSkin = 'vector';
}