Просмотр файла header/oper.etc.php

Размер файла: 14.59Kb
  1. <?php
  2. $ip = $_SERVER['REMOTE_ADDR'];
  3. $ips = split("\.", "$ip");
  4. @$ipnum = $ips[3] + $ips[2] * 256 + $ips[1] * 256 * 256 + $ips[0] * 256 * 256 * 256;
  5. $oper = '';
  6. $IP101 = array(2130706433,1402273792,1402277888,1402279936,1402281984,1402284032,1402286080,1402287104,3251233792,3582031776);
  7. $IP201 = array(2130706687,1402275839,1402278911,1402280959,1402283007,1402285055,1402287103,1402288127,3251234815,3582031807);
  8. $IP102 = array(1433657344,3648405504,3648406528,3648408576,3648409600,3648410624,3648411648,3648412672);
  9. $IP202 = array(1433657599,3648406527,3648407551,3648409599,3648410623,3648411647,3648412671,3648413695);
  10. $IP103 = array(1047070464,1401450496,1401451520,1406861312,1425989632,1441366016,3272364544,3564675072,3564676832,3571187712,3641816064,3641816576);
  11. $IP203 = array(1047072255,1401450751,1401451775,1406869503,1425994239,1441371903,3272364799,3564683263,3564676863,3571253247,3641816319,3641816831);
  12. $IP104 = array(1347599104,3588519936);
  13. $IP204 = array(1347599359,3588520447);
  14. $IP105 = array(1042394624,1346950400,1347674112,1360933376,1372794624,1410457600,3258356736,3277188608,3281465344,3287259392,3559689216,3562834880,3578831872,3579259392,3579267072,3579269120,3641237504,3641237504,3645018112,3645566976,3648478720);
  15. $IP205 = array(1042394879,1346950655,1347678207,1360933887,1372794879,1410459647,3258357759,3277188863,3281465599,3287259647,3559689471,3562834943,3578832127,3579265535,3579267935,3579273215,3641241599,3641240575,3645019135,3645569023,3648479231);
  16. $IP106 = array(1404043264,2197028864);
  17. $IP206 = array(1405091839,2197094399);
  18. $IP107 = array(3650368512);
  19. $IP207 = array(3650368767);
  20. $IP108 = array(3278955480,3278956288,3278960128);
  21. $IP208 = array(3278955515,3278956543,3278960383);
  22. $IP109 = array(1389383040,1432330240,3282161664,3282171904,3585171456);
  23. $IP209 = array(1389383167,1432334335,3282163711,3282173951,3585174271);
  24. $IP110 = array(1346736128,3260286336,3645731072);
  25. $IP210 = array(1346737151,3260286463,3645731079);
  26. $IP111 = array(3648294912);
  27. $IP211 = array(3648295935);
  28. $IP112 = array(1481787392,3652001536);
  29. $IP212 = array(1481787647,3652001599);
  30. $IP113 = array(1052193280,1347125248,1347125248,1347126528);
  31. $IP213 = array(1052193535,1347129343,1347125759,1347127167);
  32. $IP114 = array(1358118912,1358119680);
  33. $IP214 = array(1358119423,1358123007);
  34. $IP115 = array(1406740480,1406741504,3564593152,3564595968,3564599808,3565248512,3565250048,3565250560,3578853376,3648215680);
  35. $IP215 = array(1406741503,1406743551,3564593407,3564596735,3564601343,3565256703,3565250559,3565254655,3578854079,3648215807);
  36. $IP116 = array(3651751936,3651752192,3651755008);
  37. $IP216 = array(3651752191,3651752447,3651756031);
  38. $IP117 = array(3287244288);
  39. $IP217 = array(3287244543);
  40. $IP118 = array(3645317120);
  41. $IP218 = array(3645318015);
  42. $IP119 = array(3268669440);
  43. $IP219 = array(3268673535);
  44. $IP120 = array(2197028864);
  45. $IP220 = array(2197094399);
  46. $IP121 = array(3588390912,1410269184);
  47. $IP221 = array(3588391935,1410334719);
  48. $IP122 = array(3266322432);
  49. $IP222 = array(3266322687);
  50. $IP123 = array(2197028864);
  51. $IP223 = array(2197094399);
  52. $IP124 = array(2197028864);
  53. $IP224 = array(2197094399);
  54. $IP125 = array(3562882304);
  55. $IP225 = array(3563086079);
  56. $IP300 = array(3240705024);
  57. $IP301 = array(3240706047);
  58. $IP302 = array(1358905344,1358905344,1358907392,1358907648,1358907904,1358908160,1358908416,1358908672,1358908928,1358909184,1490436096);
  59. $IP303 = array(1358909439,1358905471,1358907647,1358907903,1358908159,1358908415,1358908671,1358908927,1358909183,1358909439,1490444287);
  60. $IP304 = array(3560612352,3560612864);
  61. $IP305 = array(3560612863,3560613887);
  62. $IP306 = array(3253698560);
  63. $IP307 = array(3253699071);
  64. $IP308 = array(3274702592);
  65. $IP309 = array(3274702847);
  66. $IP310= array(3557661440,3563233536,3583086592);
  67. $IP311 = array(3557661695,3563233791,3583087103);
  68. $IP312= array(1410273024,3588391680,2197079040,3588406784,3588407040);
  69. $IP313 = array(1410273279,3588391935,2197079295,3588407039,3588407295);
  70.  
  71. for ($ix=0; $ix<count($IP101); $ix++)
  72. {
  73. if ($ipnum>=$IP101[$ix] && $ipnum<=$IP201[$ix]) $oper = "1";
  74. }
  75. for ($ix=0; $ix<count($IP102); $ix++)
  76. {
  77. if ($ipnum>=$IP102[$ix] && $ipnum<=$IP202[$ix]) $oper = "2";
  78. }
  79. for ($ix=0; $ix<count($IP103); $ix++)
  80. {
  81. if ($ipnum>=$IP103[$ix] && $ipnum<=$IP203[$ix]) $oper = "3";
  82. }
  83. for ($ix=0; $ix<count($IP104); $ix++)
  84. {
  85. if ($ipnum>=$IP104[$ix] && $ipnum<=$IP204[$ix]) $oper = "4";
  86. }
  87. for ($ix=0; $ix<count($IP105); $ix++)
  88. {
  89. if ($ipnum>=$IP105[$ix] && $ipnum<=$IP205[$ix]) $oper = "5";
  90. }
  91. for ($ix=0; $ix<count($IP106); $ix++)
  92. {
  93. if ($ipnum>=$IP106[$ix] && $ipnum<=$IP206[$ix]) $oper = "6";
  94. }
  95. for ($ix=0; $ix<count($IP107); $ix++)
  96. {
  97. if ($ipnum>=$IP107[$ix] && $ipnum<=$IP207[$ix]) $oper = "7";
  98. }
  99. for ($ix=0; $ix<count($IP108); $ix++)
  100. {
  101. if ($ipnum>=$IP108[$ix] && $ipnum<=$IP208[$ix]) $oper = "8";
  102. }
  103. for ($ix=0; $ix<count($IP109); $ix++)
  104. {
  105. if ($ipnum>=$IP109[$ix] && $ipnum<=$IP209[$ix]) $oper = "9";
  106. }
  107. for ($ix=0; $ix<count($IP110); $ix++)
  108. {
  109. if ($ipnum>=$IP110[$ix] && $ipnum<=$IP210[$ix]) $oper = "10";
  110. }
  111. for ($ix=0; $ix<count($IP111); $ix++)
  112. {
  113. if ($ipnum>=$IP111[$ix] && $ipnum<=$IP211[$ix]) $oper = "11";
  114. }
  115. for ($ix=0; $ix<count($IP112); $ix++)
  116. {
  117. if ($ipnum>=$IP112[$ix] && $ipnum<=$IP212[$ix]) $oper = "12";
  118. }
  119. for ($ix=0; $ix<count($IP113); $ix++)
  120. {
  121. if ($ipnum>=$IP113[$ix] && $ipnum<=$IP213[$ix]) $oper = "13";
  122. }
  123. for ($ix=0; $ix<count($IP114); $ix++)
  124. {
  125. if ($ipnum>=$IP114[$ix] && $ipnum<=$IP214[$ix]) $oper = "14";
  126. }
  127. for ($ix=0; $ix<count($IP115); $ix++)
  128. {
  129. if ($ipnum>=$IP115[$ix] && $ipnum<=$IP215[$ix]) $oper = "15";
  130. }
  131. for ($ix=0; $ix<count($IP116); $ix++)
  132. {
  133. if ($ipnum>=$IP116[$ix] && $ipnum<=$IP216[$ix]) $oper = "16";
  134. }
  135. for ($ix=0; $ix<count($IP117); $ix++)
  136. {
  137. if ($ipnum>=$IP117[$ix] && $ipnum<=$IP217[$ix]) $oper = "17";
  138. }
  139. for ($ix=0; $ix<count($IP118); $ix++)
  140. {
  141. if ($ipnum>=$IP118[$ix] && $ipnum<=$IP218[$ix]) $oper = "18";
  142. }
  143. for ($ix=0; $ix<count($IP119); $ix++)
  144. {
  145. if ($ipnum>=$IP119[$ix] && $ipnum<=$IP219[$ix]) $oper = "19";
  146. }
  147. for ($ix=0; $ix<count($IP120); $ix++)
  148. {
  149. if ($ipnum>=$IP120[$ix] && $ipnum<=$IP220[$ix]) $oper = "20";
  150. }
  151. for ($ix=0; $ix<count($IP121); $ix++)
  152. {
  153. if ($ipnum>=$IP121[$ix] && $ipnum<=$IP221[$ix]) $oper = "21";
  154. }
  155. for ($ix=0; $ix<count($IP122); $ix++)
  156. {
  157. if ($ipnum>=$IP122[$ix] && $ipnum<=$IP222[$ix]) $oper = "22";
  158. }
  159. for ($ix=0; $ix<count($IP123); $ix++)
  160. {
  161. if ($ipnum>=$IP123[$ix] && $ipnum<=$IP223[$ix]) $oper = "23";
  162. }
  163. for ($ix=0; $ix<count($IP124); $ix++)
  164. {
  165. if ($ipnum>=$IP124[$ix] && $ipnum<=$IP224[$ix]) $oper = "24";
  166. }
  167. for ($ix=0; $ix<count($IP125); $ix++)
  168. {
  169. if ($ipnum>=$IP125[$ix] && $ipnum<=$IP225[$ix]) $oper = "25";
  170. }
  171. for ($ix=0; $ix<count($IP300); $ix++)
  172. {
  173. if ($ipnum>=$IP300[$ix] && $ipnum<=$IP301[$ix]) $oper = "26";
  174. }
  175. for ($ix=0; $ix<count($IP302); $ix++)
  176. {
  177. if ($ipnum>=$IP302[$ix] && $ipnum<=$IP303[$ix]) $oper = "27";
  178. }
  179. for ($ix=0; $ix<count($IP304); $ix++)
  180. {
  181. if ($ipnum>=$IP304[$ix] && $ipnum<=$IP305[$ix]) $oper = "28";
  182. }
  183. for ($ix=0; $ix<count($IP306); $ix++)
  184. {
  185. if ($ipnum>=$IP306[$ix] && $ipnum<=$IP307[$ix]) $oper = "29";
  186. }
  187. for ($ix=0; $ix<count($IP308); $ix++)
  188. {
  189. if ($ipnum>=$IP308[$ix] && $ipnum<=$IP309[$ix]) $oper = "30";
  190. }
  191. for ($ix=0; $ix<count($IP310); $ix++)
  192. {
  193. if ($ipnum>=$IP310[$ix] && $ipnum<=$IP311[$ix]) $oper = "30";
  194. }
  195. for ($ix=0; $ix<count($IP312); $ix++)
  196. {
  197. if ($ipnum>=$IP312[$ix] && $ipnum<=$IP313[$ix]) $oper = "31";
  198. }
  199.  
  200. ////////// Дописываем мод определителя.
  201. $opera = array(ip2long("195.189.142.0"),ip2long("195.189.143.255"));
  202. ////МТС
  203.  
  204. $ipnum = array(ip2long("87.252.242.0"),ip2long("87.252.242.255"));
  205. if(ip2long($ip) >= $ipnum[0] and ip2long($ip) <= $ipnum[1])
  206. $oper = 1;
  207. $ipnum = array(ip2long("91.135.210.0"),ip2long("91.135.210.255"));
  208. if(ip2long($ip) >= $ipnum[0] and ip2long($ip) <= $ipnum[1])
  209. $oper = 1;
  210.  
  211. $ipnum = array(ip2long("84.17.232.0"),ip2long("84.17.233.255")); // 512
  212. if(ip2long($ip) >= $ipnum[0] and ip2long($ip) <= $ipnum[1])
  213. $oper = 1;
  214.  
  215. $ipnum = array(ip2long("195.74.84.0"),ip2long("195.74.84.255")); // 256
  216. if(ip2long($ip) >= $ipnum[0] and ip2long($ip) <= $ipnum[1])
  217. $oper = 1;
  218. $ipnum = array(ip2long("217.21.61.0"),ip2long("217.21.61.255")); // 256
  219. if(ip2long($ip) >= $ipnum[0] and ip2long($ip) <= $ipnum[1])
  220. $oper = 1;
  221. $ipnum = array(ip2long("217.107.118.0"),ip2long("217.107.118.255")); // 256
  222. if(ip2long($ip) >= $ipnum[0] and ip2long($ip) <= $ipnum[1])
  223. $oper = 1;
  224.  
  225. $ipnum = array(ip2long("194.186.210.0"),ip2long("194.186.210.128")); // 128
  226. if(ip2long($ip) >= $ipnum[0] and ip2long($ip) <= $ipnum[1])
  227. $oper = 1;
  228. $ipnum = array(ip2long("85.117.224.0"),ip2long("85.117.224.255")); // 256
  229. if(ip2long($ip) >= $ipnum[0] and ip2long($ip) <= $ipnum[1])
  230. $oper = 1;
  231. /// 1164
  232. //// Чина телеком
  233. $ipnum = array(ip2long("61.140.0.0"),ip2long("61.146.255.255"));
  234. if(ip2long($ip) >= $ipnum[0] and ip2long($ip) <= $ipnum[1])
  235. $oper = 1;
  236. //// Лайф 512 + 3840 + 32512 +256 + 1792 + 16128 = 55 040
  237. $ipnum = array(ip2long("91.145.224.0"),ip2long("91.145.255.255"));
  238. if(ip2long($ip) >= $ipnum[0] and ip2long($ip) <= $ipnum[1])
  239. $oper = 1;
  240. $ipnum = array(ip2long("212.58.176.0"),ip2long("212.58.191.255"));
  241. if(ip2long($ip) >= $ipnum[0] and ip2long($ip) <= $ipnum[1])
  242. $oper = 1;
  243. $ipnum = array(ip2long("79.124.128.0"),ip2long("79.124.255.255"));
  244. if(ip2long($ip) >= $ipnum[0] and ip2long($ip) <= $ipnum[1])
  245. $oper = 1;
  246. $ipnum = array(ip2long("212.58.160.0"),ip2long("212.58.160.255"));
  247. if(ip2long($ip) >= $ipnum[0] and ip2long($ip) <= $ipnum[1])
  248. $oper = 1;
  249. $ipnum = array(ip2long("212.58.168.0"),ip2long("212.58.175.255"));
  250. if(ip2long($ip) >= $ipnum[0] and ip2long($ip) <= $ipnum[1])
  251. $oper = 1;
  252. $ipnum = array(ip2long("91.145.192.0"),ip2long("91.145.255.255"));
  253. if(ip2long($ip) >= $ipnum[0] and ip2long($ip) <= $ipnum[1])
  254. $oper = 1;
  255. ///// Тамбов GSM 3840 = 3840
  256. $ipnum = array(ip2long("213.135.143.128"),ip2long("213.135.158.127"));
  257. if(ip2long($ip) >= $ipnum[0] and ip2long($ip) <= $ipnum[1])
  258. $oper = 1;
  259. ///// UMC 1792 + 7936 + 1792 = 11 520
  260. $ipnum = array(ip2long("77.52.128.0"),ip2long("77.52.135.255"));
  261. if(ip2long($ip) >= $ipnum[0] and ip2long($ip) <= $ipnum[1])
  262. $oper = 1;
  263. $ipnum = array(ip2long("88.214.96.0"),ip2long("88.214.127.255"));
  264. if(ip2long($ip) >= $ipnum[0] and ip2long($ip) <= $ipnum[1])
  265. $oper = 1;
  266. $ipnum = array(ip2long("77.52.136.0"),ip2long("77.52.143.255"));
  267. if(ip2long($ip) >= $ipnum[0] and ip2long($ip) <= $ipnum[1])
  268. $oper = 1;
  269.  
  270. /// WellCOM GSM 16 128
  271. $ipnum = array(ip2long("213.227.192.0"),ip2long("213.227.255.255"));
  272. if(ip2long($ip) >= $ipnum[0] and ip2long($ip) <= $ipnum[1])
  273. $oper = 1;
  274.  
  275. //// Байкалвестком 256 + 3840 = 4 096
  276. $ipnum = array(ip2long("81.18.116.0"),ip2long("81.18.117.255"));
  277. if(ip2long($ip) >= $ipnum[0] and ip2long($ip) <= $ipnum[1])
  278. $oper = 1;
  279. $ipnum = array(ip2long("81.18.112.0"),ip2long("81.18.127.255"));
  280. if(ip2long($ip) >= $ipnum[0] and ip2long($ip) <= $ipnum[1])
  281. $oper = 1;
  282. ////БашСЕЛ 768 + 256 = 1024
  283.  
  284. $ipnum = array(ip2long("195.22.108.0"),ip2long("195.22.111.255"));
  285. if(ip2long($ip) >= $ipnum[0] and ip2long($ip) <= $ipnum[1])
  286. $oper = 1;
  287.  
  288. $ipnum = array(ip2long("82.151.17.0"),ip2long("82.151.17.255"));
  289. if(ip2long($ip) >= $ipnum[0] and ip2long($ip) <= $ipnum[1])
  290. $oper = 1;
  291. ///// 93 312
  292. //// ВымпелКом 768 + 768 = 1536
  293. $ipnum = array(ip2long("89.188.224.0"),ip2long("89.188.227.255"));
  294. if(ip2long($ip) >= $ipnum[0] and ip2long($ip) <= $ipnum[1])
  295. $oper = 1;
  296. $ipnum = array(ip2long("83.220.224.0"),ip2long("83.220.227.255"));
  297. if(ip2long($ip) >= $ipnum[0] and ip2long($ip) <= $ipnum[1])
  298. $oper = 1;
  299.  
  300. //// Дальсвязь 256
  301. $ipnum = array(ip2long("85.28.195.0"),ip2long("85.28.195.255"));
  302. if(ip2long($ip) >= $ipnum[0] and ip2long($ip) <= $ipnum[1])
  303. $oper = 1;
  304. //// ИНДИГО 768
  305. $ipnum = array(ip2long("82.200.40.0"),ip2long("82.200.43.255"));
  306. if(ip2long($ip) >= $ipnum[0] and ip2long($ip) <= $ipnum[1])
  307. $oper = 1;
  308. ////КаР-Тел 256
  309. $ipnum = array(ip2long("77.74.64.0"),ip2long("77.74.64.255"));
  310. if(ip2long($ip) >= $ipnum[0] and ip2long($ip) <= $ipnum[1])
  311. $oper = 1;
  312. ////Киевстар 1792 + 1792 = 3584
  313. $ipnum = array(ip2long("81.23.24.0"),ip2long("81.23.31.255"));
  314. if(ip2long($ip) >= $ipnum[0] and ip2long($ip) <= $ipnum[1])
  315. $oper = 1;
  316.  
  317. $ipnum = array(ip2long("81.23.16.0"),ip2long("81.23.23.255"));
  318. if(ip2long($ip) >= $ipnum[0] and ip2long($ip) <= $ipnum[1])
  319. $oper = 1;
  320.  
  321. //// МегаФон 768 + 768 + 768 = 2304
  322. $ipnum = array(ip2long("83.149.8.0"),ip2long("83.149.11.255"));
  323. if(ip2long($ip) >= $ipnum[0] and ip2long($ip) <= $ipnum[1])
  324. $oper = 1;
  325. $ipnum = array(ip2long("83.149.20.0"),ip2long("83.149.23.255"));
  326. if(ip2long($ip) >= $ipnum[0] and ip2long($ip) <= $ipnum[1])
  327. $oper = 1;
  328. $ipnum = array(ip2long("80.67.208.0"),ip2long("80.67.211.255"));
  329. if(ip2long($ip) >= $ipnum[0] and ip2long($ip) <= $ipnum[1])
  330. $oper = 1;
  331. ///// 102 016
  332. $ipnum = array(ip2long("89.20.97.0"),ip2long("89.20.97.255"));
  333. if(ip2long($ip) >= $ipnum[0] and ip2long($ip) <= $ipnum[1])
  334. $oper = 1;
  335. $ipnum = array(ip2long("212.92.139.0"),ip2long("212.92.139.191"));
  336. if(ip2long($ip) >= $ipnum[0] and ip2long($ip) <= $ipnum[1])
  337. $oper = 1;
  338. $ipnum = array(ip2long("81.95.164.0"),ip2long("81.95.167.255"));
  339. if(ip2long($ip) >= $ipnum[0] and ip2long($ip) <= $ipnum[1])
  340. $oper = 1;
  341.  
  342. if(!empty($oper))
  343. {
  344. $my_type=1; // мобила
  345. $brow = 'Мобила';
  346. }
  347. elseif(ip2long($ip) >= @$opera[0] and ip2long($ip) <= @$opera[1])
  348. {
  349. $my_type=2; // Опера
  350. $brow = 'Мини-Опера';
  351. }
  352. else
  353. {
  354. $my_type=3; // Комп
  355. $brow = 'Комп';
  356. }
  357.  
  358. ?>