Follow along with the video below to see how to install our site as a web app on your home screen.
Примечание: This feature may not be available in some browsers.
RewriteCond %{HTTP_USER_AGENT} ^.*тут-юзерагент.*$
RewriteRule ^(.*)$ тут-url-переключения-шаблона-для-этого-типа-юзерагента [R=301]
functions.phpКакие файлы движка здесь задействованы?
function check_smartphone() {
if ( $_SESSION['mobile_enable'] ) return true;
$phone_array = array('iphone', 'android', 'pocket', 'palm', 'windows ce', 'windowsce', 'cellphone', 'opera mobi', 'operamobi', 'ipod', 'small', 'sharp', 'sonyericsson', 'symbian', 'symbos', 'opera mini', 'nokia', 'htc_', 'samsung', 'motorola', 'smartphone', 'blackberry', 'playstation portable', 'tablet browser', 'android');
$agent = strtolower( $_SERVER['HTTP_USER_AGENT'] );
foreach ($phone_array as $value) {
if ( strpos($agent, $value) !== false ) return true;
}
return false;
}
if ($smartphone_detected) {
if (!$config['allow_smart_format']) {
$row['short_story'] = strip_tags( $row['short_story'], '<p><br><a>' );
$row['full_story'] = strip_tags( $row['full_story'], '<p><br><a>' );
} else {
if ( !$config['allow_smart_images'] ) {
$row['short_story'] = preg_replace( "#<!--TBegin-->(.+?)<!--TEnd-->#is", "", $row['short_story'] );
$row['short_story'] = preg_replace( "#<img(.+?)>#is", "", $row['short_story'] );
$row['full_story'] = preg_replace( "#<!--TBegin-->(.+?)<!--TEnd-->#is", "", $row['full_story'] );
$row['full_story'] = preg_replace( "#<img(.+?)>#is", "", $row['full_story'] );
}
if ( !$config['allow_smart_video'] ) {
$row['short_story'] = preg_replace( "#<!--dle_video_begin(.+?)<!--dle_video_end-->#is", "", $row['short_story'] );
$row['short_story'] = preg_replace( "#<!--dle_audio_begin(.+?)<!--dle_audio_end-->#is", "", $row['short_story'] );
$row['full_story'] = preg_replace( "#<!--dle_video_begin(.+?)<!--dle_video_end-->#is", "", $row['full_story'] );
$row['full_story'] = preg_replace( "#<!--dle_audio_begin(.+?)<!--dle_audio_end-->#is", "", $row['full_story'] );
}
}
}
require_once 'mobiledetect.class.php';
$mobile_detect = new Mobile_Detect;
if ($mobile_detect->isTablet() or $mobile_detect->isMobile()) {
echo "It's Mobile or Tablet";
}