Operating System Detector Integration
Вывод версии операционной системы пользователя в SE от Samanalee Design Labs
Шаг 1 - Открыть "header.php" и найти это
// CHECK TO SEE IF SITE IS ONLINE OR NOT, ADMIN NOT LOGGED IN, DISPLAY OFFLINE PAGE
if( !$setting['setting_online'] && !$admin->admin_exists )
{
$page = "offline";
include "footer.php";
}
Добавить после
$OSList = array
(
'Microsoft Windows 3.11' => 'Win16',
'Microsoft Windows 95' => '(Windows 95)|(Win95)|(Windows_95)',
'Microsoft Windows 98' => '(Windows 98)|(Win98)',
'Microsoft Windows 2000' => '(Windows NT 5.0)|(Windows 2000)',
'Microsoft Windows XP' => '(Windows NT 5.1)|(Windows XP)',
'Microsoft Windows Server 2003' => '(Windows NT 5.2)',
'Microsoft Windows Vista' => '(Windows NT 6.0)',
'Microsoft Windows 7' => '(Windows NT 7.0)',
'Microsoft Windows NT 4.0' => '(Windows NT 4.0)|(WinNT4.0)|(WinNT)|(Windows NT)',
'Microsoft Windows ME' => 'Windows ME',
'Open BSD' => 'OpenBSD',
'Sun OS' => 'SunOS',
'Linux' => '(Linux)|(X11)',
'Apple Mac OS' => '(Mac_PowerPC)|(Macintosh)',
'QNX' => 'QNX System',
'BeOS' => 'BeOS',
'OS/2' => 'OS/2',
'Search Engine Bot'=>'(nuhk)|(Googlebot)|(Yammybot)|(Openbot)|(Slurp)|(MSNBot)|(Ask Jeeves/Teoma)|(ia_archiver)'
);
foreach($OSList as $CurrOS=>$Match)
{
if (eregi($Match, $_SERVER['HTTP_USER_AGENT']))
{
break;
}
}
Шаг 2 - в этом же файле найти
// CHECK TO SEE IF USER HAS BEEN BLOCKED BY IP
$banned_ips = explode(",", $setting['setting_banned_ips']);
if( in_array($_SERVER['REMOTE_ADDR'], $banned_ips) )
{
// ASSIGN VARIABLES AND DISPLAY ERROR PAGE
$page = "error";
$smarty->assign('error_header', 639);
$smarty->assign('error_message', 807);
$smarty->assign('error_submit', 641);
include "footer.php";
}
Добавить после
// ASSIGN OPERATING SYSTEM DETECTOR - BY SANDAKELUM
$smarty->assign('user_operating_system', $CurrOS);
Готово.
Для вывода имени и версии операционной системы в нужном вам месте вставьте
{$user_operating_system}